blob: 4534baba83edbce914d54aa094af37369d0386b0 [file] [log] [blame]
Yingdi Yu06202d32013-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>
Yingdi Yu7989eb22013-10-31 17:38:22 -070015#include <ndn.cxx/regex/regex.h>
Yingdi Yu06202d32013-10-26 15:08:37 -070016
17class ChatPolicyRule : public ndn::security::PolicyRule
18{
19
20public:
Yingdi Yu7989eb22013-10-31 17:38:22 -070021 ChatPolicyRule(ndn::Ptr<ndn::Regex> dataRegex,
22 ndn::Ptr<ndn::Regex> signerRegex);
23
24 ChatPolicyRule(const ChatPolicyRule& rule);
Yingdi Yu06202d32013-10-26 15:08:37 -070025
26 virtual
Yingdi Yu7989eb22013-10-31 17:38:22 -070027 ~ChatPolicyRule() {};
Yingdi Yu06202d32013-10-26 15:08:37 -070028
29 bool
Yingdi Yu7989eb22013-10-31 17:38:22 -070030 matchDataName(const ndn::Data & data);
Yingdi Yu06202d32013-10-26 15:08:37 -070031
32 bool
Yingdi Yu7989eb22013-10-31 17:38:22 -070033 matchSignerName(const ndn::Data & data);
Yingdi Yu06202d32013-10-26 15:08:37 -070034
35 bool
Yingdi Yu7989eb22013-10-31 17:38:22 -070036 satisfy(const ndn::Data & data);
Yingdi Yu06202d32013-10-26 15:08:37 -070037
38 bool
Yingdi Yu7989eb22013-10-31 17:38:22 -070039 satisfy(const ndn::Name & dataName, const ndn::Name & signerName);
Yingdi Yu06202d32013-10-26 15:08:37 -070040
Yingdi Yu06202d32013-10-26 15:08:37 -070041private:
42 ndn::Ptr<ndn::Regex> m_dataRegex;
43 ndn::Ptr<ndn::Regex> m_signerRegex;
Yingdi Yu06202d32013-10-26 15:08:37 -070044};
45
46#endif //CHAT_POLICY_RULE_H