blob: 2783aa9596d2a54b3e006881dd44c3d0910e4459 [file] [log] [blame]
Jeff Thompson25b4e612013-10-10 16:03:24 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
Jeff Thompson47eecfc2013-07-07 22:56:46 -07002/**
Jeff Thompson7687dc02013-09-13 11:54:07 -07003 * Copyright (C) 2013 Regents of the University of California.
Jeff Thompson47eecfc2013-07-07 22:56:46 -07004 * See COPYING for copyright and distribution information.
Jeff Thompsonb7f95562013-07-03 18:36:42 -07005 */
6
7#ifndef NDN_INTEREST_HPP
Jeff Thompson2d27e2f2013-08-09 12:55:00 -07008#define NDN_INTEREST_HPP
Jeff Thompsonb7f95562013-07-03 18:36:42 -07009
Alexander Afanasyeve2dcdfd2014-02-07 15:53:28 -080010#include "common.hpp"
Jeff Thompson53412192013-08-06 13:35:50 -070011#include "name.hpp"
Alexander Afanasyevc348f832014-02-17 16:35:17 -080012#include "selectors.hpp"
Alexander Afanasyev6d48bc12014-02-18 00:10:51 -080013#include "management/nfd-local-control-header.hpp"
Jeff Thompsonb7f95562013-07-03 18:36:42 -070014
15namespace ndn {
Alexander Afanasyevc348f832014-02-17 16:35:17 -080016
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -070017const time::seconds DEFAULT_INTEREST_LIFETIME = time::seconds(4);
Alexander Afanasyevc348f832014-02-17 16:35:17 -080018
Jeff Thompson8238d002013-07-10 11:56:49 -070019/**
Jeff Thompson8238d002013-07-10 11:56:49 -070020 * An Interest holds a Name and other fields for an interest.
21 */
Alexander Afanasyevc348f832014-02-17 16:35:17 -080022class Interest : public enable_shared_from_this<Interest>
23{
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -070024public:
Jeff Thompson1b4a7b12013-11-15 12:00:02 -080025 /**
Alexander Afanasyevc348f832014-02-17 16:35:17 -080026 * @brief Create a new Interest with an empty name and "none" for all values.
27 */
28 Interest()
29 : m_nonce(0)
30 , m_scope(-1)
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -070031 , m_interestLifetime(time::milliseconds::min())
Alexander Afanasyevc348f832014-02-17 16:35:17 -080032 {
33 }
34
35 /**
36 * @brief Create a new Interest with the given name and "none" for other values.
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -070037 *
Alexander Afanasyevc348f832014-02-17 16:35:17 -080038 * @param name The name for the interest.
39 */
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -070040 Interest(const Name& name)
Alexander Afanasyevc348f832014-02-17 16:35:17 -080041 : m_name(name)
42 , m_nonce(0)
43 , m_scope(-1)
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -070044 , m_interestLifetime(time::milliseconds::min())
Alexander Afanasyevc348f832014-02-17 16:35:17 -080045 {
46 }
47
48 /**
49 * Create a new Interest with the given name and interest lifetime and "none" for other values.
50 * @param name The name for the interest.
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -070051 * @param interestLifetimeMilliseconds The interest lifetime in time::milliseconds, or -1 for none.
Alexander Afanasyevc348f832014-02-17 16:35:17 -080052 */
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -070053 Interest(const Name& name, const time::milliseconds& interestLifetime)
Alexander Afanasyevc348f832014-02-17 16:35:17 -080054 : m_name(name)
55 , m_nonce(0)
56 , m_scope(-1)
57 , m_interestLifetime(interestLifetime)
58 {
59 }
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -070060
Alexander Afanasyevc348f832014-02-17 16:35:17 -080061 Interest(const Name& name,
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -070062 const Selectors& selectors,
Alexander Afanasyevc348f832014-02-17 16:35:17 -080063 int scope,
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -070064 const time::milliseconds& interestLifetime,
65 uint32_t nonce = 0)
Alexander Afanasyevc348f832014-02-17 16:35:17 -080066 : m_name(name)
67 , m_selectors(selectors)
68 , m_nonce(nonce)
69 , m_scope(scope)
70 , m_interestLifetime(interestLifetime)
71 {
72 }
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -070073
Alexander Afanasyevc348f832014-02-17 16:35:17 -080074 /**
Jeff Thompson1b4a7b12013-11-15 12:00:02 -080075 * Create a new Interest for the given name and values.
76 * @param name
77 * @param minSuffixComponents
78 * @param maxSuffixComponents
Jeff Thompson1b4a7b12013-11-15 12:00:02 -080079 * @param exclude
80 * @param childSelector
Alexander Afanasyev84681982014-01-03 13:26:09 -080081 * @param mustBeFresh
Jeff Thompson1b4a7b12013-11-15 12:00:02 -080082 * @param scope
Alexander Afanasyev84681982014-01-03 13:26:09 -080083 * @param interestLifetime
Jeff Thompson1b4a7b12013-11-15 12:00:02 -080084 * @param nonce
85 */
Alexander Afanasyev84681982014-01-03 13:26:09 -080086 Interest(const Name& name,
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -070087 int minSuffixComponents, int maxSuffixComponents,
Alexander Afanasyev84681982014-01-03 13:26:09 -080088 const Exclude& exclude,
89 int childSelector,
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -070090 bool mustBeFresh,
Alexander Afanasyev84681982014-01-03 13:26:09 -080091 int scope,
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -070092 const time::milliseconds& interestLifetime,
93 uint32_t nonce = 0)
Alexander Afanasyevc348f832014-02-17 16:35:17 -080094 : m_name(name)
95 , m_selectors(minSuffixComponents, maxSuffixComponents, exclude, childSelector, mustBeFresh)
96 , m_nonce(nonce)
97 , m_scope(scope)
98 , m_interestLifetime(interestLifetime)
Jeff Thompson3f76e9e2013-08-21 13:14:58 -070099 {
100 }
101
Alexander Afanasyev6d48bc12014-02-18 00:10:51 -0800102 explicit
103 Interest(const Block& wire)
104 {
105 wireDecode(wire);
106 }
107
Jeff Thompson1b4a7b12013-11-15 12:00:02 -0800108 /**
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800109 * @brief Fast encoding or block size estimation
Jeff Thompson1b4a7b12013-11-15 12:00:02 -0800110 */
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800111 template<bool T>
112 inline size_t
113 wireEncode(EncodingImpl<T> &block) const;
Alexander Afanasyev6d48bc12014-02-18 00:10:51 -0800114
Jeff Thompson1b4a7b12013-11-15 12:00:02 -0800115 /**
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800116 * @brief Encode to a wire format
Jeff Thompson1b4a7b12013-11-15 12:00:02 -0800117 */
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800118 inline const Block&
Alexander Afanasyev1eb961a2014-01-03 13:51:49 -0800119 wireEncode() const;
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800120
Jeff Thompson1b4a7b12013-11-15 12:00:02 -0800121 /**
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800122 * @brief Decode from the wire format
Jeff Thompson1b4a7b12013-11-15 12:00:02 -0800123 */
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700124 inline void
Alexander Afanasyev1eb961a2014-01-03 13:51:49 -0800125 wireDecode(const Block &wire);
Alexander Afanasyev6d48bc12014-02-18 00:10:51 -0800126
127 /**
128 * @brief Check if already has wire
129 */
130 inline bool
131 hasWire() const;
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700132
Jeff Thompsond9e278c2013-07-08 15:20:13 -0700133 /**
Jeff Thompson13e280b2013-12-03 13:12:23 -0800134 * Encode the name according to the "NDN URI Scheme". If there are interest selectors, append "?" and
135 * added the selectors as a query string. For example "/test/name?ndn.ChildSelector=1".
136 * @return The URI string.
137 */
Alexander Afanasyev84681982014-01-03 13:26:09 -0800138 inline std::string
Jeff Thompson13e280b2013-12-03 13:12:23 -0800139 toUri() const;
Jeff Thompsonb7f95562013-07-03 18:36:42 -0700140
Alexander Afanasyev84681982014-01-03 13:26:09 -0800141 inline bool
142 hasSelectors() const;
143
144 inline bool
145 hasGuiders() const;
146
147 /**
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700148 * @brief Check if Interest name matches the given name (using ndn_Name_match) and the given name also conforms to the
Alexander Afanasyev84681982014-01-03 13:26:09 -0800149 * interest selectors.
150 * @param self A pointer to the ndn_Interest struct.
151 * @param name A pointer to the name to check.
152 * @return 1 if the name and interest selectors match, 0 otherwise.
153 */
154 bool
155 matchesName(const Name &name) const;
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800156
157 ///////////////////////////////////////////////////////////////////////////////
158 ///////////////////////////////////////////////////////////////////////////////
159 ///////////////////////////////////////////////////////////////////////////////
Alexander Afanasyev5964fb72014-02-18 12:42:45 -0800160 // Getters/setters
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700161
162 const Name&
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800163 getName() const
Jeff Thompsonc0486c12013-07-16 14:36:16 -0700164 {
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800165 return m_name;
166 }
167
168 Interest&
169 setName(const Name& name)
170 {
171 m_name = name;
172 m_wire.reset();
173 return *this;
Jeff Thompsonc0486c12013-07-16 14:36:16 -0700174 }
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700175
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800176 //
Alexander Afanasyev84681982014-01-03 13:26:09 -0800177
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800178 const Selectors&
179 getSelectors() const
180 {
181 return m_selectors;
182 }
183
184 Interest&
185 setSelectors(const Selectors& selectors)
186 {
187 m_selectors = selectors;
188 m_wire.reset();
189 return *this;
190 }
191
192 //
193
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700194 int
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800195 getScope() const
196 {
197 return m_scope;
198 }
199
200 Interest&
201 setScope(int scope)
202 {
203 m_scope = scope;
204 m_wire.reset();
205 return *this;
206 }
207
208 //
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700209
210 const time::milliseconds&
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800211 getInterestLifetime() const
212 {
213 return m_interestLifetime;
214 }
215
216 Interest&
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700217 setInterestLifetime(const time::milliseconds& interestLifetime)
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800218 {
219 m_interestLifetime = interestLifetime;
220 m_wire.reset();
221 return *this;
222 }
223
224 //
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700225
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800226 /**
227 * @brief Get Interest's nonce
228 *
229 * If nonce was not set before this call, it will be automatically assigned to a random value
230 *
231 * Const reference needed for C decoding
232 */
233 const uint32_t&
234 getNonce() const;
235
236 Interest&
237 setNonce(uint32_t nonce)
238 {
239 m_nonce = nonce;
240 m_wire.reset();
241 return *this;
242 }
243
244 //
Alexander Afanasyev6d48bc12014-02-18 00:10:51 -0800245
246 nfd::LocalControlHeader&
247 getLocalControlHeader()
248 {
249 return m_localControlHeader;
250 }
251
252 const nfd::LocalControlHeader&
253 getLocalControlHeader() const
254 {
255 return m_localControlHeader;
256 }
257
258 // helper methods for LocalControlHeader
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700259
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800260 uint64_t
261 getIncomingFaceId() const
262 {
Alexander Afanasyev6d48bc12014-02-18 00:10:51 -0800263 return getLocalControlHeader().getIncomingFaceId();
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800264 }
Alexander Afanasyev6d48bc12014-02-18 00:10:51 -0800265
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800266 Interest&
267 setIncomingFaceId(uint64_t incomingFaceId)
268 {
Alexander Afanasyev6d48bc12014-02-18 00:10:51 -0800269 getLocalControlHeader().setIncomingFaceId(incomingFaceId);
Alexander Afanasyev5964fb72014-02-18 12:42:45 -0800270 // ! do not reset Interest's wire !
271 return *this;
272 }
273
274 //
275
276 // NextHopFaceId helpers make sense only for Interests
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700277
Alexander Afanasyev5964fb72014-02-18 12:42:45 -0800278 uint64_t
279 getNextHopFaceId() const
280 {
281 return getLocalControlHeader().getNextHopFaceId();
282 }
283
284 Interest&
285 setNextHopFaceId(uint64_t nextHopFaceId)
286 {
287 getLocalControlHeader().setNextHopFaceId(nextHopFaceId);
288 // ! do not reset Interest's wire !
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800289 return *this;
290 }
291
292 //
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700293
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800294 ///////////////////////////////////////////////////////////////////////////////
295 ///////////////////////////////////////////////////////////////////////////////
296 ///////////////////////////////////////////////////////////////////////////////
297 // Wrappers for Selectors
298 //
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700299
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800300 int
301 getMinSuffixComponents() const
302 {
303 return m_selectors.getMinSuffixComponents();
304 }
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700305
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800306 Interest&
307 setMinSuffixComponents(int minSuffixComponents)
308 {
309 m_selectors.setMinSuffixComponents(minSuffixComponents);
310 m_wire.reset();
311 return *this;
312 }
313
314 //
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700315
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800316 int
317 getMaxSuffixComponents() const
318 {
319 return m_selectors.getMaxSuffixComponents();
320 }
321
322 Interest&
323 setMaxSuffixComponents(int maxSuffixComponents)
324 {
325 m_selectors.setMaxSuffixComponents(maxSuffixComponents);
326 m_wire.reset();
327 return *this;
328 }
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700329
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800330 //
331
332 const Exclude&
333 getExclude() const
334 {
335 return m_selectors.getExclude();
336 }
337
338 Interest&
339 setExclude(const Exclude& exclude)
340 {
341 m_selectors.setExclude(exclude);
342 m_wire.reset();
343 return *this;
344 }
345
346 //
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700347
348 int
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800349 getChildSelector() const
350 {
351 return m_selectors.getChildSelector();
352 }
353
354 Interest&
355 setChildSelector(int childSelector)
356 {
357 m_selectors.setChildSelector(childSelector);
358 m_wire.reset();
359 return *this;
360 }
361
362 //
363
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700364 int
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800365 getMustBeFresh() const
366 {
367 return m_selectors.getMustBeFresh();
368 }
369
370 Interest&
371 setMustBeFresh(bool mustBeFresh)
372 {
373 m_selectors.setMustBeFresh(mustBeFresh);
374 m_wire.reset();
375 return *this;
376 }
377
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800378private:
379 Name m_name;
380 Selectors m_selectors;
381 mutable uint32_t m_nonce;
382 int m_scope;
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700383 time::milliseconds m_interestLifetime;
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800384
385 mutable Block m_wire;
Yingdi Yua4e57672014-02-06 11:16:17 -0800386
Alexander Afanasyev6d48bc12014-02-18 00:10:51 -0800387 nfd::LocalControlHeader m_localControlHeader;
388 friend class nfd::LocalControlHeader;
Jeff Thompsonb7f95562013-07-03 18:36:42 -0700389};
Alexander Afanasyev84681982014-01-03 13:26:09 -0800390
391std::ostream &
392operator << (std::ostream &os, const Interest &interest);
393
394inline std::string
395Interest::toUri() const
396{
397 std::ostringstream os;
398 os << *this;
399 return os.str();
400}
401
402inline bool
403Interest::hasSelectors() const
404{
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800405 return !m_selectors.empty();
Alexander Afanasyev84681982014-01-03 13:26:09 -0800406}
407
408inline bool
409Interest::hasGuiders() const
410{
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800411 return m_scope >= 0 ||
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700412 m_interestLifetime >= time::milliseconds::zero() ||
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800413 m_nonce > 0;
Alexander Afanasyev84681982014-01-03 13:26:09 -0800414}
415
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800416template<bool T>
417inline size_t
418Interest::wireEncode(EncodingImpl<T> &block) const
419{
420 size_t total_len = 0;
421
422 // Interest ::= INTEREST-TYPE TLV-LENGTH
423 // Name
424 // Selectors?
425 // Nonce
426 // Scope?
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700427 // InterestLifetime?
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800428
429 // (reverse encoding)
430
431 // InterestLifetime
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700432 if (getInterestLifetime() >= time::milliseconds::zero()
433 && getInterestLifetime() != DEFAULT_INTEREST_LIFETIME)
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800434 {
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700435 total_len += prependNonNegativeIntegerBlock(block, Tlv::InterestLifetime, getInterestLifetime().count());
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800436 }
437
438 // Scope
439 if (getScope() >= 0)
440 {
441 total_len += prependNonNegativeIntegerBlock(block, Tlv::Scope, getScope());
442 }
443
444 // Nonce
445 total_len += prependNonNegativeIntegerBlock(block, Tlv::Nonce, getNonce());
446
447 // Selectors
448 if (!getSelectors().empty())
449 {
450 total_len += getSelectors().wireEncode(block);
451 }
452
453 // Name
454 total_len += getName().wireEncode(block);
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700455
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800456 total_len += block.prependVarNumber (total_len);
457 total_len += block.prependVarNumber (Tlv::Interest);
458 return total_len;
Jeff Thompsonb7f95562013-07-03 18:36:42 -0700459}
460
Alexander Afanasyev6d48bc12014-02-18 00:10:51 -0800461inline const Block&
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800462Interest::wireEncode() const
463{
464 if (m_wire.hasWire())
465 return m_wire;
466
467 EncodingEstimator estimator;
468 size_t estimatedSize = wireEncode(estimator);
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700469
Alexander Afanasyev5964fb72014-02-18 12:42:45 -0800470 EncodingBuffer buffer(estimatedSize, 0);
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800471 wireEncode(buffer);
472
473 m_wire = buffer.block();
474 return m_wire;
475}
476
477inline void
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700478Interest::wireDecode(const Block &wire)
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800479{
480 m_wire = wire;
481 m_wire.parse();
482
483 // Interest ::= INTEREST-TYPE TLV-LENGTH
484 // Name
485 // Selectors?
486 // Nonce
487 // Scope?
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700488 // InterestLifetime?
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800489
490 if (m_wire.type() != Tlv::Interest)
491 throw Tlv::Error("Unexpected TLV number when decoding Interest");
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700492
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800493 // Name
494 m_name.wireDecode(m_wire.get(Tlv::Name));
495
496 // Selectors
497 Block::element_const_iterator val = m_wire.find(Tlv::Selectors);
498 if (val != m_wire.elements_end())
499 {
500 m_selectors.wireDecode(*val);
501 }
502 else
503 m_selectors = Selectors();
504
505 // Nonce
506 val = m_wire.find(Tlv::Nonce);
507 if (val != m_wire.elements_end())
508 {
509 m_nonce = readNonNegativeInteger(*val);
510 }
511 else
512 m_nonce = 0;
513
514 // Scope
515 val = m_wire.find(Tlv::Scope);
516 if (val != m_wire.elements_end())
517 {
518 m_scope = readNonNegativeInteger(*val);
519 }
520 else
521 m_scope = -1;
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700522
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800523 // InterestLifetime
524 val = m_wire.find(Tlv::InterestLifetime);
525 if (val != m_wire.elements_end())
526 {
Alexander Afanasyevaa0e7da2014-03-17 14:37:33 -0700527 m_interestLifetime = time::milliseconds(readNonNegativeInteger(*val));
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800528 }
529 else
530 {
531 m_interestLifetime = DEFAULT_INTEREST_LIFETIME;
532 }
533}
534
Alexander Afanasyev6d48bc12014-02-18 00:10:51 -0800535inline bool
536Interest::hasWire() const
537{
538 return m_wire.hasWire();
539}
540
Alexander Afanasyevc348f832014-02-17 16:35:17 -0800541
542} // namespace ndn
543
544#endif // NDN_INTEREST_HPP