37 const unique_ptr<Entry> Fib::s_emptyEntry = make_unique<Entry>(
Name());
46 : m_nameTree(nameTree)
52 Fib::findLongestPrefixMatchImpl(
const K& key)
const 64 return this->findLongestPrefixMatchImpl(prefix);
70 return this->findLongestPrefixMatchImpl(pitEntry);
76 return this->findLongestPrefixMatchImpl(measurementsEntry);
89 std::pair<Entry*, bool>
94 if (entry !=
nullptr) {
95 return {entry,
false};
106 BOOST_ASSERT(nte !=
nullptr);
119 if (nte !=
nullptr) {
128 if (nte ==
nullptr) {
129 BOOST_ASSERT(&entry == s_emptyEntry.get());
138 NextHopList::iterator it;
140 std::tie(it, isNew) = entry.addOrUpdateNextHop(face, cost);
149 bool isRemoved = entry.removeNextHop(face);
156 this->
erase(nte,
false);
165 Fib::getRange()
const RemoveNextHopResult removeNextHop(Entry &entry, const Face &face)
Remove the NextHop record for face from entry.
const Name & getPrefix() const
std::pair< Entry *, bool > insert(const Name &prefix)
Find or insert a FIB entry.
Entry * findExactMatch(const Name &prefix)
Performs an exact match lookup.
void erase(const Name &prefix)
fib::Entry * getFibEntry() const
const Entry & findLongestPrefixMatch(const Name &prefix) const
Performs a longest prefix match.
Entry & lookup(const Name &name, size_t prefixLen)
Find or insert an entry by name.
Entry * findLongestPrefixMatch(const Name &name, const EntrySelector &entrySelector=AnyEntry()) const
Longest prefix matching.
void addOrUpdateNextHop(Entry &entry, Face &face, uint64_t cost)
Add a NextHop record.
Represents a Measurements entry.
NDN_CXX_ASSERT_FORWARD_ITERATOR(Fib::const_iterator)
Copyright (c) 2011-2015 Regents of the University of California.
Entry * getEntry(const EntryT &tableEntry) const
signal::Signal< Fib, Name, NextHop > afterNewNextHop
signals on Fib entry nexthop creation
the nexthop is removed and the fib entry stays
Represents an absolute name.
boost::range_iterator< Range >::type const_iterator
Range fullEnumerate(const EntrySelector &entrySelector=AnyEntry()) const
Enumerate all entries.
size_t eraseIfEmpty(Entry *entry, bool canEraseAncestors=true)
Delete the entry if it is empty.
A common index structure for FIB, PIT, StrategyChoice, and Measurements.
Entry * findExactMatch(const Name &name, size_t prefixLen=std::numeric_limits< size_t >::max()) const
Exact match lookup.
a functor to get a table entry from a name tree entry
static bool nteHasFibEntry(const name_tree::Entry &nte)
boost::transformed_range< name_tree::GetTableEntry< Entry >, const name_tree::Range > Range
void setFibEntry(unique_ptr< fib::Entry > fibEntry)
the nexthop is removed and the fib entry is removed
An entry in the name tree.