37 Entry::findNextHop(
const Face& face)
39 return std::find_if(m_nextHops.begin(), m_nextHops.end(),
40 [&face] (
const NextHop& nexthop) {
41 return &nexthop.getFace() == &face;
48 return const_cast<Entry*
>(
this)->findNextHop(face) != m_nextHops.end();
51 std::pair<NextHopList::iterator, bool>
52 Entry::addOrUpdateNextHop(
Face& face, uint64_t cost)
54 auto it = this->findNextHop(face);
56 if (it == m_nextHops.end()) {
57 m_nextHops.emplace_back(face);
58 it = std::prev(m_nextHops.end());
65 return std::make_pair(it, isNew);
69 Entry::removeNextHop(
const Face& face)
71 auto it = this->findNextHop(face);
72 if (it != m_nextHops.end()) {
82 std::sort(m_nextHops.begin(), m_nextHops.end(),
Entry(const Name &prefix)
bool hasNextHop(const Face &face) const
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
generalization of a network interface
Represents a nexthop record in a FIB entry.