37 Entry::findNextHop(
const Face& face,
EndpointId endpointId)
39 return std::find_if(m_nextHops.begin(), m_nextHops.end(),
40 [&face, endpointId] (
const NextHop& nexthop) {
41 return &nexthop.getFace() == &face && nexthop.getEndpointId() == endpointId;
48 return const_cast<Entry*
>(
this)->findNextHop(face, endpointId) != m_nextHops.end();
54 auto it = this->findNextHop(face, endpointId);
55 if (it == m_nextHops.end()) {
56 m_nextHops.emplace_back(face, endpointId);
57 it = std::prev(m_nextHops.end());
66 auto it = this->findNextHop(face, endpointId);
67 if (it != m_nextHops.end()) {
75 auto it = std::remove_if(m_nextHops.begin(), m_nextHops.end(),
76 [&face] (
const NextHop& nexthop) {
77 return &nexthop.getFace() == &face;
79 m_nextHops.erase(it, m_nextHops.end());
85 std::sort(m_nextHops.begin(), m_nextHops.end(),
Entry(const Name &prefix)
void removeNextHopByFace(const Face &face)
removes all NextHop records on face for any endpointId
Table::const_iterator iterator
uint64_t EndpointId
identifies an endpoint on the link
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
void addOrUpdateNextHop(Face &face, EndpointId endpointId, uint64_t cost)
adds a NextHop record
void removeNextHop(const Face &face, EndpointId endpointId)
removes the NextHop record for face with the given endpointId
bool hasNextHop(const Face &face, EndpointId endpointId) const
Represents a nexthop record in a FIB entry.