blob: 34b18c86cc5b6d475561a320e6d49647862069bf [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 Afanasyevc169a812014-05-20 20:37:29 -04003 * Copyright (c) 2013-2014 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 {
31
Alexander Afanasyev2a7f7202014-04-23 14:25:29 -070032class ValidatorNull : public Validator
33{
Yingdi Yu9a335352014-01-31 11:57:46 -080034public:
Yingdi Yu6ac97982014-01-30 14:49:21 -080035 virtual
36 ~ValidatorNull()
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070037 {
38 }
Alexander Afanasyevfdbfc6d2014-04-14 15:12:11 -070039
Yingdi Yu9a335352014-01-31 11:57:46 -080040protected:
Yingdi Yu6ac97982014-01-30 14:49:21 -080041 virtual void
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070042 checkPolicy(const Data& data,
43 int nSteps,
44 const OnDataValidated& onValidated,
45 const OnDataValidationFailed& onValidationFailed,
46 std::vector<shared_ptr<ValidationRequest> >& nextSteps)
47 {
48 onValidated(data.shared_from_this());
49 }
Alexander Afanasyevfdbfc6d2014-04-14 15:12:11 -070050
Yingdi Yu6ac97982014-01-30 14:49:21 -080051 virtual void
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070052 checkPolicy(const Interest& interest,
53 int nSteps,
54 const OnInterestValidated& onValidated,
55 const OnInterestValidationFailed& onValidationFailed,
56 std::vector<shared_ptr<ValidationRequest> >& nextSteps)
57 {
58 onValidated(interest.shared_from_this());
59 }
Yingdi Yu6ac97982014-01-30 14:49:21 -080060};
61
Yingdi Yufc40d872014-02-18 12:56:04 -080062} // namespace ndn
Yingdi Yu6ac97982014-01-30 14:49:21 -080063
Yingdi Yufc40d872014-02-18 12:56:04 -080064#endif //NDN_SECURITY_VALIDATOR_NULL_HPP