Add counter for interest and data packets (for performance evaluations)
diff --git a/model/ndn-l3-protocol.cc b/model/ndn-l3-protocol.cc
index 86002e3..372df77 100644
--- a/model/ndn-l3-protocol.cc
+++ b/model/ndn-l3-protocol.cc
@@ -51,9 +51,24 @@
const uint16_t L3Protocol::ETHERNET_FRAME_TYPE = 0x7777;
+uint64_t L3Protocol::s_interestCounter = 0;
+uint64_t L3Protocol::s_dataCounter = 0;
NS_OBJECT_ENSURE_REGISTERED (L3Protocol);
+uint64_t
+L3Protocol::GetInterestCounter ()
+{
+ return s_interestCounter;
+}
+
+uint64_t
+L3Protocol::GetDataCounter ()
+{
+ return s_dataCounter;
+}
+
+
TypeId
L3Protocol::GetTypeId (void)
{
@@ -240,6 +255,7 @@
{
case HeaderHelper::INTEREST:
{
+ s_interestCounter ++;
Ptr<InterestHeader> header = Create<InterestHeader> ();
// Deserialization. Exception may be thrown
@@ -255,6 +271,7 @@
}
case HeaderHelper::CONTENT_OBJECT:
{
+ s_dataCounter ++;
Ptr<ContentObjectHeader> header = Create<ContentObjectHeader> ();
static ContentObjectTail contentObjectTrailer; //there is no data in this object