35 if (outFace.
getScope() == ndn::nfd::FACE_SCOPE_LOCAL) {
47 return inFace.
getScope() != ndn::nfd::FACE_SCOPE_LOCAL;
60 if (inRecord.getLastNonce() == nonce) {
61 if (&inRecord.getFace() == &face) {
71 if (outRecord.getLastNonce() == nonce) {
72 if (&outRecord.getFace() == &face) {
87 auto now = time::steady_clock::now();
90 return outRecord.getExpiry() >= now &&
91 outRecord.getIncomingNack() == nullptr;
95 time::steady_clock::time_point
98 pit::OutRecordCollection::const_iterator lastOutgoing = std::max_element(
101 return a.getLastRenewed() < b.getLastRenewed();
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,
135 time::steady_clock::time_point now)
146 auto outRecord = pitEntry->getOutRecord(outFace);
147 if (outRecord != pitEntry->out_end() && outRecord->getExpiry() > now) {
generalization of a network interface
ndn::nfd::FaceScope getScope() const
ndn::nfd::LinkType getLinkType() const
Represents a nexthop record in a FIB entry.
OutRecordCollection::iterator out_end()
const InRecordCollection & getInRecords() const
OutRecordCollection::iterator out_begin()
const OutRecordCollection & getOutRecords() const
Contains information about an Interest from an incoming face.
Contains information about an Interest toward an outgoing face.
This file contains common algorithms used by forwarding strategies.
std::vector< NextHop > NextHopList
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
time::steady_clock::time_point getLastOutgoing(const pit::Entry &pitEntry)
@ DUPLICATE_NONCE_OUT_SAME
out-record of same face
@ DUPLICATE_NONCE_NONE
no duplicate Nonce is found
@ DUPLICATE_NONCE_IN_SAME
in-record of same face
@ DUPLICATE_NONCE_OUT_OTHER
out-record of other face
@ DUPLICATE_NONCE_IN_OTHER
in-record of other 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)
int findDuplicateNonce(const pit::Entry &pitEntry, Interest::Nonce nonce, const Face &face)
determine whether pitEntry has duplicate Nonce nonce
bool hasPendingOutRecords(const pit::Entry &pitEntry)
determine whether pitEntry has any pending out-records
bool wouldViolateScope(const Face &inFace, const Interest &interest, const Face &outFace)
determine whether forwarding the Interest in pitEntry to outFace would violate scope
const Name LOCALHOST
ndn:/localhost
const Name LOCALHOP
ndn:/localhop
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents,...