represents the Routing Information Base More...
#include <rib.hpp>
Public Types | |
using | RibEntryList = std::list< shared_ptr< RibEntry > > |
using | RibTable = std::map< Name, shared_ptr< RibEntry > > |
using | const_iterator = RibTable::const_iterator |
using | UpdateSuccessCallback = std::function< void()> |
using | UpdateFailureCallback = std::function< void(uint32_t code, const std::string &error)> |
Public Member Functions | |
void | setFibUpdater (FibUpdater *updater) |
const_iterator | find (const Name &prefix) const |
Route * | find (const Name &prefix, const Route &route) const |
Route * | findLongestPrefix (const Name &prefix, const Route &route) const |
const_iterator | begin () const |
const_iterator | end () const |
size_t | size () const |
bool | empty () const |
shared_ptr< RibEntry > | findParent (const Name &prefix) const |
void | beginApplyUpdate (const RibUpdate &update, const UpdateSuccessCallback &onSuccess, const UpdateFailureCallback &onFailure) |
passes the provided RibUpdateBatch to FibUpdater to calculate and send FibUpdates. More... | |
void | beginRemoveFace (uint64_t faceId) |
starts the FIB update process when a face has been destroyed More... | |
void | beginRemoveFailedFaces (const std::set< uint64_t > &activeFaceIds) |
void | onRouteExpiration (const Name &prefix, const Route &route) |
void | insert (const Name &prefix, const Route &route) |
Public Attributes | |
signal::Signal< Rib, Name > | afterInsertEntry |
signals after a RIB entry is inserted More... | |
signal::Signal< Rib, Name > | afterEraseEntry |
signals after a RIB entry is erased More... | |
signal::Signal< Rib, RibRouteRef > | afterAddRoute |
signals after a Route is added More... | |
signal::Signal< Rib, RibRouteRef > | beforeRemoveRoute |
signals before a route is removed More... | |
Friends | |
class | FibUpdater |
represents the Routing Information Base
The Routing Information Base contains a collection of Routes, each represents a piece of static or dynamic routing information registered by applications, operators, or NFD itself. Routes associated with the same namespace are collected into a RIB entry.
using nfd::rib::Rib::RibEntryList = std::list<shared_ptr<RibEntry> > |
using nfd::rib::Rib::RibTable = std::map<Name, shared_ptr<RibEntry> > |
using nfd::rib::Rib::const_iterator = RibTable::const_iterator |
using nfd::rib::Rib::UpdateSuccessCallback = std::function<void()> |
using nfd::rib::Rib::UpdateFailureCallback = std::function<void(uint32_t code, const std::string& error)> |
void nfd::rib::Rib::setFibUpdater | ( | FibUpdater * | updater | ) |
Definition at line 49 of file rib.cpp.
Referenced by nfd::rib::FibUpdater::FibUpdater().
Rib::const_iterator nfd::rib::Rib::find | ( | const Name & | prefix | ) | const |
Definition at line 55 of file rib.cpp.
Referenced by nfd::rib::FibUpdater::computeAndSendFibUpdates(), findLongestPrefix(), and nfd::RibManager::slFindAnn().
Definition at line 78 of file rib.cpp.
References find(), and findParent().
Referenced by nfd::RibManager::slRenew().
|
inline |
|
inline |
Definition at line 85 of file rib.hpp.
Referenced by nfd::rib::FibUpdater::computeAndSendFibUpdates(), and nfd::RibManager::slFindAnn().
Definition at line 215 of file rib.cpp.
References afterEraseEntry, nfd::rib::RibEntry::getParent(), ndn::Name::getPrefix(), ndn::nfd::RouteFlagsTraits< T >::isChildInherit(), ndn::Name::isPrefixOf(), ndn::Name::size(), and nfd::rib::sortRoutes().
Referenced by nfd::rib::FibUpdater::computeAndSendFibUpdates(), findLongestPrefix(), insert(), and nfd::RibManager::slFindAnn().
void nfd::rib::Rib::beginApplyUpdate | ( | const RibUpdate & | update, |
const UpdateSuccessCallback & | onSuccess, | ||
const UpdateFailureCallback & | onFailure | ||
) |
passes the provided RibUpdateBatch to FibUpdater to calculate and send FibUpdates.
If the FIB is updated successfully, onFibUpdateSuccess() will be called, and the RIB will be updated
If the FIB update fails, onFibUpdateFailure() will be called, and the RIB will not be updated.
Definition at line 351 of file rib.cpp.
Referenced by nfd::RibManager::enableLocalFields(), and onRouteExpiration().
void nfd::rib::Rib::beginRemoveFace | ( | uint64_t | faceId | ) |
starts the FIB update process when a face has been destroyed
Definition at line 363 of file rib.cpp.
Referenced by nfd::RibManager::slFindAnn().
void nfd::rib::Rib::beginRemoveFailedFaces | ( | const std::set< uint64_t > & | activeFaceIds | ) |
Definition at line 373 of file rib.cpp.
References nfd::rib::RibUpdateBatch::add(), nfd::rib::FibUpdater::computeAndSendFibUpdates(), nfd::rib::Route::faceId, nfd::rib::RibUpdate::getAction(), nfd::rib::RibUpdate::getName(), nfd::rib::RibUpdate::getRoute(), insert(), nonstd::optional_lite::std11::move(), nfd::rib::RibUpdate::REGISTER, nfd::rib::RibUpdate::REMOVE_FACE, nfd::rib::RibUpdate::setAction(), nfd::rib::RibUpdate::setName(), nfd::rib::RibUpdateBatch::size(), and nfd::rib::RibUpdate::UNREGISTER.
Referenced by nfd::RibManager::slFindAnn().
Definition at line 202 of file rib.cpp.
References beginApplyUpdate(), NFD_LOG_DEBUG, nfd::rib::RibUpdate::setAction(), nfd::rib::RibUpdate::setName(), nfd::rib::RibUpdate::setRoute(), and nfd::rib::RibUpdate::UNREGISTER.
Referenced by nfd::RibManager::enableLocalFields().
Definition at line 92 of file rib.cpp.
References afterAddRoute, afterInsertEntry, beforeRemoveRoute, nfd::rib::Route::faceId, findParent(), and NFD_LOG_TRACE.
Referenced by beginRemoveFailedFaces(), and nfd::RibManager::enableLocalFields().
|
friend |
signal::Signal<Rib, Name> nfd::rib::Rib::afterInsertEntry |
signals after a RIB entry is inserted
A RIB entry is inserted when the first route associated with a certain namespace is added.
Definition at line 217 of file rib.hpp.
Referenced by insert(), and nfd::rib::NfdRibReadvertiseDestination::NfdRibReadvertiseDestination().
signal::Signal<Rib, Name> nfd::rib::Rib::afterEraseEntry |
signals after a RIB entry is erased
A RIB entry is erased when the last route associated with a certain namespace is removed.
Definition at line 224 of file rib.hpp.
Referenced by findParent(), and nfd::rib::NfdRibReadvertiseDestination::NfdRibReadvertiseDestination().
signal::Signal<Rib, RibRouteRef> nfd::rib::Rib::afterAddRoute |
signals after a Route is added
Definition at line 228 of file rib.hpp.
Referenced by insert(), and nfd::rib::Readvertise::Readvertise().
signal::Signal<Rib, RibRouteRef> nfd::rib::Rib::beforeRemoveRoute |
signals before a route is removed
Definition at line 232 of file rib.hpp.
Referenced by insert(), and nfd::rib::Readvertise::Readvertise().