Enabling app-layer tracing
Network-layer tracing is not working yet (needs a couple of attributes
to be implemented)
diff --git a/apps/ccnx-app.cc b/apps/ccnx-app.cc
index 40c1168..780eb9f 100644
--- a/apps/ccnx-app.cc
+++ b/apps/ccnx-app.cc
@@ -42,6 +42,15 @@
static TypeId tid = TypeId ("ns3::CcnxApp")
.SetParent<Application> ()
.AddConstructor<CcnxApp> ()
+
+ .AddTraceSource ("ReceivedInterests", "ReceivedInterests",
+ MakeTraceSourceAccessor (&CcnxApp::m_receivedInterests))
+
+ .AddTraceSource ("ReceivedNacks", "ReceivedNacks",
+ MakeTraceSourceAccessor (&CcnxApp::m_receivedNacks))
+
+ .AddTraceSource ("ReceivedContentObjects", "ReceivedContentObjects",
+ MakeTraceSourceAccessor (&CcnxApp::m_receivedContentObjects))
;
return tid;
}
@@ -78,12 +87,14 @@
CcnxApp::OnInterest (const Ptr<const CcnxInterestHeader> &interest)
{
NS_LOG_FUNCTION (this << interest);
+ m_receivedInterests (interest, this, m_face);
}
void
CcnxApp::OnNack (const Ptr<const CcnxInterestHeader> &interest)
{
NS_LOG_FUNCTION (this << interest);
+ m_receivedNacks (interest, this, m_face);
}
void
@@ -91,6 +102,7 @@
const Ptr<const Packet> &payload)
{
NS_LOG_FUNCTION (this << contentObject << payload);
+ m_receivedContentObjects (contentObject, payload, this, m_face);
}
// Application Methods