blob: dfb434d3a4660e2c7a998dcc1c022fa5a15a05fa [file] [log] [blame]
Yingdi Yu89da3052013-10-26 15:08:37 -07001/* -*- 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
16class ChatPolicyRule : public ndn::security::PolicyRule
17{
18
19public:
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
40private:
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