Finalizing implementation of almost all events for forwarding strategy.
Implementing FwStats strategy that just calculates statistics for
pit entries and incoming/outgoing interests.
A serious testing is necessary to see if everything works.
diff --git a/model/forwarding-strategy/best-route.cc b/model/forwarding-strategy/best-route.cc
index 33d9cde..f109568 100644
--- a/model/forwarding-strategy/best-route.cc
+++ b/model/forwarding-strategy/best-route.cc
@@ -59,7 +59,7 @@
bool
BestRoute::DoPropagateInterest (const Ptr<CcnxFace> &incomingFace,
- Ptr<CcnxInterestHeader> &header,
+ Ptr<CcnxInterestHeader> header,
const Ptr<const Packet> &packet,
Ptr<CcnxPitEntry> pitEntry)
{
@@ -84,30 +84,17 @@
if (pitEntry->GetIncoming ().find (metricFace.m_face) != pitEntry->GetIncoming ().end ())
continue; // don't forward to face that we received interest from
- CcnxPitEntryOutgoingFaceContainer::type::iterator outgoing =
- pitEntry->GetOutgoing ().find (metricFace.m_face);
-
- if (outgoing != pitEntry->GetOutgoing ().end () &&
- outgoing->m_retxCount >= pitEntry->GetMaxRetxCount ())
- {
- NS_LOG_ERROR (outgoing->m_retxCount << " >= " << pitEntry->GetMaxRetxCount ());
- continue; // already forwarded before during this retransmission cycle
- }
-
- bool faceAvailable = metricFace.m_face->IsBelowLimit ();
- if (!faceAvailable) // huh...
+ if (!WillSendOutInterest (metricFace.m_face, header, pitEntry))
{
continue;
}
- pitEntry->AddOutgoing (metricFace.m_face);
-
- Ptr<Packet> packetToSend = packet->Copy ();
-
//transmission
+ Ptr<Packet> packetToSend = packet->Copy ();
metricFace.m_face->Send (packetToSend);
- m_outInterests (header, metricFace.m_face);
-
+
+ DidSendOutInterest (metricFace.m_face, header, pitEntry);
+
propagatedCount++;
break; // do only once
}