fw: Nack in pipelines and best-route strategy
* in PIT out-record, add last incoming Nack field
* create incoming Nack pipeline
* create outgoing Nack pipeline
* modify Interest loop pipeline to send Nack upon duplicate Nonce
* in strategy API, add after receive Nack trigger and send Nack action
* in best-route strategy, send Nack-NoRoute before rejecting pending Interest
* in best-route strategy, process incoming Nack
Other changes include:
* Pit::find
* StrategyTester saved arguments structs
* TopologyTester transmit at Transport level
refs #3156
Change-Id: I7868561c0838231083d471261200aeb280cc6e9d
diff --git a/tests/daemon/fw/dummy-strategy.hpp b/tests/daemon/fw/dummy-strategy.hpp
index d078051..33d2656 100644
--- a/tests/daemon/fw/dummy-strategy.hpp
+++ b/tests/daemon/fw/dummy-strategy.hpp
@@ -33,7 +33,7 @@
/** \brief strategy for unit testing
*
- * Triggers on DummyStrategy are recorded but does nothing
+ * Unless otherwise indicated, triggers are recorded but does nothing.
*/
class DummyStrategy : public fw::Strategy
{
@@ -47,9 +47,13 @@
{
}
+ /** \brief after receive Interest trigger
+ *
+ * If \p interestOutFace is not null, send Interest action is invoked with that face;
+ * otherwise, reject pending Interest action is invoked.
+ */
virtual void
- afterReceiveInterest(const Face& inFace,
- const Interest& interest,
+ afterReceiveInterest(const Face& inFace, const Interest& interest,
shared_ptr<fib::Entry> fibEntry,
shared_ptr<pit::Entry> pitEntry) DECL_OVERRIDE
{
@@ -59,7 +63,7 @@
interest, fibEntry, pitEntry));
}
- if (static_cast<bool>(interestOutFace)) {
+ if (interestOutFace) {
this->sendInterest(pitEntry, interestOutFace);
}
else {
@@ -80,16 +84,25 @@
++beforeExpirePendingInterest_count;
}
+ virtual void
+ afterReceiveNack(const Face& inFace, const lp::Nack& nack,
+ shared_ptr<fib::Entry> fibEntry,
+ shared_ptr<pit::Entry> pitEntry) DECL_OVERRIDE
+ {
+ ++afterReceiveNack_count;
+ }
+
public:
int afterReceiveInterest_count;
bool wantAfterReceiveInterestCalls;
std::vector<std::tuple<FaceId, Interest, shared_ptr<fib::Entry>,
shared_ptr<pit::Entry>>> afterReceiveInterestCalls;
+ shared_ptr<Face> interestOutFace;
+
int beforeSatisfyInterest_count;
int beforeExpirePendingInterest_count;
+ int afterReceiveNack_count;
- /// outFace to use in afterReceiveInterest, nullptr to reject
- shared_ptr<Face> interestOutFace;
};
} // namespace tests