nfd::rib::Rib Class Reference

Represents the Routing Information Base. More...

#include <daemon/rib/rib.hpp>

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

Public Types

using const_iterator = RibTable::const_iterator
 
using RibEntryList = std::list< shared_ptr< RibEntry > >
 
using RibTable = std::map< Name, shared_ptr< RibEntry > >
 
using UpdateFailureCallback = std::function< void(uint32_t code, const std::string &error)>
 
using UpdateSuccessCallback = std::function< void()>
 

Public Member Functions

const_iterator begin () 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)
 
bool empty () const noexcept
 
const_iterator end () const
 
const_iterator find (const Name &prefix) const
 
Routefind (const Name &prefix, const Route &route) const
 
RoutefindLongestPrefix (const Name &prefix, const Route &route) const
 
shared_ptr< RibEntryfindParent (const Name &prefix) const
 
void insert (const Name &prefix, const Route &route)
 
void onRouteExpiration (const Name &prefix, const Route &route)
 
void setFibUpdater (FibUpdater *updater)
 
size_t size () const noexcept
 

Public Attributes

signal::Signal< Rib, RibRouteRefafterAddRoute
 Signals after a Route is added. More...
 
signal::Signal< Rib, Name > afterEraseEntry
 Signals after a RIB entry is erased. More...
 
signal::Signal< Rib, Name > afterInsertEntry
 Signals after a RIB entry is inserted. More...
 
signal::Signal< Rib, RibRouteRefbeforeRemoveRoute
 Signals before a route is removed. More...
 

Detailed Description

Represents the Routing Information Base.

The Routing Information Base (RIB) contains a collection of Route objects, each representing 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.

See also
RibEntry

Definition at line 69 of file rib.hpp.

Member Typedef Documentation

◆ const_iterator

using nfd::rib::Rib::const_iterator = RibTable::const_iterator

Definition at line 74 of file rib.hpp.

◆ RibEntryList

using nfd::rib::Rib::RibEntryList = std::list<shared_ptr<RibEntry> >

Definition at line 72 of file rib.hpp.

◆ RibTable

using nfd::rib::Rib::RibTable = std::map<Name, shared_ptr<RibEntry> >

Definition at line 73 of file rib.hpp.

◆ UpdateFailureCallback

using nfd::rib::Rib::UpdateFailureCallback = std::function<void(uint32_t code, const std::string& error)>

Definition at line 117 of file rib.hpp.

◆ UpdateSuccessCallback

using nfd::rib::Rib::UpdateSuccessCallback = std::function<void()>

Definition at line 116 of file rib.hpp.

Member Function Documentation

◆ begin()

const_iterator nfd::rib::Rib::begin ( ) const
inline

Definition at line 89 of file rib.hpp.

◆ beginApplyUpdate()

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 335 of file rib.cpp.

◆ beginRemoveFace()

void nfd::rib::Rib::beginRemoveFace ( uint64_t  faceId)

Starts the FIB update process when a face has been destroyed.

Definition at line 345 of file rib.cpp.

◆ beginRemoveFailedFaces()

void nfd::rib::Rib::beginRemoveFailedFaces ( const std::set< uint64_t > &  activeFaceIds)

Definition at line 355 of file rib.cpp.

◆ empty()

bool nfd::rib::Rib::empty ( ) const
inlinenoexcept

Definition at line 107 of file rib.hpp.

◆ end()

const_iterator nfd::rib::Rib::end ( ) const
inline

Definition at line 95 of file rib.hpp.

◆ find() [1/2]

Rib::const_iterator nfd::rib::Rib::find ( const Name &  prefix) const

Definition at line 47 of file rib.cpp.

◆ find() [2/2]

Route * nfd::rib::Rib::find ( const Name &  prefix,
const Route route 
) const

Definition at line 53 of file rib.cpp.

◆ findLongestPrefix()

Route * nfd::rib::Rib::findLongestPrefix ( const Name &  prefix,
const Route route 
) const

Definition at line 70 of file rib.cpp.

◆ findParent()

shared_ptr< RibEntry > nfd::rib::Rib::findParent ( const Name &  prefix) const

Definition at line 202 of file rib.cpp.

◆ insert()

void nfd::rib::Rib::insert ( const Name &  prefix,
const Route route 
)

Definition at line 84 of file rib.cpp.

◆ onRouteExpiration()

void nfd::rib::Rib::onRouteExpiration ( const Name &  prefix,
const Route route 
)

Definition at line 189 of file rib.cpp.

◆ setFibUpdater()

void nfd::rib::Rib::setFibUpdater ( FibUpdater updater)

Definition at line 41 of file rib.cpp.

◆ size()

size_t nfd::rib::Rib::size ( ) const
inlinenoexcept

Definition at line 101 of file rib.hpp.

Member Data Documentation

◆ afterAddRoute

signal::Signal<Rib, RibRouteRef> nfd::rib::Rib::afterAddRoute

Signals after a Route is added.

Definition at line 235 of file rib.hpp.

◆ afterEraseEntry

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 231 of file rib.hpp.

◆ afterInsertEntry

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 224 of file rib.hpp.

◆ beforeRemoveRoute

signal::Signal<Rib, RibRouteRef> nfd::rib::Rib::beforeRemoveRoute

Signals before a route is removed.

Definition at line 239 of file rib.hpp.