36 Entry::findNextHop(
const Face& face)
38 return std::find_if(m_nextHops.begin(), m_nextHops.end(),
39 [&face] (
const NextHop& nexthop) {
40 return &nexthop.getFace() == &face;
47 return const_cast<Entry*
>(
this)->findNextHop(face) != m_nextHops.end();
50 std::pair<NextHopList::iterator, bool>
51 Entry::addOrUpdateNextHop(
Face& face, uint64_t cost)
53 auto it = this->findNextHop(face);
55 if (it == m_nextHops.end()) {
56 m_nextHops.emplace_back(face);
57 it = std::prev(m_nextHops.end());
68 Entry::removeNextHop(
const Face& face)
70 auto it = this->findNextHop(face);
71 if (it != m_nextHops.end()) {
81 std::sort(m_nextHops.begin(), m_nextHops.end(),
82 [] (
const NextHop& a,
const NextHop& b) { return a.getCost() < b.getCost(); });
Generalization of a network interface.
Represents an entry in the FIB.
bool hasNextHop(const Face &face) const
Entry(const Name &prefix)
Represents a nexthop record in a FIB entry.