blob: 36448aff1371fb530b3c81bf0a4bd2264c584ee4 [file] [log] [blame]
Alexander Afanasyevc169a812014-05-20 20:37:29 -04001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Yingdi Yu6ac97982014-01-30 14:49:21 -08002/**
Alexander Afanasyev2fa59392016-07-29 17:24:23 -07003 * Copyright (c) 2013-2016 Regents of the University of California.
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -07004 *
5 * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -07006 *
Alexander Afanasyevc169a812014-05-20 20:37:29 -04007 * ndn-cxx library is free software: you can redistribute it and/or modify it under the
8 * terms of the GNU Lesser General Public License as published by the Free Software
9 * Foundation, either version 3 of the License, or (at your option) any later version.
10 *
11 * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14 *
15 * You should have received copies of the GNU General Public License and GNU Lesser
16 * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17 * <http://www.gnu.org/licenses/>.
18 *
19 * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -070020 *
21 * @author Yingdi Yu <http://irl.cs.ucla.edu/~yingdi/>
22 * @author Jeff Thompson <jefft0@remap.ucla.edu>
Yingdi Yu6ac97982014-01-30 14:49:21 -080023 */
24
Yingdi Yufc40d872014-02-18 12:56:04 -080025#ifndef NDN_SECURITY_VALIDATOR_NULL_HPP
26#define NDN_SECURITY_VALIDATOR_NULL_HPP
Yingdi Yu6ac97982014-01-30 14:49:21 -080027
28#include "validator.hpp"
29
30namespace ndn {
Alexander Afanasyev2fa59392016-07-29 17:24:23 -070031namespace security {
Yingdi Yu6ac97982014-01-30 14:49:21 -080032
Alexander Afanasyev2a7f7202014-04-23 14:25:29 -070033class ValidatorNull : public Validator
34{
Yingdi Yu9a335352014-01-31 11:57:46 -080035public:
Yingdi Yu6ac97982014-01-30 14:49:21 -080036 virtual
37 ~ValidatorNull()
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070038 {
39 }
Alexander Afanasyevfdbfc6d2014-04-14 15:12:11 -070040
Yingdi Yu9a335352014-01-31 11:57:46 -080041protected:
Yingdi Yu6ac97982014-01-30 14:49:21 -080042 virtual void
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070043 checkPolicy(const Data& data,
44 int nSteps,
45 const OnDataValidated& onValidated,
46 const OnDataValidationFailed& onValidationFailed,
47 std::vector<shared_ptr<ValidationRequest> >& nextSteps)
48 {
49 onValidated(data.shared_from_this());
50 }
Alexander Afanasyevfdbfc6d2014-04-14 15:12:11 -070051
Yingdi Yu6ac97982014-01-30 14:49:21 -080052 virtual void
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070053 checkPolicy(const Interest& interest,
54 int nSteps,
55 const OnInterestValidated& onValidated,
56 const OnInterestValidationFailed& onValidationFailed,
57 std::vector<shared_ptr<ValidationRequest> >& nextSteps)
58 {
59 onValidated(interest.shared_from_this());
60 }
Yingdi Yu6ac97982014-01-30 14:49:21 -080061};
62
Alexander Afanasyev2fa59392016-07-29 17:24:23 -070063} // namespace security
64
65using security::ValidatorNull;
66
Yingdi Yufc40d872014-02-18 12:56:04 -080067} // namespace ndn
Yingdi Yu6ac97982014-01-30 14:49:21 -080068
Yingdi Yufc40d872014-02-18 12:56:04 -080069#endif //NDN_SECURITY_VALIDATOR_NULL_HPP