validation-request.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NDN_SECURITY_VALIDATION_REQUEST_HPP
23 #define NDN_SECURITY_VALIDATION_REQUEST_HPP
24 
25 #include "../interest.hpp"
26 
27 namespace ndn {
28 namespace security {
29 
31 typedef function<void(const shared_ptr<const Interest>&)> OnInterestValidated;
32 
34 typedef function<void(const shared_ptr<const Interest>&,
35  const std::string&)> OnInterestValidationFailed;
36 
38 typedef function<void(const shared_ptr<const Data>&)> OnDataValidated;
39 
41 typedef function<void(const shared_ptr<const Data>&,
42  const std::string&)> OnDataValidationFailed;
43 
54 {
55 public:
56  ValidationRequest(const Interest& interest,
57  const OnDataValidated& onDataValidated,
58  const OnDataValidationFailed& onDataValidationFailed,
59  int nRetries, int nSteps,
60  uint64_t requesterFaceId = 0)
61  : m_interest(interest)
62  , m_onDataValidated(onDataValidated)
63  , m_onDataValidationFailed(onDataValidationFailed)
64  , m_nRetries(nRetries)
65  , m_nSteps(nSteps)
66  , m_requesterFaceId(requesterFaceId)
67  {
68  }
69 
79  int m_nSteps;
82 };
83 
84 } // namespace security
85 
91 
92 } // namespace ndn
93 
94 #endif //NDN_SECURITY_VALIDATION_REQUEST_HPP
function< void(const shared_ptr< const Interest > &, const std::string &)> OnInterestValidationFailed
Callback to report a failed Interest validation.
Copyright (c) 2013-2017 Regents of the University of California.
Definition: common.hpp:75
Interest m_interest
the Interest for the requested data/certificate.
represents an Interest packet
Definition: interest.hpp:42
ValidationRequest contains information related to further validation.
int m_nRetries
the number of retries when the interest times out.
function< void(const shared_ptr< const Data > &, const std::string &)> OnDataValidationFailed
Callback to report a failed Data validation.
function< void(const shared_ptr< const Data > &)> OnDataValidated
Callback to report a successful Data validation.
function< void(const shared_ptr< const Interest > &)> OnInterestValidated
Callback to report a successful Interest validation.
int m_nSteps
the number of validation steps that have been performed.
ValidationRequest(const Interest &interest, const OnDataValidated &onDataValidated, const OnDataValidationFailed &onDataValidationFailed, int nRetries, int nSteps, uint64_t requesterFaceId=0)
uint64_t m_requesterFaceId
the incoming face id of the origin packet.
OnDataValidationFailed m_onDataValidationFailed
callback when the retrieved certificate cannot be authenticated.
OnDataValidated m_onDataValidated
callback when the retrieved certificate is authenticated.