[ndnSIM] fw: Add afterReceiveLoopedInterest strategy trigger
Change-Id: I86407ff82d4b9dd182a199bbe335d6fec87976b6
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index b94108f..28159cd 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -136,6 +136,8 @@
if (hasDuplicateNonceInPit) {
// goto Interest loop pipeline
this->onInterestLoop(ingress, interest);
+ this->dispatchToStrategy(*pitEntry,
+ [&] (fw::Strategy& strategy) { strategy.afterReceiveLoopedInterest(ingress, interest, *pitEntry); });
return;
}
diff --git a/daemon/fw/strategy.cpp b/daemon/fw/strategy.cpp
index d33ad9a..a775382 100644
--- a/daemon/fw/strategy.cpp
+++ b/daemon/fw/strategy.cpp
@@ -150,6 +150,15 @@
Strategy::~Strategy() = default;
+
+void
+Strategy::afterReceiveLoopedInterest(const FaceEndpoint& ingress, const Interest& interest,
+ pit::Entry& pitEntry)
+{
+ NFD_LOG_DEBUG("afterReceiveLoopedInterest pitEntry=" << pitEntry.getName()
+ << " in=" << ingress);
+}
+
void
Strategy::beforeSatisfyInterest(const shared_ptr<pit::Entry>& pitEntry,
const FaceEndpoint& ingress, const Data& data)
diff --git a/daemon/fw/strategy.hpp b/daemon/fw/strategy.hpp
index 37d98bb..b9ed766 100644
--- a/daemon/fw/strategy.hpp
+++ b/daemon/fw/strategy.hpp
@@ -151,6 +151,19 @@
afterReceiveInterest(const FaceEndpoint& ingress, const Interest& interest,
const shared_ptr<pit::Entry>& pitEntry) = 0;
+
+ /** \brief trigger after a looped Interest is received
+ *
+ * The Interest:
+ * - does not violate Scope
+ * - IS looped
+ * - cannot be satisfied by ContentStore
+ * - is under a namespace managed by this strategy
+ */
+ virtual void
+ afterReceiveLoopedInterest(const FaceEndpoint& ingress, const Interest& interest,
+ pit::Entry& pitEntry);
+
/** \brief trigger before PIT entry is satisfied
*
* This trigger is invoked when an incoming Data satisfies more than one PIT entry.