NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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-2017 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_SECURITY_V2_VALIDATOR_CONFIG_RULE_HPP
23
#define NDN_SECURITY_V2_VALIDATOR_CONFIG_RULE_HPP
24
25
#include "
filter.hpp
"
26
#include "
checker.hpp
"
27
28
namespace
ndn
{
29
namespace
security
{
30
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
71
bool
72
match
(uint32_t pktType,
const
Name
& pktName)
const
;
73
87
bool
88
check
(uint32_t pktType,
const
Name
& pktName,
const
Name
& klName,
const
shared_ptr<ValidationState>& state)
const
;
89
90
public
:
98
static
unique_ptr<Rule>
99
create
(
const
ConfigSection
& configSection,
const
std::string& configFilename);
100
101
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
102
std::string m_id;
103
uint32_t
m_pktType
;
104
std::vector<unique_ptr<Filter>>
m_filters
;
105
std::vector<unique_ptr<Checker>>
m_checkers
;
106
};
107
108
}
// namespace validator_config
109
}
// namespace v2
110
}
// namespace security
111
}
// namespace ndn
112
113
#endif // NDN_SECURITY_V2_VALIDATOR_CONFIG_RULE_HPP
ndn::security::v2::validator_config::Rule::Rule
Rule(const std::string &id, uint32_t pktType)
Definition:
rule.cpp:34
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
Definition:
common.hpp:43
ndn::security::v2::validator_config::Rule::getPktType
uint32_t getPktType() const
Definition:
rule.hpp:48
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:98
websocketpp::transport::asio::socket::error::security
Catch-all error for security policy errors that don't fit in other categories.
Definition:
base.hpp:79
ndn::security::v2::validator_config::Rule::m_checkers
std::vector< unique_ptr< Checker > > m_checkers
Definition:
rule.hpp:105
ndn::security::v2::validator_config::Rule::getId
const std::string & getId() const
Definition:
rule.hpp:42
ndn::security::v2::validator_config::Rule::addFilter
void addFilter(unique_ptr< Filter > filter)
Definition:
rule.cpp:41
ndn::security::v2::validator_config::Rule::m_pktType
uint32_t m_pktType
Definition:
rule.hpp:103
ndn::Name
Represents an absolute name.
Definition:
name.hpp:42
ndn::security::v2::ValidationState
ndn security v2 ValidationState
Definition:
validation-state.cpp:31
ndn::security::v2::validator_config::ConfigSection
boost::property_tree::ptree ConfigSection
Definition:
common.hpp:35
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:47
ndn::security::v2::validator_config::Rule::check
bool check(uint32_t pktType, const Name &pktName, const Name &klName, const shared_ptr< ValidationState > &state) const
check if packet satisfies rule's condition
Definition:
rule.cpp:76
ndn::security::v2::validator_config::Rule::m_filters
std::vector< unique_ptr< Filter > > m_filters
Definition:
rule.hpp:104
filter.hpp
checker.hpp
ndn::security::v2::validator_config::Rule::match
bool match(uint32_t pktType, const Name &pktName) const
check if the packet name matches rule's filter
Definition:
rule.cpp:53
ndnSIM
ndn-cxx
src
security
v2
validator-config
rule.hpp
Generated on Thu Nov 2 2017 03:30:29 for ndnSIM by
1.8.11