fw: Adding a couple of new events. Adding more documentation for events.
diff --git a/model/fw/ndn-forwarding-strategy.cc b/model/fw/ndn-forwarding-strategy.cc
index 4219deb..9fc4d29 100644
--- a/model/fw/ndn-forwarding-strategy.cc
+++ b/model/fw/ndn-forwarding-strategy.cc
@@ -130,8 +130,10 @@
m_inInterests (header, inFace);
Ptr<pit::Entry> pitEntry = m_pit->Lookup (*header);
+ bool similarInterest = true;
if (pitEntry == 0)
{
+ similarInterest = false;
pitEntry = m_pit->Create (header);
if (pitEntry != 0)
{
@@ -175,7 +177,7 @@
return;
}
- if (ShouldSuppressIncomingInterest (inFace, header, origPacket, pitEntry))
+ if (similarInterest && ShouldSuppressIncomingInterest (inFace, header, origPacket, pitEntry))
{
pitEntry->AddIncoming (inFace/*, header->GetInterestLifetime ()*/);
// update PIT entry lifetime
@@ -184,9 +186,16 @@
// Suppress this interest if we're still expecting data from some other face
NS_LOG_DEBUG ("Suppress interests");
m_dropInterests (header, inFace);
+
+ DidSuppressSimilarInterest (inFace, header, origPacket, pitEntry);
return;
}
+ if (similarInterest)
+ {
+ DidForwardSimilarInterest (inFace, header, origPacket, pitEntry);
+ }
+
PropagateInterest (inFace, header, origPacket, pitEntry);
}
@@ -225,6 +234,21 @@
}
}
+void
+ForwardingStrategy::DidCreatePitEntry (Ptr<Face> inFace,
+ Ptr<const InterestHeader> header,
+ Ptr<const Packet> origPacket,
+ Ptr<pit::Entry> pitEntrypitEntry)
+{
+}
+
+void
+ForwardingStrategy::FailedToCreatePitEntry (Ptr<Face> inFace,
+ Ptr<const InterestHeader> header,
+ Ptr<const Packet> origPacket)
+{
+ m_dropInterests (header, inFace);
+}
void
ForwardingStrategy::DidReceiveDuplicateInterest (Ptr<Face> inFace,
@@ -232,7 +256,6 @@
Ptr<const Packet> origPacket,
Ptr<pit::Entry> pitEntry)
{
- NS_LOG_FUNCTION (this << boost::cref (*inFace));
/////////////////////////////////////////////////////////////////////////////////////////
// //
// !!!! IMPORTANT CHANGE !!!! Duplicate interests will create incoming face entry !!!! //
@@ -243,6 +266,22 @@
}
void
+ForwardingStrategy::DidSuppressSimilarInterest (Ptr<Face> face,
+ Ptr<const InterestHeader> header,
+ Ptr<const Packet> origPacket,
+ Ptr<pit::Entry> pitEntry)
+{
+}
+
+void
+ForwardingStrategy::DidForwardSimilarInterest (Ptr<Face> inFace,
+ Ptr<const InterestHeader> header,
+ Ptr<const Packet> origPacket,
+ Ptr<pit::Entry> pitEntry)
+{
+}
+
+void
ForwardingStrategy::DidExhaustForwardingOptions (Ptr<Face> inFace,
Ptr<const InterestHeader> header,
Ptr<const Packet> origPacket,
@@ -263,23 +302,8 @@
m_pit->MarkErased (pitEntry);
}
}
-
-void
-ForwardingStrategy::FailedToCreatePitEntry (Ptr<Face> inFace,
- Ptr<const InterestHeader> header,
- Ptr<const Packet> origPacket)
-{
- NS_LOG_FUNCTION (this);
- m_dropInterests (header, inFace);
-}
-void
-ForwardingStrategy::DidCreatePitEntry (Ptr<Face> inFace,
- Ptr<const InterestHeader> header,
- Ptr<const Packet> origPacket,
- Ptr<pit::Entry> pitEntrypitEntry)
-{
-}
+
bool
ForwardingStrategy::DetectRetransmittedInterest (Ptr<Face> inFace,