new Tlv0_1_1WireFormat()
A Tlv0_1_1WireFormat implements the WireFormat interface for encoding and
decoding with the NDN-TLV wire format, version 0.1.1.
- Source:
Methods
(static) decodeName(name, decoder) → {object}
Clear the name, decode a Name from the decoder and set the fields of the name
object.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
Name | The name object whose fields are updated. |
decoder |
TlvDecoder | The decoder with the input. |
Returns:
An associative array with fields
(signedPortionBeginOffset, signedPortionEndOffset) where
signedPortionBeginOffset is the offset in the encoding of the beginning of
the signed portion, and signedPortionEndOffset is 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).
- Type
- object
(static) encodeName(name, encoder) → {object}
Encode the name to the encoder.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
Name | The name to encode. |
encoder |
TlvEncoder | The encoder to receive the encoding. |
Returns:
An associative array with fields
(signedPortionBeginOffset, signedPortionEndOffset) where
signedPortionBeginOffset is the offset in the encoding of the beginning of
the signed portion, and signedPortionEndOffset is 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).
- Type
- object
(static) encodeSelectors()
Encode the interest selectors. If no selectors are written, do not output a
Selectors TLV.
(static) encodeSignatureInfo_(signature, encoder)
An internal method to encode signature as the appropriate form of
SignatureInfo in NDN-TLV.
Parameters:
| Name | Type | Description |
|---|---|---|
signature |
Signature | An object of a subclass of Signature to encode. |
encoder |
TlvEncoder | The encoder. |
(static) get() → {Tlv0_1_1WireFormat}
Get a singleton instance of a Tlv0_1_1WireFormat. To always use the
preferred version NDN-TLV, you should use TlvWireFormat.get().
Returns:
The singleton instance.
- Type
- Tlv0_1_1WireFormat
decodeControlParameters(controlParameters, input)
Decode controlParameters in NDN-TLV and return the encoding.
Parameters:
| Name | Type | Description |
|---|---|---|
controlParameters |
ControlParameters | The ControlParameters object to encode. |
input |
Buffer | The buffer with the bytes to decode. |
Throws:
EncodingException For invalid encoding
decodeControlResponse(controlResponse, input)
Decode controlResponse in NDN-TLV and return the encoding.
Parameters:
| Name | Type | Description |
|---|---|---|
controlResponse |
ControlResponse | The ControlResponse object to encode. |
input |
Buffer | The buffer with the bytes to decode. |
Throws:
EncodingException For invalid encoding
decodeData(data, input) → {object}
Decode input as an NDN-TLV data packet, set the fields in the data object,
and return the signed offsets.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Data | The Data object whose fields are updated. |
input |
Buffer | The buffer with the bytes to decode. |
Returns:
An associative array with fields
(signedPortionBeginOffset, signedPortionEndOffset) where
signedPortionBeginOffset is the offset in the encoding of the beginning of
the signed portion, and signedPortionEndOffset is the offset in the encoding
of the end of the signed portion.
- Type
- object
decodeDelegationSet(delegationSet, input)
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.
Parameters:
| Name | Type | Description |
|---|---|---|
delegationSet |
DelegationSet | The DelegationSet object whose fields are updated. |
input |
Buffer | The buffer with the bytes to decode. |
decodeEncryptedContent(encryptedContent, input)
Decode input as an EncryptedContent in NDN-TLV and set the fields of the
encryptedContent object.
Parameters:
| Name | Type | Description |
|---|---|---|
encryptedContent |
EncryptedContent | The EncryptedContent object whose fields are updated. |
input |
Buffer | The buffer with the bytes to decode. |
decodeInterest(interest, input) → {object}
Decode input as an NDN-TLV interest and set the fields of the interest
object.
Parameters:
| Name | Type | Description |
|---|---|---|
interest |
Interest | The Interest object whose fields are updated. |
input |
Buffer | The buffer with the bytes to decode. |
Returns:
An associative array with fields
(signedPortionBeginOffset, signedPortionEndOffset) where
signedPortionBeginOffset is the offset in the encoding of the beginning of
the signed portion, and signedPortionEndOffset is 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).
- Type
- object
decodeLpPacket(lpPacket, input)
Decode input as an NDN-TLV LpPacket and set the fields of the lpPacket object.
Parameters:
| Name | Type | Description |
|---|---|---|
lpPacket |
LpPacket | The LpPacket object whose fields are updated. |
input |
Buffer | The buffer with the bytes to decode. |
decodeName(name, input)
Decode input as a NDN-TLV name and set the fields of the Name object.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
Name | The Name object whose fields are updated. |
input |
Buffer | The buffer with the bytes to decode. |
- Source:
decodeSignatureInfoAndValue(signatureInfo, signatureValue) → {Signature}
Decode signatureInfo as a signature info and signatureValue as the related
SignatureValue, and return a new object which is a subclass of Signature.
Parameters:
| Name | Type | Description |
|---|---|---|
signatureInfo |
Buffer | The buffer with the signature info bytes to decode. |
signatureValue |
Buffer | The buffer with the signature value to decode. |
Returns:
A new object which is a subclass of Signature.
- Type
- Signature
encodeControlParameters(controlParameters) → {Blob}
Encode controlParameters as NDN-TLV and return the encoding.
Parameters:
| Name | Type | Description |
|---|---|---|
controlParameters |
ControlParameters | The ControlParameters object to encode. |
Returns:
A Blob containing the encoding.
- Type
- Blob
encodeControlResponse(controlResponse) → {Blob}
Encode controlResponse as NDN-TLV and return the encoding.
Parameters:
| Name | Type | Description |
|---|---|---|
controlResponse |
ControlResponse | The ControlResponse object to encode. |
Returns:
A Blob containing the encoding.
- Type
- Blob
encodeData(data) → {object}
Encode data as NDN-TLV and return the encoding and signed offsets.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Data | The Data object to encode. |
Returns:
An associative array with fields
(encoding, signedPortionBeginOffset, signedPortionEndOffset) where encoding
is a Blob containing the encoding, signedPortionBeginOffset is the offset in
the encoding of the beginning of the signed portion, and
signedPortionEndOffset is the offset in the encoding of the end of the
signed portion.
- Type
- object
encodeDelegationSet(delegationSet) → {Blob}
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:
| Name | Type | Description |
|---|---|---|
delegationSet |
DelegationSet | The DelegationSet object to encode. |
Returns:
A Blob containing the encoding.
- Type
- Blob
encodeEncryptedContent(encryptedContent) → {Blob}
Encode the EncryptedContent in NDN-TLV and return the encoding.
Parameters:
| Name | Type | Description |
|---|---|---|
encryptedContent |
EncryptedContent | The EncryptedContent object to encode. |
Returns:
A Blob containing the encoding.
- Type
- Blob
encodeInterest(interest) → {object}
Encode the interest using NDN-TLV and return a Buffer.
Parameters:
| Name | Type | Description |
|---|---|---|
interest |
Interest | The Interest object to encode. |
- Source:
Returns:
An associative array with fields
(encoding, signedPortionBeginOffset, signedPortionEndOffset) where encoding
is a Blob containing the encoding, signedPortionBeginOffset is the offset in
the encoding of the beginning of the signed portion, and
signedPortionEndOffset is 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).
- Type
- object
encodeName(interest) → {Blobl}
Encode interest as NDN-TLV and return the encoding.
Parameters:
| Name | Type | Description |
|---|---|---|
interest |
Name | The Name to encode. |
- Source:
Returns:
A Blob containing the encoding.
- Type
- Blobl
encodeSignatureInfo(signature) → {Blob}
Encode signature as a SignatureInfo and return the encoding.
Parameters:
| Name | Type | Description |
|---|---|---|
signature |
Signature | An object of a subclass of Signature to encode. |
Returns:
A Blob containing the encoding.
- Type
- Blob
encodeSignatureValue(signature) → {Blob}
Encode the signatureValue in the Signature object as a SignatureValue (the
signature bits) and return the encoding.
Parameters:
| Name | Type | Description |
|---|---|---|
signature |
Signature | An object of a subclass of Signature with the signature value to encode. |
Returns:
A Blob containing the encoding.
- Type
- Blob