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 (ndn::Face &face, ndn::KeyChain &keyChain, ConfParameter &confParam)
 
void registerStrategyForCerts (const ndn::Name &originRouter)
 
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...
 
LsdbgetLsdb ()
 
FibgetFib ()
 
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 setStrategies ()
 

Static Public Attributes

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

Friends

class NlsrRunner
 

Detailed Description

Definition at line 66 of file nlsr.hpp.

Member Typedef Documentation

◆ FetchDatasetCallback

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

Definition at line 69 of file nlsr.hpp.

◆ FetchDatasetTimeoutCallback

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

Definition at line 70 of file nlsr.hpp.

Constructor & Destructor Documentation

◆ Nlsr()

nlsr::Nlsr::Nlsr ( ndn::Face &  face,
ndn::KeyChain &  keyChain,
ConfParameter confParam 
)

Definition at line 42 of file nlsr.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ addDispatcherTopPrefix()

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFib()

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

Definition at line 114 of file nlsr.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLsdb()

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

Definition at line 108 of file nlsr.hpp.

Here is the caller graph for this function:

◆ initialize()

void nlsr::Nlsr::initialize ( )

Definition at line 218 of file nlsr.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initializeFaces()

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

Here is the caller graph for this function:

◆ onFaceDatasetFetchTimeout()

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

Definition at line 402 of file nlsr.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onRegistrationSuccess()

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

Definition at line 163 of file nlsr.cpp.

Here is the caller graph for this function:

◆ processFaceDataset()

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ registerAdjacencyPrefixes()

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ registerStrategyForCerts()

void nlsr::Nlsr::registerStrategyForCerts ( const ndn::Name &  originRouter)

Definition at line 121 of file nlsr.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ registrationFailed()

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

Definition at line 156 of file nlsr.cpp.

Here is the caller graph for this function:

◆ setInfoInterestFilter()

void nlsr::Nlsr::setInfoInterestFilter ( )

Definition at line 169 of file nlsr.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setLsaInterestFilter()

void nlsr::Nlsr::setLsaInterestFilter ( )

Definition at line 185 of file nlsr.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setStrategies()

void nlsr::Nlsr::setStrategies ( )

Definition at line 211 of file nlsr.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ NlsrRunner

friend class NlsrRunner
friend

Definition at line 252 of file nlsr.hpp.

Field Documentation

◆ LOCALHOST_PREFIX

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

Definition at line 206 of file nlsr.hpp.