Represents the Forwarding Information Base (FIB) More...
#include <fib.hpp>
Public Types | |
enum | RemoveNextHopResult { RemoveNextHopResult::NO_SUCH_NEXTHOP, RemoveNextHopResult::NEXTHOP_REMOVED, RemoveNextHopResult::FIB_ENTRY_REMOVED } |
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) |
Find or insert a FIB entry. More... | |
void | erase (const Name &prefix) |
void | erase (const Entry &entry) |
void | addOrUpdateNextHop (Entry &entry, Face &face, uint64_t cost) |
Add a NextHop record. More... | |
RemoveNextHopResult | removeNextHop (Entry &entry, const Face &face) |
Remove the NextHop record for face from entry . 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... | |
Public Attributes | |
signal::Signal< Fib, Name, NextHop > | afterNewNextHop |
signals on Fib entry nexthop creation More... | |
typedef boost::transformed_range<name_tree::GetTableEntry<Entry>, const name_tree::Range> nfd::fib::Fib::Range |
typedef boost::range_iterator<Range>::type nfd::fib::Fib::const_iterator |
|
strong |
Performs a longest prefix match.
Definition at line 62 of file fib.cpp.
Referenced by nfd::fw::Strategy::lookupFib().
const Entry & nfd::fib::Fib::findLongestPrefixMatch | ( | const pit::Entry & | pitEntry | ) | const |
const Entry & nfd::fib::Fib::findLongestPrefixMatch | ( | const measurements::Entry & | measurementsEntry | ) | const |
Performs an exact match lookup.
Definition at line 80 of file fib.cpp.
References nfd::name_tree::NameTree::findExactMatch(), and nfd::name_tree::Entry::getFibEntry().
|
inlinestaticconstexpr |
Maximum number of components in a FIB entry prefix.
Definition at line 88 of file fib.hpp.
References nfd::name_tree::NameTree::getMaxDepth().
Find or insert a FIB entry.
prefix | FIB entry name; it must not have more than getMaxDepth() components. |
Definition at line 90 of file fib.cpp.
References nfd::name_tree::Entry::getFibEntry(), nfd::name_tree::NameTree::lookup(), and nfd::name_tree::Entry::setFibEntry().
void nfd::fib::Fib::erase | ( | const Name & | prefix | ) |
Definition at line 116 of file fib.cpp.
References nfd::name_tree::NameTree::findExactMatch().
Referenced by erase(), and removeNextHop().
void nfd::fib::Fib::erase | ( | const Entry & | entry | ) |
Definition at line 125 of file fib.cpp.
References erase(), and nfd::name_tree::NameTree::getEntry().
Add a NextHop record.
If a NextHop record for face
already exists in entry
, its cost is set to cost
.
Definition at line 136 of file fib.cpp.
References afterNewNextHop, and nfd::fib::Entry::getPrefix().
Fib::RemoveNextHopResult nfd::fib::Fib::removeNextHop | ( | Entry & | entry, |
const Face & | face | ||
) |
Remove the NextHop record for face
from entry
.
Definition at line 147 of file fib.cpp.
References erase(), FIB_ENTRY_REMOVED, nfd::name_tree::NameTree::getEntry(), nfd::fib::Entry::hasNextHops(), NEXTHOP_REMOVED, and NO_SUCH_NEXTHOP.
Referenced by nfd::cleanupOnFaceRemoval().
|
inline |
|
inline |
signal::Signal<Fib, Name, NextHop> nfd::fib::Fib::afterNewNextHop |
signals on Fib entry nexthop creation
Definition at line 151 of file fib.hpp.
Referenced by addOrUpdateNextHop(), and nfd::Forwarder::Forwarder().