#include <ndn-cxx/security/validator-config/rule.hpp>
|
static unique_ptr< Rule > | create (const ConfigSection &configSection, const std::string &configFilename) |
| Create a rule from configuration section. More...
|
|
Definition at line 34 of file rule.hpp.
◆ Rule()
ndn::security::validator_config::Rule::Rule |
( |
const std::string & |
id, |
|
|
uint32_t |
pktType |
|
) |
| |
◆ addChecker()
void ndn::security::validator_config::Rule::addChecker |
( |
unique_ptr< Checker > |
checker | ) |
|
◆ addFilter()
void ndn::security::validator_config::Rule::addFilter |
( |
unique_ptr< Filter > |
filter | ) |
|
◆ check()
Check if packet satisfies rule's condition.
- Parameters
-
pktType | tlv::Interest or tlv::Data |
sigType | Signature type |
pktName | packet name, for signed Interests the last two components are not removed |
klName | KeyLocator name |
state | Validation state |
- Return values
-
false | packet violates all checkers. fail() will have been called on state with proper code and message. |
true | packet satisfies at least one checker, further validation is needed. |
- Exceptions
-
Error | the supplied pktType doesn't match one for which the rule is designed. |
Definition at line 74 of file rule.cpp.
◆ create()
unique_ptr< Rule > ndn::security::validator_config::Rule::create |
( |
const ConfigSection & |
configSection, |
|
|
const std::string & |
configFilename |
|
) |
| |
|
static |
Create a rule from configuration section.
- Parameters
-
configSection | The section containing the definition of checker. |
configFilename | The configuration file name. |
- Returns
- a rule created from configuration
Definition at line 104 of file rule.cpp.
◆ getId()
const std::string& ndn::security::validator_config::Rule::getId |
( |
| ) |
const |
|
inline |
◆ getPktType()
uint32_t ndn::security::validator_config::Rule::getPktType |
( |
| ) |
const |
|
inline |
◆ match()
bool ndn::security::validator_config::Rule::match |
( |
uint32_t |
pktType, |
|
|
const Name & |
pktName, |
|
|
const shared_ptr< ValidationState > & |
state |
|
) |
| const |
Check if the packet name matches rule's filter.
If no filters were added, the rule matches everything.
- Parameters
-
pktType | tlv::Interest or tlv::Data |
pktName | packet name, for signed Interests the last two components are not removed |
state | The associated validation state |
- Return values
-
true | If at least one filter matches pktName |
false | If none of the filters match pktName |
- Exceptions
-
Error | the supplied pktType doesn't match one for which the rule is designed |
Definition at line 51 of file rule.cpp.