22 #ifndef NDN_SECURITY_V2_VALIDATOR_CONFIG_RULE_HPP 23 #define NDN_SECURITY_V2_VALIDATOR_CONFIG_RULE_HPP 32 class ValidationState;
34 namespace validator_config {
39 Rule(
const std::string&
id, uint32_t pktType);
72 match(uint32_t pktType,
const Name& pktName)
const;
88 check(uint32_t pktType,
const Name& pktName,
const Name& klName,
const shared_ptr<ValidationState>& state)
const;
98 static unique_ptr<Rule>
104 std::vector<unique_ptr<Filter>> m_filters;
105 std::vector<unique_ptr<Checker>> m_checkers;
113 #endif // NDN_SECURITY_V2_VALIDATOR_CONFIG_RULE_HPP Rule(const std::string &id, uint32_t pktType)
Copyright (c) 2013-2017 Regents of the University of California.
uint32_t getPktType() const
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
static unique_ptr< Rule > create(const ConfigSection &configSection, const std::string &configFilename)
create a rule from configuration section
const std::string & getId() const
void addFilter(unique_ptr< Filter > filter)
Represents an absolute name.
boost::property_tree::ptree ConfigSection
void addChecker(unique_ptr< Checker > checker)
bool check(uint32_t pktType, const Name &pktName, const Name &klName, const shared_ptr< ValidationState > &state) const
check if packet satisfies rule's condition
bool match(uint32_t pktType, const Name &pktName) const
check if the packet name matches rule's filter