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

A BinaryXmlWireFormat extends WireFormat to override its virtual methods to implement encoding and decoding using binary XML. More...

#include <binary-xml-wire-format.hpp>

Inheritance diagram for ndn::BinaryXmlWireFormat:
ndn::WireFormat

Public Member Functions

virtual Blob encodeName (const Name &name)
 Encode name in binary XML and return the encoding. More...
 
virtual void decodeName (Name &name, const uint8_t *input, size_t inputLength)
 Decode input as a name in binary XML and set the fields of the Name object. More...
 
virtual Blob encodeInterest (const Interest &interest, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset)
 Encode interest in binary XML 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 binary XML and set the fields of the interest object. More...
 
virtual Blob encodeData (const Data &data, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset)
 Encode data with binary XML 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 binary XML and set the fields in the data object. More...
 
virtual Blob encodeForwardingEntry (const ForwardingEntry &forwardingEntry)
 Encode forwardingEntry in binary XML and return the encoding. More...
 
virtual void decodeForwardingEntry (ForwardingEntry &forwardingEntry, const uint8_t *input, size_t inputLength)
 Decode input as a forwarding entry in binary XML and set the fields of the forwardingEntry 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 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 command parameters and set the fields of the controlParameters object. More...
 
virtual Blob encodeSignatureInfo (const Signature &signature)
 Encode signature as a SignatureInfo 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 encodeSignatureValue (const Signature &signature)
 Encode the signatureValue in the Signature object as a SignatureValue (the signature bits) and return the encoding. More...
 

Static Public Member Functions

static BinaryXmlWireFormatget ()
 Get a singleton instance of a BinaryXmlWireFormat. 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...
 

Additional Inherited Members

- Static Public Attributes inherited from ndn::WireFormat
static bool ENABLE_NDNX = false
 NDNx support and binary XML (ccnb or ndnb) encoding is deprecated and code with throw an exception. More...
 

Detailed Description

A BinaryXmlWireFormat extends WireFormat to override its virtual methods to implement encoding and decoding using binary XML.

Member Function Documentation

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

Decode input as a data packet in binary XML 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::BinaryXmlWireFormat::decodeForwardingEntry ( ForwardingEntry forwardingEntry,
const uint8_t *  input,
size_t  inputLength 
)
virtual

Decode input as a forwarding entry in binary XML and set the fields of the forwardingEntry object.

Parameters
forwardingEntryThe ForwardingEntry 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::BinaryXmlWireFormat::decodeInterest ( Interest interest,
const uint8_t *  input,
size_t  inputLength,
size_t *  signedPortionBeginOffset,
size_t *  signedPortionEndOffset 
)
virtual

Decode input as an interest in binary XML 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::BinaryXmlWireFormat::decodeName ( Name name,
const uint8_t *  input,
size_t  inputLength 
)
virtual

Decode input as a name in binary XML 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.

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

Encode data with binary XML 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::BinaryXmlWireFormat::encodeForwardingEntry ( const ForwardingEntry forwardingEntry)
virtual

Encode forwardingEntry in binary XML and return the encoding.

Parameters
forwardingEntryThe ForwardingEntry object to encode.
Returns
A Blob containing the encoding.

Reimplemented from ndn::WireFormat.

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

Encode interest in binary XML 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::BinaryXmlWireFormat::encodeName ( const Name name)
virtual

Encode name in binary XML and return the encoding.

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

Reimplemented from ndn::WireFormat.

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

Get a singleton instance of a BinaryXmlWireFormat.

Assuming that the default wire format was set with WireFormat::setDefaultWireFormat(BinaryXmlWireFormat::get()), you can check if this is the default wire encoding with if (WireFormat::getDefaultWireFormat() == BinaryXmlWireFormat::get()).

Returns
A pointer to the singleton instance.

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