model: Mark face YELLOW when PIT entry times out in ndn::fw::GreenYellowRed strategy
diff --git a/model/fw/green-yellow-red.cc b/model/fw/green-yellow-red.cc
index 52acc68..2045634 100644
--- a/model/fw/green-yellow-red.cc
+++ b/model/fw/green-yellow-red.cc
@@ -72,7 +72,7 @@
NS_ASSERT_MSG (m_pit != 0, "PIT should be aggregated with forwarding strategy");
int propagatedCount = 0;
-
+
BOOST_FOREACH (const fib::FaceMetric &metricFace, pitEntry->GetFibEntry ()->m_faces.get<fib::i_metric> ())
{
if (metricFace.m_status == fib::FaceMetric::NDN_FIB_RED ||
@@ -83,7 +83,7 @@
{
continue;
}
-
+
propagatedCount++;
break; // propagate only one interest
}
@@ -105,6 +105,21 @@
}
void
+GreenYellowRed::WillEraseTimedOutPendingInterest (Ptr<pit::Entry> pitEntry)
+{
+ NS_LOG_DEBUG ("WillEraseTimedOutPendingInterest for " << pitEntry->GetPrefix ());
+ for (pit::Entry::out_container::iterator face = pitEntry->GetOutgoing ().begin ();
+ face != pitEntry->GetOutgoing ().end ();
+ face ++)
+ {
+ NS_LOG_DEBUG ("Face: " << face->m_face);
+ pitEntry->GetFibEntry ()->UpdateStatus (face->m_face, fib::FaceMetric::NDN_FIB_YELLOW);
+ }
+
+ super::WillEraseTimedOutPendingInterest (pitEntry);
+}
+
+void
GreenYellowRed::DidReceiveValidNack (Ptr<Face> inFace,
uint32_t nackCode,
Ptr<const InterestHeader> header,
diff --git a/model/fw/green-yellow-red.h b/model/fw/green-yellow-red.h
index 371f7fd..93c00ca 100644
--- a/model/fw/green-yellow-red.h
+++ b/model/fw/green-yellow-red.h
@@ -47,6 +47,10 @@
Ptr<const InterestHeader> header,
Ptr<const Packet> origPacket,
Ptr<pit::Entry> pitEntry);
+
+ virtual void
+ WillEraseTimedOutPendingInterest (Ptr<pit::Entry> pitEntry);
+
virtual void
DidReceiveValidNack (Ptr<Face> incomingFace,
uint32_t nackCode,