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 | |||||
Yingdi Yu | eaa84e2 | 2014-01-16 10:30:26 -0800 | [diff] [blame^] | 11 | #ifndef SEC_RULE_CHRONO_CHAT_H |
12 | #define SEC_RULE_CHRONO_CHAT_H | ||||
Yingdi Yu | 89da305 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 13 | |
Yingdi Yu | eaa84e2 | 2014-01-16 10:30:26 -0800 | [diff] [blame^] | 14 | #include <ndn-cpp-et/policy/sec-rule.hpp> |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 15 | #include <ndn-cpp-et/regex/regex.hpp> |
Yingdi Yu | 89da305 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 16 | |
Yingdi Yu | eaa84e2 | 2014-01-16 10:30:26 -0800 | [diff] [blame^] | 17 | class SecRuleChronoChat : public ndn::SecRule |
Yingdi Yu | 89da305 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 18 | { |
19 | |||||
20 | public: | ||||
Yingdi Yu | eaa84e2 | 2014-01-16 10:30:26 -0800 | [diff] [blame^] | 21 | SecRuleChronoChat(ndn::ptr_lib::shared_ptr<ndn::Regex> dataRegex, |
22 | ndn::ptr_lib::shared_ptr<ndn::Regex> signerRegex); | ||||
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 23 | |
Yingdi Yu | eaa84e2 | 2014-01-16 10:30:26 -0800 | [diff] [blame^] | 24 | SecRuleChronoChat(const SecRuleChronoChat& rule); |
Yingdi Yu | 89da305 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 25 | |
26 | virtual | ||||
Yingdi Yu | eaa84e2 | 2014-01-16 10:30:26 -0800 | [diff] [blame^] | 27 | ~SecRuleChronoChat() {}; |
Yingdi Yu | 89da305 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 28 | |
29 | bool | ||||
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 30 | matchDataName(const ndn::Data & data); |
Yingdi Yu | 89da305 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 31 | |
32 | bool | ||||
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 33 | matchSignerName(const ndn::Data & data); |
Yingdi Yu | 89da305 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 34 | |
35 | bool | ||||
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 36 | satisfy(const ndn::Data & data); |
Yingdi Yu | 89da305 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 37 | |
38 | bool | ||||
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 39 | satisfy(const ndn::Name & dataName, const ndn::Name & signerName); |
Yingdi Yu | 89da305 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 40 | |
Yingdi Yu | 89da305 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 41 | private: |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 42 | ndn::ptr_lib::shared_ptr<ndn::Regex> m_dataRegex; |
43 | ndn::ptr_lib::shared_ptr<ndn::Regex> m_signerRegex; | ||||
Yingdi Yu | 89da305 | 2013-10-26 15:08:37 -0700 | [diff] [blame] | 44 | }; |
45 | |||||
46 | #endif //CHAT_POLICY_RULE_H |