58 bool hasUnexpiredOutRecord = std::any_of(pitEntry.
out_begin(), pitEntry.
out_end(),
60 return &outRecord.getFace() == &face && outRecord.getExpiry() >= now;
62 if (hasUnexpiredOutRecord) {
66 bool hasUnexpiredOtherInRecord = std::any_of(pitEntry.
in_begin(), pitEntry.
in_end(),
68 return &inRecord.getFace() != &face && inRecord.getExpiry() >= now;
70 if (!hasUnexpiredOtherInRecord) {
83 if (inRecord.getLastNonce() == nonce) {
84 if (&inRecord.getFace() == &face) {
94 if (outRecord.getLastNonce() == nonce) {
95 if (&outRecord.getFace() == &face) {
113 return outRecord.getExpiry() >= now &&
114 outRecord.getIncomingNack() ==
nullptr;
121 pit::OutRecordCollection::const_iterator lastOutgoing = std::max_element(
126 BOOST_ASSERT(lastOutgoing != pitEntry.
out_end());
128 return lastOutgoing->getLastRenewed();
bool canForwardToLegacy(const pit::Entry &pitEntry, const Face &face)
decide whether Interest can be forwarded to face
const InRecordCollection & getInRecords() const
const Name LOCALHOST("ndn:/localhost")
ndn:/localhost
generalization of a network interface
static time_point now() noexcept
contains information about an Interest from an incoming face
OutRecordCollection::iterator out_end()
Represents an Interest packet.
OutRecordCollection::iterator out_begin()
InRecordCollection::iterator in_end()
Copyright (c) 2011-2015 Regents of the University of California.
ndn::nfd::FaceScope getScope() const
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::TimePoint getLastOutgoing(const pit::Entry &pitEntry)
int findDuplicateNonce(const pit::Entry &pitEntry, uint32_t nonce, const Face &face)
determine whether pitEntry has duplicate Nonce nonce
InRecordCollection::iterator in_begin()
This file contains common algorithms used by forwarding strategies.
contains information about an Interest toward an outgoing face
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
const Name & getName() const
time::steady_clock::TimePoint getLastRenewed() const