32 const unique_ptr<Entry> Fib::s_emptyEntry = make_unique<Entry>(Name());
41 : m_nameTree(nameTree)
47 Fib::findLongestPrefixMatchImpl(
const K& key)
const
59 return this->findLongestPrefixMatchImpl(prefix);
65 return this->findLongestPrefixMatchImpl(pitEntry);
71 return this->findLongestPrefixMatchImpl(measurementsEntry);
84 std::pair<Entry*, bool>
89 if (entry !=
nullptr) {
90 return {entry,
false};
101 BOOST_ASSERT(nte !=
nullptr);
114 if (nte !=
nullptr) {
123 if (nte ==
nullptr) {
124 BOOST_ASSERT(&entry == s_emptyEntry.get());
133 auto [it, isNew] = entry.addOrUpdateNextHop(face, cost);
141 bool isRemoved = entry.removeNextHop(face);
148 this->
erase(nte,
false);
157 Fib::getRange()
const
Generalization of a network interface.
Represents an entry in the FIB.
bool hasNextHops() const noexcept
Returns whether this Entry has any NextHop records.
const Name & getPrefix() const noexcept
@ NEXTHOP_REMOVED
the nexthop is removed and the fib entry stays
@ FIB_ENTRY_REMOVED
the nexthop is removed and the fib entry is removed
@ NO_SUCH_NEXTHOP
the nexthop is not found
std::pair< Entry *, bool > insert(const Name &prefix)
Find or insert a FIB entry.
Entry * findExactMatch(const Name &prefix)
Performs an exact match lookup.
RemoveNextHopResult removeNextHop(Entry &entry, const Face &face)
Remove the NextHop record for face from entry.
boost::transformed_range< name_tree::GetTableEntry< Entry >, const name_tree::Range > Range
signal::Signal< Fib, Name, NextHop > afterNewNextHop
Signals on Fib entry nexthop creation.
void erase(const Name &prefix)
const Entry & findLongestPrefixMatch(const Name &prefix) const
Performs a longest prefix match.
void addOrUpdateNextHop(Entry &entry, Face &face, uint64_t cost)
Add a NextHop record.
Represents an entry in the Measurements table.
An entry in the name tree.
fib::Entry * getFibEntry() const
void setFibEntry(unique_ptr< fib::Entry > fibEntry)
A functor to get a table entry from a name tree entry.
A common index structure for FIB, PIT, StrategyChoice, and Measurements.
size_t eraseIfEmpty(Entry *entry, bool canEraseAncestors=true)
Delete the entry if it is empty.
Range fullEnumerate(const EntrySelector &entrySelector=AnyEntry()) const
Enumerate all entries.
Entry & lookup(const Name &name, size_t prefixLen)
Find or insert an entry by name.
Entry * getEntry(const EntryT &tableEntry) const
Entry * findExactMatch(const Name &name, size_t prefixLen=std::numeric_limits< size_t >::max()) const
Exact match lookup.
Entry * findLongestPrefixMatch(const Name &name, const EntrySelector &entrySelector=AnyEntry()) const
Longest prefix matching.
Represents an entry in the Interest table (PIT).
static bool nteHasFibEntry(const name_tree::Entry &nte)