fw: add strategy notification for Interests dropped by LpReliability
add dropped Interest counter to faces
refs #3823
Change-Id: I9910b66932d74383203e8f3732bb45cade83b972
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index 69a93de..6d57a2d 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -61,6 +61,10 @@
[this, &face] (const lp::Nack& nack) {
this->startProcessNack(face, nack);
});
+ face.onDroppedInterest.connect(
+ [this, &face] (const Interest& interest) {
+ this->onDroppedInterest(face, interest);
+ });
});
m_faceTable.beforeRemove.connect([this] (Face& face) {
@@ -481,6 +485,12 @@
++m_counters.nOutNacks;
}
+void
+Forwarder::onDroppedInterest(Face& outFace, const Interest& interest)
+{
+ m_strategyChoice.findEffectiveStrategy(interest.getName()).onDroppedInterest(outFace, interest);
+}
+
static inline bool
compare_InRecord_expiry(const pit::InRecord& a, const pit::InRecord& b)
{
diff --git a/daemon/fw/forwarder.hpp b/daemon/fw/forwarder.hpp
index d2e73a8..6d50909 100644
--- a/daemon/fw/forwarder.hpp
+++ b/daemon/fw/forwarder.hpp
@@ -252,6 +252,9 @@
VIRTUAL_WITH_TESTS void
onOutgoingNack(const shared_ptr<pit::Entry>& pitEntry, const Face& outFace, const lp::NackHeader& nack);
+ VIRTUAL_WITH_TESTS void
+ onDroppedInterest(Face& outFace, const Interest& interest);
+
PROTECTED_WITH_TESTS_ELSE_PRIVATE:
VIRTUAL_WITH_TESTS void
setUnsatisfyTimer(const shared_ptr<pit::Entry>& pitEntry);
diff --git a/daemon/fw/strategy.cpp b/daemon/fw/strategy.cpp
index fea2164..284b1f2 100644
--- a/daemon/fw/strategy.cpp
+++ b/daemon/fw/strategy.cpp
@@ -171,6 +171,12 @@
}
void
+Strategy::onDroppedInterest(const Face& outFace, const Interest& interest)
+{
+ NFD_LOG_DEBUG("onDroppedInterest outFace=" << outFace.getId() << " name=" << interest.getName());
+}
+
+void
Strategy::sendNacks(const shared_ptr<pit::Entry>& pitEntry, const lp::NackHeader& header,
std::initializer_list<const Face*> exceptFaces)
{
diff --git a/daemon/fw/strategy.hpp b/daemon/fw/strategy.hpp
index 99ed1dc..e09b590 100644
--- a/daemon/fw/strategy.hpp
+++ b/daemon/fw/strategy.hpp
@@ -1,5 +1,5 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
* Copyright (c) 2014-2017, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
@@ -181,6 +181,13 @@
afterReceiveNack(const Face& inFace, const lp::Nack& nack,
const shared_ptr<pit::Entry>& pitEntry);
+ /** \brief trigger after Interest dropped for exceeding allowed retransmissions
+ *
+ * In the base class this method does nothing.
+ */
+ virtual void
+ onDroppedInterest(const Face& outFace, const Interest& interest);
+
protected: // actions
/** \brief send Interest to outFace
* \param pitEntry PIT entry