50 bool wantUnused =
false,
53 shared_ptr<Face> upstream = nexthop.
getFace();
56 if (upstream->getId() == currentDownstream)
60 if (pitEntry->violatesScope(*upstream))
65 pit::OutRecordCollection::const_iterator outRecord = pitEntry->getOutRecord(*upstream);
66 if (outRecord != pitEntry->getOutRecords().end() &&
67 outRecord->getExpiry() > now) {
78 static inline fib::NextHopList::const_iterator
83 fib::NextHopList::const_iterator found = nexthops.end();
85 for (fib::NextHopList::const_iterator it = nexthops.begin(); it != nexthops.end(); ++it) {
88 pit::OutRecordCollection::const_iterator outRecord = pitEntry->getOutRecord(*it->getFace());
89 BOOST_ASSERT(outRecord != pitEntry->getOutRecords().end());
90 if (outRecord->getLastRenewed() < earliestRenewed) {
92 earliestRenewed = outRecord->getLastRenewed();
101 shared_ptr<fib::Entry> fibEntry,
102 shared_ptr<pit::Entry> pitEntry)
105 fib::NextHopList::const_iterator it = nexthops.end();
108 m_retxSuppression.
decide(inFace, interest, *pitEntry);
111 it = std::find_if(nexthops.begin(), nexthops.end(),
113 false, time::steady_clock::TimePoint::min()));
115 if (it == nexthops.end()) {
121 shared_ptr<Face> outFace = it->getFace();
124 <<
" newPitEntry-to=" << outFace->getId());
135 it = std::find_if(nexthops.begin(), nexthops.end(),
138 if (it != nexthops.end()) {
139 shared_ptr<Face> outFace = it->getFace();
142 <<
" retransmit-unused-to=" << outFace->getId());
148 if (it == nexthops.end()) {
152 shared_ptr<Face> outFace = it->getFace();
155 <<
" retransmit-retry-to=" << outFace->getId());
virtual void afterReceiveInterest(const Face &inFace, const Interest &interest, shared_ptr< fib::Entry > fibEntry, shared_ptr< pit::Entry > pitEntry) 1
trigger after Interest is received
#define NFD_LOG_DEBUG(expression)
static time_point now() noexcept
Best Route strategy version 3.
Interest is retransmission and should be suppressed.
represents an Interest packet
Interest is new (not a retransmission)
Copyright (c) 2011-2015 Regents of the University of California.
NFD_REGISTER_STRATEGY(AccessStrategy)
std::vector< fib::NextHop > NextHopList
Name abstraction to represent an absolute name.
void rejectPendingInterest(shared_ptr< pit::Entry > pitEntry)
decide that a pending Interest cannot be forwarded
static const Name STRATEGY_NAME
represents a forwarding strategy
virtual Result decide(const Face &inFace, const Interest &interest, pit::Entry &pitEntry) const 1
determines whether Interest is a retransmission, and if so, whether it shall be forwarded or suppress...
const shared_ptr< Face > & getFace() const
static bool predicate_NextHop_eligible(const shared_ptr< pit::Entry > &pitEntry, const fib::NextHop &nexthop, FaceId currentDownstream, bool wantUnused=false, time::steady_clock::TimePoint now=time::steady_clock::TimePoint::min())
determines whether a NextHop is eligible
#define NFD_LOG_INIT(name)
void sendInterest(shared_ptr< pit::Entry > pitEntry, shared_ptr< Face > outFace, bool wantNewNonce=false)
send Interest to outFace
BestRouteStrategy2(Forwarder &forwarder, const Name &name=STRATEGY_NAME)
static fib::NextHopList::const_iterator findEligibleNextHopWithEarliestOutRecord(const shared_ptr< pit::Entry > &pitEntry, const fib::NextHopList &nexthops, FaceId currentDownstream)
pick an eligible NextHop with earliest OutRecord
represents a nexthop record in FIB entry