41 #include <boost/cstdint.hpp> 43 #include <boost/throw_exception.hpp> 45 #include <ndn-cxx/face.hpp> 46 #include <ndn-cxx/security/key-chain.hpp> 47 #include <ndn-cxx/security/validator-config.hpp> 48 #include <ndn-cxx/security/v2/certificate-fetcher-direct-fetch.hpp> 49 #include <ndn-cxx/security/signing-helpers.hpp> 50 #include <ndn-cxx/security/signing-info.hpp> 51 #include <ndn-cxx/util/scheduler.hpp> 52 #include <ndn-cxx/mgmt/nfd/face-event-notification.hpp> 53 #include <ndn-cxx/mgmt/nfd/face-monitor.hpp> 54 #include <ndn-cxx/mgmt/dispatcher.hpp> 55 #include <ndn-cxx/mgmt/nfd/face-status.hpp> 56 #include <ndn-cxx/data.hpp> 57 #include <ndn-cxx/encoding/block.hpp> 58 #include <ndn-cxx/encoding/nfd-constants.hpp> 59 #include <ndn-cxx/mgmt/nfd/control-parameters.hpp> 60 #include <ndn-cxx/mgmt/nfd/control-response.hpp> 72 class Error :
public std::runtime_error
77 :
std::runtime_error(what)
138 const std::string& reason,
139 uint32_t nRetriesSoFar);
165 const ndn::time::milliseconds& timeout);
174 registerLocalhostPrefix();
179 registerRouterPrefix();
184 onFaceEventNotification(
const ndn::nfd::FaceEventNotification& faceEventNotification);
187 scheduleDatasetFetch();
197 enableIncomingFaceIdIndication();
200 onFaceIdIndicationSuccess(
const ndn::nfd::ControlParameters& cp);
203 onFaceIdIndicationFailure(
const ndn::nfd::ControlResponse& cr);
210 ndn::Scheduler m_scheduler;
211 ndn::security::v2::KeyChain& m_keyChain;
215 bool m_isDaemonProcess;
216 ndn::security::ValidatorConfig& m_validator;
217 std::vector<ndn::Name> m_strategySetOnRouters;
227 ndn::util::signal::ScopedConnection m_onNewLsaConnection;
228 ndn::util::signal::ScopedConnection m_onPrefixRegistrationSuccess;
229 ndn::util::signal::ScopedConnection m_onHelloDataValidated;
232 ndn::mgmt::Dispatcher m_dispatcher;
240 ndn::nfd::Controller m_controller;
241 ndn::nfd::Controller m_faceDatasetController;
250 ndn::nfd::FaceMonitor m_faceMonitor;
257 #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
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE
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 setInfoInterestFilter()
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 registerStrategyForCerts(const ndn::Name &originRouter)
void registrationFailed(const ndn::Name &name)
Copyright (c) 2014-2019, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
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.