First steps in CCNx packet coding. ccnx_encode* routines rewritten in NS3 style (using NS3::Buffer)
diff --git a/model/ccnx-content-object-header.h b/model/ccnx-content-object-header.h
index 0800885..c26052b 100644
--- a/model/ccnx-content-object-header.h
+++ b/model/ccnx-content-object-header.h
@@ -1,4 +1,4 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2011 University of California, Los Angeles
*
@@ -40,9 +40,13 @@
* Only few important fields are actually implemented in the simulation
*
*
- * NDN ContentObjectHeader and routines to serialize/deserialize
+ * ContentObjectHeader serializes/deserializes header up-to and including <Content> tags
+ * Necessary closing tags should be added using ContentObjectTail
*
- * Simplifications:
+ * This hacks are necessary to optimize memory use (i.e., virtual payload)
+ *
+ * "<ContentObject><Signature>..</Signature><Name>...</Name><SignedInfo>...</SignedInfo><Content>"
+ *
*/
class CcnxContentObjectHeader : public Header
@@ -77,12 +81,6 @@
// ?
// GetSignedInfo () const;
-
- // void
- // SetContent ();
-
- // ?
- // GetContent ();
//////////////////////////////////////////////////////////////////
@@ -97,9 +95,27 @@
Ptr<Name::Components> m_name;
// m_signature;
// m_signedInfo;
- // ? content
};
+/**
+ * ContentObjectTail should always be 2 bytes, representing two closing tags:
+ * "</Content><ContentObject>"
+ */
+class CcnxContentObjectTail : public Header
+{
+public:
+ CcnxContentObjectTail ();
+ //////////////////////////////////////////////////////////////////
+
+ static TypeId GetTypeId (void);
+ virtual TypeId GetInstanceTypeId (void) const;
+ virtual void Print (std::ostream &os) const;
+ virtual uint32_t GetSerializedSize (void) const;
+ virtual void Serialize (Buffer::Iterator start) const;
+ virtual uint32_t Deserialize (Buffer::Iterator start);
+};
+
+
} // namespace ns3
#endif // _CCNX_CONTENT_OBJECT_HEADER_H_