nfd::fib::Fib Class Reference

represents the Forwarding Information Base (FIB) More...

#include <daemon/table/fib.hpp>

+ Inheritance diagram for nfd::fib::Fib:
+ Collaboration diagram for nfd::fib::Fib:

Public Types

typedef boost::range_iterator< Range >::type const_iterator
 
typedef boost::transformed_range< name_tree::GetTableEntry< Entry >, const name_tree::RangeRange
 

Public Member Functions

 Fib (NameTree &nameTree)
 
const_iterator begin () const
 
const_iterator end () const
 
void erase (const Name &prefix)
 
void erase (const Entry &entry)
 
EntryfindExactMatch (const Name &prefix)
 performs an exact match lookup More...
 
const EntryfindLongestPrefixMatch (const Name &prefix) const
 performs a longest prefix match More...
 
const EntryfindLongestPrefixMatch (const pit::Entry &pitEntry) const
 performs a longest prefix match More...
 
const EntryfindLongestPrefixMatch (const measurements::Entry &measurementsEntry) const
 performs a longest prefix match More...
 
std::pair< Entry *, bool > insert (const Name &prefix)
 inserts a FIB entry for prefix More...
 
void removeNextHop (Entry &entry, const Face &face)
 removes the NextHop record for face More...
 
size_t size () const
 

Static Public Member Functions

static constexpr size_t getMaxDepth ()
 Maximum number of components in a FIB entry prefix. More...
 

Detailed Description

represents the Forwarding Information Base (FIB)

Definition at line 49 of file fib.hpp.

Member Typedef Documentation

typedef boost::range_iterator<Range>::type nfd::fib::Fib::const_iterator

Definition at line 119 of file fib.hpp.

typedef boost::transformed_range<name_tree::GetTableEntry<Entry>, const name_tree::Range> nfd::fib::Fib::Range

Definition at line 118 of file fib.hpp.

Constructor & Destructor Documentation

nfd::fib::Fib::Fib ( NameTree &  nameTree)
explicit

Definition at line 44 of file fib.cpp.

Member Function Documentation

const_iterator nfd::fib::Fib::begin ( ) const
inline
Returns
an iterator to the beginning
Note
Iteration order is implementation-defined.
Warning
Undefined behavior may occur if a FIB/PIT/Measurements/StrategyChoice entry is inserted or erased during enumeration.

Definition at line 127 of file fib.hpp.

const_iterator nfd::fib::Fib::end ( ) const
inline
Returns
an iterator to the end
See also
begin()

Definition at line 136 of file fib.hpp.

void nfd::fib::Fib::erase ( const Name &  prefix)

Definition at line 116 of file fib.cpp.

void nfd::fib::Fib::erase ( const Entry entry)

Definition at line 125 of file fib.cpp.

Entry * nfd::fib::Fib::findExactMatch ( const Name &  prefix)

performs an exact match lookup

Definition at line 80 of file fib.cpp.

const Entry & nfd::fib::Fib::findLongestPrefixMatch ( const Name &  prefix) const

performs a longest prefix match

Definition at line 62 of file fib.cpp.

const Entry & nfd::fib::Fib::findLongestPrefixMatch ( const pit::Entry pitEntry) const

performs a longest prefix match

This is equivalent to .findLongestPrefixMatch(pitEntry.getName())

Definition at line 68 of file fib.cpp.

const Entry & nfd::fib::Fib::findLongestPrefixMatch ( const measurements::Entry measurementsEntry) const

performs a longest prefix match

This is equivalent to .findLongestPrefixMatch(measurementsEntry.getName())

Definition at line 74 of file fib.cpp.

static constexpr size_t nfd::fib::Fib::getMaxDepth ( )
inlinestatic

Maximum number of components in a FIB entry prefix.

This constant is currently advisory, but will become mandatory later.

Definition at line 92 of file fib.hpp.

std::pair< Entry *, bool > nfd::fib::Fib::insert ( const Name &  prefix)

inserts a FIB entry for prefix

If an entry for exact same prefix exists, that entry is returned.

Returns
the entry, and true for new entry or false for existing entry

Definition at line 90 of file fib.cpp.

void nfd::fib::Fib::removeNextHop ( Entry entry,
const Face &  face 
)

removes the NextHop record for face

Definition at line 136 of file fib.cpp.

size_t nfd::fib::Fib::size ( ) const
inline

Definition at line 56 of file fib.hpp.