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 
131  virtual Blob
133  (const ControlParameters& controlParameters);
134 
143  virtual void
145  (ControlParameters& controlParameters, const uint8_t *input,
146  size_t inputLength);
147 
153  virtual Blob
154  encodeSignatureInfo(const Signature& signature);
155 
165  virtual ptr_lib::shared_ptr<Signature>
167  (const uint8_t *signatureInfo, size_t signatureInfoLength,
168  const uint8_t *signatureValue, size_t signatureValueLength);
169 
177  virtual Blob
178  encodeSignatureValue(const Signature& signature);
179 
185  static Tlv0_1_1WireFormat*
186  get()
187  {
188  if (!instance_)
189  instance_ = new Tlv0_1_1WireFormat();
190 
191  return instance_;
192  }
193 
194 private:
195  static Tlv0_1_1WireFormat* instance_;
196 };
197 
198 }
199 
200 #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:211
virtual Blob encodeControlParameters(const ControlParameters &controlParameters)
Encode controlParameters as NDN-TLV and return the encoding.
Definition: tlv-0_1_1-wire-format.cpp:169
Copyright (C) 2013-2015 Regents of the University of California.
Definition: common.hpp:35
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:63
Definition: data.hpp:36
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 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:150
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.
Definition: tlv-0_1_1-wire-format.cpp:191
A ControlParameters holds a Name and other fields for a ControlParameters which is used...
Definition: control-parameters.hpp:38
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:42
A Signature is an abstract base class providing methods to work with the signature information in a D...
Definition: signature.hpp:36
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:130
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 encodeName(const Name &name)
Encode name in NDN-TLV and return the encoding.
Definition: tlv-0_1_1-wire-format.cpp:43
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:107
Definition: wire-format.hpp:37
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:230
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:82