Represents a RIB entry, which contains one or more Routes with the same prefix. More...
#include <daemon/rib/rib-entry.hpp>
Public Types | |
using | const_iterator = RouteList::const_iterator |
using | iterator = RouteList::iterator |
using | RouteList = std::list< Route > |
Public Member Functions | |
void | addChild (shared_ptr< RibEntry > child) |
void | addInheritedRoute (const Route &route) |
const_iterator | begin () const noexcept |
iterator | begin () noexcept |
bool | empty () const noexcept |
const_iterator | end () const noexcept |
iterator | end () noexcept |
void | eraseRoute (const Route &route) |
Erases a Route with the same FaceId and origin. More... | |
iterator | eraseRoute (RouteList::iterator route) |
Erases a Route with the passed iterator. More... | |
RouteList::const_iterator | findInheritedRoute (const Route &route) const |
Finds an inherited route with a matching face ID. More... | |
iterator | findRoute (const Route &route) |
const_iterator | findRoute (const Route &route) const |
const std::list< shared_ptr< RibEntry > > & | getChildren () const noexcept |
const RouteList & | getInheritedRoutes () const noexcept |
Returns the routes this namespace has inherited. More... | |
const Name & | getName () const noexcept |
shared_ptr< RibEntry > | getParent () const |
ndn::PrefixAnnouncement | getPrefixAnnouncement (time::milliseconds minExpiration=15_s, time::milliseconds maxExpiration=1_h) const |
Retrieve a prefix announcement suitable for readvertising this route. More... | |
const RouteList & | getRoutes () const noexcept |
const Route * | getRouteWithLowestCostAndChildInheritByFaceId (uint64_t faceId) const |
Returns the route with the lowest cost that has the passed face ID and its child inherit flag set. More... | |
const Route * | getRouteWithLowestCostByFaceId (uint64_t faceId) const |
Returns the route with the lowest cost that has the passed face ID. More... | |
const Route * | getRouteWithSecondLowestCostByFaceId (uint64_t faceId) const |
bool | hasCapture () const noexcept |
bool | hasChildInheritOnFaceId (uint64_t faceId) const |
Determines if the entry has an inherited route with the passed face ID and its child inherit flag set. More... | |
bool | hasFaceId (uint64_t faceId) const |
bool | hasInheritedRoute (const Route &route) const |
Determines if the entry has an inherited route with a matching face ID. More... | |
std::pair< RibEntry::iterator, bool > | insertRoute (const Route &route) |
Inserts a new route into the entry's route list. More... | |
void | removeChild (shared_ptr< RibEntry > child) |
void | removeInheritedRoute (const Route &route) |
void | setName (const Name &prefix) |
Represents a RIB entry, which contains one or more Routes with the same prefix.
Definition at line 38 of file rib-entry.hpp.
using nfd::rib::RibEntry::const_iterator = RouteList::const_iterator |
Definition at line 43 of file rib-entry.hpp.
using nfd::rib::RibEntry::iterator = RouteList::iterator |
Definition at line 42 of file rib-entry.hpp.
using nfd::rib::RibEntry::RouteList = std::list<Route> |
Definition at line 41 of file rib-entry.hpp.
void nfd::rib::RibEntry::addChild | ( | shared_ptr< RibEntry > | child | ) |
Definition at line 85 of file rib-entry.cpp.
void nfd::rib::RibEntry::addInheritedRoute | ( | const Route & | route | ) |
Definition at line 119 of file rib-entry.cpp.
|
inlinenoexcept |
Definition at line 199 of file rib-entry.hpp.
|
inlinenoexcept |
Definition at line 211 of file rib-entry.hpp.
|
inlinenoexcept |
Definition at line 193 of file rib-entry.hpp.
|
inlinenoexcept |
Definition at line 205 of file rib-entry.hpp.
|
inlinenoexcept |
Definition at line 217 of file rib-entry.hpp.
void nfd::rib::RibEntry::eraseRoute | ( | const Route & | route | ) |
Erases a Route with the same FaceId and origin.
Definition at line 73 of file rib-entry.cpp.
RibEntry::RouteList::iterator nfd::rib::RibEntry::eraseRoute | ( | RouteList::iterator | route | ) |
Erases a Route with the passed iterator.
Definition at line 101 of file rib-entry.cpp.
RibEntry::RouteList::const_iterator nfd::rib::RibEntry::findInheritedRoute | ( | const Route & | route | ) | const |
Finds an inherited route with a matching face ID.
Definition at line 131 of file rib-entry.cpp.
RibEntry::RouteList::iterator nfd::rib::RibEntry::findRoute | ( | const Route & | route | ) |
Definition at line 42 of file rib-entry.cpp.
RibEntry::RouteList::const_iterator nfd::rib::RibEntry::findRoute | ( | const Route & | route | ) | const |
Definition at line 49 of file rib-entry.cpp.
|
inlinenoexcept |
Definition at line 64 of file rib-entry.hpp.
|
inlinenoexcept |
Returns the routes this namespace has inherited.
The inherited routes returned represent inherited routes this namespace has in the FIB.
Definition at line 122 of file rib-entry.hpp.
|
inlinenoexcept |
Definition at line 46 of file rib-entry.hpp.
|
inline |
Definition at line 58 of file rib-entry.hpp.
ndn::PrefixAnnouncement nfd::rib::RibEntry::getPrefixAnnouncement | ( | time::milliseconds | minExpiration = 15_s , |
time::milliseconds | maxExpiration = 1_h |
||
) | const |
Retrieve a prefix announcement suitable for readvertising this route.
If one or more routes in this RIB entry contains a prefix announcement, this method returns the announcement from the route that expires last.
If this RIB entry does not have a route containing a prefix announcement, this method creates a new announcement. Its expiration period reflects the remaining lifetime of this RIB entry, confined within [minExpiration
, maxExpiration
] range. The caller is expected to sign this announcement.
minExpiration > maxExpiration
triggers undefined behavior. Definition at line 226 of file rib-entry.cpp.
|
inlinenoexcept |
Definition at line 187 of file rib-entry.hpp.
const Route * nfd::rib::RibEntry::getRouteWithLowestCostAndChildInheritByFaceId | ( | uint64_t | faceId | ) | const |
Returns the route with the lowest cost that has the passed face ID and its child inherit flag set.
Definition at line 202 of file rib-entry.cpp.
const Route * nfd::rib::RibEntry::getRouteWithLowestCostByFaceId | ( | uint64_t | faceId | ) | const |
Returns the route with the lowest cost that has the passed face ID.
Definition at line 156 of file rib-entry.cpp.
const Route * nfd::rib::RibEntry::getRouteWithSecondLowestCostByFaceId | ( | uint64_t | faceId | ) | const |
Definition at line 178 of file rib-entry.cpp.
|
inlinenoexcept |
Definition at line 143 of file rib-entry.hpp.
bool nfd::rib::RibEntry::hasChildInheritOnFaceId | ( | uint64_t | faceId | ) | const |
Determines if the entry has an inherited route with the passed face ID and its child inherit flag set.
Definition at line 144 of file rib-entry.cpp.
bool nfd::rib::RibEntry::hasFaceId | ( | uint64_t | faceId | ) | const |
Definition at line 79 of file rib-entry.cpp.
bool nfd::rib::RibEntry::hasInheritedRoute | ( | const Route & | route | ) | const |
Determines if the entry has an inherited route with a matching face ID.
Definition at line 138 of file rib-entry.cpp.
std::pair< RibEntry::iterator, bool > nfd::rib::RibEntry::insertRoute | ( | const Route & | route | ) |
Inserts a new route into the entry's route list.
If another route already exists with the same faceId and origin, the new route is not inserted.
Definition at line 56 of file rib-entry.cpp.
void nfd::rib::RibEntry::removeChild | ( | shared_ptr< RibEntry > | child | ) |
Definition at line 93 of file rib-entry.cpp.
void nfd::rib::RibEntry::removeInheritedRoute | ( | const Route & | route | ) |
Definition at line 125 of file rib-entry.cpp.
|
inline |
Definition at line 52 of file rib-entry.hpp.