Static Public Member Functions | List of all members
ndn::Tlv0_1_1WireFormatLite Class Reference

A Tlv0_1_1WireFormatLite implements implement encoding and decoding using NDN-TLV version 0.1.1. More...

#include <tlv-0_1_1-wire-format-lite.hpp>

Static Public Member Functions

static ndn_Error encodeInterest (const InterestLite &interest, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset, DynamicUInt8ArrayLite &output, size_t *encodingLength)
 Encode interest as NDN-TLV. More...
 
static ndn_Error decodeInterest (InterestLite &interest, const uint8_t *input, size_t inputLength, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset)
 Decode input as an interest in NDN-TLV and set the fields of the interest object. More...
 
static ndn_Error encodeData (const DataLite &data, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset, DynamicUInt8ArrayLite &output, size_t *encodingLength)
 Encode the data packet as NDN-TLV. More...
 
static ndn_Error decodeData (DataLite &data, const uint8_t *input, size_t inputLength, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset)
 Decode input as a data packet in NDN-TLV and set the fields in the data object. More...
 

Detailed Description

A Tlv0_1_1WireFormatLite implements implement encoding and decoding using NDN-TLV version 0.1.1.

Member Function Documentation

ndn_Error ndn::Tlv0_1_1WireFormatLite::decodeData ( DataLite data,
const uint8_t *  input,
size_t  inputLength,
size_t *  signedPortionBeginOffset,
size_t *  signedPortionEndOffset 
)
static

Decode input as a data packet in NDN-TLV and set the fields in the data object.

Parameters
dataThe data object whose fields are updated.
inputA pointer to the input buffer to decode.
inputLengthThe number of bytes in input.
signedPortionBeginOffsetReturn the offset in the input buffer of the beginning of the signed portion. If you are not decoding in order to verify, you can ignore this returned value.
signedPortionEndOffsetReturn the offset in the input buffer of the end of the signed portion. If you are not decoding in order to verify, you can ignore this returned value.
Returns
0 for success, else an error code.
ndn_Error ndn::Tlv0_1_1WireFormatLite::decodeInterest ( InterestLite interest,
const uint8_t *  input,
size_t  inputLength,
size_t *  signedPortionBeginOffset,
size_t *  signedPortionEndOffset 
)
static

Decode input as an interest in NDN-TLV and set the fields of the interest object.

Parameters
interestThe Interest object whose fields are updated.
inputA pointer to the input buffer to decode.
inputLengthThe number of bytes in input.
signedPortionBeginOffsetReturn the offset in the encoding of the beginning of the signed portion. The signed portion starts from the first name component and ends just before the final name component (which is assumed to be a signature for a signed interest).
signedPortionEndOffsetReturn the offset in the encoding of the end of the signed portion. The signed portion starts from the first name component and ends just before the final name component (which is assumed to be a signature for a signed interest).
Returns
0 for success, else an error code.
ndn_Error ndn::Tlv0_1_1WireFormatLite::encodeData ( const DataLite data,
size_t *  signedPortionBeginOffset,
size_t *  signedPortionEndOffset,
DynamicUInt8ArrayLite output,
size_t *  encodingLength 
)
static

Encode the data packet as NDN-TLV.

Parameters
dataThe data object to encode.
signedPortionBeginOffsetReturn the offset in the encoding of the beginning of the signed portion. If you are not encoding in order to sign, you can ignore this returned value.
signedPortionEndOffsetReturn the offset in the encoding of the end of the signed portion. If you are not encoding in order to sign, you can ignore this returned value.
outputA DynamicUInt8ArrayLite object which receives the encoded output. If the output's reallocFunction is null, its array must be large enough to receive the entire encoding.
encodingLengthSet encodingLength to the length of the encoded output.
Returns
0 for success, else an error code.
ndn_Error ndn::Tlv0_1_1WireFormatLite::encodeInterest ( const InterestLite interest,
size_t *  signedPortionBeginOffset,
size_t *  signedPortionEndOffset,
DynamicUInt8ArrayLite output,
size_t *  encodingLength 
)
static

Encode interest as NDN-TLV.

Parameters
interestThe interest object to encode.
signedPortionBeginOffsetReturn the offset in the encoding of the beginning of the signed portion. The signed portion starts from the first name component and ends just before the final name component (which is assumed to be a signature for a signed interest).
signedPortionEndOffsetReturn the offset in the encoding of the end of the signed portion. The signed portion starts from the first name component and ends just before the final name component (which is assumed to be a signature for a signed interest).
outputA DynamicUInt8ArrayLite object which receives the encoded output. If the output's reallocFunction is null, its array must be large enough to receive the entire encoding.
encodingLengthSet encodingLength to the length of the encoded output.
Returns
0 for success, else an error code.

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