All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
certificate-fetcher-from-network.hpp
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
23 #ifndef NDN_CERTIFICATE_FETCHER_FROM_NETWORK_HPP
24 #define NDN_CERTIFICATE_FETCHER_FROM_NETWORK_HPP
25 
26 #include "../../face.hpp"
27 #include "certificate-fetcher.hpp"
28 
29 namespace ndn {
30 
36 public:
42  : impl_(new Impl(*this, face))
43  {}
44 
45 protected:
55  virtual void
56  doFetch
57  (const ptr_lib::shared_ptr<CertificateRequest>& certificateRequest,
58  const ptr_lib::shared_ptr<ValidationState>& state,
59  const ValidationContinuation& continueValidation)
60  {
61  impl_->doFetch(certificateRequest, state, continueValidation);
62  }
63 
64 private:
71  class Impl : public ptr_lib::enable_shared_from_this<Impl> {
72  public:
73  Impl(CertificateFetcherFromNetwork& parent, Face& face)
74  : parent_(parent), face_(face)
75  {}
76 
86  virtual void
87  doFetch
88  (const ptr_lib::shared_ptr<CertificateRequest>& certificateRequest,
89  const ptr_lib::shared_ptr<ValidationState>& state,
90  const ValidationContinuation& continueValidation);
91 
92  private:
101  void
102  onData
103  (const ptr_lib::shared_ptr<const Interest>& interest,
104  const ptr_lib::shared_ptr<Data>& data,
105  const ptr_lib::shared_ptr<ValidationState>& state,
106  const CertificateFetcher::ValidationContinuation& continueValidation);
107 
122  void
123  onNetworkNack
124  (const ptr_lib::shared_ptr<const Interest>& interest,
125  const ptr_lib::shared_ptr<NetworkNack>& networkNack,
126  const ptr_lib::shared_ptr<CertificateRequest>& certificateRequest,
127  const ptr_lib::shared_ptr<ValidationState>& state,
128  const CertificateFetcher::ValidationContinuation& continueValidation);
129 
143  void
144  onTimeout
145  (const ptr_lib::shared_ptr<const Interest>& interest,
146  const ptr_lib::shared_ptr<CertificateRequest>& certificateRequest,
147  const ptr_lib::shared_ptr<ValidationState>& state,
148  const CertificateFetcher::ValidationContinuation& continueValidation);
149 
151  Face& face_;
152  };
153 
154  ptr_lib::shared_ptr<Impl> impl_;
155 };
156 
157 }
158 
159 #endif
The Face class provides the main methods for NDN communication.
Definition: face.hpp:86
virtual void doFetch(const ptr_lib::shared_ptr< CertificateRequest > &certificateRequest, const ptr_lib::shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation)
Implement doFetch to use face_.expressInterest to fetch a certificate.
Definition: certificate-fetcher-from-network.hpp:57
CertificateFetcher is an abstract base class which provides an interface used by the validator to fet...
Definition: certificate-fetcher.hpp:36
CertificateFetcherFromNetwork extends CertificateFetcher to fetch missing certificates from the netwo...
Definition: certificate-fetcher-from-network.hpp:35
CertificateFetcherFromNetwork(Face &face)
Create a CertificateFetcherFromNetwork to fetch certificates using the Face.
Definition: certificate-fetcher-from-network.hpp:41