23 #ifndef NDN_CONFIG_RULE_HPP
24 #define NDN_CONFIG_RULE_HPP
26 #include "config-filter.hpp"
27 #include "config-checker.hpp"
46 isForInterest_(isForInterest)
70 addFilter(
const ptr_lib::shared_ptr<ConfigFilter>& filter)
72 filters_.push_back(filter);
80 addChecker(
const ptr_lib::shared_ptr<ConfigChecker>& checker)
82 checkers_.push_back(checker);
98 match(
bool isForInterest,
const Name& packetName);
116 (
bool isForInterest,
const Name& packetName,
const Name& keyLocatorName,
117 const ptr_lib::shared_ptr<ValidationState>& state);
125 static ptr_lib::shared_ptr<ConfigRule>
135 std::vector<ptr_lib::shared_ptr<ConfigFilter>> filters_;
136 std::vector<ptr_lib::shared_ptr<ConfigChecker>> checkers_;
const std::string & getId() const
Get the rule ID.
Definition: config-rule.hpp:55
void addChecker(const ptr_lib::shared_ptr< ConfigChecker > &checker)
Add the ConfigChecker to the list of checkers.
Definition: config-rule.hpp:80
void addFilter(const ptr_lib::shared_ptr< ConfigFilter > &filter)
Add the ConfigFilter to the list of filters.
Definition: config-rule.hpp:70
BoostInfoTree is provided for compatibility with the Boost INFO property list format used in ndn-cxx...
Definition: boost-info-parser.hpp:46
A ConfigRule represents a rule configuration section, used by ConfigValidator.
Definition: config-rule.hpp:36
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
bool getIsForInterest() const
Get the isForInterest flag.
Definition: config-rule.hpp:63
bool check(bool isForInterest, const Name &packetName, const Name &keyLocatorName, const ptr_lib::shared_ptr< ValidationState > &state)
Check if the packet satisfies the rule's condition.
bool match(bool isForInterest, const Name &packetName)
Check if the packet name matches the rule's filter.
ConfigRule(const std::string &id, bool isForInterest)
Create a ConfigRule with empty filters and checkers.
Definition: config-rule.hpp:44
static ptr_lib::shared_ptr< ConfigRule > create(const BoostInfoTree &configSection)
Create a rule from configuration section.