nlsr::Nlsr Class Reference

#include <nlsr.hpp>

Collaboration diagram for nlsr::Nlsr:
[legend]

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)
 
ConfParametergetConfParameter ()
 
const ConfParametergetConfParameter () const
 
AdjacencyListgetAdjacencyList ()
 
const AdjacencyListgetAdjacencyList () const
 
NamePrefixListgetNamePrefixList ()
 
const NamePrefixListgetNamePrefixList () const
 
ndn::Face & getNlsrFace ()
 
LsdbgetLsdb ()
 
RoutingTablegetRoutingTable ()
 
NamePrefixTablegetNamePrefixTable ()
 
FibgetFib ()
 
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)
 
DatasetInterestHandlergetDatasetHandler ()
 
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 connectToFetcher (ndn::util::SegmentFetcher &fetcher)
 
void afterFetcherSignalEmitted (const ndn::Data &lsaSegment)
 Callback when SegmentFetcher retrieves a segment. More...
 
void publishCertFromCache (const ndn::Name &keyName)
 Retrieves the chain of certificates from Validator's cache and store them in Nlsr's own CertificateStore. 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::PrefixUpdateProcessorgetPrefixUpdateProcessor ()
 
update::NfdRibCommandProcessorgetNfdRibCommandProcessor ()
 
ndn::mgmt::Dispatcher & getDispatcher ()
 
void setStrategies ()
 
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...
 
StatsCollectorgetStatsCollector ()
 

Static Public Attributes

static const ndn::Name LOCALHOST_PREFIX = ndn::Name("/localhost/nlsr")
 

Friends

class NlsrRunner
 

Detailed Description

Definition at line 67 of file nlsr.hpp.

Member Typedef Documentation

using nlsr::Nlsr::FetchDatasetCallback = std::function<void(const std::vector<ndn::nfd::FaceStatus>&)>

Definition at line 70 of file nlsr.hpp.

using nlsr::Nlsr::FetchDatasetTimeoutCallback = std::function<void(uint32_t, const std::string&)>

Definition at line 71 of file nlsr.hpp.

Constructor & Destructor Documentation

nlsr::Nlsr::Nlsr ( boost::asio::io_service &  ioService,
ndn::Scheduler &  scheduler,
ndn::Face &  face,
ndn::KeyChain &  keyChain 
)

Definition at line 42 of file nlsr.cpp.

Here is the caller graph for this function:

Member Function Documentation

void nlsr::Nlsr::addDispatcherTopPrefix ( const ndn::Name &  topPrefix)

Add top level prefixes for Dispatcher.

All dispatcher-related sub-prefixes must be registered before sub-prefixes must be added before adding top

Definition at line 132 of file nlsr.cpp.

Here is the caller graph for this function:

void nlsr::Nlsr::afterFetcherSignalEmitted ( const ndn::Data &  lsaSegment)

Callback when SegmentFetcher retrieves a segment.

Definition at line 210 of file nlsr.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

See also
Nlsr::canonizeContinuation
Nlsr::initialize
NlsrRunner::run

Definition at line 162 of file nlsr.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nlsr::Nlsr::connectToFetcher ( ndn::util::SegmentFetcher &  fetcher)

Definition at line 201 of file nlsr.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

AdjacencyList& nlsr::Nlsr::getAdjacencyList ( )
inline

Definition at line 133 of file nlsr.hpp.

Here is the caller graph for this function:

const AdjacencyList& nlsr::Nlsr::getAdjacencyList ( ) const
inline

Definition at line 139 of file nlsr.hpp.

long int nlsr::Nlsr::getAdjBuildCount ( )
inline

Definition at line 187 of file nlsr.hpp.

Here is the caller graph for this function:

const ndn::security::v2::Certificate* nlsr::Nlsr::getCertificate ( const ndn::Name &  certificateKeyName)
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 341 of file nlsr.hpp.

Here is the caller graph for this function:

std::string nlsr::Nlsr::getConfFileName ( ) const
inline

Definition at line 109 of file nlsr.hpp.

Here is the caller graph for this function:

ConfParameter& nlsr::Nlsr::getConfParameter ( )
inline

Definition at line 121 of file nlsr.hpp.

Here is the caller graph for this function:

const ConfParameter& nlsr::Nlsr::getConfParameter ( ) const
inline

Definition at line 127 of file nlsr.hpp.

DatasetInterestHandler& nlsr::Nlsr::getDatasetHandler ( )
inline

Definition at line 241 of file nlsr.hpp.

Here is the call graph for this function:

const ndn::Name& nlsr::Nlsr::getDefaultCertName ( )
inline

Definition at line 356 of file nlsr.hpp.

ndn::mgmt::Dispatcher& nlsr::Nlsr::getDispatcher ( )
inline

Definition at line 380 of file nlsr.hpp.

Here is the call graph for this function:

Fib& nlsr::Nlsr::getFib ( )
inline

Definition at line 181 of file nlsr.hpp.

Here is the caller graph for this function:

uint32_t nlsr::Nlsr::getFirstHelloInterval ( ) const
inline

Definition at line 389 of file nlsr.hpp.

Here is the call graph for this function:

bool nlsr::Nlsr::getIsBuildAdjLsaSheduled ( )
inline

Definition at line 205 of file nlsr.hpp.

Here is the caller graph for this function:

bool nlsr::Nlsr::getIsRouteCalculationScheduled ( )
inline

Definition at line 229 of file nlsr.hpp.

Here is the caller graph for this function:

bool nlsr::Nlsr::getIsRoutingTableCalculating ( )
inline

Definition at line 217 of file nlsr.hpp.

Here is the caller graph for this function:

ndn::security::v2::KeyChain& nlsr::Nlsr::getKeyChain ( )
inline

Definition at line 350 of file nlsr.hpp.

Here is the caller graph for this function:

Lsdb& nlsr::Nlsr::getLsdb ( )
inline

Definition at line 163 of file nlsr.hpp.

Here is the caller graph for this function:

NamePrefixList& nlsr::Nlsr::getNamePrefixList ( )
inline

Definition at line 145 of file nlsr.hpp.

Here is the caller graph for this function:

const NamePrefixList& nlsr::Nlsr::getNamePrefixList ( ) const
inline

Definition at line 151 of file nlsr.hpp.

NamePrefixTable& nlsr::Nlsr::getNamePrefixTable ( )
inline

Definition at line 175 of file nlsr.hpp.

Here is the caller graph for this function:

update::NfdRibCommandProcessor& nlsr::Nlsr::getNfdRibCommandProcessor ( )
inline

Definition at line 374 of file nlsr.hpp.

ndn::Face& nlsr::Nlsr::getNlsrFace ( )
inline

Definition at line 157 of file nlsr.hpp.

Here is the caller graph for this function:

update::PrefixUpdateProcessor& nlsr::Nlsr::getPrefixUpdateProcessor ( )
inline

Definition at line 368 of file nlsr.hpp.

RoutingTable& nlsr::Nlsr::getRoutingTable ( )
inline

Definition at line 169 of file nlsr.hpp.

Here is the caller graph for this function:

const ndn::security::SigningInfo& nlsr::Nlsr::getSigningInfo ( )
inline

Definition at line 362 of file nlsr.hpp.

Here is the caller graph for this function:

StatsCollector& nlsr::Nlsr::getStatsCollector ( )
inline

Definition at line 415 of file nlsr.hpp.

ndn::security::ValidatorConfig& nlsr::Nlsr::getValidator ( )
inline

Definition at line 327 of file nlsr.hpp.

Here is the caller graph for this function:

void nlsr::Nlsr::incrementAdjBuildCount ( )
inline

Definition at line 193 of file nlsr.hpp.

Here is the caller graph for this function:

void nlsr::Nlsr::initialize ( )

Definition at line 250 of file nlsr.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nlsr::Nlsr::initializeFaces ( const FetchDatasetCallback onFetchSuccess,
const FetchDatasetTimeoutCallback onFetchFailure 
)

Initializes neighbors' Faces using information from NFD.

See also
Nlsr::initialize()
Nlsr::processFaceDataset()

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 545 of file nlsr.cpp.

Here is the caller graph for this function:

void nlsr::Nlsr::initializeKey ( )

Definition at line 317 of file nlsr.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nlsr::Nlsr::loadCertToPublish ( const ndn::security::v2::Certificate &  certificate)

Add a certificate NLSR claims to be authoritative for to the certificate store.

See also
CertificateStore

Definition at line 189 of file nlsr.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nlsr::Nlsr::loadValidator ( boost::property_tree::ptree  section,
const std::string &  filename 
)
inline

Definition at line 320 of file nlsr.hpp.

void nlsr::Nlsr::onFaceDatasetFetchTimeout ( uint32_t  code,
const std::string &  reason,
uint32_t  nRetriesSoFar 
)

Definition at line 609 of file nlsr.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nlsr::Nlsr::onRegistrationSuccess ( const ndn::Name &  name)

Definition at line 91 of file nlsr.cpp.

Here is the caller graph for this function:

void nlsr::Nlsr::processFaceDataset ( const std::vector< ndn::nfd::FaceStatus > &  faces)

Consumes a Face StatusDataset to configure NLSR neighbors.

See also
Nlsr::initializeFaces
Parameters
facesA 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 555 of file nlsr.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nlsr::Nlsr::publishCertFromCache ( const ndn::Name &  keyName)

Retrieves the chain of certificates from Validator's cache and store them in Nlsr's own CertificateStore.

Parameters
keyNameName of the first key in the certificate chain.

Definition at line 223 of file nlsr.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nlsr::Nlsr::registerAdjacencyPrefixes ( const Adjacent adj,
const ndn::time::milliseconds &  timeout 
)

Registers NLSR-specific prefixes for a neighbor (Adjacent)

See also
Nlsr::initializeFaces
Parameters
adjA reference to the neighbor to register prefixes for
timeoutThe 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 589 of file nlsr.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nlsr::Nlsr::registrationFailed ( const ndn::Name &  name)

Definition at line 84 of file nlsr.cpp.

Here is the caller graph for this function:

void nlsr::Nlsr::setAdjBuildCount ( int64_t  abc)
inline

Definition at line 199 of file nlsr.hpp.

Here is the caller graph for this function:

void nlsr::Nlsr::setConfFileName ( const std::string &  fileName)
inline

Definition at line 115 of file nlsr.hpp.

Here is the caller graph for this function:

void nlsr::Nlsr::setInfoInterestFilter ( )

Definition at line 97 of file nlsr.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nlsr::Nlsr::setIsBuildAdjLsaSheduled ( bool  iabls)
inline

Definition at line 211 of file nlsr.hpp.

Here is the caller graph for this function:

void nlsr::Nlsr::setIsRouteCalculationScheduled ( bool  ircs)
inline

Definition at line 235 of file nlsr.hpp.

Here is the caller graph for this function:

void nlsr::Nlsr::setIsRoutingTableCalculating ( bool  irtc)
inline

Definition at line 223 of file nlsr.hpp.

Here is the caller graph for this function:

void nlsr::Nlsr::setLsaInterestFilter ( )

Definition at line 115 of file nlsr.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nlsr::Nlsr::setStrategies ( )

Definition at line 143 of file nlsr.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nlsr::Nlsr::startEventLoop ( )

Definition at line 679 of file nlsr.cpp.

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class NlsrRunner
friend

Definition at line 537 of file nlsr.hpp.

Field Documentation

const ndn::Name nlsr::Nlsr::LOCALHOST_PREFIX = ndn::Name("/localhost/nlsr")
static

Definition at line 491 of file nlsr.hpp.