nfd::rib::Route Class Reference

Represents a route for a name prefix. More...

#include <daemon/rib/route.hpp>

+ Inheritance diagram for nfd::rib::Route:
+ Collaboration diagram for nfd::rib::Route:

Public Member Functions

 Route ()
 Default constructor. More...
 
 Route (const ndn::PrefixAnnouncement &ann, uint64_t faceId)
 Construct from a prefix announcement. More...
 
void cancelExpirationEvent ()
 
const ndn::scheduler::EventId & getExpirationEvent () const
 
std::underlying_type_t< ndn::nfd::RouteFlags > getFlags () const
 
void setExpirationEvent (const ndn::scheduler::EventId &eid)
 

Public Attributes

time::steady_clock::time_point annExpires
 Expiration time of the prefix announcement. More...
 
std::optional< ndn::PrefixAnnouncement > announcement
 The prefix announcement that caused the creation of this route. More...
 
uint64_t cost = 0
 
std::optional< time::steady_clock::time_point > expires
 
uint64_t faceId = 0
 
std::underlying_type_t< ndn::nfd::RouteFlags > flags = ndn::nfd::ROUTE_FLAGS_NONE
 
ndn::nfd::RouteOrigin origin = ndn::nfd::ROUTE_ORIGIN_APP
 

Friends

bool operator== (const Route &lhs, const Route &rhs)
 

Detailed Description

Represents a route for a name prefix.

Definition at line 43 of file route.hpp.

Constructor & Destructor Documentation

◆ Route() [1/2]

nfd::rib::Route::Route ( )
default

Default constructor.

◆ Route() [2/2]

nfd::rib::Route::Route ( const ndn::PrefixAnnouncement &  ann,
uint64_t  faceId 
)

Construct from a prefix announcement.

Parameters
anna prefix announcement that has passed verification
faceIdthe face on which ann arrived

Definition at line 53 of file route.cpp.

Member Function Documentation

◆ cancelExpirationEvent()

void nfd::rib::Route::cancelExpirationEvent ( )
inline

Definition at line 69 of file route.hpp.

◆ getExpirationEvent()

const ndn::scheduler::EventId& nfd::rib::Route::getExpirationEvent ( ) const
inline

Definition at line 57 of file route.hpp.

◆ getFlags()

std::underlying_type_t<ndn::nfd::RouteFlags> nfd::rib::Route::getFlags ( ) const
inline

Definition at line 75 of file route.hpp.

◆ setExpirationEvent()

void nfd::rib::Route::setExpirationEvent ( const ndn::scheduler::EventId &  eid)
inline

Definition at line 63 of file route.hpp.

Friends And Related Function Documentation

◆ operator==

bool operator== ( const Route lhs,
const Route rhs 
)
friend

Definition at line 82 of file route.hpp.

Member Data Documentation

◆ annExpires

time::steady_clock::time_point nfd::rib::Route::annExpires

Expiration time of the prefix announcement.

Valid only if announcement is not nullopt.

If this field is before or equal the current time, it indicates the prefix announcement is not yet valid or has expired. In this case, the exact value of this field does not matter. If this field is after the current time, it indicates when the prefix announcement expires.

Definition at line 113 of file route.hpp.

◆ announcement

std::optional<ndn::PrefixAnnouncement> nfd::rib::Route::announcement

The prefix announcement that caused the creation of this route.

This is nullopt if this route is not created by a prefix announcement.

Definition at line 103 of file route.hpp.

◆ cost

uint64_t nfd::rib::Route::cost = 0

Definition at line 95 of file route.hpp.

◆ expires

std::optional<time::steady_clock::time_point> nfd::rib::Route::expires

Definition at line 97 of file route.hpp.

◆ faceId

uint64_t nfd::rib::Route::faceId = 0

Definition at line 93 of file route.hpp.

◆ flags

std::underlying_type_t<ndn::nfd::RouteFlags> nfd::rib::Route::flags = ndn::nfd::ROUTE_FLAGS_NONE

Definition at line 96 of file route.hpp.

◆ origin

ndn::nfd::RouteOrigin nfd::rib::Route::origin = ndn::nfd::ROUTE_ORIGIN_APP

Definition at line 94 of file route.hpp.