NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
rule.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2013-2021 Regents of the University of California.
4
*
5
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
6
*
7
* ndn-cxx library is free software: you can redistribute it and/or modify it under the
8
* terms of the GNU Lesser General Public License as published by the Free Software
9
* Foundation, either version 3 of the License, or (at your option) any later version.
10
*
11
* ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14
*
15
* You should have received copies of the GNU General Public License and GNU Lesser
16
* General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17
* <http://www.gnu.org/licenses/>.
18
*
19
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
20
*/
21
22
#ifndef NDN_CXX_SECURITY_VALIDATOR_CONFIG_RULE_HPP
23
#define NDN_CXX_SECURITY_VALIDATOR_CONFIG_RULE_HPP
24
25
#include "
ndn-cxx/security/validator-config/checker.hpp
"
26
#include "
ndn-cxx/security/validator-config/filter.hpp
"
27
28
namespace
ndn
{
29
namespace
security
{
30
inline
namespace
v2 {
31
32
class
ValidationState
;
33
34
namespace
validator_config {
35
36
class
Rule
: noncopyable
37
{
38
public
:
39
Rule
(
const
std::string&
id
, uint32_t pktType);
40
41
const
std::string&
42
getId
()
const
43
{
44
return
m_id;
45
}
46
47
uint32_t
48
getPktType
()
const
49
{
50
return
m_pktType
;
51
}
52
53
void
54
addFilter
(unique_ptr<Filter> filter);
55
56
void
57
addChecker
(unique_ptr<Checker> checker);
58
72
bool
73
match
(uint32_t pktType,
const
Name
& pktName,
const
shared_ptr<ValidationState>& state)
const
;
74
90
bool
91
check
(uint32_t pktType,
tlv::SignatureTypeValue
sigType,
const
Name
& pktName,
const
Name
& klName,
92
const
shared_ptr<ValidationState>& state)
const
;
93
94
public
:
102
static
unique_ptr<Rule>
103
create
(
const
ConfigSection
& configSection,
const
std::string& configFilename);
104
105
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
106
std::string m_id;
107
uint32_t
m_pktType
;
108
std::vector<unique_ptr<Filter>>
m_filters
;
109
std::vector<unique_ptr<Checker>>
m_checkers
;
110
};
111
112
}
// namespace validator_config
113
}
// inline namespace v2
114
}
// namespace security
115
}
// namespace ndn
116
117
#endif // NDN_CXX_SECURITY_VALIDATOR_CONFIG_RULE_HPP
ndn::security::v2::validator_config::Rule::Rule
Rule(const std::string &id, uint32_t pktType)
Definition:
rule.cpp:35
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::security::v2::validator_config::Rule::match
bool match(uint32_t pktType, const Name &pktName, const shared_ptr< ValidationState > &state) const
check if the packet name matches rule's filter
Definition:
rule.cpp:54
ndn::security::v2::validator_config::Rule::getId
const std::string & getId() const
Definition:
rule.hpp:42
ndn::security::v2::ValidationState
ndn security ValidationState
Definition:
validation-state.cpp:31
ndn::security::v2::validator_config::Rule::check
bool check(uint32_t pktType, tlv::SignatureTypeValue sigType, const Name &pktName, const Name &klName, const shared_ptr< ValidationState > &state) const
Check if packet satisfies rule's condition.
Definition:
rule.cpp:77
ndn::security::v2::validator_config::Rule::create
static unique_ptr< Rule > create(const ConfigSection &configSection, const std::string &configFilename)
create a rule from configuration section
Definition:
rule.cpp:107
ndn::security::v2::validator_config::Rule::getPktType
uint32_t getPktType() const
Definition:
rule.hpp:48
ndn::security::v2::validator_config::Rule::m_checkers
std::vector< unique_ptr< Checker > > m_checkers
Definition:
rule.hpp:109
ndn::security::v2::validator_config::Rule::addFilter
void addFilter(unique_ptr< Filter > filter)
Definition:
rule.cpp:42
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
Definition:
common.hpp:48
ndn::security::v2::validator_config::Rule::m_pktType
uint32_t m_pktType
Definition:
rule.hpp:107
ndn::Name
Represents an absolute name.
Definition:
name.hpp:41
ndn::tlv::SignatureTypeValue
SignatureTypeValue
SignatureType values.
Definition:
tlv.hpp:132
ndn::security::v2::validator_config::ConfigSection
boost::property_tree::ptree ConfigSection
Definition:
common.hpp:36
ndn::security
Definition:
dummy-keychain.cpp:28
ndn::security::v2::validator_config::Rule
Definition:
rule.hpp:36
ndn::security::v2::validator_config::Rule::addChecker
void addChecker(unique_ptr< Checker > checker)
Definition:
rule.cpp:48
ndn::security::v2::validator_config::Rule::m_filters
std::vector< unique_ptr< Filter > > m_filters
Definition:
rule.hpp:108
filter.hpp
checker.hpp
ndnSIM
ndn-cxx
ndn-cxx
security
validator-config
rule.hpp
Generated on Fri May 6 2022 12:34:13 for ndnSIM by
1.8.13