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

represents the FIB More...

#include <fib.hpp>

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

Classes

class  const_iterator
 

Public Member Functions

 Fib (NameTree &nameTree)
 
 ~Fib ()
 
size_t size () const
 
shared_ptr< fib::EntryfindLongestPrefixMatch (const Name &prefix) const
 performs a longest prefix match More...
 
shared_ptr< fib::EntryfindLongestPrefixMatch (const pit::Entry &pitEntry) const
 performs a longest prefix match More...
 
shared_ptr< fib::EntryfindLongestPrefixMatch (const measurements::Entry &measurementsEntry) const
 performs a longest prefix match More...
 
shared_ptr< fib::EntryfindExactMatch (const Name &prefix) const
 
std::pair< shared_ptr< fib::Entry >, bool > insert (const Name &prefix)
 inserts a FIB entry for prefix If an entry for exact same prefix exists, that entry is returned. More...
 
void erase (const Name &prefix)
 
void erase (const fib::Entry &entry)
 
void removeNextHopFromAllEntries (shared_ptr< Face > face)
 removes the NextHop record for face in all entrites More...
 
const_iterator begin () const
 returns an iterator pointing to the first FIB entry More...
 
const_iterator end () const
 returns an iterator referring to the past-the-end FIB entry More...
 

Detailed Description

represents the FIB

Definition at line 44 of file fib.hpp.

Constructor & Destructor Documentation

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

Definition at line 49 of file fib.cpp.

nfd::Fib::~Fib ( )

Definition at line 55 of file fib.cpp.

Member Function Documentation

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

Definition at line 166 of file fib.hpp.

Referenced by nfd::StatusServer::StatusServer().

shared_ptr< fib::Entry > nfd::Fib::findLongestPrefixMatch ( const Name prefix) const

performs a longest prefix match

Definition at line 66 of file fib.cpp.

References nfd::NameTree::findLongestPrefixMatch(), and nfd::predicate_NameTreeEntry_hasFibEntry().

Referenced by findLongestPrefixMatch(), and nfd::Forwarder::~Forwarder().

shared_ptr< fib::Entry > nfd::Fib::findLongestPrefixMatch ( const pit::Entry pitEntry) const

performs a longest prefix match

Definition at line 91 of file fib.cpp.

References findLongestPrefixMatch(), and nfd::NameTree::get().

shared_ptr< fib::Entry > nfd::Fib::findLongestPrefixMatch ( const measurements::Entry measurementsEntry) const

performs a longest prefix match

Definition at line 101 of file fib.cpp.

References findLongestPrefixMatch(), and nfd::NameTree::get().

shared_ptr< fib::Entry > nfd::Fib::findExactMatch ( const Name prefix) const

Definition at line 111 of file fib.cpp.

References nfd::NameTree::findExactMatch().

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

std::pair< shared_ptr< fib::Entry >, bool > nfd::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, false for existing entry }

Definition at line 120 of file fib.cpp.

References erase(), nfd::NameTree::eraseEntryIfEmpty(), and nfd::NameTree::lookup().

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

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

Definition at line 150 of file fib.cpp.

References erase(), and nfd::NameTree::get().

void nfd::Fib::removeNextHopFromAllEntries ( shared_ptr< Face face)

removes the NextHop record for face in all entrites

This is usually invoked when face goes away. Removing the last NextHop in a FIB entry will erase the FIB entry.

Todo:
change parameter type to Face&

Definition at line 159 of file fib.cpp.

References erase(), nfd::NameTree::fullEnumerate(), and nfd::predicate_NameTreeEntry_hasFibEntry().

Referenced by nfd::FaceTable::addReserved().

Fib::const_iterator nfd::Fib::begin ( ) const

returns an iterator pointing to the first FIB entry

Note
Iteration order is implementation-specific and is undefined
The returned iterator may get invalidated if FIB or another NameTree-based table is modified

Definition at line 180 of file fib.cpp.

References nfd::NameTree::fullEnumerate(), and nfd::predicate_NameTreeEntry_hasFibEntry().

Referenced by nfd::FibEnumerationPublisher::generate().

Fib::const_iterator nfd::Fib::end ( ) const
inline

returns an iterator referring to the past-the-end FIB entry

Note
The returned iterator may get invalidated if FIB or another NameTree-based table is modified

Definition at line 172 of file fib.hpp.

Referenced by nfd::FibEnumerationPublisher::generate().


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