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

A Tlv0_1_1WireFormat extends WireFormat to override its virtual methods to implement encoding and decoding using NDN-TLV version 0.1.1. More...

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

Inheritance diagram for ndn::Tlv0_1_1WireFormat:
ndn::WireFormat ndn::Tlv0_1WireFormat ndn::TlvWireFormat

Public Member Functions

virtual Blob encodeName (const Name &name)
 Encode name in NDN-TLV and return the encoding. More...
 
virtual void decodeName (Name &name, const uint8_t *input, size_t inputLength)
 Decode input as a name in NDN-TLV and set the fields of the Name object. More...
 
virtual Blob encodeInterest (const Interest &interest, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset)
 Encode interest in NDN-TLV and return the encoding. More...
 
virtual void decodeInterest (Interest &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...
 
virtual Blob encodeData (const Data &data, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset)
 Encode data with NDN-TLV and return the encoding. More...
 
virtual void decodeData (Data &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...
 
virtual Blob encodeControlParameters (const ControlParameters &controlParameters)
 Encode controlParameters as NDN-TLV and return the encoding. More...
 
virtual void decodeControlParameters (ControlParameters &controlParameters, const uint8_t *input, size_t inputLength)
 Decode input as an NDN-TLV ControlParameters and set the fields of the controlParameters object. More...
 
virtual Blob encodeControlResponse (const ControlResponse &controlResponse)
 Encode controlResponse as NDN-TLV and return the encoding. More...
 
virtual void decodeControlResponse (ControlResponse &controlResponse, const uint8_t *input, size_t inputLength)
 Decode input as an NDN-TLV ControlResponse and set the fields of the controlResponse object. More...
 
virtual Blob encodeSignatureInfo (const Signature &signature)
 Encode signature as an NDN-TLV SignatureInfo and return the encoding. More...
 
virtual Blob encodeSignatureValue (const Signature &signature)
 Encode the signatureValue in the Signature object as an NDN-TLV SignatureValue (the signature bits) and return the encoding. More...
 
virtual ptr_lib::shared_ptr< SignaturedecodeSignatureInfoAndValue (const uint8_t *signatureInfo, size_t signatureInfoLength, const uint8_t *signatureValue, size_t signatureValueLength)
 Decode signatureInfo as a signature info and signatureValue as the related SignatureValue, and return a new object which is a subclass of Signature. More...
 
virtual Blob encodeDelegationSet (const DelegationSet &delegationSet)
 Encode delegationSet as a sequence of NDN-TLV Delegation, and return the encoding. More...
 
virtual void decodeDelegationSet (DelegationSet &delegationSet, const uint8_t *input, size_t inputLength)
 Decode input as a sequence of NDN-TLV Delegation and set the fields of the delegationSet object. More...
 
virtual Blob encodeEncryptedContent (const EncryptedContent &encryptedContent)
 Encode encryptedContent as NDN-TLV and return the encoding. More...
 
virtual void decodeEncryptedContent (EncryptedContent &encryptedContent, const uint8_t *input, size_t inputLength)
 Decode input as an NDN-TLV EncryptedContent and set the fields of the encryptedContent object. More...
 
- Public Member Functions inherited from ndn::WireFormat
Blob encodeInterest (const Interest &interest)
 Encode interest and return the encoding. More...
 
void decodeInterest (Interest &interest, const uint8_t *input, size_t inputLength)
 
Blob encodeData (const Data &data)
 Encode data and return the encoding. More...
 
void decodeData (Data &data, const uint8_t *input, size_t inputLength)
 
virtual ptr_lib::shared_ptr< SignaturedecodeSignatureInfoAndValue (const Blob &signatureInfo, const Blob &signatureValue)
 Decode signatureInfo as a signature info and signatureValue as the related SignatureValue, and return a new object which is a subclass of Signature. More...
 

Static Public Member Functions

static Tlv0_1_1WireFormatget ()
 Get a singleton instance of a Tlv0_1_1WireFormat. More...
 
- Static Public Member Functions inherited from ndn::WireFormat
static void setDefaultWireFormat (WireFormat *wireFormat)
 Set the static default WireFormat used by default encoding and decoding methods. More...
 
static WireFormatgetDefaultWireFormat ()
 Return the default WireFormat used by default encoding and decoding methods which was set with setDefaultWireFormat. More...
 

Detailed Description

A Tlv0_1_1WireFormat extends WireFormat to override its virtual methods to implement encoding and decoding using NDN-TLV version 0.1.1.

To always use the preferred version NDN-TLV, you should use the class TlvWireFormat.

Member Function Documentation

void ndn::Tlv0_1_1WireFormat::decodeControlParameters ( ControlParameters controlParameters,
const uint8_t *  input,
size_t  inputLength 
)
virtual

Decode input as an NDN-TLV ControlParameters and set the fields of the controlParameters object.

Parameters
controlParametersThe ControlParameters object whose fields are updated.
inputA pointer to the input buffer to decode.
inputLengthThe number of bytes in input.

Reimplemented from ndn::WireFormat.

void ndn::Tlv0_1_1WireFormat::decodeControlResponse ( ControlResponse controlResponse,
const uint8_t *  input,
size_t  inputLength 
)
virtual

Decode input as an NDN-TLV ControlResponse and set the fields of the controlResponse object.

Parameters
controlResponseThe ControlResponse object whose fields are updated.
inputA pointer to the input buffer to decode.
inputLengthThe number of bytes in input.

Reimplemented from ndn::WireFormat.

void ndn::Tlv0_1_1WireFormat::decodeData ( Data data,
const uint8_t *  input,
size_t  inputLength,
size_t *  signedPortionBeginOffset,
size_t *  signedPortionEndOffset 
)
virtual

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 call decodeData(Data& data, const uint8_t *input, size_t inputLength) to 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 call decodeData(Data& data, const uint8_t *input, size_t inputLength) to ignore this returned value.

Reimplemented from ndn::WireFormat.

void ndn::Tlv0_1_1WireFormat::decodeDelegationSet ( DelegationSet delegationSet,
const uint8_t *  input,
size_t  inputLength 
)
virtual

Decode input as a sequence of NDN-TLV Delegation and set the fields of the delegationSet object.

Note that the sequence of Delegation does not have an outer TLV type and length because it is intended to use the type and length of a Data packet's Content. This ignores any elements after the sequence of Delegation and before inputLength.

Parameters
delegationSetThe DelegationSet object whose fields are updated.
inputA pointer to the input buffer to decode.
inputLengthThe number of bytes in input.

Reimplemented from ndn::WireFormat.

void ndn::Tlv0_1_1WireFormat::decodeEncryptedContent ( EncryptedContent encryptedContent,
const uint8_t *  input,
size_t  inputLength 
)
virtual

Decode input as an NDN-TLV EncryptedContent and set the fields of the encryptedContent object.

Parameters
encryptedContentThe EncryptedContent object whose fields are updated.
inputA pointer to the input buffer to decode.
inputLengthThe number of bytes in input.

Reimplemented from ndn::WireFormat.

void ndn::Tlv0_1_1WireFormat::decodeInterest ( Interest interest,
const uint8_t *  input,
size_t  inputLength,
size_t *  signedPortionBeginOffset,
size_t *  signedPortionEndOffset 
)
virtual

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). If you are not decoding in order to verify, you can call decodeInterest(Interest& interest, const uint8_t *input, size_t inputLength) to ignore this returned value.
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). If you are not decoding in order to verify, you can call decodeInterest(Interest& interest, const uint8_t *input, size_t inputLength) to ignore this returned value.

Reimplemented from ndn::WireFormat.

void ndn::Tlv0_1_1WireFormat::decodeName ( Name name,
const uint8_t *  input,
size_t  inputLength 
)
virtual

Decode input as a name in NDN-TLV and set the fields of the Name object.

Parameters
nameThe Name object whose fields are updated.
inputA pointer to the input buffer to decode.
inputLengthThe number of bytes in input.

Reimplemented from ndn::WireFormat.

ptr_lib::shared_ptr< Signature > ndn::Tlv0_1_1WireFormat::decodeSignatureInfoAndValue ( const uint8_t *  signatureInfo,
size_t  signatureInfoLength,
const uint8_t *  signatureValue,
size_t  signatureValueLength 
)
virtual

Decode signatureInfo as a signature info and signatureValue as the related SignatureValue, and return a new object which is a subclass of Signature.

Parameters
signatureInfoA pointer to the signature info input buffer to decode.
signatureInfoLengthThe number of bytes in signatureInfo.
signatureValueA pointer to the signature value input buffer to decode.
signatureValueLengthThe number of bytes in signatureValue.
Returns
A new object which is a subclass of Signature.

Reimplemented from ndn::WireFormat.

Blob ndn::Tlv0_1_1WireFormat::encodeControlParameters ( const ControlParameters controlParameters)
virtual

Encode controlParameters as NDN-TLV and return the encoding.

Parameters
controlParametersThe ControlParameters object to encode.
Returns
A Blob containing the encoding.

Reimplemented from ndn::WireFormat.

Blob ndn::Tlv0_1_1WireFormat::encodeControlResponse ( const ControlResponse controlResponse)
virtual

Encode controlResponse as NDN-TLV and return the encoding.

Parameters
controlResponseThe ControlResponse object to encode.
Returns
A Blob containing the encoding.

Reimplemented from ndn::WireFormat.

Blob ndn::Tlv0_1_1WireFormat::encodeData ( const Data data,
size_t *  signedPortionBeginOffset,
size_t *  signedPortionEndOffset 
)
virtual

Encode data with NDN-TLV and return the encoding.

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 call encodeData(const Data& data) to 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 call encodeData(const Data& data) to ignore this returned value.
Returns
A Blob containing the encoding.

Reimplemented from ndn::WireFormat.

Blob ndn::Tlv0_1_1WireFormat::encodeDelegationSet ( const DelegationSet delegationSet)
virtual

Encode delegationSet as a sequence of NDN-TLV Delegation, and return the encoding.

Note that the sequence of Delegation does not have an outer TLV type and length because it is intended to use the type and length of a Data packet's Content.

Parameters
delegationSetThe DelegationSet object to encode.
Returns
A Blob containing the encoding.

Reimplemented from ndn::WireFormat.

Blob ndn::Tlv0_1_1WireFormat::encodeEncryptedContent ( const EncryptedContent encryptedContent)
virtual

Encode encryptedContent as NDN-TLV and return the encoding.

Parameters
encryptedContentThe EncryptedContent object to encode.
Returns
A Blob containing the encoding.

Reimplemented from ndn::WireFormat.

Blob ndn::Tlv0_1_1WireFormat::encodeInterest ( const Interest interest,
size_t *  signedPortionBeginOffset,
size_t *  signedPortionEndOffset 
)
virtual

Encode interest in NDN-TLV and return the encoding.

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).
Returns
A Blob containing the encoding.

Reimplemented from ndn::WireFormat.

Blob ndn::Tlv0_1_1WireFormat::encodeName ( const Name name)
virtual

Encode name in NDN-TLV and return the encoding.

Parameters
nameThe Name object to encode.
Returns
A Blob containing the encoding.

Reimplemented from ndn::WireFormat.

Blob ndn::Tlv0_1_1WireFormat::encodeSignatureInfo ( const Signature signature)
virtual

Encode signature as an NDN-TLV SignatureInfo and return the encoding.

Parameters
signatureAn object of a subclass of Signature to encode.
Returns
A Blob containing the encoding.

Reimplemented from ndn::WireFormat.

Blob ndn::Tlv0_1_1WireFormat::encodeSignatureValue ( const Signature signature)
virtual

Encode the signatureValue in the Signature object as an NDN-TLV SignatureValue (the signature bits) and return the encoding.

Parameters
signatureAn object of a subclass of Signature with the signature value to encode.
Returns
A Blob containing the encoding.

Reimplemented from ndn::WireFormat.

static Tlv0_1_1WireFormat* ndn::Tlv0_1_1WireFormat::get ( )
inlinestatic

Get a singleton instance of a Tlv0_1_1WireFormat.

To always use the preferred version NDN-TLV, you should use TlvWireFormat::get().

Returns
A pointer to the singleton instance.

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