36 : afterAddFace(forwarder.getFaceTable().afterAdd)
37 , beforeRemoveFace(forwarder.getFaceTable().beforeRemove)
39 , m_forwarder(forwarder)
40 , m_measurements(m_forwarder.getMeasurements(), m_forwarder.getStrategyChoice(), *this)
48 const Face& inFace,
const Data& data)
50 NFD_LOG_DEBUG(
"beforeSatisfyInterest pitEntry=" << pitEntry->getName() <<
51 " inFace=" << inFace.getId() <<
" data=" << data.getName());
57 NFD_LOG_DEBUG(
"beforeExpirePendingInterest pitEntry=" << pitEntry->getName());
62 const shared_ptr<pit::Entry>& pitEntry)
65 " pitEntry=" << pitEntry->getName());
70 std::initializer_list<const Face*> exceptFaces)
73 std::unordered_set<const Face*> downstreams;
74 std::transform(pitEntry->in_begin(), pitEntry->in_end(), std::inserter(downstreams, downstreams.end()),
79 for (
const Face* exceptFace : exceptFaces) {
80 downstreams.erase(exceptFace);
84 for (
const Face* downstream : downstreams) {
85 this->
sendNack(pitEntry, *downstream, header);
93 const Fib& fib = m_forwarder.
getFib();
98 if (!interest.hasLink()) {
100 const fib::Entry& fibEntry = fib.findLongestPrefixMatch(pitEntry);
105 const Link& link = interest.getLink();
110 const fib::Entry& fibEntry = fib.findLongestPrefixMatch(pitEntry);
116 if (interest.hasSelectedDelegation()) {
118 Name selectedDelegation = interest.getSelectedDelegation();
119 const fib::Entry& fibEntry = fib.findLongestPrefixMatch(selectedDelegation);
120 NFD_LOG_TRACE(
"lookupFib hasSelectedDelegation=" << selectedDelegation <<
" found=" << fibEntry.
getPrefix());
125 const fib::Entry& fibEntry0 = fib.findLongestPrefixMatch(link.getDelegations().begin()->second);
128 if (!isDefaultFreeZone) {
134 for (
const std::pair<uint32_t, Name>& delegation : link.getDelegations()) {
135 const Name& delegationName = delegation.second;
136 const fib::Entry& fibEntry = fib.findLongestPrefixMatch(delegationName);
142 const_cast<Interest&
>(inR.getInterest()).setSelectedDelegation(delegationName);
144 NFD_LOG_TRACE(
"lookupFib enterDefaultFreeZone setSelectedDelegation=" << delegationName);
#define NFD_LOG_DEBUG(expression)
Strategy(Forwarder &forwarder, const Name &name)
construct a strategy instance
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
bool isInProducerRegion(const Link &link) const
determines whether an Interest has reached a producer region
void sendNack(const shared_ptr< pit::Entry > &pitEntry, const Face &outFace, const lp::NackHeader &header)
send Nack to outFace
virtual void beforeSatisfyInterest(const shared_ptr< pit::Entry > &pitEntry, const Face &inFace, const Data &data)
trigger before PIT entry is satisfied
const Name & getPrefix() const
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
contains information about an Interest from an incoming face
virtual void afterReceiveNack(const Face &inFace, const lp::Nack &nack, const shared_ptr< pit::Entry > &pitEntry)
trigger after Nack is received
stores a collection of producer region names
InRecordCollection::iterator in_end()
const Interest & getInterest() const
#define NFD_LOG_INIT(name)
#define NFD_LOG_TRACE(expression)
virtual void beforeExpirePendingInterest(const shared_ptr< pit::Entry > &pitEntry)
trigger before PIT entry expires
NetworkRegionTable & getNetworkRegionTable()
const fib::Entry & lookupFib(const pit::Entry &pitEntry) const
performs a FIB lookup, considering Link object if present
InRecordCollection::iterator in_begin()