NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
nfd::rib::Rib Class Reference

represents the Routing Information Base More...

#include <rib.hpp>

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

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
 
Routefind (const Name &prefix, const Route &route) const
 
RoutefindLongestPrefix (const Name &prefix, const Route &route) const
 
const_iterator begin () const
 
const_iterator end () const
 
size_t size () const
 
bool empty () const
 
shared_ptr< RibEntryfindParent (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, NameafterInsertEntry
 signals after a RIB entry is inserted More...
 
signal::Signal< Rib, NameafterEraseEntry
 signals after a RIB entry is erased More...
 
signal::Signal< Rib, RibRouteRefafterAddRoute
 signals after a Route is added More...
 
signal::Signal< Rib, RibRouteRefbeforeRemoveRoute
 signals before a route is removed More...
 

Friends

class FibUpdater
 

Detailed Description

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.

Definition at line 59 of file rib.hpp.

Member Typedef Documentation

◆ RibEntryList

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

Definition at line 62 of file rib.hpp.

◆ RibTable

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

Definition at line 63 of file rib.hpp.

◆ const_iterator

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

Definition at line 64 of file rib.hpp.

◆ UpdateSuccessCallback

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

Definition at line 106 of file rib.hpp.

◆ UpdateFailureCallback

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

Definition at line 107 of file rib.hpp.

Member Function Documentation

◆ setFibUpdater()

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

Definition at line 49 of file rib.cpp.

Referenced by nfd::rib::FibUpdater::FibUpdater().

◆ find() [1/2]

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

Definition at line 55 of file rib.cpp.

Referenced by findLongestPrefix().

◆ find() [2/2]

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

Definition at line 61 of file rib.cpp.

◆ findLongestPrefix()

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

Definition at line 78 of file rib.cpp.

References find(), and findParent().

◆ begin()

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

Definition at line 79 of file rib.hpp.

◆ end()

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

Definition at line 85 of file rib.hpp.

◆ size()

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

Definition at line 91 of file rib.hpp.

◆ empty()

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

Definition at line 97 of file rib.hpp.

◆ findParent()

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

Definition at line 215 of file rib.cpp.

References ndn::Name::getPrefix(), and ndn::Name::size().

Referenced by findLongestPrefix(), and insert().

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

Referenced by onRouteExpiration().

◆ beginRemoveFace()

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.

◆ beginRemoveFailedFaces()

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

Definition at line 373 of file rib.cpp.

◆ onRouteExpiration()

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

◆ insert()

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

Friends And Related Function Documentation

◆ FibUpdater

friend class FibUpdater
friend

Definition at line 251 of file rib.hpp.

Member Data Documentation

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

Referenced by insert(), and nfd::rib::NfdRibReadvertiseDestination::NfdRibReadvertiseDestination().

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

Referenced by nfd::rib::NfdRibReadvertiseDestination::NfdRibReadvertiseDestination().

◆ afterAddRoute

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().

◆ beforeRemoveRoute

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

signals before a route is removed

Definition at line 232 of file rib.hpp.

Referenced by nfd::rib::Readvertise::Readvertise().


The documentation for this class was generated from the following files: