blob: fec8658fd0a22dc2efeb9afac8f7d0b8fb37869a [file] [log] [blame]
Alexander Afanasyevc169a812014-05-20 20:37:29 -04001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Jeff Thompson5cae5e52013-07-10 19:41:20 -07002/**
Alexander Afanasyevc169a812014-05-20 20:37:29 -04003 * Copyright (c) 2013-2014 Regents of the University of California.
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -07004 *
5 * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -07006 *
Alexander Afanasyevc169a812014-05-20 20:37:29 -04007 * ndn-cxx library is free software: you can redistribute it and/or modify it under the
8 * terms of the GNU Lesser General Public License as published by the Free Software
9 * Foundation, either version 3 of the License, or (at your option) any later version.
10 *
11 * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14 *
15 * You should have received copies of the GNU General Public License and GNU Lesser
16 * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17 * <http://www.gnu.org/licenses/>.
18 *
19 * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
Jeff Thompson5cae5e52013-07-10 19:41:20 -070020 */
21
Jeff Thompson56ec9e22013-08-02 11:34:07 -070022#ifndef NDN_DATA_HPP
Jeff Thompsona0d18c92013-08-06 13:55:32 -070023#define NDN_DATA_HPP
Jeff Thompson5cae5e52013-07-10 19:41:20 -070024
Jeff Thompson46bd45f2013-08-08 16:46:41 -070025#include "common.hpp"
Jeff Thompson53412192013-08-06 13:35:50 -070026#include "name.hpp"
Alexander Afanasyevfadc97d2014-01-03 13:22:10 -080027#include "encoding/block.hpp"
Jeff Thompson25b4e612013-10-10 16:03:24 -070028
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -080029#include "signature.hpp"
30#include "meta-info.hpp"
31#include "key-locator.hpp"
Alexander Afanasyev6d48bc12014-02-18 00:10:51 -080032#include "management/nfd-local-control-header.hpp"
Jeff Thompson5cae5e52013-07-10 19:41:20 -070033
34namespace ndn {
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -070035
Junxiao Shic2b8d242014-11-04 08:35:29 -070036/** @brief represents a Data packet
37 */
Alexander Afanasyev0222fba2014-02-09 23:16:02 -080038class Data : public enable_shared_from_this<Data>
39{
Jeff Thompson5cae5e52013-07-10 19:41:20 -070040public:
Junxiao Shic2b8d242014-11-04 08:35:29 -070041 class Error : public tlv::Error
Alexander Afanasyevff2d08f2014-04-07 18:28:25 -070042 {
43 public:
44 explicit
45 Error(const std::string& what)
Junxiao Shic2b8d242014-11-04 08:35:29 -070046 : tlv::Error(what)
Alexander Afanasyevff2d08f2014-04-07 18:28:25 -070047 {
48 }
49 };
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -070050
Jeff Thompson20af0732013-09-12 17:01:45 -070051 /**
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -080052 * @brief Create an empty Data object
Alexander Afanasyev770827c2014-05-13 17:42:55 -070053 *
54 * Note that in certain contexts that use Data::shared_from_this(), Data must be
55 * created using `make_shared`:
56 *
57 * shared_ptr<Data> data = make_shared<Data>();
58 *
59 * Otherwise, Data::shared_from_this() will throw an exception.
Jeff Thompson20af0732013-09-12 17:01:45 -070060 */
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -080061 Data();
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -070062
Jeff Thompson20af0732013-09-12 17:01:45 -070063 /**
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -080064 * @brief Create a new Data object with the given name
Alexander Afanasyev770827c2014-05-13 17:42:55 -070065 *
66 * @param name A reference to the name
67 *
68 * Note that in certain contexts that use Data::shared_from_this(), Data must be
69 * created using `make_shared`:
70 *
71 * shared_ptr<Data> data = make_shared<Data>(name);
72 *
73 * Otherwise, Data::shared_from_this() will throw an exception.
Jeff Thompson20af0732013-09-12 17:01:45 -070074 */
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -080075 Data(const Name& name);
Alexander Afanasyev6d48bc12014-02-18 00:10:51 -080076
77 /**
78 * @brief Create a new Data object from wire encoding
Alexander Afanasyev770827c2014-05-13 17:42:55 -070079 *
80 * Note that in certain contexts that use Data::shared_from_this(), Data must be
81 * created using `make_shared`:
82 *
83 * shared_ptr<Data> data = make_shared<Data>(wire);
84 *
85 * Otherwise, Data::shared_from_this() will throw an exception.
Alexander Afanasyev6d48bc12014-02-18 00:10:51 -080086 */
87 explicit
Alexander Afanasyev197e5652014-06-13 16:56:31 -070088 Data(const Block& wire);
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -070089
Jeff Thompson25bfdca2013-10-16 17:05:41 -070090 /**
Alexander Afanasyev809805d2014-02-17 17:20:33 -080091 * @brief Fast encoding or block size estimation
Alexander Afanasyev197e5652014-06-13 16:56:31 -070092 *
93 * @param block EncodingEstimator or EncodingBuffer instance
94 * @param wantUnsignedPortionOnly Request only unsigned portion to be encoded in block.
95 * If true, only Name, MetaInfo, Content, and SignatureInfo
96 * blocks will be encoded into the block. Note that there
97 * will be no outer TLV header of the Data packet.
Jeff Thompsonb7aefa002013-09-16 18:22:00 -070098 */
Alexander Afanasyev809805d2014-02-17 17:20:33 -080099 template<bool T>
Alexander Afanasyevff2d08f2014-04-07 18:28:25 -0700100 size_t
Alexander Afanasyev197e5652014-06-13 16:56:31 -0700101 wireEncode(EncodingImpl<T>& block, bool wantUnsignedPortionOnly = false) const;
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700102
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800103 /**
Alexander Afanasyev809805d2014-02-17 17:20:33 -0800104 * @brief Encode to a wire format
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800105 */
Alexander Afanasyevff2d08f2014-04-07 18:28:25 -0700106 const Block&
Alexander Afanasyev809805d2014-02-17 17:20:33 -0800107 wireEncode() const;
108
109 /**
Alexander Afanasyev197e5652014-06-13 16:56:31 -0700110 * @brief Finalize Data packet encoding with the specified SignatureValue
111 *
112 * @param encoder EncodingBuffer instance, containing Name, MetaInfo, Content, and
113 * SignatureInfo (without outer TLV header of the Data packet).
114 * @param signatureValue SignatureValue block to be added to Data packet to finalize
115 * the wire encoding
116 *
117 * This method is intended to be used in concert with Data::wireEncode(EncodingBuffer&, true)
118 * method to optimize Data packet wire format creation:
119 *
120 * Data data;
121 * ...
122 * EncodingBuffer encoder;
123 * data.wireEncode(encoder, true);
124 * ...
125 * Block signatureValue = <sign_over_unsigned_portion>(encoder.buf(), encoder.size());
126 * data.wireEncode(encoder, signatureValue)
127 */
128 const Block&
129 wireEncode(EncodingBuffer& encoder, const Block& signatureValue) const;
130
131 /**
Alexander Afanasyev809805d2014-02-17 17:20:33 -0800132 * @brief Decode from the wire format
133 */
Alexander Afanasyevff2d08f2014-04-07 18:28:25 -0700134 void
135 wireDecode(const Block& wire);
Alexander Afanasyevfadc97d2014-01-03 13:22:10 -0800136
Alexander Afanasyev6d48bc12014-02-18 00:10:51 -0800137 /**
Alexander Afanasyev770827c2014-05-13 17:42:55 -0700138 * @brief Check if Data is already has wire encoding
Alexander Afanasyev6d48bc12014-02-18 00:10:51 -0800139 */
Alexander Afanasyevff2d08f2014-04-07 18:28:25 -0700140 bool
Alexander Afanasyev6d48bc12014-02-18 00:10:51 -0800141 hasWire() const;
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700142
143 ////////////////////////////////////////////////////////////////////
144
Alexander Afanasyev770827c2014-05-13 17:42:55 -0700145 /**
146 * @brief Get name of the Data packet
147 */
Alexander Afanasyevff2d08f2014-04-07 18:28:25 -0700148 const Name&
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800149 getName() const;
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700150
Jeff Thompson5cae5e52013-07-10 19:41:20 -0700151 /**
Alexander Afanasyev770827c2014-05-13 17:42:55 -0700152 * @brief Set name to a copy of the given Name
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800153 *
Alexander Afanasyev770827c2014-05-13 17:42:55 -0700154 * @return This Data so that you can chain calls to update values
Jeff Thompson0cd8c4a2013-09-13 17:46:40 -0700155 */
Alexander Afanasyev770827c2014-05-13 17:42:55 -0700156 Data&
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800157 setName(const Name& name);
158
Alexander Afanasyev809805d2014-02-17 17:20:33 -0800159 //
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700160
Alexander Afanasyev770827c2014-05-13 17:42:55 -0700161 /**
Alexander Afanasyev3b703102014-06-13 17:01:14 -0700162 * @brief Get full name of Data packet, including the implicit digest
163 *
164 * @throws Error if Data packet doesn't have a full name yet (wire encoding has not been
165 * yet created)
166 */
167 const Name&
168 getFullName() const;
169
170 /**
Alexander Afanasyev770827c2014-05-13 17:42:55 -0700171 * @brief Get MetaInfo block from Data packet
172 */
Alexander Afanasyevff2d08f2014-04-07 18:28:25 -0700173 const MetaInfo&
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800174 getMetaInfo() const;
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700175
Jeff Thompson0cd8c4a2013-09-13 17:46:40 -0700176 /**
Alexander Afanasyev770827c2014-05-13 17:42:55 -0700177 * @brief Set metaInfo to a copy of the given MetaInfo
178 *
Jeff Thompson6d591972013-10-17 11:16:32 -0700179 * @return This Data so that you can chain calls to update values.
Jeff Thompson0cd8c4a2013-09-13 17:46:40 -0700180 */
Alexander Afanasyev770827c2014-05-13 17:42:55 -0700181 Data&
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800182 setMetaInfo(const MetaInfo& metaInfo);
Jeff Thompson46bd45f2013-08-08 16:46:41 -0700183
Alexander Afanasyev809805d2014-02-17 17:20:33 -0800184 //
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700185
Alexander Afanasyev809805d2014-02-17 17:20:33 -0800186 ///////////////////////////////////////////////////////////////
187 ///////////////////////////////////////////////////////////////
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800188 ///////////////////////////////////////////////////////////////
189 // MetaInfo proxy methods
Alexander Afanasyev809805d2014-02-17 17:20:33 -0800190
Alexander Afanasyevff2d08f2014-04-07 18:28:25 -0700191 uint32_t
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800192 getContentType() const;
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700193
Alexander Afanasyev770827c2014-05-13 17:42:55 -0700194 Data&
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800195 setContentType(uint32_t type);
Alexander Afanasyev809805d2014-02-17 17:20:33 -0800196
197 //
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700198
Alexander Afanasyevff2d08f2014-04-07 18:28:25 -0700199 const time::milliseconds&
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800200 getFreshnessPeriod() const;
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700201
Alexander Afanasyev770827c2014-05-13 17:42:55 -0700202 Data&
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700203 setFreshnessPeriod(const time::milliseconds& freshnessPeriod);
Alexander Afanasyev95b0e342014-02-12 21:34:44 -0800204
Alexander Afanasyev809805d2014-02-17 17:20:33 -0800205 //
206
Alexander Afanasyevff2d08f2014-04-07 18:28:25 -0700207 const name::Component&
Alexander Afanasyev95b0e342014-02-12 21:34:44 -0800208 getFinalBlockId() const;
209
Alexander Afanasyev770827c2014-05-13 17:42:55 -0700210 Data&
Alexander Afanasyev95b0e342014-02-12 21:34:44 -0800211 setFinalBlockId(const name::Component& finalBlockId);
Alexander Afanasyev809805d2014-02-17 17:20:33 -0800212
213 //
214 ///////////////////////////////////////////////////////////////
215 ///////////////////////////////////////////////////////////////
216 ///////////////////////////////////////////////////////////////
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700217
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800218 /**
219 * @brief Get content Block
220 *
221 * To access content value, one can use value()/value_size() or
222 * value_begin()/value_end() methods of the Block class
223 */
Alexander Afanasyevff2d08f2014-04-07 18:28:25 -0700224 const Block&
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800225 getContent() const;
Alexander Afanasyevfadc97d2014-01-03 13:22:10 -0800226
Jeff Thompson0899c0f2013-09-12 12:15:31 -0700227 /**
Alexander Afanasyev770827c2014-05-13 17:42:55 -0700228 * @brief Set the content from the buffer (buffer will be copied)
229 *
230 * @param buffer Pointer to first byte of the buffer
231 * @param bufferSize Size of the buffer
232 *
Jeff Thompson6d591972013-10-17 11:16:32 -0700233 * @return This Data so that you can chain calls to update values.
Jeff Thompson0899c0f2013-09-12 12:15:31 -0700234 */
Alexander Afanasyev770827c2014-05-13 17:42:55 -0700235 Data&
236 setContent(const uint8_t* buffer, size_t bufferSize);
Alexander Afanasyevfadc97d2014-01-03 13:22:10 -0800237
Alexander Afanasyev770827c2014-05-13 17:42:55 -0700238 /**
239 * @brief Set the content from the block
240 *
241 * Depending on type of the supplied block, there are two cases:
242 *
Steve DiBenedetto54ce6682014-07-22 13:22:57 -0600243 * - if block.type() == tlv::Content, then block will be used directly as Data packet's
Alexander Afanasyev770827c2014-05-13 17:42:55 -0700244 * content (no extra copying)
245 *
Steve DiBenedetto54ce6682014-07-22 13:22:57 -0600246 * - if block.type() != tlv::Content, then this method will create a new Block with type
247 * tlv::Content and put block as a nested element in the content Block.
Alexander Afanasyev770827c2014-05-13 17:42:55 -0700248 *
249 * @param block The Block containing the content to assign
250 *
251 * @return This Data so that you can chain calls to update values.
252 */
253 Data&
254 setContent(const Block& block);
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800255
Alexander Afanasyev770827c2014-05-13 17:42:55 -0700256 /**
257 * @brief Set the content from the pointer to immutable buffer
258 *
Steve DiBenedetto54ce6682014-07-22 13:22:57 -0600259 * This method will create a Block with tlv::Content and set contentValue as a payload
Alexander Afanasyev770827c2014-05-13 17:42:55 -0700260 * for this block. Note that this method is very different from setContent(const
261 * Block&), since it does not require that payload should be a valid TLV element.
262 *
263 * @param contentValue The pointer to immutable buffer containing the content to assign
264 *
265 * @return This Data so that you can chain calls to update values.
266 */
267 Data&
Alexander Afanasyevff2d08f2014-04-07 18:28:25 -0700268 setContent(const ConstBufferPtr& contentValue);
Alexander Afanasyev809805d2014-02-17 17:20:33 -0800269
270 //
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700271
Alexander Afanasyevff2d08f2014-04-07 18:28:25 -0700272 const Signature&
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800273 getSignature() const;
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700274
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800275 /**
276 * @brief Set the signature to a copy of the given signature.
277 * @param signature The signature object which is cloned.
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800278 */
Alexander Afanasyev770827c2014-05-13 17:42:55 -0700279 Data&
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800280 setSignature(const Signature& signature);
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700281
Alexander Afanasyev770827c2014-05-13 17:42:55 -0700282 Data&
Alexander Afanasyevff2d08f2014-04-07 18:28:25 -0700283 setSignatureValue(const Block& value);
Yingdi Yua4e57672014-02-06 11:16:17 -0800284
Alexander Afanasyev809805d2014-02-17 17:20:33 -0800285 ///////////////////////////////////////////////////////////////
Alexander Afanasyev6d48bc12014-02-18 00:10:51 -0800286
287 nfd::LocalControlHeader&
288 getLocalControlHeader();
289
290 const nfd::LocalControlHeader&
291 getLocalControlHeader() const;
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700292
Alexander Afanasyevff2d08f2014-04-07 18:28:25 -0700293 uint64_t
Yingdi Yua4e57672014-02-06 11:16:17 -0800294 getIncomingFaceId() const;
295
Alexander Afanasyev770827c2014-05-13 17:42:55 -0700296 Data&
Yingdi Yua4e57672014-02-06 11:16:17 -0800297 setIncomingFaceId(uint64_t incomingFaceId);
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700298
Alexander Afanasyevff2d08f2014-04-07 18:28:25 -0700299public: // EqualityComparable concept
300 bool
301 operator==(const Data& other) const;
302
303 bool
304 operator!=(const Data& other) const;
305
Jeff Thompson5cae5e52013-07-10 19:41:20 -0700306private:
Jeff Thompsonb7aefa002013-09-16 18:22:00 -0700307 /**
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800308 * @brief Clear the wire encoding.
Jeff Thompsonb7aefa002013-09-16 18:22:00 -0700309 */
Alexander Afanasyevff2d08f2014-04-07 18:28:25 -0700310 void
Jeff Thompson0050abe2013-09-17 12:50:25 -0700311 onChanged();
Alexander Afanasyevfadc97d2014-01-03 13:22:10 -0800312
313private:
Alexander Afanasyev809805d2014-02-17 17:20:33 -0800314 Name m_name;
315 MetaInfo m_metaInfo;
316 mutable Block m_content;
317 Signature m_signature;
Alexander Afanasyevfadc97d2014-01-03 13:22:10 -0800318
Alexander Afanasyev809805d2014-02-17 17:20:33 -0800319 mutable Block m_wire;
Alexander Afanasyev3b703102014-06-13 17:01:14 -0700320 mutable Name m_fullName;
Yingdi Yua4e57672014-02-06 11:16:17 -0800321
Alexander Afanasyev6d48bc12014-02-18 00:10:51 -0800322 nfd::LocalControlHeader m_localControlHeader;
323 friend class nfd::LocalControlHeader;
Jeff Thompson5cae5e52013-07-10 19:41:20 -0700324};
Alexander Afanasyevfadc97d2014-01-03 13:22:10 -0800325
Alexander Afanasyeva0c5f832014-06-19 13:27:56 -0700326std::ostream&
327operator<<(std::ostream& os, const Data& data);
Alexander Afanasyev809805d2014-02-17 17:20:33 -0800328
Alexander Afanasyev6d48bc12014-02-18 00:10:51 -0800329inline bool
330Data::hasWire() const
331{
332 return m_wire.hasWire();
333}
334
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700335inline const Name&
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800336Data::getName() const
337{
Alexander Afanasyev809805d2014-02-17 17:20:33 -0800338 return m_name;
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800339}
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700340
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700341inline const MetaInfo&
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800342Data::getMetaInfo() const
343{
Alexander Afanasyev809805d2014-02-17 17:20:33 -0800344 return m_metaInfo;
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800345}
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700346
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700347inline uint32_t
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800348Data::getContentType() const
349{
Alexander Afanasyev809805d2014-02-17 17:20:33 -0800350 return m_metaInfo.getType();
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800351}
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700352
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700353inline const time::milliseconds&
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800354Data::getFreshnessPeriod() const
355{
Alexander Afanasyev809805d2014-02-17 17:20:33 -0800356 return m_metaInfo.getFreshnessPeriod();
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800357}
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700358
Alexander Afanasyev95b0e342014-02-12 21:34:44 -0800359inline const name::Component&
360Data::getFinalBlockId() const
361{
Alexander Afanasyev809805d2014-02-17 17:20:33 -0800362 return m_metaInfo.getFinalBlockId();
Alexander Afanasyev95b0e342014-02-12 21:34:44 -0800363}
364
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800365inline const Signature&
366Data::getSignature() const
367{
Alexander Afanasyev809805d2014-02-17 17:20:33 -0800368 return m_signature;
Alexander Afanasyev2ba8f662014-01-05 22:53:18 -0800369}
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700370
Alexander Afanasyev6d48bc12014-02-18 00:10:51 -0800371inline nfd::LocalControlHeader&
372Data::getLocalControlHeader()
373{
374 return m_localControlHeader;
375}
376
377inline const nfd::LocalControlHeader&
378Data::getLocalControlHeader() const
379{
380 return m_localControlHeader;
381}
382
Yingdi Yua4e57672014-02-06 11:16:17 -0800383inline uint64_t
384Data::getIncomingFaceId() const
385{
Alexander Afanasyev6d48bc12014-02-18 00:10:51 -0800386 return getLocalControlHeader().getIncomingFaceId();
Yingdi Yua4e57672014-02-06 11:16:17 -0800387}
388
Alexander Afanasyev4ff3c912014-01-03 15:25:02 -0800389
Alexander Afanasyevfadc97d2014-01-03 13:22:10 -0800390} // namespace ndn
391
Jeff Thompson5cae5e52013-07-10 19:41:20 -0700392#endif