app+utils+doc: Adding application-level trace helper to record Interest-Data delays
diff --git a/apps/ndn-app.cc b/apps/ndn-app.cc
index 3f982b6..dcf164d 100644
--- a/apps/ndn-app.cc
+++ b/apps/ndn-app.cc
@@ -90,7 +90,16 @@
{
m_protocolHandler = handler;
}
-
+
+uint32_t
+App::GetId () const
+{
+ if (m_face == 0)
+ return (uint32_t)-1;
+ else
+ return m_face->GetId ();
+}
+
void
App::OnInterest (const Ptr<const InterestHeader> &interest, Ptr<Packet> packet)
{
diff --git a/apps/ndn-app.h b/apps/ndn-app.h
index f61d54b..94fb4a7 100644
--- a/apps/ndn-app.h
+++ b/apps/ndn-app.h
@@ -63,7 +63,13 @@
*/
void
RegisterProtocolHandler (ProtocolHandler handler);
-
+
+ /**
+ * @brief Get application ID (ID of applications face)
+ */
+ uint32_t
+ GetId () const;
+
/**
* @brief Method that will be called every time new Interest arrives
* @param interest Interest header
@@ -88,7 +94,7 @@
virtual void
OnContentObject (const Ptr<const ContentObjectHeader> &contentObject,
Ptr<Packet> payload);
-
+
protected:
/**
* @brief Do cleanup when application is destroyed
diff --git a/apps/ndn-consumer.cc b/apps/ndn-consumer.cc
index 794bcb9..e71a5f4 100644
--- a/apps/ndn-consumer.cc
+++ b/apps/ndn-consumer.cc
@@ -253,20 +253,12 @@
{
m_lastRetransmittedInterestDataDelay (this, seq, Simulator::Now () - entry->time);
}
- else
- {
- NS_ASSERT_MSG (entry != m_seqTimeouts.end (), "Something is now right");
- }
entry = m_seqLifetimes.find (seq);
if (entry != m_seqLifetimes.end ())
{
m_firstInterestDataDelay (this, seq, Simulator::Now () - entry->time);
}
- else
- {
- NS_ASSERT_MSG (entry != m_seqLifetimes.end (), "Something is now right");
- }
m_seqLifetimes.erase (seq);
m_seqTimeouts.erase (seq);