blob: 3a0c3b2e808cc9caf8b5c8b98557e70cc619575d [file] [log] [blame]
Yingdi Yu6ac97982014-01-30 14:49:21 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/**
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -07003 * Copyright (c) 2013-2014, Regents of the University of California.
4 * All rights reserved.
5 *
6 * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
7 * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
8 *
9 * This file licensed under New BSD License. See COPYING for detailed information about
10 * ndn-cxx library copyright, permissions, and redistribution restrictions.
11 *
12 * @author Yingdi Yu <http://irl.cs.ucla.edu/~yingdi/>
13 * @author Jeff Thompson <jefft0@remap.ucla.edu>
Yingdi Yu6ac97982014-01-30 14:49:21 -080014 */
15
Yingdi Yufc40d872014-02-18 12:56:04 -080016#ifndef NDN_SECURITY_VALIDATOR_NULL_HPP
17#define NDN_SECURITY_VALIDATOR_NULL_HPP
Yingdi Yu6ac97982014-01-30 14:49:21 -080018
19#include "validator.hpp"
20
21namespace ndn {
22
Alexander Afanasyev2a7f7202014-04-23 14:25:29 -070023class ValidatorNull : public Validator
24{
Yingdi Yu9a335352014-01-31 11:57:46 -080025public:
Yingdi Yu6ac97982014-01-30 14:49:21 -080026 virtual
27 ~ValidatorNull()
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070028 {
29 }
Alexander Afanasyevfdbfc6d2014-04-14 15:12:11 -070030
Yingdi Yu9a335352014-01-31 11:57:46 -080031protected:
Yingdi Yu6ac97982014-01-30 14:49:21 -080032 virtual void
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070033 checkPolicy(const Data& data,
34 int nSteps,
35 const OnDataValidated& onValidated,
36 const OnDataValidationFailed& onValidationFailed,
37 std::vector<shared_ptr<ValidationRequest> >& nextSteps)
38 {
39 onValidated(data.shared_from_this());
40 }
Alexander Afanasyevfdbfc6d2014-04-14 15:12:11 -070041
Yingdi Yu6ac97982014-01-30 14:49:21 -080042 virtual void
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070043 checkPolicy(const Interest& interest,
44 int nSteps,
45 const OnInterestValidated& onValidated,
46 const OnInterestValidationFailed& onValidationFailed,
47 std::vector<shared_ptr<ValidationRequest> >& nextSteps)
48 {
49 onValidated(interest.shared_from_this());
50 }
Yingdi Yu6ac97982014-01-30 14:49:21 -080051};
52
Yingdi Yufc40d872014-02-18 12:56:04 -080053} // namespace ndn
Yingdi Yu6ac97982014-01-30 14:49:21 -080054
Yingdi Yufc40d872014-02-18 12:56:04 -080055#endif //NDN_SECURITY_VALIDATOR_NULL_HPP