blob: e2b859b0b48470f2fec3cd14ca6008ac6e4ba7b4 [file] [log] [blame]
Yingdi Yu43e71612013-10-30 22:19:31 -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 SPECIFIC_POLICY_RULE_H
12#define SPECIFIC_POLICY_RULE_H
13
14#include <ndn.cxx/security/policy/policy-rule.h>
15#include <ndn.cxx/regex/regex.h>
16
17class SpecificPolicyRule : public ndn::security::PolicyRule
18{
19
20public:
21 SpecificPolicyRule(ndn::Ptr<ndn::Regex> dataRegex,
22 ndn::Ptr<ndn::Regex> signerRegex);
23
24 SpecificPolicyRule(const SpecificPolicyRule& rule);
25
26 virtual
27 ~SpecificPolicyRule() {};
28
29 bool
30 matchDataName(const ndn::Data & data);
31
32 bool
33 matchSignerName(const ndn::Data & data);
34
35 bool
36 satisfy(const ndn::Data & data);
37
38 bool
39 satisfy(const ndn::Name & dataName, const ndn::Name & signerName);
40
41private:
42 ndn::Ptr<ndn::Regex> m_dataRegex;
43 ndn::Ptr<ndn::Regex> m_signerRegex;
44};
45
46#endif //CHAT_POLICY_RULE_H