Yingdi Yu | ce94f35 | 2015-04-11 19:17:01 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
Alexander Afanasyev | 9091d83 | 2018-04-18 17:21:08 -0400 | [diff] [blame^] | 3 | * Copyright (c) 2014-2018, Regents of the University of California |
Yingdi Yu | ce94f35 | 2015-04-11 19:17:01 -0700 | [diff] [blame] | 4 | * |
Alexander Afanasyev | 9091d83 | 2018-04-18 17:21:08 -0400 | [diff] [blame^] | 5 | * 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 Yu | ce94f35 | 2015-04-11 19:17:01 -0700 | [diff] [blame] | 7 | * |
Alexander Afanasyev | 9091d83 | 2018-04-18 17:21:08 -0400 | [diff] [blame^] | 8 | * 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 Yu | ce94f35 | 2015-04-11 19:17:01 -0700 | [diff] [blame] | 11 | * |
Alexander Afanasyev | 9091d83 | 2018-04-18 17:21:08 -0400 | [diff] [blame^] | 12 | * 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 Yu | ce94f35 | 2015-04-11 19:17:01 -0700 | [diff] [blame] | 15 | * |
| 16 | * You should have received a copy of the GNU General Public License along with |
Alexander Afanasyev | 9091d83 | 2018-04-18 17:21:08 -0400 | [diff] [blame^] | 17 | * NAC, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
Yingdi Yu | ce94f35 | 2015-04-11 19:17:01 -0700 | [diff] [blame] | 18 | */ |
| 19 | |
Alexander Afanasyev | 9091d83 | 2018-04-18 17:21:08 -0400 | [diff] [blame^] | 20 | #ifndef NDN_NAC_COMMON_HPP |
| 21 | #define NDN_NAC_COMMON_HPP |
Yingdi Yu | ce94f35 | 2015-04-11 19:17:01 -0700 | [diff] [blame] | 22 | |
| 23 | #include "config.hpp" |
| 24 | |
Alexander Afanasyev | 9091d83 | 2018-04-18 17:21:08 -0400 | [diff] [blame^] | 25 | #ifdef NDN_NAC_HAVE_TESTS |
Yingdi Yu | ce94f35 | 2015-04-11 19:17:01 -0700 | [diff] [blame] | 26 | #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 Yu | ce94f35 | 2015-04-11 19:17:01 -0700 | [diff] [blame] | 37 | #include <cstddef> |
| 38 | #include <list> |
| 39 | #include <map> |
Yingdi Yu | ce94f35 | 2015-04-11 19:17:01 -0700 | [diff] [blame] | 40 | #include <queue> |
Zhiyi Zhang | 19a11d2 | 2018-04-12 22:58:20 -0700 | [diff] [blame] | 41 | #include <set> |
Yingdi Yu | ce94f35 | 2015-04-11 19:17:01 -0700 | [diff] [blame] | 42 | #include <unordered_map> |
| 43 | #include <unordered_set> |
| 44 | #include <vector> |
| 45 | |
| 46 | #include <ndn-cxx/common.hpp> |
Yingdi Yu | ce94f35 | 2015-04-11 19:17:01 -0700 | [diff] [blame] | 47 | #include <ndn-cxx/data.hpp> |
Zhiyi Zhang | 19a11d2 | 2018-04-12 22:58:20 -0700 | [diff] [blame] | 48 | #include <ndn-cxx/interest.hpp> |
Yingdi Yu | ce94f35 | 2015-04-11 19:17:01 -0700 | [diff] [blame] | 49 | #include <ndn-cxx/util/signal.hpp> |
Zhiyi Zhang | 19a11d2 | 2018-04-12 22:58:20 -0700 | [diff] [blame] | 50 | #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 Yu | ce94f35 | 2015-04-11 19:17:01 -0700 | [diff] [blame] | 56 | |
| 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 | |
| 64 | namespace ndn { |
Alexander Afanasyev | 9091d83 | 2018-04-18 17:21:08 -0400 | [diff] [blame^] | 65 | namespace nac { |
Yingdi Yu | ce94f35 | 2015-04-11 19:17:01 -0700 | [diff] [blame] | 66 | |
Zhiyi Zhang | 19a11d2 | 2018-04-12 22:58:20 -0700 | [diff] [blame] | 67 | using security::v2::Certificate; |
Alexander Afanasyev | 9091d83 | 2018-04-18 17:21:08 -0400 | [diff] [blame^] | 68 | using security::v2::Validator; |
| 69 | using security::ValidatorNull; |
Zhiyi Zhang | 19a11d2 | 2018-04-12 22:58:20 -0700 | [diff] [blame] | 70 | using security::v2::DataValidationSuccessCallback; |
| 71 | using security::v2::DataValidationFailureCallback; |
| 72 | using security::v2::ValidationError; |
| 73 | |
Yingdi Yu | ce94f35 | 2015-04-11 19:17:01 -0700 | [diff] [blame] | 74 | namespace tlv { |
| 75 | using namespace ndn::tlv; |
| 76 | } // namespace tlv |
| 77 | |
Alexander Afanasyev | 9091d83 | 2018-04-18 17:21:08 -0400 | [diff] [blame^] | 78 | const name::Component NAME_COMPONENT_FOR("FOR"); |
| 79 | const name::Component NAME_COMPONENT_READ("READ"); |
| 80 | const name::Component NAME_COMPONENT_SAMPLE("SAMPLE"); |
| 81 | const name::Component NAME_COMPONENT_ACCESS("ACCESS"); |
| 82 | const name::Component NAME_COMPONENT_E_KEY("E-KEY"); |
| 83 | const name::Component NAME_COMPONENT_D_KEY("D-KEY"); |
| 84 | const name::Component NAME_COMPONENT_C_KEY("C-KEY"); |
Yingdi Yu | ce94f35 | 2015-04-11 19:17:01 -0700 | [diff] [blame] | 85 | |
Alexander Afanasyev | 9091d83 | 2018-04-18 17:21:08 -0400 | [diff] [blame^] | 86 | } // namespace nac |
Yingdi Yu | ce94f35 | 2015-04-11 19:17:01 -0700 | [diff] [blame] | 87 | } // namespace ndn |
| 88 | |
Alexander Afanasyev | 9091d83 | 2018-04-18 17:21:08 -0400 | [diff] [blame^] | 89 | #endif // NDN_NAC_COMMON_HPP |