42 #include <boost/cstdint.hpp> 44 #include <boost/throw_exception.hpp> 46 #include <ndn-cxx/face.hpp> 47 #include <ndn-cxx/security/key-chain.hpp> 48 #include <ndn-cxx/security/validator-config.hpp> 49 #include <ndn-cxx/security/v2/certificate-fetcher-direct-fetch.hpp> 50 #include <ndn-cxx/security/signing-helpers.hpp> 51 #include <ndn-cxx/security/signing-info.hpp> 52 #include <ndn-cxx/util/scheduler.hpp> 53 #include <ndn-cxx/mgmt/nfd/face-event-notification.hpp> 54 #include <ndn-cxx/mgmt/nfd/face-monitor.hpp> 55 #include <ndn-cxx/mgmt/dispatcher.hpp> 56 #include <ndn-cxx/mgmt/nfd/face-status.hpp> 57 #include <ndn-cxx/data.hpp> 58 #include <ndn-cxx/encoding/block.hpp> 59 #include <ndn-cxx/encoding/nfd-constants.hpp> 60 #include <ndn-cxx/mgmt/nfd/control-parameters.hpp> 61 #include <ndn-cxx/mgmt/nfd/control-response.hpp> 73 class Error :
public std::runtime_error
78 :
std::runtime_error(what)
130 const std::string& reason,
131 uint32_t nRetriesSoFar);
157 const ndn::time::milliseconds& timeout);
189 const ndn::security::v2::Certificate*
192 const ndn::security::v2::Certificate* cert =
193 m_certStore.find(certificateKeyName);
204 getCertificateStore()
218 registerLocalhostPrefix();
223 registerRouterPrefix();
228 onKeyInterest(
const ndn::Name& name,
const ndn::Interest& interest);
233 onKeyPrefixRegSuccess(
const ndn::Name& name);
238 onFaceEventNotification(
const ndn::nfd::FaceEventNotification& faceEventNotification);
241 scheduleDatasetFetch();
251 enableIncomingFaceIdIndication();
254 onFaceIdIndicationSuccess(
const ndn::nfd::ControlParameters& cp);
257 onFaceIdIndicationFailure(
const ndn::nfd::ControlResponse& cr);
264 ndn::Scheduler m_scheduler;
265 ndn::security::v2::KeyChain& m_keyChain;
269 bool m_isDaemonProcess;
270 ndn::security::ValidatorConfig& m_validator;
279 ndn::util::signal::ScopedConnection m_afterSegmentValidatedConnection;
282 ndn::mgmt::Dispatcher m_dispatcher;
292 ndn::nfd::Controller m_controller;
293 ndn::nfd::Controller m_faceDatasetController;
296 ndn::security::SigningInfo m_signingInfo;
303 ndn::nfd::FaceMonitor m_faceMonitor;
310 #endif // NLSR_NLSR_HPP
void initializeFaces(const FetchDatasetCallback &onFetchSuccess, const FetchDatasetTimeoutCallback &onFetchFailure)
Initializes neighbors' Faces using information from NFD.
void onFaceDatasetFetchTimeout(uint32_t code, const std::string &reason, uint32_t nRetriesSoFar)
A class to house all the configuration parameters for NLSR.
Class to publish all dataset.
std::function< void(uint32_t, const std::string &)> FetchDatasetTimeoutCallback
Store certificates for names.
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE
A wrapper class to instantiate and configure an NLSR object.
Error(const std::string &what)
std::function< void(const std::vector< ndn::nfd::FaceStatus > &)> FetchDatasetCallback
Nlsr(ndn::Face &face, ndn::KeyChain &keyChain, ConfParameter &confParam)
Maps names to lists of next hops, and exports this information to NFD.
void setLsaInterestFilter()
void addDispatcherTopPrefix(const ndn::Name &topPrefix)
Add top level prefixes for Dispatcher.
static const ndn::Name LOCALHOST_PREFIX
void registerAdjacencyPrefixes(const Adjacent &adj, const ndn::time::milliseconds &timeout)
Registers NLSR-specific prefixes for a neighbor (Adjacent)
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California.
void onRegistrationSuccess(const ndn::Name &name)
void loadCertToPublish(const ndn::security::v2::Certificate &certificate)
Add a certificate NLSR claims to be authoritative for to the certificate store.
void publishCertFromCache(const ndn::Name &keyName)
Retrieves the chain of certificates from Validator's cache and store them in Nlsr's own CertificateSt...
void setInfoInterestFilter()
void afterFetcherSignalEmitted(const ndn::Data &lsaSegment)
Callback when SegmentFetcher retrieves a segment.
A neighbor reachable over a Face.
Copyright (c) 2014-2019, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
void registrationFailed(const ndn::Name &name)
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
const ndn::security::v2::Certificate * getCertificate(const ndn::Name &certificateKeyName)
Find a certificate.
static ndn::Name DEFAULT_BROADCAST_PREFIX("/ndn/broadcast")
void processFaceDataset(const std::vector< ndn::nfd::FaceStatus > &faces)
Consumes a Face StatusDataset to configure NLSR neighbors.