#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 36 of file rule.hpp.
◆ Rule()
ndn::security::v2::validator_config::Rule::Rule |
( |
const std::string & |
id, |
|
|
uint32_t |
pktType |
|
) |
| |
◆ addChecker()
void ndn::security::v2::validator_config::Rule::addChecker |
( |
unique_ptr< Checker > |
checker | ) |
|
◆ addFilter()
void ndn::security::v2::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 77 of file rule.cpp.
◆ create()
unique_ptr< Rule > ndn::security::v2::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 107 of file rule.cpp.
◆ getId()
const std::string& ndn::security::v2::validator_config::Rule::getId |
( |
| ) |
const |
|
inline |
◆ getPktType()
uint32_t ndn::security::v2::validator_config::Rule::getPktType |
( |
| ) |
const |
|
inline |
◆ match()
bool ndn::security::v2::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 54 of file rule.cpp.