blob: 14bca9172ca7fdf63c481177e800fecb10977e32 [file] [log] [blame]
Yingdi Yuce94f352015-04-11 19:17:01 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
Zhiyi Zhang19a11d22018-04-12 22:58:20 -07003 * Copyright (c) 2014-2018, Regents of the University of California
Yingdi Yuce94f352015-04-11 19:17:01 -07004 *
5 * This file is part of ndn-group-encrypt (Group-based Encryption Protocol for NDN).
6 * See AUTHORS.md for complete list of ndn-group-encrypt authors and contributors.
7 *
8 * ndn-group-encrypt is free software: you can redistribute it and/or modify it under
9 * the terms of the GNU General Public License as published by the Free Software
10 * Foundation, either version 3 of the License, or (at your option) any later version.
11 *
12 * ndn-group-encrypt is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * ndn-group-encrypt, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef NDN_GEP_COMMON_HPP
21#define NDN_GEP_COMMON_HPP
22
23#include "config.hpp"
24
Zhiyi Zhang84986cc2015-09-21 00:26:07 +080025#ifdef NDN_GEP_HAVE_TESTS
Yingdi Yuce94f352015-04-11 19:17:01 -070026#define VIRTUAL_WITH_TESTS virtual
27#define PUBLIC_WITH_TESTS_ELSE_PROTECTED public
28#define PUBLIC_WITH_TESTS_ELSE_PRIVATE public
29#define PROTECTED_WITH_TESTS_ELSE_PRIVATE protected
30#else
31#define VIRTUAL_WITH_TESTS
32#define PUBLIC_WITH_TESTS_ELSE_PROTECTED protected
33#define PUBLIC_WITH_TESTS_ELSE_PRIVATE private
34#define PROTECTED_WITH_TESTS_ELSE_PRIVATE private
35#endif
36
37/** \def DECL_OVERRIDE
38 * \brief expands to 'override' if compiler supports this feature, otherwise expands to nothing
39 */
40#ifdef HAVE_CXX_OVERRIDE
41#define DECL_OVERRIDE override
42#else
43#define DECL_OVERRIDE
44#endif
45
46#include <cstddef>
47#include <list>
48#include <map>
Yingdi Yuce94f352015-04-11 19:17:01 -070049#include <queue>
Zhiyi Zhang19a11d22018-04-12 22:58:20 -070050#include <set>
Yingdi Yuce94f352015-04-11 19:17:01 -070051#include <unordered_map>
52#include <unordered_set>
53#include <vector>
54
55#include <ndn-cxx/common.hpp>
Yingdi Yuce94f352015-04-11 19:17:01 -070056#include <ndn-cxx/data.hpp>
Zhiyi Zhang19a11d22018-04-12 22:58:20 -070057#include <ndn-cxx/interest.hpp>
Yingdi Yuce94f352015-04-11 19:17:01 -070058#include <ndn-cxx/util/signal.hpp>
Zhiyi Zhang19a11d22018-04-12 22:58:20 -070059#include <ndn-cxx/link.hpp>
60
61#include <ndn-cxx/security/v2/validation-callback.hpp>
62#include <ndn-cxx/security/v2/validation-error.hpp>
63#include <ndn-cxx/security/v2/validator.hpp>
64#include <ndn-cxx/security/validator-null.hpp>
Yingdi Yuce94f352015-04-11 19:17:01 -070065
66#include <boost/algorithm/string.hpp>
67#include <boost/asio.hpp>
68#include <boost/assert.hpp>
69#include <boost/lexical_cast.hpp>
70#include <boost/noncopyable.hpp>
71#include <boost/property_tree/ptree.hpp>
72
73namespace ndn {
74namespace gep {
75
76using std::size_t;
77
78using boost::noncopyable;
79
80using std::shared_ptr;
81using std::unique_ptr;
82using std::weak_ptr;
83using std::bad_weak_ptr;
84using std::make_shared;
85using std::enable_shared_from_this;
86
87using std::static_pointer_cast;
88using std::dynamic_pointer_cast;
89using std::const_pointer_cast;
90
91using std::function;
92using std::bind;
93using std::ref;
94using std::cref;
95
96using ndn::Interest;
97using ndn::Data;
98using ndn::Name;
99using ndn::Exclude;
100using ndn::Block;
101
Zhiyi Zhang19a11d22018-04-12 22:58:20 -0700102using security::v2::Certificate;
103using ndn::security::v2::Validator;
104using ndn::security::ValidatorNull;
105using security::v2::DataValidationSuccessCallback;
106using security::v2::DataValidationFailureCallback;
107using security::v2::ValidationError;
108
Yingdi Yuce94f352015-04-11 19:17:01 -0700109namespace tlv {
110using namespace ndn::tlv;
111} // namespace tlv
112
113namespace name = ndn::name;
114namespace time = ndn::time;
115namespace signal = ndn::util::signal;
116
Yingdi Yu3decf4e2015-11-02 12:33:31 -0800117const ndn::name::Component NAME_COMPONENT_FOR("FOR");
118const ndn::name::Component NAME_COMPONENT_READ("READ");
119const ndn::name::Component NAME_COMPONENT_SAMPLE("SAMPLE");
120const ndn::name::Component NAME_COMPONENT_ACCESS("ACCESS");
121const ndn::name::Component NAME_COMPONENT_E_KEY("E-KEY");
122const ndn::name::Component NAME_COMPONENT_D_KEY("D-KEY");
123const ndn::name::Component NAME_COMPONENT_C_KEY("C-KEY");
124
Yingdi Yuce94f352015-04-11 19:17:01 -0700125} // namespace gep
126} // namespace ndn
127
128#endif // NDN_GEP_COMMON_HPP