NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
sec-rule.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
24 #ifndef NDN_SECURITY_SEC_RULE_HPP
25 #define NDN_SECURITY_SEC_RULE_HPP
26 
27 #include "../common.hpp"
28 #include "../data.hpp"
29 
30 namespace ndn {
31 
32 class SecRule
33 {
34 public:
35  class Error : public std::runtime_error
36  {
37  public:
38  explicit
39  Error(const std::string& what)
40  : std::runtime_error(what)
41  {
42  }
43  };
44 
45  explicit
47  : m_isPositive(isPositive)
48  {
49  }
50 
51  virtual
53  {
54  }
55 
56  virtual bool
57  matchDataName(const Data& data) = 0;
58 
59  virtual bool
60  matchSignerName(const Data& data) = 0;
61 
62  virtual bool
63  satisfy(const Data& data) = 0;
64 
65  virtual bool
66  satisfy(const Name& dataName, const Name& signerName) = 0;
67 
68  inline bool
69  isPositive();
70 
71 protected:
73 };
74 
75 bool
77 {
78  return m_isPositive;
79 }
80 
81 } // namespace ndn
82 
83 #endif //NDN_SECURITY_SEC_RULE_HPP
Copyright (c) 2011-2015 Regents of the University of California.
bool isPositive()
Definition: sec-rule.hpp:76
SecRule(bool isPositive)
Definition: sec-rule.hpp:46
STL namespace.
bool m_isPositive
Definition: sec-rule.hpp:72
virtual ~SecRule()
Definition: sec-rule.hpp:52
virtual bool satisfy(const Data &data)=0
Name abstraction to represent an absolute name.
Definition: name.hpp:46
Error(const std::string &what)
Definition: sec-rule.hpp:39
virtual bool matchDataName(const Data &data)=0
virtual bool matchSignerName(const Data &data)=0
represents a Data packet
Definition: data.hpp:37