Adding support for Timestamp and Freshness in ContentObject
diff --git a/model/ccnx-content-object-header.cc b/model/ccnx-content-object-header.cc
index 767d512..ca013e8 100644
--- a/model/ccnx-content-object-header.cc
+++ b/model/ccnx-content-object-header.cc
@@ -61,6 +61,31 @@
return *m_name;
}
+void
+CcnxContentObjectHeader::SetTimestamp (const Time ×tamp)
+{
+ m_signedInfo.m_timestamp = timestamp;
+}
+
+Time
+CcnxContentObjectHeader::GetTimestamp () const
+{
+ return m_signedInfo.m_timestamp;
+}
+
+void
+CcnxContentObjectHeader::SetFreshness (const Time &freshness)
+{
+ m_signedInfo.m_freshness = freshness;
+}
+
+Time
+CcnxContentObjectHeader::GetFreshness () const
+{
+ return m_signedInfo.m_freshness;
+}
+
+
uint32_t
CcnxContentObjectHeader::GetSerializedSize (void) const
{
diff --git a/model/ccnx-content-object-header.h b/model/ccnx-content-object-header.h
index f71e483..324f766 100644
--- a/model/ccnx-content-object-header.h
+++ b/model/ccnx-content-object-header.h
@@ -25,6 +25,7 @@
#include "ns3/integer.h"
#include "ns3/header.h"
#include "ns3/trailer.h"
+#include "ns3/nstime.h"
#include <string>
#include <vector>
@@ -77,11 +78,17 @@
// ?
// GetSignature () const;
- // void
- // SetSignedInfo ();
+ void
+ SetTimestamp (const Time ×tamp);
- // ?
- // GetSignedInfo () const;
+ Time
+ GetTimestamp () const;
+
+ void
+ SetFreshness (const Time &freshness);
+
+ Time
+ GetFreshness () const;
//////////////////////////////////////////////////////////////////
@@ -92,10 +99,20 @@
virtual void Serialize (Buffer::Iterator start) const;
virtual uint32_t Deserialize (Buffer::Iterator start);
+ struct SignedInfo
+ {
+ // PublisherPublicKeyDigest
+ Time m_timestamp;
+ // Type (ContentType)
+ Time m_freshness;
+ // FinalBlockID
+ // KeyLocator
+ };
+
private:
- Ptr<CcnxNameComponents> m_name;
// m_signature;
- // m_signedInfo;
+ Ptr<CcnxNameComponents> m_name;
+ SignedInfo m_signedInfo;
};
/**