Helper to encode CCNb blocks. More...
#include <wire-ccnb.h>
Public Member Functions | |
template<class T > | |
size_t | AppendTaggedBlob (Buffer::Iterator &start, uint32_t dtag, const T &data) |
Static Public Member Functions | |
static size_t | AppendBlockHeader (Buffer::Iterator &start, size_t value, uint32_t block_type) |
Append CCNB block header. More... | |
static size_t | EstimateBlockHeader (size_t value) |
Estimate size of the CCNB block header. More... | |
static size_t | AppendNumber (Buffer::Iterator &start, uint32_t number) |
Add number in CCNB encoding. More... | |
static size_t | EstimateNumber (uint32_t number) |
Estimate size of the number in CCNB encoding. More... | |
static size_t | AppendCloser (Buffer::Iterator &start) |
Append CCNB closer tag (estimated size is 1) More... | |
static size_t | AppendTimestampBlob (Buffer::Iterator &start, const Time &time) |
Append a binary timestamp as a BLOB using the ccn binary Timestamp representation (12-bit fraction). More... | |
static size_t | EstimateTimestampBlob (const Time &time) |
Estimate size of a binary timestamp as a BLOB using CCNB enconding. More... | |
static size_t | AppendTaggedBlob (Buffer::Iterator &start, uint32_t dtag, const uint8_t *data, size_t size) |
Append a tagged BLOB. More... | |
static size_t | EstimateTaggedBlob (uint32_t dtag, size_t size) |
Estimate size of a tagged BLOB in CCNB enconding. More... | |
template<class T > | |
static size_t | AppendTaggedBlob (Buffer::Iterator &start, uint32_t dtag, const T &data) |
Append value as a tagged BLOB (templated version) More... | |
static size_t | AppendString (Buffer::Iterator &start, uint32_t dtag, const std::string &string) |
Append a tagged string (should be a valid UTF-8 coded string) More... | |
static size_t | EstimateString (uint32_t dtag, const std::string &string) |
Estimate size of the string in CCNB encoding. More... | |
static size_t | SerializeName (Buffer::Iterator &start, const Name &name) |
Append Name in CCNB encoding. More... | |
static size_t | SerializedSizeName (const Name &name) |
Estimate size of Name in CCNB encoding. More... | |
static Ptr< Name > | DeserializeName (Buffer::Iterator &start) |
Deserialize Name from CCNB encodeing. More... | |
Helper to encode CCNb blocks.
Definition at line 38 of file wire-ccnb.h.
|
static |
Append CCNB block header.
start | Buffer to store serialized |
value | dictionary id of the block header |
block_type | Type of CCNB block |
Definition at line 43 of file wire-ccnb.cc.
Referenced by AppendNumber(), AppendString(), AppendTaggedBlob(), and AppendTimestampBlob().
|
static |
Append CCNB closer tag (estimated size is 1)
start | Buffer to store serialized Interest |
Definition at line 97 of file wire-ccnb.cc.
Referenced by AppendString(), and AppendTaggedBlob().
|
static |
Add number in CCNB encoding.
start | Buffer to store serialized NdnInterest |
number | Number to be written |
Definition at line 75 of file wire-ccnb.cc.
References AppendBlockHeader(), and wire::CcnbParser::CCN_UDATA.
|
static |
Append a tagged string (should be a valid UTF-8 coded string)
This is a ccnb-encoded element with containing UDATA as content
start | start iterator of the buffer to append to. |
dtag | is the element's dtab |
string | UTF-8 string to be written |
Definition at line 170 of file wire-ccnb.cc.
References AppendBlockHeader(), AppendCloser(), wire::CcnbParser::CCN_DTAG, and wire::CcnbParser::CCN_UDATA.
|
static |
Append a tagged BLOB.
This is a ccnb-encoded element with containing the BLOB as content
start | start iterator of the buffer to append to. |
dtag | is the element's dtab |
data | points to the binary data |
size | is the size of the data, in bytes |
Definition at line 142 of file wire-ccnb.cc.
References AppendBlockHeader(), AppendCloser(), wire::CcnbParser::CCN_BLOB, and wire::CcnbParser::CCN_DTAG.
Referenced by SerializeName().
|
inlinestatic |
Append value as a tagged BLOB (templated version)
This is a ccnb-encoded element with containing the BLOB as content
Data will be reinterpret_cast<const uint8_t*> and size will be obtained using sizeof
start | start iterator of the buffer to append to. |
dtag | is the element's dtab |
data | a value to add |
|
static |
Append a binary timestamp as a BLOB using the ccn binary Timestamp representation (12-bit fraction).
start | start iterator of the buffer to append to. |
time | - Time object |
Definition at line 104 of file wire-ccnb.cc.
References AppendBlockHeader(), and wire::CcnbParser::CCN_BLOB.
|
static |
Deserialize Name from CCNB encodeing.
start | Buffer that stores serialized Interest |
name | Name object |
Definition at line 214 of file wire-ccnb.cc.
References wire::CcnbParser::Block::ParseBlock().
Referenced by Wire::ToName().
|
static |
Estimate size of the CCNB block header.
value | dictionary id of the block header |
Definition at line 62 of file wire-ccnb.cc.
Referenced by EstimateNumber(), EstimateString(), EstimateTaggedBlob(), and EstimateTimestampBlob().
|
static |
Estimate size of the number in CCNB encoding.
number | Number to be written |
Definition at line 89 of file wire-ccnb.cc.
References EstimateBlockHeader().
|
static |
Estimate size of the string in CCNB encoding.
dtag | is the element's dtab |
string | UTF-8 string to be written |
Definition at line 185 of file wire-ccnb.cc.
References EstimateBlockHeader().
|
static |
Estimate size of a tagged BLOB in CCNB enconding.
dtag | is the element's dtab |
size | is the size of the data, in bytes |
Definition at line 161 of file wire-ccnb.cc.
References EstimateBlockHeader().
Referenced by SerializedSizeName().
|
static |
Estimate size of a binary timestamp as a BLOB using CCNB enconding.
time | - Time object |
Definition at line 131 of file wire-ccnb.cc.
References EstimateBlockHeader().
|
static |
Estimate size of Name in CCNB encoding.
name | constant reference to Name object |
Definition at line 203 of file wire-ccnb.cc.
References EstimateTaggedBlob().
|
static |
Append Name in CCNB encoding.
start | Buffer to store serialized Interest |
name | constant reference to Name object |
Definition at line 191 of file wire-ccnb.cc.
References AppendTaggedBlob().
Referenced by Wire::FromName().