Yingdi Yu | 89da305 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2013, Regents of the University of California |
| 4 | * Yingdi Yu |
| 5 | * |
| 6 | * BSD license, See the LICENSE file for more information |
| 7 | * |
| 8 | * Author: Yingdi Yu <yingdi@cs.ucla.edu> |
| 9 | */ |
| 10 | |
| 11 | #ifndef CHAT_POLICY_RULE_H |
| 12 | #define CHAT_POLICY_RULE_H |
| 13 | |
| 14 | #include <ndn.cxx/security/policy/policy-rule.h> |
| 15 | |
| 16 | class ChatPolicyRule : public ndn::security::PolicyRule |
| 17 | { |
| 18 | |
| 19 | public: |
| 20 | ChatPolicyRule(); |
| 21 | |
| 22 | virtual |
| 23 | ~ChatPolicyRyle() {}; |
| 24 | |
| 25 | bool |
| 26 | matchDataName(const Data & data); |
| 27 | |
| 28 | bool |
| 29 | matchSignerName(const Data & data); |
| 30 | |
| 31 | bool |
| 32 | satisfy(const Data & data); |
| 33 | |
| 34 | bool |
| 35 | satisfy(const Name & dataName, const Name & signerName); |
| 36 | |
| 37 | TiXmlElement * |
| 38 | toXmlElement(); |
| 39 | |
| 40 | private: |
| 41 | ndn::Ptr<ndn::Regex> m_dataRegex; |
| 42 | ndn::Ptr<ndn::Regex> m_signerRegex; |
| 43 | ndn::Name m_dataRef; |
| 44 | ndn::Name m_signerRef; |
| 45 | }; |
| 46 | |
| 47 | #endif //CHAT_POLICY_RULE_H |