#include <nlsr.hpp>
Data Structures | |
class | Error |
Public Types | |
using | FetchDatasetCallback = std::function< void(const std::vector< ndn::nfd::FaceStatus > &)> |
using | FetchDatasetTimeoutCallback = std::function< void(uint32_t, const std::string &)> |
Public Member Functions | |
Nlsr (boost::asio::io_service &ioService, ndn::Scheduler &scheduler, ndn::Face &face, ndn::KeyChain &keyChain) | |
void | registrationFailed (const ndn::Name &name) |
void | onRegistrationSuccess (const ndn::Name &name) |
void | setInfoInterestFilter () |
void | setLsaInterestFilter () |
void | addDispatcherTopPrefix (const ndn::Name &topPrefix) |
Add top level prefixes for Dispatcher. More... | |
void | startEventLoop () |
std::string | getConfFileName () const |
void | setConfFileName (const std::string &fileName) |
bool | getIsSetDaemonProcess () |
void | setIsDaemonProcess (bool value) |
ConfParameter & | getConfParameter () |
AdjacencyList & | getAdjacencyList () |
NamePrefixList & | getNamePrefixList () |
ndn::Face & | getNlsrFace () |
Lsdb & | getLsdb () |
RoutingTable & | getRoutingTable () |
NamePrefixTable & | getNamePrefixTable () |
Fib & | getFib () |
long int | getAdjBuildCount () |
void | incrementAdjBuildCount () |
void | setAdjBuildCount (int64_t abc) |
bool | getIsBuildAdjLsaSheduled () |
void | setIsBuildAdjLsaSheduled (bool iabls) |
bool | getIsRoutingTableCalculating () |
void | setIsRoutingTableCalculating (bool irtc) |
bool | getIsRouteCalculationScheduled () |
void | setIsRouteCalculationScheduled (bool ircs) |
LsdbDatasetInterestHandler & | getLsdbDatasetHandler () |
void | initialize () |
void | initializeFaces (const FetchDatasetCallback &onFetchSuccess, const FetchDatasetTimeoutCallback &onFetchFailure) |
Initializes neighbors' Faces using information from NFD. More... | |
void | onFaceDatasetFetchTimeout (uint32_t code, const std::string &reason, uint32_t nRetriesSoFar) |
void | processFaceDataset (const std::vector< ndn::nfd::FaceStatus > &faces) |
Consumes a Face StatusDataset to configure NLSR neighbors. More... | |
void | registerAdjacencyPrefixes (const Adjacent &adj, const ndn::time::milliseconds &timeout) |
Registers NLSR-specific prefixes for a neighbor (Adjacent) More... | |
void | loadCertToPublish (const ndn::security::v2::Certificate &certificate) |
Add a certificate NLSR claims to be authoritative for to the certificate store. More... | |
void | initializeKey () |
void | loadValidator (boost::property_tree::ptree section, const std::string &filename) |
ndn::security::ValidatorConfig & | getValidator () |
const ndn::security::v2::Certificate * | getCertificate (const ndn::Name &certificateKeyName) |
Find a certificate. More... | |
ndn::security::v2::KeyChain & | getKeyChain () |
const ndn::Name & | getDefaultCertName () |
const ndn::security::SigningInfo & | getSigningInfo () |
update::PrefixUpdateProcessor & | getPrefixUpdateProcessor () |
update::NfdRibCommandProcessor & | getNfdRibCommandProcessor () |
ndn::mgmt::Dispatcher & | getLocalhostDispatcher () |
ndn::mgmt::Dispatcher & | getRouterNameDispatcher () |
void | setStrategies () |
void | daemonize () |
uint32_t | getFirstHelloInterval () const |
void | canonizeNeighborUris (std::list< Adjacent >::iterator currentNeighbor, std::function< void(std::list< Adjacent >::iterator)> then, std::function< void(void)> finally) |
Canonize the URI for this and all proceeding neighbors in a list. More... | |
StatsCollector & | getStatsCollector () |
Static Public Attributes | |
static const ndn::Name | LOCALHOST_PREFIX = ndn::Name("/localhost/nlsr") |
Friends | |
class | NlsrRunner |
using nlsr::Nlsr::FetchDatasetCallback = std::function<void(const std::vector<ndn::nfd::FaceStatus>&)> |
using nlsr::Nlsr::FetchDatasetTimeoutCallback = std::function<void(uint32_t, const std::string&)> |
nlsr::Nlsr::Nlsr | ( | boost::asio::io_service & | ioService, |
ndn::Scheduler & | scheduler, | ||
ndn::Face & | face, | ||
ndn::KeyChain & | keyChain | ||
) |
void nlsr::Nlsr::addDispatcherTopPrefix | ( | const ndn::Name & | topPrefix | ) |
void nlsr::Nlsr::canonizeNeighborUris | ( | std::list< Adjacent >::iterator | currentNeighbor, |
std::function< void(std::list< Adjacent >::iterator)> | then, | ||
std::function< void(void)> | finally | ||
) |
Canonize the URI for this and all proceeding neighbors in a list.
This function canonizes the URI of the Adjacent object pointed to by currentNeighbor. It then executes the then callback, providing the next iterator in the list to the callback. A standard invocation would be to pass the begin() iterator of NLSR's adjacency list, and to provide Nlsr::canonizeContinuation as the callback. Because every URI must be canonical before we begin operations, the canonize function provides a finally() function to resume whatever needs to occur.
Definition at line 196 of file nlsr.cpp.
void nlsr::Nlsr::daemonize | ( | ) |
|
inline |
|
inline |
|
inline |
Find a certificate.
Find a certificate that NLSR has. First it checks against the certificates this NLSR claims to be authoritative for, usually something like this specific router's certificate, and then checks the cache of certficates it has already fetched. If none can be found, it will return an empty pointer.
Definition at line 320 of file nlsr.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void nlsr::Nlsr::initialize | ( | ) |
void nlsr::Nlsr::initializeFaces | ( | const FetchDatasetCallback & | onFetchSuccess, |
const FetchDatasetTimeoutCallback & | onFetchFailure | ||
) |
Initializes neighbors' Faces using information from NFD.
This function serves as the entry-point for initializing the neighbors listed in nlsr.conf during Nlsr::initialize(). NLSR will attempt to fetch a dataset of Faces from NFD, and configure each of its neighbors using information from that dataset. The explicit callbacks allow for better testability.
Definition at line 521 of file nlsr.cpp.
void nlsr::Nlsr::initializeKey | ( | ) |
void nlsr::Nlsr::loadCertToPublish | ( | const ndn::security::v2::Certificate & | certificate | ) |
|
inline |
void nlsr::Nlsr::onFaceDatasetFetchTimeout | ( | uint32_t | code, |
const std::string & | reason, | ||
uint32_t | nRetriesSoFar | ||
) |
void nlsr::Nlsr::onRegistrationSuccess | ( | const ndn::Name & | name | ) |
void nlsr::Nlsr::processFaceDataset | ( | const std::vector< ndn::nfd::FaceStatus > & | faces | ) |
Consumes a Face StatusDataset to configure NLSR neighbors.
faces | A Face Dataset that should conform to FaceMgmt specifications. |
This function processes a Face StatusDataset that should conform to the FaceMgmt specifications listed here. Any newly configured neighbors will have prefixes registered with NFD and be sent Hello Interests as well.
Definition at line 531 of file nlsr.cpp.
void nlsr::Nlsr::registerAdjacencyPrefixes | ( | const Adjacent & | adj, |
const ndn::time::milliseconds & | timeout | ||
) |
Registers NLSR-specific prefixes for a neighbor (Adjacent)
adj | A reference to the neighbor to register prefixes for |
timeout | The amount of time to give NFD to respond to each registration request. |
Registers the prefixes in NFD that NLSR needs to route with a neighbor. The timeout given is how long to set the timeout for each registration request that is made.
Definition at line 565 of file nlsr.cpp.
void nlsr::Nlsr::registrationFailed | ( | const ndn::Name & | name | ) |
|
inline |
|
inline |
void nlsr::Nlsr::setInfoInterestFilter | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
void nlsr::Nlsr::setLsaInterestFilter | ( | ) |
void nlsr::Nlsr::setStrategies | ( | ) |
void nlsr::Nlsr::startEventLoop | ( | ) |
|
friend |