60 if (inRecord.getLastNonce() == nonce) {
61 if (&inRecord.getFace() == &face) {
71 if (outRecord.getLastNonce() == nonce) {
72 if (&outRecord.getFace() == &face) {
90 return outRecord.getExpiry() >= now &&
91 outRecord.getIncomingNack() ==
nullptr;
98 pit::OutRecordCollection::const_iterator lastOutgoing = std::max_element(
103 BOOST_ASSERT(lastOutgoing != pitEntry.
out_end());
105 return lastOutgoing->getLastRenewed();
108 fib::NextHopList::const_iterator
111 const shared_ptr<pit::Entry>& pitEntry)
113 auto found = nexthops.end();
114 auto earliestRenewed = time::steady_clock::time_point::max();
116 for (
auto it = nexthops.begin(); it != nexthops.end(); ++it) {
120 auto outRecord = pitEntry->getOutRecord(it->getFace());
121 BOOST_ASSERT(outRecord != pitEntry->out_end());
122 if (outRecord->getLastRenewed() < earliestRenewed) {
124 earliestRenewed = outRecord->getLastRenewed();
133 const shared_ptr<pit::Entry>& pitEntry,
146 auto outRecord = pitEntry->getOutRecord(outFace);
147 if (outRecord != pitEntry->out_end() && outRecord->getExpiry() > now) {
const InRecordCollection & getInRecords() const
const Name LOCALHOST("ndn:/localhost")
ndn:/localhost
static time_point now() noexcept
Contains information about an Interest from an incoming face.
fib::NextHopList::const_iterator findEligibleNextHopWithEarliestOutRecord(const Face &inFace, const Interest &interest, const fib::NextHopList &nexthops, const shared_ptr< pit::Entry > &pitEntry)
pick an eligible NextHop with earliest out-record
OutRecordCollection::iterator out_end()
boost::chrono::time_point< steady_clock > time_point
Represents an Interest packet.
Represents a collection of nexthops.
OutRecordCollection::iterator out_begin()
int findDuplicateNonce(const pit::Entry &pitEntry, Interest::Nonce nonce, const Face &face)
determine whether pitEntry has duplicate Nonce nonce
Copyright (c) 2011-2015 Regents of the University of California.
const Name LOCALHOP("ndn:/localhop")
ndn:/localhop
bool hasPendingOutRecords(const pit::Entry &pitEntry)
determine whether pitEntry has any pending out-records
no duplicate Nonce is found
time::steady_clock::time_point getLastOutgoing(const pit::Entry &pitEntry)
This file contains common algorithms used by forwarding strategies.
const Name & getName() const noexcept
Contains information about an Interest toward an outgoing face.
bool isNextHopEligible(const Face &inFace, const Interest &interest, const fib::NextHop &nexthop, const shared_ptr< pit::Entry > &pitEntry, bool wantUnused, time::steady_clock::time_point now)
bool wouldViolateScope(const Face &inFace, const Interest &interest, const Face &outFace)
determine whether forwarding the Interest in pitEntry to outFace would violate scope ...
const OutRecordCollection & getOutRecords() const
Represents a nexthop record in a FIB entry.
time::steady_clock::TimePoint getLastRenewed() const