Public Member Functions | Static Public Member Functions | List of all members
ndn::WireFormat Class Reference
Inheritance diagram for ndn::WireFormat:
ndn::Tlv0_1_1WireFormat ndn::Tlv0_1WireFormat ndn::TlvWireFormat

Public Member Functions

virtual Blob encodeName (const Name &name)
 Encode name and return the encoding. More...
 
virtual void decodeName (Name &name, const uint8_t *input, size_t inputLength)
 Decode input as a name and set the fields of the Name object. More...
 
virtual Blob encodeInterest (const Interest &interest, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset)
 Encode interest and return the encoding. More...
 
Blob encodeInterest (const Interest &interest)
 Encode interest 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 and set the fields of the interest object. More...
 
void decodeInterest (Interest &interest, const uint8_t *input, size_t inputLength)
 
virtual Blob encodeData (const Data &data, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset)
 Encode data and return the encoding. More...
 
Blob encodeData (const Data &data)
 Encode data 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 and set the fields in the data object. More...
 
void decodeData (Data &data, const uint8_t *input, size_t inputLength)
 
virtual Blob encodeControlParameters (const ControlParameters &controlParameters)
 Encode controlParameters and return the encoding. More...
 
virtual void decodeControlParameters (ControlParameters &controlParameters, const uint8_t *input, size_t inputLength)
 Decode input as a control parameters and set the fields of the controlParameters object. More...
 
virtual Blob encodeControlResponse (const ControlResponse &controlResponse)
 Encode controlResponse and return the encoding. More...
 
virtual void decodeControlResponse (ControlResponse &controlResponse, const uint8_t *input, size_t inputLength)
 Decode input as a control response and set the fields of the controlResponse object. More...
 
virtual Blob encodeSignatureInfo (const Signature &signature)
 Encode signature as a SignatureInfo and return the encoding. More...
 
virtual Blob encodeSignatureValue (const Signature &signature)
 Encode the signatureValue in the Signature object as a 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 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...
 
virtual Blob encodeDelegationSet (const DelegationSet &delegationSet)
 Encode delegationSet and return the encoding. More...
 
virtual void decodeDelegationSet (DelegationSet &delegationSet, const uint8_t *input, size_t inputLength)
 Decode input as a delegation set and set the fields of the delegationSet object. More...
 
virtual Blob encodeEncryptedContent (const EncryptedContent &encryptedContent)
 Encode encryptedContent and return the encoding. More...
 
virtual void decodeEncryptedContent (EncryptedContent &encryptedContent, const uint8_t *input, size_t inputLength)
 Decode input as an EncryptedContent and set the fields of the encryptedContent object. More...
 

Static Public Member Functions

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...
 

Member Function Documentation

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

Decode input as a control parameters and set the fields of the controlParameters object.

Your derived class should override.

Parameters
controlParametersThe ControlParameters object whose fields are updated.
inputA pointer to the input buffer to decode.
inputLengthThe number of bytes in input.
Exceptions
logic_errorfor unimplemented if the derived class does not override.

Reimplemented in ndn::Tlv0_1_1WireFormat.

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

Decode input as a control response and set the fields of the controlResponse object.

Your derived class should override.

Parameters
controlResponseThe ControlResponse object whose fields are updated.
inputA pointer to the input buffer to decode.
inputLengthThe number of bytes in input.
Exceptions
logic_errorfor unimplemented if the derived class does not override.

Reimplemented in ndn::Tlv0_1_1WireFormat.

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

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

Your derived class should override.

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.
Exceptions
logic_errorfor unimplemented if the derived class does not override.

Reimplemented in ndn::Tlv0_1_1WireFormat.

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

Decode input as a delegation set and set the fields of the delegationSet object.

Your derived class should override.

Parameters
delegationSetThe DelegationSet object whose fields are updated.
inputA pointer to the input buffer to decode.
inputLengthThe number of bytes in input.
Exceptions
logic_errorfor unimplemented if the derived class does not override.

Reimplemented in ndn::Tlv0_1_1WireFormat.

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

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

Your derived class should override.

Parameters
encryptedContentThe EncryptedContent object whose fields are updated.
inputA pointer to the input buffer to decode.
inputLengthThe number of bytes in input.
Exceptions
logic_errorfor unimplemented if the derived class does not override.

Reimplemented in ndn::Tlv0_1_1WireFormat.

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

Decode input as an interest and set the fields of the interest object.

Your derived class should override.

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.
Exceptions
logic_errorfor unimplemented if the derived class does not override.

Reimplemented in ndn::Tlv0_1_1WireFormat.

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

Decode input as a name and set the fields of the Name object.

Your derived class should override.

Parameters
nameThe Name object whose fields are updated.
inputA pointer to the input buffer to decode.
inputLengthThe number of bytes in input.
Exceptions
logic_errorfor unimplemented if the derived class does not override.

Reimplemented in ndn::Tlv0_1_1WireFormat.

ptr_lib::shared_ptr< Signature > ndn::WireFormat::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.

Your derived class should override.

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.
Exceptions
logic_errorfor unimplemented if the derived class does not override.

Reimplemented in ndn::Tlv0_1_1WireFormat.

virtual ptr_lib::shared_ptr<Signature> ndn::WireFormat::decodeSignatureInfoAndValue ( const Blob signatureInfo,
const Blob signatureValue 
)
inlinevirtual

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

Parameters
signatureInfoThe signature input buffer to decode.
signatureValueThe signature value input buffer to decode.
Returns
A new object which is a subclass of Signature.
Blob ndn::WireFormat::encodeControlParameters ( const ControlParameters controlParameters)
virtual

Encode controlParameters and return the encoding.

Your derived class should override.

Parameters
controlParametersThe ControlParameters object to encode.
Returns
A Blob containing the encoding.
Exceptions
logic_errorfor unimplemented if the derived class does not override.

Reimplemented in ndn::Tlv0_1_1WireFormat.

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

Encode controlResponse and return the encoding.

Your derived class should override.

Parameters
controlResponseThe ControlResponse object to encode.
Returns
A Blob containing the encoding.
Exceptions
logic_errorfor unimplemented if the derived class does not override.

Reimplemented in ndn::Tlv0_1_1WireFormat.

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

Encode data and return the encoding.

Your derived class should override.

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.
Exceptions
logic_errorfor unimplemented if the derived class does not override.

Reimplemented in ndn::Tlv0_1_1WireFormat.

Blob ndn::WireFormat::encodeData ( const Data data)
inline

Encode data and return the encoding.

Parameters
dataThe Data object to encode.
Returns
A Blob containing the encoding.
Exceptions
logic_errorfor unimplemented if the derived class does not override.
Blob ndn::WireFormat::encodeDelegationSet ( const DelegationSet delegationSet)
virtual

Encode delegationSet and return the encoding.

Your derived class should override.

Parameters
delegationSetThe DelegationSet object to encode.
Returns
A Blob containing the encoding.
Exceptions
logic_errorfor unimplemented if the derived class does not override.

Reimplemented in ndn::Tlv0_1_1WireFormat.

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

Encode encryptedContent and return the encoding.

Your derived class should override.

Parameters
encryptedContentThe EncryptedContent object to encode.
Returns
A Blob containing the encoding.
Exceptions
logic_errorfor unimplemented if the derived class does not override.

Reimplemented in ndn::Tlv0_1_1WireFormat.

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

Encode interest and return the encoding.

Your derived class should override.

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). If you are not encoding in order to sign, you can call encodeInterest(const Interest& interest) 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 encoding in order to sign, you can call encodeInterest(const Interest& interest) to ignore this returned value.
Returns
A Blob containing the encoding.
Exceptions
logic_errorfor unimplemented if the derived class does not override.

Reimplemented in ndn::Tlv0_1_1WireFormat.

Blob ndn::WireFormat::encodeInterest ( const Interest interest)
inline

Encode interest and return the encoding.

Your derived class should override.

Parameters
interestThe Interest object to encode.
Returns
A Blob containing the encoding.
Exceptions
logic_errorfor unimplemented if the derived class does not override.
Blob ndn::WireFormat::encodeName ( const Name name)
virtual

Encode name and return the encoding.

Your derived class should override.

Parameters
nameThe Name object to encode.
Returns
A Blob containing the encoding.
Exceptions
logic_errorfor unimplemented if the derived class does not override.

Reimplemented in ndn::Tlv0_1_1WireFormat.

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

Encode signature as a SignatureInfo and return the encoding.

Your derived class should override.

Parameters
signatureAn object of a subclass of Signature to encode.
Returns
A Blob containing the encoding.
Exceptions
logic_errorfor unimplemented if the derived class does not override.

Reimplemented in ndn::Tlv0_1_1WireFormat.

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

Encode the signatureValue in the Signature object as a SignatureValue (the signature bits) and return the encoding.

Your derived class should override.

Parameters
signatureAn object of a subclass of Signature with the signature value to encode.
Returns
A Blob containing the encoding.
Exceptions
logic_errorfor unimplemented if the derived class does not override.

Reimplemented in ndn::Tlv0_1_1WireFormat.

WireFormat * ndn::WireFormat::getDefaultWireFormat ( )
static

Return the default WireFormat used by default encoding and decoding methods which was set with setDefaultWireFormat.

Returns
A pointer to the WireFormat object.
static void ndn::WireFormat::setDefaultWireFormat ( WireFormat wireFormat)
inlinestatic

Set the static default WireFormat used by default encoding and decoding methods.

Parameters
wireFormatA Pointer to an object of a subclass of WireFormat. This does not make a copy and the caller must ensure that the object remains allocated.

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