More debug
diff --git a/helper/ccnb-parser/syntax-tree/ccnb-parser-base-tag.h b/helper/ccnb-parser/syntax-tree/ccnb-parser-base-tag.h
index 6b7fe76..604ebce 100644
--- a/helper/ccnb-parser/syntax-tree/ccnb-parser-base-tag.h
+++ b/helper/ccnb-parser/syntax-tree/ccnb-parser-base-tag.h
@@ -40,6 +40,9 @@
std::list<Ptr<Block> > m_attrs; ///< \brief List of attributes, associated with this tag
std::list<Ptr<Block> > m_nestedTags; ///< \brief List of nested tags
+public:
+ virtual ~BaseTag () { }
+
protected:
/**
* \brief Default constructor
diff --git a/helper/ccnb-parser/syntax-tree/ccnb-parser-block.cc b/helper/ccnb-parser/syntax-tree/ccnb-parser-block.cc
index 74807d3..09bf96a 100644
--- a/helper/ccnb-parser/syntax-tree/ccnb-parser-block.cc
+++ b/helper/ccnb-parser/syntax-tree/ccnb-parser-block.cc
@@ -28,6 +28,10 @@
#include "ccnb-parser-dattr.h"
#include "ccnb-parser-ext.h"
+#include "ns3/log.h"
+
+NS_LOG_COMPONENT_DEFINE ("CcnbParserBlock");
+
namespace ns3 {
namespace CcnbParser {
@@ -40,6 +44,8 @@
Ptr<Block> Block::ParseBlock (Buffer::Iterator &start)
{
+ NS_LOG_DEBUG (">");
+
// std::cout << "<< pos: " << counter << "\n";
uint32_t value = 0;
@@ -57,7 +63,7 @@
value <<= 4;
value += ( (byte&(~CCN_TT_HBIT)) >> 3);
-
+
/**
* Huh. After fighting with NS-3, it became apparent that Create<T>(...) construct
* doesn't work with references. Just simply doesn't work. wtf?
@@ -83,5 +89,10 @@
}
}
+Block::~Block ()
+{
+ NS_LOG_DEBUG ("<");
+}
+
}
}
diff --git a/helper/ccnb-parser/syntax-tree/ccnb-parser-block.h b/helper/ccnb-parser/syntax-tree/ccnb-parser-block.h
index 59ccf02..a188597 100644
--- a/helper/ccnb-parser/syntax-tree/ccnb-parser-block.h
+++ b/helper/ccnb-parser/syntax-tree/ccnb-parser-block.h
@@ -56,6 +56,8 @@
*/
static Ptr<Block>
ParseBlock (Buffer::Iterator &start);
+
+ virtual ~Block ();
virtual void accept( VoidNoArguVisitor &v ) = 0;
virtual void accept( VoidVisitor &v, boost::any param ) = 0;
diff --git a/helper/ccnb-parser/visitors/ccnb-parser-interest-visitor.cc b/helper/ccnb-parser/visitors/ccnb-parser-interest-visitor.cc
index 992fae5..65ec4ee 100644
--- a/helper/ccnb-parser/visitors/ccnb-parser-interest-visitor.cc
+++ b/helper/ccnb-parser/visitors/ccnb-parser-interest-visitor.cc
@@ -34,6 +34,10 @@
#include <boost/foreach.hpp>
+#include "ns3/log.h"
+
+NS_LOG_COMPONENT_DEFINE ("CcnbParserInterestVisitor");
+
namespace ns3 {
namespace CcnbParser {
@@ -50,10 +54,12 @@
static NonceVisitor nonceVisitor;
CcnxInterestHeader &interest = *(boost::any_cast<CcnxInterestHeader*> (param));
-
+
switch (n.m_dtag)
{
case CCN_DTAG_Interest:
+ NS_LOG_DEBUG ("Interest");
+
// process nested blocks
BOOST_FOREACH (Ptr<Block> block, n.m_nestedTags)
{
@@ -62,6 +68,8 @@
break;
case CCN_DTAG_Name:
{
+ NS_LOG_DEBUG ("Name");
+
// process name components
Ptr<CcnxNameComponents> name = Create<CcnxNameComponents> ();
@@ -73,6 +81,7 @@
break;
}
case CCN_DTAG_MinSuffixComponents:
+ NS_LOG_DEBUG ("MinSuffixComponents");
if (n.m_nestedTags.size()!=1) // should be exactly one UDATA inside this tag
throw CcnbDecodingException ();
interest.SetMinSuffixComponents (
@@ -82,6 +91,7 @@
)));
break;
case CCN_DTAG_MaxSuffixComponents:
+ NS_LOG_DEBUG ("MaxSuffixComponents");
if (n.m_nestedTags.size()!=1) // should be exactly one UDATA inside this tag
throw CcnbDecodingException ();
interest.SetMaxSuffixComponents (
@@ -92,6 +102,7 @@
break;
case CCN_DTAG_Exclude:
{
+ NS_LOG_DEBUG ("Exclude");
// process exclude components
Ptr<CcnxNameComponents> exclude = Create<CcnxNameComponents> ();
@@ -103,6 +114,7 @@
break;
}
case CCN_DTAG_ChildSelector:
+ NS_LOG_DEBUG ("ChildSelector");
if (n.m_nestedTags.size()!=1) // should be exactly one UDATA inside this tag
throw CcnbDecodingException ();
@@ -113,6 +125,7 @@
)));
break;
case CCN_DTAG_AnswerOriginKind:
+ NS_LOG_DEBUG ("AnswerOriginKind");
if (n.m_nestedTags.size()!=1) // should be exactly one UDATA inside this tag
throw CcnbDecodingException ();
interest.SetAnswerOriginKind (
@@ -122,6 +135,7 @@
)));
break;
case CCN_DTAG_Scope:
+ NS_LOG_DEBUG ("Scope");
if (n.m_nestedTags.size()!=1) // should be exactly one UDATA inside this tag
throw CcnbDecodingException ();
interest.SetScope (
@@ -131,16 +145,18 @@
)));
break;
case CCN_DTAG_InterestLifetime:
+ NS_LOG_DEBUG ("InterestLifetime");
if (n.m_nestedTags.size()!=1) // should be exactly one UDATA inside this tag
throw CcnbDecodingException ();
interest.SetInterestLifetime (
boost::any_cast<Time> (
- (*n.m_nestedTags.begin())->accept(
- timestampVisitor
- )));
+ (*n.m_nestedTags.begin())->accept(
+ timestampVisitor
+ )));
break;
case CCN_DTAG_Nonce:
+ NS_LOG_DEBUG ("Nonce");
if (n.m_nestedTags.size()!=1) // should be exactly one UDATA inside this tag
throw CcnbDecodingException ();
@@ -153,6 +169,7 @@
case NDN_DTAG_Nack:
+ NS_LOG_DEBUG ("Nack");
if (n.m_nestedTags.size()!=1) // should be exactly one UDATA inside this tag
throw CcnbDecodingException ();
@@ -162,6 +179,7 @@
break;
case NDN_DTAG_Congested:
+ NS_LOG_DEBUG ("Congested");
if (n.m_nestedTags.size()!=1) // should be exactly one UDATA inside this tag
throw CcnbDecodingException ();
diff --git a/helper/ccnb-parser/visitors/ccnb-parser-timestamp-visitor.cc b/helper/ccnb-parser/visitors/ccnb-parser-timestamp-visitor.cc
index 22965aa..ea4ab00 100644
--- a/helper/ccnb-parser/visitors/ccnb-parser-timestamp-visitor.cc
+++ b/helper/ccnb-parser/visitors/ccnb-parser-timestamp-visitor.cc
@@ -44,7 +44,6 @@
}
uint8_t combo = start[n.m_blobSize-2]; // 4 most significant bits hold 4 least significant bits of number of seconds
seconds = (seconds << 4) | (combo >> 4);
- std::cout << std::hex << (int) start[n.m_blobSize-2] << "\n";
nanoseconds = combo & 0x0F; /*00001111*/ // 4 least significant bits hold 4 most significant bits of number of
nanoseconds = (nanoseconds << 8) | start[n.m_blobSize-1];