#include <hello-protocol.hpp>
Public Member Functions | |
HelloProtocol (Nlsr &nlsr, ndn::Scheduler &scheduler) | |
void | scheduleInterest (uint32_t seconds) |
Schedules a Hello Interest event. More... | |
void | expressInterest (const ndn::Name &interestNamePrefix, uint32_t seconds) |
Sends a Hello Interest packet. More... | |
void | sendScheduledInterest (uint32_t seconds) |
Sends Hello Interests to all neighbors. More... | |
void | processInterest (const ndn::Name &name, const ndn::Interest &interest) |
Processes a Hello Interest from a neighbor. More... | |
Data Fields | |
ndn::util::signal::Signal< HelloProtocol, Statistics::PacketType > | hpIncrementSignal |
Definition at line 39 of file hello-protocol.hpp.
nlsr::HelloProtocol::HelloProtocol | ( | Nlsr & | nlsr, |
ndn::Scheduler & | scheduler | ||
) |
Definition at line 35 of file hello-protocol.cpp.
void nlsr::HelloProtocol::expressInterest | ( | const ndn::Name & | interestNamePrefix, |
uint32_t | seconds | ||
) |
Sends a Hello Interest packet.
interestNamePrefix | The name of the router that has published the update we want. Here that should be: <router name>/NLSR/INFO |
seconds | The 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 42 of file hello-protocol.cpp.
void nlsr::HelloProtocol::processInterest | ( | const ndn::Name & | name, |
const ndn::Interest & | interest | ||
) |
Processes a Hello Interest from a neighbor.
name | (ignored) |
interest | The 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 92 of file hello-protocol.cpp.
void nlsr::HelloProtocol::scheduleInterest | ( | uint32_t | seconds | ) |
Schedules a Hello Interest event.
This function serves as the Hello Interest loop, and must be explicitly called to start the Hello cycle. This is done at NLSR's initialization.
seconds | The number of seconds to wait before calling the event. |
Definition at line 83 of file hello-protocol.cpp.
void nlsr::HelloProtocol::sendScheduledInterest | ( | uint32_t | seconds | ) |
Sends Hello Interests to all neighbors.
seconds | (ignored) |
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 each neighbor in Nlsr::m_adjacencyList. If the neighbor has not been contacted before and curerntly has no Face in NFD, this method will call a different pipeline that creates the Face first, then registers prefixes.
Definition at line 62 of file hello-protocol.cpp.
ndn::util::signal::Signal<HelloProtocol, Statistics::PacketType> nlsr::HelloProtocol::hpIncrementSignal |
Definition at line 102 of file hello-protocol.hpp.