tlv-0_1_1-wire-format-lite.hpp
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
22 #ifndef NDN_TLV_0_1_1_WIRE_FORMAT_LITE_HPP
23 #define NDN_TLV_0_1_1_WIRE_FORMAT_LITE_HPP
24 
25 #include "../interest-lite.hpp"
26 #include "../data-lite.hpp"
27 #include "../signature-lite.hpp"
28 #include "../control-parameters-lite.hpp"
29 #include "../control-response-lite.hpp"
30 #include "../lp/lp-packet-lite.hpp"
31 #include "../delegation-set-lite.hpp"
32 #include "../encrypt/encrypted-content-lite.hpp"
33 #include "../util/dynamic-uint8-array-lite.hpp"
34 
35 namespace ndn {
36 
42 public:
60  static ndn_Error
62  (const NameLite& name, size_t* signedPortionBeginOffset,
63  size_t* signedPortionEndOffset, DynamicUInt8ArrayLite& output,
64  size_t* encodingLength);
65 
82  static ndn_Error
84  (NameLite& name, const uint8_t* input, size_t inputLength,
85  size_t* signedPortionBeginOffset, size_t* signedPortionEndOffset);
86 
104  static ndn_Error
106  (const InterestLite& interest, size_t* signedPortionBeginOffset,
107  size_t* signedPortionEndOffset, DynamicUInt8ArrayLite& output,
108  size_t* encodingLength);
109 
126  static ndn_Error
128  (InterestLite& interest, const uint8_t* input, size_t inputLength,
129  size_t* signedPortionBeginOffset, size_t* signedPortionEndOffset);
130 
146  static ndn_Error
147  encodeData
148  (const DataLite& data, size_t* signedPortionBeginOffset,
149  size_t* signedPortionEndOffset, DynamicUInt8ArrayLite& output,
150  size_t* encodingLength);
151 
165  static ndn_Error
166  decodeData
167  (DataLite& data, const uint8_t* input, size_t inputLength,
168  size_t* signedPortionBeginOffset, size_t* signedPortionEndOffset);
169 
179  static ndn_Error
181  (const ControlParametersLite& controlParameters,
182  DynamicUInt8ArrayLite& output, size_t* encodingLength);
183 
193  static ndn_Error
195  (ControlParametersLite& controlParameters, const uint8_t* input,
196  size_t inputLength);
197 
207  static ndn_Error
209  (const ControlResponseLite& controlResponse,
210  DynamicUInt8ArrayLite& output, size_t* encodingLength);
211 
221  static ndn_Error
223  (ControlResponseLite& controlResponse, const uint8_t* input,
224  size_t inputLength);
225 
235  static ndn_Error
237  (const SignatureLite& signature, DynamicUInt8ArrayLite& output,
238  size_t* encodingLength);
239 
250  static ndn_Error
252  (const SignatureLite& signature, DynamicUInt8ArrayLite& output,
253  size_t* encodingLength);
254 
265  static ndn_Error
267  (SignatureLite& signature, const uint8_t *signatureInfo,
268  size_t signatureInfoLength, const uint8_t *signatureValue,
269  size_t signatureValueLength);
270 
278  static ndn_Error
280  (LpPacketLite& lpPacket, const uint8_t* input, size_t inputLength);
281 
294  static ndn_Error
296  (const DelegationSetLite::Delegation& delegation,
297  DynamicUInt8ArrayLite& output, size_t offset, size_t* encodingLength);
298 
310  static ndn_Error
312  (DelegationSetLite::Delegation& delegation, const uint8_t* input,
313  size_t inputLength, size_t *encodingLength);
314 
324  static ndn_Error
326  (const EncryptedContentLite& encryptedContent,
327  DynamicUInt8ArrayLite& output, size_t* encodingLength);
328 
338  static ndn_Error
340  (EncryptedContentLite& encryptedContent, const uint8_t* input,
341  size_t inputLength);
342 };
343 
344 }
345 
346 #endif
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:35
A ControlResponseLite holds a status code, status text and other fields for a ControlResponse which i...
Definition: control-response-lite.hpp:35
static ndn_Error encodeInterest(const InterestLite &interest, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset, DynamicUInt8ArrayLite &output, size_t *encodingLength)
Encode interest as NDN-TLV.
Definition: tlv-0_1_1-wire-format-lite.cpp:50
static ndn_Error encodeEncryptedContent(const EncryptedContentLite &encryptedContent, DynamicUInt8ArrayLite &output, size_t *encodingLength)
Encode encryptedContent as an NDN-TLV EncryptedContent.
Definition: tlv-0_1_1-wire-format-lite.cpp:182
A NameLite holds an array of NameLite::Component.
Definition: name-lite.hpp:34
static ndn_Error decodeDelegationSet_Delegation(DelegationSetLite::Delegation &delegation, const uint8_t *input, size_t inputLength, size_t *encodingLength)
Decode input as an NDN-TLV Delegation and set the fields in the delegation object.
Definition: tlv-0_1_1-wire-format-lite.cpp:173
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.
Definition: tlv-0_1_1-wire-format-lite.cpp:71
static ndn_Error encodeDelegationSet_Delegation(const DelegationSetLite::Delegation &delegation, DynamicUInt8ArrayLite &output, size_t offset, size_t *encodingLength)
Encode delegation as an NDN-TLV Delegation.
Definition: tlv-0_1_1-wire-format-lite.cpp:164
A DynamicUInt8ArrayLite holds a pointer to an allocated array, the length of the allocated array...
Definition: dynamic-uint8-array-lite.hpp:35
An InterestLite holds a NameLite and other fields for an interest.
Definition: interest-lite.hpp:35
static ndn_Error decodeLpPacket(LpPacketLite &lpPacket, const uint8_t *input, size_t inputLength)
Decode input as a TLV LpPacket and set the fields in the lpPacket object.
Definition: tlv-0_1_1-wire-format-lite.cpp:157
Definition: lp-packet-lite.hpp:83
A SignatureLite holds a signature type, a KeyLocatorLite, the signature bytes and other fields to rep...
Definition: signature-lite.hpp:36
An EncryptedContentLite holds an encryption type, a payload and other fields representing encrypted c...
Definition: encrypted-content-lite.hpp:36
static ndn_Error encodeSignatureInfo(const SignatureLite &signature, DynamicUInt8ArrayLite &output, size_t *encodingLength)
Encode signature as an NDN-TLV SignatureInfo.
Definition: tlv-0_1_1-wire-format-lite.cpp:128
static ndn_Error encodeName(const NameLite &name, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset, DynamicUInt8ArrayLite &output, size_t *encodingLength)
Encode name as NDN-TLV.
Definition: tlv-0_1_1-wire-format-lite.cpp:29
static ndn_Error decodeName(NameLite &name, const uint8_t *input, size_t inputLength, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset)
Decode input as a name in NDN-TLV and set the fields of the name object.
Definition: tlv-0_1_1-wire-format-lite.cpp:40
static ndn_Error decodeControlResponse(ControlResponseLite &controlResponse, const uint8_t *input, size_t inputLength)
Decode input as a TLV ControlResponse and set the fields in the controlResponse object.
Definition: tlv-0_1_1-wire-format-lite.cpp:119
A Tlv0_1_1WireFormatLite implements implement encoding and decoding using NDN-TLV version 0...
Definition: tlv-0_1_1-wire-format-lite.hpp:41
static ndn_Error decodeEncryptedContent(EncryptedContentLite &encryptedContent, const uint8_t *input, size_t inputLength)
Decode input as a TLV EncryptedContent and set the fields in the encrypted content object...
Definition: tlv-0_1_1-wire-format-lite.cpp:191
A ControlParametersLite holds a Name and other fields for a ControlParameters which is used...
Definition: control-parameters-lite.hpp:37
static ndn_Error decodeControlParameters(ControlParametersLite &controlParameters, const uint8_t *input, size_t inputLength)
Decode input as a TLV ControlParameters and set the fields in the controlParameters object...
Definition: tlv-0_1_1-wire-format-lite.cpp:101
Definition: delegation-set-lite.hpp:32
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. ...
Definition: tlv-0_1_1-wire-format-lite.cpp:61
static ndn_Error encodeControlResponse(const ControlResponseLite &controlResponse, DynamicUInt8ArrayLite &output, size_t *encodingLength)
Encode controlResponse as an NDN-TLV ControlResponse.
Definition: tlv-0_1_1-wire-format-lite.cpp:110
static ndn_Error decodeSignatureInfoAndValue(SignatureLite &signature, const uint8_t *signatureInfo, size_t signatureInfoLength, const uint8_t *signatureValue, size_t signatureValueLength)
Decode signatureInfo as an NDN-TLV signature info and signatureValue as the related SignatureValue...
Definition: tlv-0_1_1-wire-format-lite.cpp:146
static ndn_Error encodeControlParameters(const ControlParametersLite &controlParameters, DynamicUInt8ArrayLite &output, size_t *encodingLength)
Encode controlParameters as an NDN-TLV ControlParameters.
Definition: tlv-0_1_1-wire-format-lite.cpp:92
static ndn_Error encodeSignatureValue(const SignatureLite &signature, DynamicUInt8ArrayLite &output, size_t *encodingLength)
Encode the signatureValue in the Signature object as an NDN-TLV SignatureValue (the signature bits)...
Definition: tlv-0_1_1-wire-format-lite.cpp:137
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.
Definition: tlv-0_1_1-wire-format-lite.cpp:82
A DataLite holds a NameLite and other fields to represent an NDN Data packet.
Definition: data-lite.hpp:34