Another checkpoint
diff --git a/model/fw/per-fib-limits.cc b/model/fw/per-fib-limits.cc
index df4607d..d79a8fc 100644
--- a/model/fw/per-fib-limits.cc
+++ b/model/fw/per-fib-limits.cc
@@ -190,17 +190,20 @@
queue != m_pitQueues.end ();
queue++)
{
- if (queue->second.IsEmpty ())
- continue;
+ Ptr<Face> outFace = queue->first;
+
+ while (!queue->second.IsEmpty () && outFace->GetLimits ().IsBelowLimit ())
+ {
+ // now we have enqueued packet and have slot available. Send out delayed packet
+ Ptr<pit::Entry> pitEntry = queue->second.Pop ();
+ pitEntry->AddOutgoing (outFace);
- // if (outFace->GetLimits ().IsBelowLimit ())
- // {
- // pitEntry->AddOutgoing (outFace);
- // }
- // else
- // {
- // // do nothing
- // }
+ Ptr<Packet> packetToSend = Create<Packet> ();
+ packetToSend->AddHeader (*pitEntry->GetInterest ());
+
+ outFace->Send (packetToSend);
+ DidSendOutInterest (outFace, pitEntry->GetInterest (), packetToSend, pitEntry);
+ }
}
}
diff --git a/model/pit/ndn-pit-entry.cc b/model/pit/ndn-pit-entry.cc
index 95b81dd..4dcf6d0 100644
--- a/model/pit/ndn-pit-entry.cc
+++ b/model/pit/ndn-pit-entry.cc
@@ -241,6 +241,11 @@
return m_maxRetxCount;
}
+Ptr<const InterestHeader>
+Entry::GetInterest () const
+{
+ return m_interest;
+}
std::ostream& operator<< (std::ostream& os, const Entry &entry)
{
diff --git a/model/pit/ndn-pit-entry.h b/model/pit/ndn-pit-entry.h
index 1dc4264..ecec2a6 100644
--- a/model/pit/ndn-pit-entry.h
+++ b/model/pit/ndn-pit-entry.h
@@ -272,6 +272,12 @@
inline void
RemoveFwTag ();
+ /**
+ * @brief Get InterestHeader (if several interests are received, then nonce is from the first Interest)
+ */
+ Ptr<const InterestHeader>
+ GetInterest () const;
+
private:
friend std::ostream& operator<< (std::ostream& os, const Entry &entry);