blob: 1e961a096647666a03414b45bf4f9fdb31b4763e [file] [log] [blame]
Yingdi Yu3715f8d2014-01-30 00:32:20 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/**
3 * Copyright (C) 2013 Regents of the University of California.
4 * @author: Yingdi Yu <yingdi@cs.ucla.edu>
5 * See COPYING for copyright and distribution information.
6 */
7
Yingdi Yufc40d872014-02-18 12:56:04 -08008#ifndef NDN_SECURITY_SEC_RULE_SPECIFIC_H
9#define NDN_SECURITY_SEC_RULE_SPECIFIC_H
Yingdi Yu3715f8d2014-01-30 00:32:20 -080010
Alexander Afanasyeve2dcdfd2014-02-07 15:53:28 -080011#include "../common.hpp"
Yingdi Yu3715f8d2014-01-30 00:32:20 -080012#include "sec-rule.hpp"
13#include "../util/regex.hpp"
14
Yingdi Yufc40d872014-02-18 12:56:04 -080015namespace ndn {
Yingdi Yu3715f8d2014-01-30 00:32:20 -080016
17class SecRuleSpecific : public ndn::SecRule
18{
19
20public:
21 SecRuleSpecific(ndn::shared_ptr<ndn::Regex> dataRegex,
22 ndn::shared_ptr<ndn::Regex> signerRegex);
23
24 SecRuleSpecific(const SecRuleSpecific& rule);
25
26 virtual
27 ~SecRuleSpecific() {};
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::shared_ptr<ndn::Regex> m_dataRegex;
43 ndn::shared_ptr<ndn::Regex> m_signerRegex;
44};
45
Yingdi Yufc40d872014-02-18 12:56:04 -080046} // namespace ndn
Yingdi Yu3715f8d2014-01-30 00:32:20 -080047
Yingdi Yufc40d872014-02-18 12:56:04 -080048#endif //NDN_SECURITY_SEC_RULE_SPECIFIC_H