tlv-0_1_1-wire-format.hpp
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
22 #ifndef NDN_TLV_0_1_1_WIRE_FORMAT_HPP
23 #define NDN_TLV_0_1_1_WIRE_FORMAT_HPP
24 
25 #include "wire-format.hpp"
26 
27 namespace ndn {
28 
35 public:
41  virtual Blob
42  encodeName(const Name& name);
43 
50  virtual void
51  decodeName(Name& name, const uint8_t *input, size_t inputLength);
52 
66  virtual Blob
68  (const Interest& interest, size_t *signedPortionBeginOffset,
69  size_t *signedPortionEndOffset);
70 
91  virtual void
93  (Interest& interest, const uint8_t *input, size_t inputLength,
94  size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset);
95 
105  virtual Blob
106  encodeData
107  (const Data& data, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset);
108 
121  virtual void
122  decodeData
123  (Data& data, const uint8_t *input, size_t inputLength, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset);
124 
130  virtual Blob
131  encodeControlParameters(const ControlParameters& controlParameters);
132 
141  virtual void
143  (ControlParameters& controlParameters, const uint8_t *input,
144  size_t inputLength);
145 
151  virtual Blob
152  encodeControlResponse(const ControlResponse& controlResponse);
153 
162  virtual void
164  (ControlResponse& controlResponse, const uint8_t *input,
165  size_t inputLength);
166 
172  virtual Blob
173  encodeSignatureInfo(const Signature& signature);
174 
182  virtual Blob
183  encodeSignatureValue(const Signature& signature);
184 
194  virtual ptr_lib::shared_ptr<Signature>
196  (const uint8_t *signatureInfo, size_t signatureInfoLength,
197  const uint8_t *signatureValue, size_t signatureValueLength);
198 
207  virtual Blob
208  encodeDelegationSet(const DelegationSet& delegationSet);
209 
220  virtual void
222  (DelegationSet& delegationSet, const uint8_t *input, size_t inputLength);
223 
229  virtual Blob
230  encodeEncryptedContent(const EncryptedContent& encryptedContent);
231 
240  virtual void
242  (EncryptedContent& encryptedContent, const uint8_t *input,
243  size_t inputLength);
244 
250  static Tlv0_1_1WireFormat*
251  get()
252  {
253  if (!instance_)
254  instance_ = new Tlv0_1_1WireFormat();
255 
256  return instance_;
257  }
258 
259 private:
260  static Tlv0_1_1WireFormat* instance_;
261 };
262 
263 }
264 
265 #endif
virtual Blob encodeSignatureInfo(const Signature &signature)
Encode signature as an NDN-TLV SignatureInfo and return the encoding.
Definition: tlv-0_1_1-wire-format.cpp:250
virtual Blob encodeControlParameters(const ControlParameters &controlParameters)
Encode controlParameters as NDN-TLV and return the encoding.
Definition: tlv-0_1_1-wire-format.cpp:166
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:35
virtual Blob encodeEncryptedContent(const EncryptedContent &encryptedContent)
Encode encryptedContent as NDN-TLV and return the encoding.
Definition: tlv-0_1_1-wire-format.cpp:370
virtual Blob encodeSignatureValue(const Signature &signature)
Encode the signatureValue in the Signature object as an NDN-TLV SignatureValue (the signature bits) a...
Definition: tlv-0_1_1-wire-format.cpp:268
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.
Definition: tlv-0_1_1-wire-format.cpp:62
Definition: data.hpp:37
A Tlv0_1_1WireFormat extends WireFormat to override its virtual methods to implement encoding and dec...
Definition: tlv-0_1_1-wire-format.hpp:34
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...
Definition: tlv-0_1_1-wire-format.cpp:231
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.
Definition: tlv-0_1_1-wire-format.cpp:147
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...
Definition: tlv-0_1_1-wire-format.cpp:391
An EncryptedContent holds an encryption type, a payload and other fields representing encrypted conte...
Definition: encrypted-content.hpp:37
A ControlResponse holds a status code, status text and other fields for a ControlResponse which is us...
Definition: control-response.hpp:37
virtual Blob encodeDelegationSet(const DelegationSet &delegationSet)
Encode delegationSet as a sequence of NDN-TLV Delegation, and return the encoding.
Definition: tlv-0_1_1-wire-format.cpp:318
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...
Definition: tlv-0_1_1-wire-format.cpp:189
A ControlParameters holds a Name and other fields for a ControlParameters which is used...
Definition: control-parameters.hpp:37
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
A Signature is an abstract base class providing methods to work with the signature information in a D...
Definition: signature.hpp:35
virtual Blob encodeData(const Data &data, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset)
Encode data with NDN-TLV and return the encoding.
Definition: tlv-0_1_1-wire-format.cpp:125
A DelegationSet holds a list of DelegationSet::Delegation entries which is used as the content of a L...
Definition: delegation-set.hpp:38
A Blob holds a pointer to an immutable byte array implemented as const std::vector.
Definition: blob.hpp:42
An Interest holds a Name and other fields for an interest.
Definition: interest.hpp:41
virtual Blob encodeControlResponse(const ControlResponse &controlResponse)
Encode controlResponse as NDN-TLV and return the encoding.
Definition: tlv-0_1_1-wire-format.cpp:208
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...
Definition: tlv-0_1_1-wire-format.cpp:345
virtual Blob encodeName(const Name &name)
Encode name in NDN-TLV and return the encoding.
Definition: tlv-0_1_1-wire-format.cpp:42
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. ...
Definition: tlv-0_1_1-wire-format.cpp:104
Definition: wire-format.hpp:39
virtual ptr_lib::shared_ptr< Signature > decodeSignatureInfoAndValue(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.
Definition: tlv-0_1_1-wire-format.cpp:287
virtual Blob encodeInterest(const Interest &interest, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset)
Encode interest in NDN-TLV and return the encoding.
Definition: tlv-0_1_1-wire-format.cpp:79