21 #ifndef NDN_WIRE_CCNB_SYNTAX_H
22 #define NDN_WIRE_CCNB_SYNTAX_H
25 #include "ns3/nstime.h"
26 #include "ns3/buffer.h"
28 #include "ns3/ndn-common.h"
29 #include "ns3/ndn-name.h"
50 AppendBlockHeader (Buffer::Iterator &start,
size_t value, uint32_t block_type);
58 EstimateBlockHeader (
size_t value);
68 AppendNumber (Buffer::Iterator &start, uint32_t number);
76 EstimateNumber (uint32_t number);
85 AppendCloser (Buffer::Iterator &start);
97 AppendTimestampBlob (Buffer::Iterator &start,
const Time &time);
105 EstimateTimestampBlob (
const Time &time);
120 AppendTaggedBlob (Buffer::Iterator &start, uint32_t dtag,
121 const uint8_t *data,
size_t size);
137 AppendTaggedBlobWithPadding (Buffer::Iterator &start, uint32_t dtag,
139 const uint8_t *data,
size_t size);
148 EstimateTaggedBlob (uint32_t dtag,
size_t size);
165 AppendTaggedBlob (Buffer::Iterator &start, uint32_t dtag,
const T &data);
183 AppendTaggedBlobWithPadding (Buffer::Iterator &start, uint32_t dtag, uint32_t length,
const T &data);
197 AppendString (Buffer::Iterator &start, uint32_t dtag,
198 const std::string &
string);
207 EstimateString (uint32_t dtag,
const std::string &
string);
221 SerializeName (Buffer::Iterator &start,
const Name &name);
229 SerializedSizeName (
const Name &name);
237 DeserializeName (Buffer::Iterator &start);
243 Ccnb::AppendTaggedBlob (Buffer::Iterator &start, uint32_t dtag,
const T &data)
245 return AppendTaggedBlob (start, dtag, reinterpret_cast<const uint8_t*> (&data),
sizeof (data));
250 Ccnb::AppendTaggedBlobWithPadding (Buffer::Iterator &start, uint32_t dtag, uint32_t length,
const T &data)
252 return AppendTaggedBlobWithPadding (start, dtag, length, reinterpret_cast<const uint8_t*> (&data),
sizeof (data));
259 #endif // NDN_WIRE_CCNB_SYNTAX_H
Helper to encode CCNb blocks.