Fixing bugs with new fields in ContentObject. Implementing basic support of new fields in CcnxProducer
diff --git a/apps/ccnx-producer.cc b/apps/ccnx-producer.cc
index 6e413a0..69c5aea 100644
--- a/apps/ccnx-producer.cc
+++ b/apps/ccnx-producer.cc
@@ -26,6 +26,7 @@
#include "ns3/string.h"
#include "ns3/uinteger.h"
#include "ns3/packet.h"
+#include "ns3/simulator.h"
#include "../model/ccnx-local-face.h"
#include "ns3/ccnx-fib.h"
@@ -57,6 +58,12 @@
UintegerValue (1024),
MakeUintegerAccessor(&CcnxProducer::m_virtualPayloadSize),
MakeUintegerChecker<uint32_t>())
+
+ // optional attributes
+ .AddAttribute ("SignatureBits", "SignatureBits field",
+ UintegerValue (0),
+ MakeUintegerAccessor(&CcnxProducer::m_signatureBits),
+ MakeUintegerChecker<uint32_t> ())
;
return tid;
@@ -107,6 +114,8 @@
static CcnxContentObjectTail tail;
Ptr<CcnxContentObjectHeader> header = Create<CcnxContentObjectHeader> ();
header->SetName (Create<CcnxNameComponents> (interest->GetName ()));
+ header->GetSignedInfo ().SetTimestamp (Simulator::Now ());
+ header->GetSignature ().SetSignatureBits (m_signatureBits);
NS_LOG_INFO ("node("<< GetNode()->GetId() <<") respodning with ContentObject:\n" << boost::cref(*header));
diff --git a/apps/ccnx-producer.h b/apps/ccnx-producer.h
index cf579ab..55e7162 100644
--- a/apps/ccnx-producer.h
+++ b/apps/ccnx-producer.h
@@ -26,6 +26,7 @@
#include "ns3/ptr.h"
#include "ns3/ccnx-name-components.h"
+#include "ns3/ccnx-content-object-header.h"
namespace ns3
{
@@ -52,6 +53,9 @@
private:
CcnxNameComponents m_prefix;
uint32_t m_virtualPayloadSize;
+
+ uint32_t m_signatureBits;
+ // CcnxContentObjectHeader::SignedInfo m_signedInfo;
};
}