blob: 25e4e286b469df5e2f6ee692ef128a4d469e4f14 [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
Yingdi Yu5e0af3e2014-01-15 19:33:25 -080011#ifndef SEC_RULE_SYNC_SPECIFIC_H
12#define SEC_RULE_SYNC_SPECIFIC_H
Yingdi Yu43e71612013-10-30 22:19:31 -070013
Yingdi Yu5e0af3e2014-01-15 19:33:25 -080014#include <ndn-cpp-et/policy/sec-rule.hpp>
Yingdi Yu46c9f1a2013-12-18 15:15:46 +080015#include <ndn-cpp-et/regex/regex.hpp>
Yingdi Yu43e71612013-10-30 22:19:31 -070016
Yingdi Yu5e0af3e2014-01-15 19:33:25 -080017class SecRuleSyncSpecific : public ndn::SecRule
Yingdi Yu43e71612013-10-30 22:19:31 -070018{
19
20public:
Yingdi Yu5e0af3e2014-01-15 19:33:25 -080021 SecRuleSyncSpecific(ndn::ptr_lib::shared_ptr<ndn::Regex> dataRegex,
22 ndn::ptr_lib::shared_ptr<ndn::Regex> signerRegex);
Yingdi Yu43e71612013-10-30 22:19:31 -070023
Yingdi Yu5e0af3e2014-01-15 19:33:25 -080024 SecRuleSyncSpecific(const SecRuleSyncSpecific& rule);
Yingdi Yu43e71612013-10-30 22:19:31 -070025
26 virtual
Yingdi Yu5e0af3e2014-01-15 19:33:25 -080027 ~SecRuleSyncSpecific() {};
Yingdi Yu43e71612013-10-30 22:19:31 -070028
29 bool
Yingdi Yu46c9f1a2013-12-18 15:15:46 +080030 matchDataName(const ndn::Data& data);
Yingdi Yu43e71612013-10-30 22:19:31 -070031
32 bool
Yingdi Yu46c9f1a2013-12-18 15:15:46 +080033 matchSignerName(const ndn::Data& data);
Yingdi Yu43e71612013-10-30 22:19:31 -070034
35 bool
Yingdi Yu46c9f1a2013-12-18 15:15:46 +080036 satisfy(const ndn::Data& data);
Yingdi Yu43e71612013-10-30 22:19:31 -070037
38 bool
Yingdi Yu46c9f1a2013-12-18 15:15:46 +080039 satisfy(const ndn::Name& dataName, const ndn::Name& signerName);
Yingdi Yu43e71612013-10-30 22:19:31 -070040
41private:
Yingdi Yu46c9f1a2013-12-18 15:15:46 +080042 ndn::ptr_lib::shared_ptr<ndn::Regex> m_dataRegex;
43 ndn::ptr_lib::shared_ptr<ndn::Regex> m_signerRegex;
Yingdi Yu43e71612013-10-30 22:19:31 -070044};
45
Yingdi Yu5e0af3e2014-01-15 19:33:25 -080046#endif