38 : afterAddFace(forwarder.getFaceTable().afterAdd)
39 , beforeRemoveFace(forwarder.getFaceTable().beforeRemove)
41 , m_forwarder(forwarder)
42 , m_measurements(m_forwarder.getMeasurements(), m_forwarder.getStrategyChoice(), *this)
50 const Face& inFace,
const Data& data)
52 NFD_LOG_DEBUG(
"beforeSatisfyInterest pitEntry=" << pitEntry->getName() <<
53 " inFace=" << inFace.
getId() <<
" data=" << data.
getName());
59 NFD_LOG_DEBUG(
"beforeExpirePendingInterest pitEntry=" << pitEntry->getName());
64 const shared_ptr<pit::Entry>& pitEntry)
67 " pitEntry=" << pitEntry->getName());
77 " interest=" << pitEntry->getName() <<
" violates scope");
87 pitEntry->in_begin(), pitEntry->in_end(),
89 bool isOutFaceA = &a.
getFace() == &outFace;
90 bool isOutFaceB = &b.getFace() == &outFace;
91 return (isOutFaceA > isOutFaceB) ||
92 (isOutFaceA == isOutFaceB && a.
getLastRenewed() < b.getLastRenewed());
94 BOOST_ASSERT(pickedInRecord != pitEntry->in_end());
95 auto interest = const_pointer_cast<
Interest>(pickedInRecord->getInterest().shared_from_this());
98 interest = make_shared<Interest>(*interest);
99 static std::uniform_int_distribution<uint32_t> dist;
108 std::initializer_list<const Face*> exceptFaces)
111 std::unordered_set<const Face*> downstreams;
112 std::transform(pitEntry->in_begin(), pitEntry->in_end(), std::inserter(downstreams, downstreams.end()),
117 for (
const Face* exceptFace : exceptFaces) {
118 downstreams.erase(exceptFace);
122 for (
const Face* downstream : downstreams) {
123 this->
sendNack(pitEntry, *downstream, header);
158 NFD_LOG_TRACE(
"lookupFib hasSelectedDelegation=" << selectedDelegation <<
" found=" << fibEntry.
getPrefix());
166 if (!isDefaultFreeZone) {
172 for (
const std::pair<uint32_t, Name>& delegation : link.
getDelegations()) {
173 const Name& delegationName = delegation.second;
180 const_cast<Interest&
>(inR.getInterest()).setSelectedDelegation(delegationName);
182 NFD_LOG_TRACE(
"lookupFib enterDefaultFreeZone setSelectedDelegation=" << delegationName);
const Name & getPrefix() const
const Link & getLink() const
Get the link object for this interest.
generalization of a network interface
void sendNack(const shared_ptr< pit::Entry > &pitEntry, const Face &outFace, const lp::NackHeader &header)
send Nack to outFace
const Name & getName() const
Get name of the Data packet.
contains information about an Interest from an incoming face
virtual void beforeExpirePendingInterest(const shared_ptr< pit::Entry > &pitEntry)
trigger before PIT entry expires
represents an Interest packet
#define NFD_LOG_DEBUG(expression)
stores a collection of producer region names
const Entry & findLongestPrefixMatch(const Name &prefix) const
performs a longest prefix match
represents a Network Nack
Table::const_iterator iterator
virtual void afterReceiveNack(const Face &inFace, const lp::Nack &nack, const shared_ptr< pit::Entry > &pitEntry)
trigger after Nack is received
#define NFD_LOG_TRACE(expression)
Name getSelectedDelegation() const
Get the name of the selected delegation.
bool violatesScope(const pit::Entry &pitEntry, const Face &outFace)
represents a Link instance
InRecordCollection::iterator in_end()
Copyright (c) 2011-2015 Regents of the University of California.
Interest & setNonce(uint32_t nonce)
Set Interest's nonce.
represents the Forwarding Information Base (FIB)
bool isInProducerRegion(const Link &link) const
determines whether an Interest has reached a producer region
virtual void beforeSatisfyInterest(const shared_ptr< pit::Entry > &pitEntry, const Face &inFace, const Data &data)
trigger before PIT entry is satisfied
Strategy(Forwarder &forwarder, const Name &name)
construct a strategy instance
Name abstraction to represent an absolute name.
const Interest & getInterest() const
size_t size() const
Get the number of components.
void sendNacks(const shared_ptr< pit::Entry > &pitEntry, const lp::NackHeader &header, std::initializer_list< const Face *> exceptFaces=std::initializer_list< const Face *>())
send Nack to every face that has an in-record, except those in exceptFaces
std::mt19937 & getGlobalRng()
InRecordCollection::iterator in_begin()
Copyright (c) 2014-2016, Regents of the University of California, Arizona Board of Regents...
const fib::Entry & lookupFib(const pit::Entry &pitEntry) const
performs a FIB lookup, considering Link object if present
NetworkRegionTable & getNetworkRegionTable()
const DelegationSet & getDelegations() const
Get the pairs of <Name, Preference>
bool hasLink() const
Check whether the Interest contains a Link object.
bool hasSelectedDelegation() const
Check whether the Interest includes a selected delegation.
#define NFD_LOG_INIT(name)
void sendInterest(const shared_ptr< pit::Entry > &pitEntry, Face &outFace, const Interest &interest)
send Interest to outFace
time::steady_clock::TimePoint getLastRenewed() const