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

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

#include <fib.hpp>

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

Public Types

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

Public Member Functions

 Fib (NameTree &nameTree)
 
size_t size () const
 
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...
 
EntryfindExactMatch (const Name &prefix)
 performs an exact match lookup More...
 
std::pair< Entry *, bool > insert (const Name &prefix)
 find or insert a FIB entry More...
 
void erase (const Name &prefix)
 
void erase (const Entry &entry)
 
void removeNextHop (Entry &entry, const Face &face, uint64_t endpointId)
 removes the NextHop record for face with a given endpointId More...
 
void removeNextHopByFace (Entry &entry, const Face &face)
 removes the NextHop record for face for any endpointId More...
 
const_iterator begin () const
 
const_iterator end () 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

◆ Range

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

Definition at line 119 of file fib.hpp.

◆ const_iterator

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

Definition at line 120 of file fib.hpp.

Constructor & Destructor Documentation

◆ Fib()

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

Definition at line 45 of file fib.cpp.

Member Function Documentation

◆ size()

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

Definition at line 56 of file fib.hpp.

◆ findLongestPrefixMatch() [1/3]

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

performs a longest prefix match

Definition at line 63 of file fib.cpp.

Referenced by nfd::fw::Strategy::lookupFib().

◆ findLongestPrefixMatch() [2/3]

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 69 of file fib.cpp.

◆ findLongestPrefixMatch() [3/3]

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 75 of file fib.cpp.

◆ findExactMatch()

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

performs an exact match lookup

Definition at line 81 of file fib.cpp.

References nfd::name_tree::NameTree::findExactMatch(), and nfd::name_tree::Entry::getFibEntry().

◆ getMaxDepth()

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

Maximum number of components in a FIB entry prefix.

Definition at line 90 of file fib.hpp.

References nfd::FIB_MAX_DEPTH.

◆ insert()

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

find or insert a FIB entry

Parameters
prefixFIB entry name; it must have no more than getMaxDepth() components.
Returns
the entry, and true for new entry or false for existing entry

Definition at line 91 of file fib.cpp.

References nfd::name_tree::Entry::getFibEntry(), nfd::name_tree::NameTree::lookup(), and nfd::name_tree::Entry::setFibEntry().

◆ erase() [1/2]

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

Definition at line 117 of file fib.cpp.

References nfd::name_tree::NameTree::findExactMatch().

Referenced by erase().

◆ erase() [2/2]

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

Definition at line 126 of file fib.cpp.

References erase(), and nfd::name_tree::NameTree::getEntry().

◆ removeNextHop()

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

removes the NextHop record for face with a given endpointId

Definition at line 146 of file fib.cpp.

References nfd::fib::Entry::removeNextHop().

◆ removeNextHopByFace()

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

removes the NextHop record for face for any endpointId

Definition at line 153 of file fib.cpp.

References nfd::fib::Entry::removeNextHopByFace().

Referenced by nfd::cleanupOnFaceRemoval().

◆ begin()

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 128 of file fib.hpp.

◆ end()

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

Definition at line 137 of file fib.hpp.


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