blob: a4788207167c551f0dda8175847a127e88b8c9ed [file] [log] [blame]
Yingdi Yuce94f352015-04-11 19:17:01 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
Alexander Afanasyev9091d832018-04-18 17:21:08 -04003 * Copyright (c) 2014-2018, Regents of the University of California
Yingdi Yuce94f352015-04-11 19:17:01 -07004 *
Alexander Afanasyev9091d832018-04-18 17:21:08 -04005 * This file is part of NAC (Name-Based Access Control for NDN).
6 * See AUTHORS.md for complete list of NAC authors and contributors.
Yingdi Yuce94f352015-04-11 19:17:01 -07007 *
Alexander Afanasyev9091d832018-04-18 17:21:08 -04008 * NAC is free software: you can redistribute it and/or modify it under the terms
9 * of the GNU General Public License as published by the Free Software Foundation,
10 * either version 3 of the License, or (at your option) any later version.
Yingdi Yuce94f352015-04-11 19:17:01 -070011 *
Alexander Afanasyev9091d832018-04-18 17:21:08 -040012 * NAC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
Yingdi Yuce94f352015-04-11 19:17:01 -070015 *
16 * You should have received a copy of the GNU General Public License along with
Alexander Afanasyev9091d832018-04-18 17:21:08 -040017 * NAC, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
Yingdi Yuce94f352015-04-11 19:17:01 -070018 */
19
Alexander Afanasyev9091d832018-04-18 17:21:08 -040020#ifndef NDN_NAC_COMMON_HPP
21#define NDN_NAC_COMMON_HPP
Yingdi Yuce94f352015-04-11 19:17:01 -070022
23#include "config.hpp"
24
Alexander Afanasyev9091d832018-04-18 17:21:08 -040025#ifdef NDN_NAC_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
Yingdi Yuce94f352015-04-11 19:17:01 -070037#include <cstddef>
38#include <list>
39#include <map>
Yingdi Yuce94f352015-04-11 19:17:01 -070040#include <queue>
Zhiyi Zhang19a11d22018-04-12 22:58:20 -070041#include <set>
Yingdi Yuce94f352015-04-11 19:17:01 -070042#include <unordered_map>
43#include <unordered_set>
44#include <vector>
45
46#include <ndn-cxx/common.hpp>
Yingdi Yuce94f352015-04-11 19:17:01 -070047#include <ndn-cxx/data.hpp>
Zhiyi Zhang19a11d22018-04-12 22:58:20 -070048#include <ndn-cxx/interest.hpp>
Yingdi Yuce94f352015-04-11 19:17:01 -070049#include <ndn-cxx/util/signal.hpp>
Zhiyi Zhang19a11d22018-04-12 22:58:20 -070050#include <ndn-cxx/link.hpp>
51
52#include <ndn-cxx/security/v2/validation-callback.hpp>
53#include <ndn-cxx/security/v2/validation-error.hpp>
54#include <ndn-cxx/security/v2/validator.hpp>
55#include <ndn-cxx/security/validator-null.hpp>
Yingdi Yuce94f352015-04-11 19:17:01 -070056
57#include <boost/algorithm/string.hpp>
58#include <boost/asio.hpp>
59#include <boost/assert.hpp>
60#include <boost/lexical_cast.hpp>
61#include <boost/noncopyable.hpp>
62#include <boost/property_tree/ptree.hpp>
63
64namespace ndn {
Alexander Afanasyev9091d832018-04-18 17:21:08 -040065namespace nac {
Yingdi Yuce94f352015-04-11 19:17:01 -070066
Zhiyi Zhang19a11d22018-04-12 22:58:20 -070067using security::v2::Certificate;
Alexander Afanasyev9091d832018-04-18 17:21:08 -040068using security::v2::Validator;
69using security::ValidatorNull;
Zhiyi Zhang19a11d22018-04-12 22:58:20 -070070using security::v2::DataValidationSuccessCallback;
71using security::v2::DataValidationFailureCallback;
72using security::v2::ValidationError;
73
Yingdi Yuce94f352015-04-11 19:17:01 -070074namespace tlv {
75using namespace ndn::tlv;
76} // namespace tlv
77
Alexander Afanasyev9091d832018-04-18 17:21:08 -040078const name::Component NAME_COMPONENT_FOR("FOR");
79const name::Component NAME_COMPONENT_READ("READ");
80const name::Component NAME_COMPONENT_SAMPLE("SAMPLE");
81const name::Component NAME_COMPONENT_ACCESS("ACCESS");
82const name::Component NAME_COMPONENT_E_KEY("E-KEY");
83const name::Component NAME_COMPONENT_D_KEY("D-KEY");
84const name::Component NAME_COMPONENT_C_KEY("C-KEY");
Yingdi Yuce94f352015-04-11 19:17:01 -070085
Alexander Afanasyev9091d832018-04-18 17:21:08 -040086} // namespace nac
Yingdi Yuce94f352015-04-11 19:17:01 -070087} // namespace ndn
88
Alexander Afanasyev9091d832018-04-18 17:21:08 -040089#endif // NDN_NAC_COMMON_HPP