NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
sec-rule-relative.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_RELATIVE_HPP
25 #define NDN_SECURITY_SEC_RULE_RELATIVE_HPP
26 
27 #include "sec-rule.hpp"
28 #include "../util/regex.hpp"
29 
30 namespace ndn {
31 
32 class SecRuleRelative : public SecRule
33 {
34 public:
35  class Error : public SecRule::Error
36  {
37  public:
38  explicit
39  Error(const std::string& what)
40  : SecRule::Error(what)
41  {
42  }
43  };
44 
45  SecRuleRelative(const std::string& dataRegex, const std::string& signerRegex,
46  const std::string& op,
47  const std::string& dataExpand, const std::string& signerExpand,
48  bool isPositive);
49 
50  virtual
52 
53  virtual bool
54  matchDataName(const Data& data);
55 
56  virtual bool
57  matchSignerName(const Data& data);
58 
59  virtual bool
60  satisfy(const Data& data);
61 
62  virtual bool
63  satisfy(const Name& dataName, const Name& signerName);
64 
65 private:
66  bool
67  compare(const Name& dataName, const Name& signerName);
68 
69 private:
70  const std::string m_dataRegex;
71  const std::string m_signerRegex;
72  const std::string m_op;
73  const std::string m_dataExpand;
74  const std::string m_signerExpand;
75 
76  Regex m_dataNameRegex;
77  Regex m_signerNameRegex;
78 };
79 
80 } // namespace ndn
81 
82 #endif //NDN_SECURITY_SEC_RULE_RELATIVE_HPP
Copyright (c) 2011-2015 Regents of the University of California.
Error(const std::string &what)
bool isPositive()
Definition: sec-rule.hpp:76
virtual bool matchSignerName(const Data &data)
SecRuleRelative(const std::string &dataRegex, const std::string &signerRegex, const std::string &op, const std::string &dataExpand, const std::string &signerExpand, bool isPositive)
Name abstraction to represent an absolute name.
Definition: name.hpp:46
virtual bool matchDataName(const Data &data)
virtual bool satisfy(const Data &data)
represents a Data packet
Definition: data.hpp:37