represents a forwarding strategy More...
#include <strategy.hpp>
Public Member Functions | |
Strategy (Forwarder &forwarder, const Name &name) | |
construct a strategy instance More... | |
virtual | ~Strategy () |
const Name & | getName () const |
virtual void | afterReceiveInterest (const Face &inFace, const Interest &interest, const shared_ptr< pit::Entry > &pitEntry)=0 |
trigger after Interest is received More... | |
virtual void | beforeSatisfyInterest (const shared_ptr< pit::Entry > &pitEntry, const Face &inFace, const Data &data) |
trigger before PIT entry is satisfied More... | |
virtual void | beforeExpirePendingInterest (const shared_ptr< pit::Entry > &pitEntry) |
trigger before PIT entry expires More... | |
virtual void | afterReceiveNack (const Face &inFace, const lp::Nack &nack, const shared_ptr< pit::Entry > &pitEntry) |
trigger after Nack is received More... | |
Protected Member Functions | |
void | sendInterest (const shared_ptr< pit::Entry > &pitEntry, Face &outFace, bool wantNewNonce=false) |
send Interest to outFace More... | |
void | rejectPendingInterest (const shared_ptr< pit::Entry > &pitEntry) |
decide that a pending Interest cannot be forwarded More... | |
void | sendNack (const shared_ptr< pit::Entry > &pitEntry, const Face &outFace, const lp::NackHeader &header) |
send Nack to outFace More... | |
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 More... | |
const fib::Entry & | lookupFib (const pit::Entry &pitEntry) const |
performs a FIB lookup, considering Link object if present More... | |
MeasurementsAccessor & | getMeasurements () |
Face * | getFace (FaceId id) const |
const FaceTable & | getFaceTable () const |
Protected Attributes | |
signal::Signal< FaceTable, Face & > & | afterAddFace |
signal::Signal< FaceTable, Face & > & | beforeRemoveFace |
represents a forwarding strategy
Definition at line 38 of file strategy.hpp.
nfd::fw::Strategy::Strategy | ( | Forwarder & | forwarder, |
const Name & | name | ||
) |
construct a strategy instance
forwarder | a reference to the Forwarder, used to enable actions and accessors. Strategy subclasses should pass this reference, and should not keep a reference themselves. |
name | the strategy Name. It's recommended to include a version number as the last component. |
Definition at line 35 of file strategy.cpp.
|
virtualdefault |
|
pure virtual |
trigger after Interest is received
The Interest:
The strategy should decide whether and where to forward this Interest.
Implemented in nfd::fw::BestRouteStrategy2, nfd::fw::AccessStrategy, nfd::fw::asf::AsfStrategy, nfd::fw::BestRouteStrategy, nfd::fw::ClientControlStrategy, nfd::fw::NccStrategy, and nfd::fw::MulticastStrategy.
|
virtual |
trigger after Nack is received
This trigger is invoked when an incoming Nack is received in response to an forwarded Interest. The Nack has been confirmed to be a response to the last Interest forwarded to that upstream, i.e. the PIT out-record exists and has a matching Nonce. The NackHeader has been recorded in the PIT out-record.
In this base class this method does nothing.
Reimplemented in nfd::fw::BestRouteStrategy2, and nfd::fw::asf::AsfStrategy.
Definition at line 61 of file strategy.cpp.
|
virtual |
trigger before PIT entry expires
PIT entry expires when InterestLifetime has elapsed for all InRecords, and it is not satisfied by an incoming Data.
This trigger is not invoked for PIT entry already satisfied.
In this base class this method does nothing.
Definition at line 55 of file strategy.cpp.
|
virtual |
trigger before PIT entry is satisfied
This trigger is invoked when an incoming Data satisfies the PIT entry. It can be invoked even if the PIT entry has already been satisfied.
In this base class this method does nothing.
Reimplemented in nfd::fw::AccessStrategy, nfd::fw::asf::AsfStrategy, and nfd::fw::NccStrategy.
Definition at line 47 of file strategy.cpp.
|
inlineprotected |
Definition at line 194 of file strategy.hpp.
|
inlineprotected |
Definition at line 200 of file strategy.hpp.
|
inlineprotected |
Definition at line 188 of file strategy.hpp.
|
inline |
Definition at line 56 of file strategy.hpp.
|
protected |
performs a FIB lookup, considering Link object if present
Definition at line 91 of file strategy.cpp.
|
inlineprotected |
decide that a pending Interest cannot be forwarded
pitEntry | PIT entry |
This shall not be called if the pending Interest has been forwarded earlier, and does not need to be resent now.
Definition at line 151 of file strategy.hpp.
|
inlineprotected |
send Interest to outFace
pitEntry | PIT entry |
outFace | face through which to send out the Interest |
wantNewNonce | if true, a new Nonce will be generated, rather than reusing a Nonce from one of the PIT in-records |
Definition at line 138 of file strategy.hpp.
|
inlineprotected |
send Nack to outFace
pitEntry | PIT entry |
outFace | face through which to send out the Nack |
header | Nack header |
The outFace must have a PIT in-record, otherwise this method has no effect.
Definition at line 164 of file strategy.hpp.
|
protected |
send Nack to every face that has an in-record, except those in exceptFaces
pitEntry | PIT entry |
header | NACK header |
exceptFaces | list of faces that should be excluded from sending Nacks |
Definition at line 69 of file strategy.cpp.
|
protected |
Definition at line 206 of file strategy.hpp.
|
protected |
Definition at line 207 of file strategy.hpp.