nlsr::HelloProtocol Class Reference

#include <hello-protocol.hpp>

+ Collaboration diagram for nlsr::HelloProtocol:

Public Member Functions

 HelloProtocol (ndn::Face &face, ndn::KeyChain &keyChain, ConfParameter &confParam, RoutingTable &routingTable, Lsdb &lsdb)
 
void expressInterest (const ndn::Name &interestNamePrefix, uint32_t seconds)
 Sends a Hello Interest packet. More...
 
void processInterest (const ndn::Name &name, const ndn::Interest &interest)
 Processes a Hello Interest from a neighbor. More...
 
void sendHelloInterest (const ndn::Name &neighbor)
 Sends Hello Interests to all neighbors. More...
 

Public Attributes

ndn::signal::Signal< HelloProtocol, Statistics::PacketTypehpIncrementSignal
 
ndn::signal::Signal< HelloProtocol, const ndn::Name & > onInitialHelloDataValidated
 

Static Public Attributes

static const std::string INFO_COMPONENT {"INFO"}
 
static const std::string NLSR_COMPONENT {"nlsr"}
 

Detailed Description

Definition at line 38 of file hello-protocol.hpp.

Constructor & Destructor Documentation

◆ HelloProtocol()

nlsr::HelloProtocol::HelloProtocol ( ndn::Face &  face,
ndn::KeyChain &  keyChain,
ConfParameter confParam,
RoutingTable routingTable,
Lsdb lsdb 
)

Definition at line 33 of file hello-protocol.cpp.

Member Function Documentation

◆ expressInterest()

void nlsr::HelloProtocol::expressInterest ( const ndn::Name &  interestNamePrefix,
uint32_t  seconds 
)

Sends a Hello Interest packet.

Parameters
interestNamePrefixThe name of the router that has published the update we want. Here that should be: <router name>/NLSR/INFO
secondsThe lifetime of the Interest we construct, in seconds

This function attempts to contact neighboring routers to determine their status (which currently is one of: ACTIVE, INACTIVE, or UNKNOWN)

Definition at line 66 of file hello-protocol.cpp.

◆ processInterest()

void nlsr::HelloProtocol::processInterest ( const ndn::Name &  name,
const ndn::Interest &  interest 
)

Processes a Hello Interest from a neighbor.

Parameters
name(ignored)
interestThe Interest object that we have received and need to process.

Processes a Hello Interest that this router receives from one of its neighbors. If the neighbor that sent the Interest does not have a Face, NLSR will attempt to create one. Also, if the neighbor that sent the Interest was previously marked as INACTIVE, NLSR will attempt to contact it with its own Hello Interest.

Definition at line 111 of file hello-protocol.cpp.

◆ sendHelloInterest()

void nlsr::HelloProtocol::sendHelloInterest ( const ndn::Name &  neighbor)

Sends Hello Interests to all neighbors.

This function is called as part of a schedule to regularly determine the adjacency status of neighbors. This function creates and sends a Hello Interest to the given adjacent.

Parameters
neighborthe name of the neighbor

Definition at line 88 of file hello-protocol.cpp.

Member Data Documentation

◆ hpIncrementSignal

ndn::signal::Signal<HelloProtocol, Statistics::PacketType> nlsr::HelloProtocol::hpIncrementSignal

Definition at line 86 of file hello-protocol.hpp.

◆ INFO_COMPONENT

const std::string nlsr::HelloProtocol::INFO_COMPONENT {"INFO"}
inlinestatic

Definition at line 126 of file hello-protocol.hpp.

◆ NLSR_COMPONENT

const std::string nlsr::HelloProtocol::NLSR_COMPONENT {"nlsr"}
inlinestatic

Definition at line 127 of file hello-protocol.hpp.

◆ onInitialHelloDataValidated

ndn::signal::Signal<HelloProtocol, const ndn::Name&> nlsr::HelloProtocol::onInitialHelloDataValidated

Definition at line 129 of file hello-protocol.hpp.