NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
validator-null.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
25 #ifndef NDN_SECURITY_VALIDATOR_NULL_HPP
26 #define NDN_SECURITY_VALIDATOR_NULL_HPP
27 
28 #include "validator.hpp"
29 
30 namespace ndn {
31 
32 class ValidatorNull : public Validator
33 {
34 public:
35  virtual
37  {
38  }
39 
40 protected:
41  virtual void
42  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  }
50 
51  virtual void
52  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  }
60 };
61 
62 } // namespace ndn
63 
64 #endif //NDN_SECURITY_VALIDATOR_NULL_HPP
Copyright (c) 2011-2015 Regents of the University of California.
virtual void checkPolicy(const Data &data, int nSteps, const OnDataValidated &onValidated, const OnDataValidationFailed &onValidationFailed, std::vector< shared_ptr< ValidationRequest > > &nextSteps)
Check the Data against policy and return the next validation step if necessary.
represents an Interest packet
Definition: interest.hpp:45
function< void(const shared_ptr< const Data > &)> OnDataValidated
Callback to report a successful Data validation.
function< void(const shared_ptr< const Data > &, const std::string &)> OnDataValidationFailed
Callback to report a failed Data validation.
function< void(const shared_ptr< const Interest > &, const std::string &)> OnInterestValidationFailed
Callback to report a failed Interest validation.
virtual void checkPolicy(const Interest &interest, int nSteps, const OnInterestValidated &onValidated, const OnInterestValidationFailed &onValidationFailed, std::vector< shared_ptr< ValidationRequest > > &nextSteps)
Check the Interest against validation policy and return the next validation step if necessary...
represents a Data packet
Definition: data.hpp:39
Validator is one of the main classes of the security library.
Definition: validator.hpp:46
function< void(const shared_ptr< const Interest > &)> OnInterestValidated
Callback to report a successful Interest validation.