NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: 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::Range > Range
 
typedef boost::range_iterator< Range >::type const_iterator
 

Public Member Functions

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

Detailed Description

represents the Forwarding Information Base (FIB)

Definition at line 47 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 105 of file fib.hpp.

◆ const_iterator

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

Definition at line 106 of file fib.hpp.

Constructor & Destructor Documentation

◆ Fib()

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

Member Function Documentation

◆ size()

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

Definition at line 54 of file fib.hpp.

Referenced by nfd::ForwarderStatusManager::ForwarderStatusManager().

◆ findLongestPrefixMatch() [1/3]

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

performs a longest prefix match

Definition at line 74 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 80 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 86 of file fib.cpp.

◆ findExactMatch()

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

performs an exact match lookup

Definition at line 92 of file fib.cpp.

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

Referenced by nfd::FibManager::FibManager().

◆ insert()

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

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

Referenced by nfd::FibManager::FibManager().

◆ erase() [1/2]

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

◆ erase() [2/2]

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

Definition at line 137 of file fib.cpp.

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

◆ removeNextHop()

◆ 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 114 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 123 of file fib.hpp.


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