NS-3 based Named Data Networking (NDN) simulator
ndnSIM: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
ns3::ndn::wire::Ccnb Class Reference

Helper to encode CCNb blocks. More...

#include <wire-ccnb.h>

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 AppendTaggedBlobWithPadding (Buffer::Iterator &start, uint32_t dtag, uint32_t length, const uint8_t *data, size_t size)
 Append a tagged BLOB, adding 0-byte padding if necessary. 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...
 
template<class T >
static size_t AppendTaggedBlobWithPadding (Buffer::Iterator &start, uint32_t dtag, uint32_t length, const T &data)
 Append value as a tagged BLOB (templated version), add 0-padding if necessary. 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< NameDeserializeName (Buffer::Iterator &start)
 Deserialize Name from CCNB encodeing. More...
 

Detailed Description

Helper to encode CCNb blocks.

Definition at line 38 of file wire-ccnb.h.

Member Function Documentation

size_t ns3::ndn::wire::Ccnb::AppendBlockHeader ( Buffer::Iterator &  start,
size_t  value,
uint32_t  block_type 
)
static

Append CCNB block header.

Parameters
startBuffer to store serialized
valuedictionary id of the block header
block_typeType of CCNB block
Returns
written length

Definition at line 43 of file wire-ccnb.cc.

size_t ns3::ndn::wire::Ccnb::AppendCloser ( Buffer::Iterator &  start)
static

Append CCNB closer tag (estimated size is 1)

Parameters
startBuffer to store serialized Interest
Returns
written length

Definition at line 97 of file wire-ccnb.cc.

size_t ns3::ndn::wire::Ccnb::AppendNumber ( Buffer::Iterator &  start,
uint32_t  number 
)
static

Add number in CCNB encoding.

Parameters
startBuffer to store serialized NdnInterest
numberNumber to be written
Returns
written length

Definition at line 75 of file wire-ccnb.cc.

size_t ns3::ndn::wire::Ccnb::AppendString ( Buffer::Iterator &  start,
uint32_t  dtag,
const std::string &  string 
)
static

Append a tagged string (should be a valid UTF-8 coded string)

This is a ccnb-encoded element with containing UDATA as content

Parameters
startstart iterator of the buffer to append to.
dtagis the element's dtab
stringUTF-8 string to be written
Returns
written length

Definition at line 199 of file wire-ccnb.cc.

size_t ns3::ndn::wire::Ccnb::AppendTaggedBlob ( Buffer::Iterator &  start,
uint32_t  dtag,
const uint8_t *  data,
size_t  size 
)
static

Append a tagged BLOB.

This is a ccnb-encoded element with containing the BLOB as content

Parameters
startstart iterator of the buffer to append to.
dtagis the element's dtab
datapoints to the binary data
sizeis the size of the data, in bytes
Returns
written length

Definition at line 142 of file wire-ccnb.cc.

template<class T >
size_t ns3::ndn::wire::Ccnb::AppendTaggedBlob ( Buffer::Iterator &  start,
uint32_t  dtag,
const T &  data 
)
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

Parameters
startstart iterator of the buffer to append to.
dtagis the element's dtab
dataa value to add
Returns
written length

Definition at line 243 of file wire-ccnb.h.

size_t ns3::ndn::wire::Ccnb::AppendTaggedBlobWithPadding ( Buffer::Iterator &  start,
uint32_t  dtag,
uint32_t  length,
const uint8_t *  data,
size_t  size 
)
static

Append a tagged BLOB, adding 0-byte padding if necessary.

This is a ccnb-encoded element with containing the BLOB as content

Parameters
startstart iterator of the buffer to append to.
dtagis the element's dtab
lengthminimum required length of the added field (padding added if necessary)
datapoints to the binary data
sizeis the size of the data, in bytes
Returns
written length

Definition at line 161 of file wire-ccnb.cc.

template<class T >
size_t ns3::ndn::wire::Ccnb::AppendTaggedBlobWithPadding ( Buffer::Iterator &  start,
uint32_t  dtag,
uint32_t  length,
const T &  data 
)
inlinestatic

Append value as a tagged BLOB (templated version), add 0-padding if necessary.

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

Parameters
startstart iterator of the buffer to append to.
dtagis the element's dtab
lengthminimum required length of the field
dataa value to add
Returns
written length

Definition at line 250 of file wire-ccnb.h.

size_t ns3::ndn::wire::Ccnb::AppendTimestampBlob ( Buffer::Iterator &  start,
const Time &  time 
)
static

Append a binary timestamp as a BLOB using the ccn binary Timestamp representation (12-bit fraction).

Parameters
startstart iterator of the buffer to append to.
time- Time object
Returns
written length

Definition at line 104 of file wire-ccnb.cc.

Ptr< Name > ns3::ndn::wire::Ccnb::DeserializeName ( Buffer::Iterator &  start)
static

Deserialize Name from CCNB encodeing.

Parameters
startBuffer that stores serialized Interest
nameName object

Definition at line 247 of file wire-ccnb.cc.

size_t ns3::ndn::wire::Ccnb::EstimateBlockHeader ( size_t  value)
static

Estimate size of the CCNB block header.

Parameters
valuedictionary id of the block header
Returns
estimated length

Definition at line 62 of file wire-ccnb.cc.

size_t ns3::ndn::wire::Ccnb::EstimateNumber ( uint32_t  number)
static

Estimate size of the number in CCNB encoding.

Parameters
numberNumber to be written
Returns
estimated length

Definition at line 89 of file wire-ccnb.cc.

size_t ns3::ndn::wire::Ccnb::EstimateString ( uint32_t  dtag,
const std::string &  string 
)
static

Estimate size of the string in CCNB encoding.

Parameters
dtagis the element's dtab
stringUTF-8 string to be written
Returns
estimated length

Definition at line 214 of file wire-ccnb.cc.

size_t ns3::ndn::wire::Ccnb::EstimateTaggedBlob ( uint32_t  dtag,
size_t  size 
)
static

Estimate size of a tagged BLOB in CCNB enconding.

Parameters
dtagis the element's dtab
sizeis the size of the data, in bytes
Returns
estimated length

Definition at line 190 of file wire-ccnb.cc.

size_t ns3::ndn::wire::Ccnb::EstimateTimestampBlob ( const Time &  time)
static

Estimate size of a binary timestamp as a BLOB using CCNB enconding.

Parameters
time- Time object
Returns
estimated length

Definition at line 131 of file wire-ccnb.cc.

size_t ns3::ndn::wire::Ccnb::SerializedSizeName ( const Name name)
static

Estimate size of Name in CCNB encoding.

Parameters
nameconstant reference to Name object
Returns
estimated length

Definition at line 234 of file wire-ccnb.cc.

size_t ns3::ndn::wire::Ccnb::SerializeName ( Buffer::Iterator &  start,
const Name name 
)
static

Append Name in CCNB encoding.

Parameters
startBuffer to store serialized Interest
nameconstant reference to Name object
Returns
written length

Definition at line 220 of file wire-ccnb.cc.

References ns3::ndn::Blob::buf().


The documentation for this class was generated from the following files: