29 namespace scope_prefix {
31 const Name
LOCALHOP(
"ndn:/localhop");
39 if (outFace.getScope() == ndn::nfd::FACE_SCOPE_LOCAL) {
51 return inFace.getScope() != ndn::nfd::FACE_SCOPE_LOCAL;
61 time::steady_clock::TimePoint now = time::steady_clock::now();
63 bool hasUnexpiredOutRecord = std::any_of(pitEntry.
out_begin(), pitEntry.
out_end(),
65 return &outRecord.getFace() == &face && outRecord.getExpiry() >= now;
67 if (hasUnexpiredOutRecord) {
71 bool hasUnexpiredOtherInRecord = std::any_of(pitEntry.
in_begin(), pitEntry.
in_end(),
73 return &inRecord.getFace() != &face && inRecord.getExpiry() >= now;
75 if (!hasUnexpiredOtherInRecord) {
88 if (inRecord.getLastNonce() == nonce) {
89 if (&inRecord.getFace() == &face) {
99 if (outRecord.getLastNonce() == nonce) {
100 if (&outRecord.getFace() == &face) {
115 time::steady_clock::TimePoint now = time::steady_clock::now();
118 return outRecord.getExpiry() >= now &&
119 outRecord.getIncomingNack() ==
nullptr;
123 time::steady_clock::TimePoint
126 pit::OutRecordCollection::const_iterator lastOutgoing = std::max_element(
131 BOOST_ASSERT(lastOutgoing != pitEntry.
out_end());
133 return lastOutgoing->getLastRenewed();
bool canForwardToLegacy(const pit::Entry &pitEntry, const Face &face)
decide whether Interest can be forwarded to face
time::steady_clock::TimePoint getLastRenewed() const
const InRecordCollection & getInRecords() const
contains information about an Interest toward an outgoing face
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
contains information about an Interest from an incoming face
const Name LOCALHOP
ndn:/localhop
InRecordCollection::iterator in_end()
bool hasPendingOutRecords(const pit::Entry &pitEntry)
determine whether pitEntry has any pending out-records
const Name LOCALHOST
ndn:/localhost
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
OutRecordCollection::iterator out_begin()
This file contains common algorithms used by forwarding strategies.
OutRecordCollection::iterator out_end()
const OutRecordCollection & getOutRecords() const
bool wouldViolateScope(const Face &inFace, const Interest &interest, const Face &outFace)
determine whether forwarding the Interest in pitEntry to outFace would violate scope ...
InRecordCollection::iterator in_begin()