represents the RIB More...
#include <rib.hpp>
Public Types | |
typedef std::list< shared_ptr< RibEntry > > | RibEntryList |
typedef std::map< Name, shared_ptr< RibEntry > > | RibTable |
typedef RibTable::const_iterator | const_iterator |
typedef std::map< uint64_t, std::list< shared_ptr< RibEntry > > > | FaceLookupTable |
typedef bool(* | RouteComparePredicate) (const Route &, const Route &) |
typedef std::set< Route, RouteComparePredicate > | RouteSet |
typedef function< void()> | UpdateSuccessCallback |
typedef function< void(uint32_t code, const std::string &error)> | UpdateFailureCallback |
Public Member Functions | |
Rib () | |
~Rib () | |
void | setFibUpdater (FibUpdater *updater) |
const_iterator | find (const Name &prefix) const |
Route * | find (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 |
std::list< shared_ptr< RibEntry > > | findDescendants (const Name &prefix) const |
finds namespaces under the passed prefix More... | |
std::list< shared_ptr< RibEntry > > | findDescendantsForNonInsertedName (const Name &prefix) const |
finds namespaces under the passed prefix More... | |
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 | onFibUpdateSuccess (const RibUpdateBatch &batch, const RibUpdateList &inheritedRoutes, const Rib::UpdateSuccessCallback &onSuccess) |
void | onFibUpdateFailure (const Rib::UpdateFailureCallback &onFailure, uint32_t code, const std::string &error) |
void | onRouteExpiration (const Name &prefix, const Route &route) |
void | insert (const Name &prefix, const Route &route) |
Public Attributes | |
ndn::util::signal::Signal< Rib, Name > | afterInsertEntry |
ndn::util::signal::Signal< Rib, Name > | afterEraseEntry |
Friends | |
class | FibUpdater |
typedef std::list<shared_ptr<RibEntry> > nfd::rib::Rib::RibEntryList |
typedef std::map<Name, shared_ptr<RibEntry> > nfd::rib::Rib::RibTable |
typedef RibTable::const_iterator nfd::rib::Rib::const_iterator |
typedef std::map<uint64_t, std::list<shared_ptr<RibEntry> > > nfd::rib::Rib::FaceLookupTable |
typedef std::set<Route, RouteComparePredicate> nfd::rib::Rib::RouteSet |
typedef function<void()> nfd::rib::Rib::UpdateSuccessCallback |
typedef function<void(uint32_t code, const std::string& error)> nfd::rib::Rib::UpdateFailureCallback |
void nfd::rib::Rib::setFibUpdater | ( | FibUpdater * | updater | ) |
Definition at line 53 of file rib.cpp.
Referenced by nfd::rib::FibUpdater::FibUpdater().
Rib::const_iterator nfd::rib::Rib::find | ( | const Name & | prefix | ) | const |
Definition at line 59 of file rib.cpp.
Referenced by nfd::rib::FibUpdater::computeAndSendFibUpdates().
|
inline |
Definition at line 237 of file rib.hpp.
Referenced by nfd::rib::RibStatusPublisher::generate().
|
inline |
Definition at line 243 of file rib.hpp.
Referenced by nfd::rib::FibUpdater::computeAndSendFibUpdates(), and nfd::rib::RibStatusPublisher::generate().
|
inline |
Definition at line 255 of file rib.hpp.
References nfd::rib::operator<<().
Definition at line 200 of file rib.cpp.
References ndn::Name::getPrefix(), and ndn::Name::size().
Referenced by nfd::rib::FibUpdater::computeAndSendFibUpdates(), findDescendantsForNonInsertedName(), and insert().
finds namespaces under the passed prefix
Definition at line 214 of file rib.cpp.
References ndn::Name::isPrefixOf().
Referenced by insert().
std::list< shared_ptr< RibEntry > > nfd::rib::Rib::findDescendantsForNonInsertedName | ( | const Name & | prefix | ) | const |
finds namespaces under the passed prefix
Definition at line 236 of file rib.cpp.
References afterEraseEntry, findParent(), nfd::rib::RibEntry::getParent(), nfd::rib::Route::isChildInherit(), ndn::Name::isPrefixOf(), and nfd::rib::sortRoutes().
Referenced by nfd::rib::FibUpdater::computeAndSendFibUpdates().
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 338 of file rib.cpp.
Referenced by onRouteExpiration(), and nfd::rib::RibManager::setConfigFile().
void nfd::rib::Rib::beginRemoveFace | ( | uint64_t | faceId | ) |
starts the FIB update process when a face has been destroyed
Definition at line 350 of file rib.cpp.
References nfd::rib::RibUpdateBatch::add(), nfd::rib::FibUpdater::computeAndSendFibUpdates(), nfd::rib::Route::faceId, nfd::rib::RibUpdate::getRoute(), onFibUpdateFailure(), onFibUpdateSuccess(), nfd::rib::RibUpdate::REMOVE_FACE, nfd::rib::RibUpdate::setAction(), nfd::rib::RibUpdate::setName(), nfd::rib::RibUpdate::setRoute(), and nfd::rib::RibUpdateBatch::size().
Referenced by nfd::rib::RibManager::enableLocalControlHeader().
void nfd::rib::Rib::onFibUpdateSuccess | ( | const RibUpdateBatch & | batch, |
const RibUpdateList & | inheritedRoutes, | ||
const Rib::UpdateSuccessCallback & | onSuccess | ||
) |
Definition at line 408 of file rib.cpp.
References nfd::rib::RibUpdate::getAction(), nfd::rib::RibUpdate::getName(), nfd::rib::RibUpdate::getRoute(), insert(), nfd::rib::RibUpdate::REGISTER, nfd::rib::RibUpdate::REMOVE_FACE, and nfd::rib::RibUpdate::UNREGISTER.
Referenced by beginRemoveFace().
void nfd::rib::Rib::onFibUpdateFailure | ( | const Rib::UpdateFailureCallback & | onFailure, |
uint32_t | code, | ||
const std::string & | error | ||
) |
Definition at line 438 of file rib.cpp.
References nfd::rib::Route::faceId, nfd::rib::RibUpdate::getAction(), nfd::rib::RibUpdate::getName(), nfd::rib::RibUpdate::getRoute(), nfd::rib::RibUpdate::REGISTER, nfd::rib::RibUpdate::REMOVE_FACE, and nfd::rib::RibUpdate::UNREGISTER.
Referenced by beginRemoveFace().
Definition at line 187 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::rib::RibManager::setConfigFile().
Definition at line 84 of file rib.cpp.
References afterInsertEntry, nfd::scheduler::cancel(), nfd::rib::Route::cost, nfd::rib::Route::expires, nfd::rib::Route::faceId, findDescendants(), findParent(), nfd::rib::Route::flags, nfd::rib::Route::getExpirationEvent(), NFD_LOG_TRACE, and RibEntry.
Referenced by onFibUpdateSuccess(), and nfd::rib::RibManager::onRibUpdateFailure().
|
friend |
ndn::util::signal::Signal<Rib, Name> nfd::rib::Rib::afterInsertEntry |
Definition at line 208 of file rib.hpp.
Referenced by nfd::rib::RemoteRegistrator::enable(), and insert().
ndn::util::signal::Signal<Rib, Name> nfd::rib::Rib::afterEraseEntry |
Definition at line 209 of file rib.hpp.
Referenced by nfd::rib::RemoteRegistrator::enable(), and findDescendantsForNonInsertedName().