Yingdi Yu | 06202d3 | 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> |
Yingdi Yu | 7989eb2 | 2013-10-31 17:38:22 -0700 | [diff] [blame^] | 15 | #include <ndn.cxx/regex/regex.h> |
Yingdi Yu | 06202d3 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 16 | |
| 17 | class ChatPolicyRule : public ndn::security::PolicyRule |
| 18 | { |
| 19 | |
| 20 | public: |
Yingdi Yu | 7989eb2 | 2013-10-31 17:38:22 -0700 | [diff] [blame^] | 21 | ChatPolicyRule(ndn::Ptr<ndn::Regex> dataRegex, |
| 22 | ndn::Ptr<ndn::Regex> signerRegex); |
| 23 | |
| 24 | ChatPolicyRule(const ChatPolicyRule& rule); |
Yingdi Yu | 06202d3 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 25 | |
| 26 | virtual |
Yingdi Yu | 7989eb2 | 2013-10-31 17:38:22 -0700 | [diff] [blame^] | 27 | ~ChatPolicyRule() {}; |
Yingdi Yu | 06202d3 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 28 | |
| 29 | bool |
Yingdi Yu | 7989eb2 | 2013-10-31 17:38:22 -0700 | [diff] [blame^] | 30 | matchDataName(const ndn::Data & data); |
Yingdi Yu | 06202d3 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 31 | |
| 32 | bool |
Yingdi Yu | 7989eb2 | 2013-10-31 17:38:22 -0700 | [diff] [blame^] | 33 | matchSignerName(const ndn::Data & data); |
Yingdi Yu | 06202d3 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 34 | |
| 35 | bool |
Yingdi Yu | 7989eb2 | 2013-10-31 17:38:22 -0700 | [diff] [blame^] | 36 | satisfy(const ndn::Data & data); |
Yingdi Yu | 06202d3 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 37 | |
| 38 | bool |
Yingdi Yu | 7989eb2 | 2013-10-31 17:38:22 -0700 | [diff] [blame^] | 39 | satisfy(const ndn::Name & dataName, const ndn::Name & signerName); |
Yingdi Yu | 06202d3 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 40 | |
Yingdi Yu | 06202d3 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 41 | private: |
| 42 | ndn::Ptr<ndn::Regex> m_dataRegex; |
| 43 | ndn::Ptr<ndn::Regex> m_signerRegex; |
Yingdi Yu | 06202d3 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 44 | }; |
| 45 | |
| 46 | #endif //CHAT_POLICY_RULE_H |