blob: f0aa1b5a0b4150be318142771c08adad1fd51f60 [file] [log] [blame]
Junxiao Shibc19b372014-03-23 16:59:25 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/**
3 * Copyright (C) 2013 Regents of the University of California.
4 * See COPYING for copyright and distribution information.
5 */
6
7#ifndef NDN_MANAGEMENT_NFD_CONTROL_PARAMETERS_HPP
8#define NDN_MANAGEMENT_NFD_CONTROL_PARAMETERS_HPP
9
10#include "../name.hpp"
11#include "../encoding/tlv-nfd.hpp"
12
13namespace ndn {
14namespace nfd {
15
Junxiao Shi5ec80222014-03-25 20:08:05 -070016enum ControlParameterField {
17 CONTROL_PARAMETER_NAME,
18 CONTROL_PARAMETER_FACE_ID,
19 CONTROL_PARAMETER_URI,
20 CONTROL_PARAMETER_LOCAL_CONTROL_FEATURE,
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070021 CONTROL_PARAMETER_ORIGIN,
Junxiao Shi5ec80222014-03-25 20:08:05 -070022 CONTROL_PARAMETER_COST,
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070023 CONTROL_PARAMETER_FLAGS,
Junxiao Shi5ec80222014-03-25 20:08:05 -070024 CONTROL_PARAMETER_STRATEGY,
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070025 CONTROL_PARAMETER_EXPIRATION_PERIOD,
Junxiao Shi5ec80222014-03-25 20:08:05 -070026 CONTROL_PARAMETER_UBOUND
27};
28
29const std::string CONTROL_PARAMETER_FIELD[CONTROL_PARAMETER_UBOUND] = {
30 "Name",
31 "FaceId",
32 "Uri",
33 "LocalControlFeature",
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070034 "Origin",
Junxiao Shi5ec80222014-03-25 20:08:05 -070035 "Cost",
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070036 "Flags",
Junxiao Shi5ec80222014-03-25 20:08:05 -070037 "Strategy",
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070038 "ExpirationPeriod",
Junxiao Shi5ec80222014-03-25 20:08:05 -070039};
40
Junxiao Shibc19b372014-03-23 16:59:25 -070041enum LocalControlFeature {
42 LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID = 1,
43 LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID = 2
44};
45
Junxiao Shi7b6b79d2014-03-26 20:59:35 -070046/** \brief represents parameters in a ControlCommand request or response
47 * \sa http://redmine.named-data.net/projects/nfd/wiki/ControlCommand
48 */
49class ControlParameters
50{
Junxiao Shibc19b372014-03-23 16:59:25 -070051public:
52 class Error : public Tlv::Error
53 {
54 public:
55 explicit
56 Error(const std::string& what)
57 : Tlv::Error(what)
58 {
59 }
60 };
61
Junxiao Shi5ec80222014-03-25 20:08:05 -070062 ControlParameters()
63 : m_hasFields(CONTROL_PARAMETER_UBOUND)
64 {
65 }
Junxiao Shibc19b372014-03-23 16:59:25 -070066
67 explicit
68 ControlParameters(const Block& block)
Junxiao Shi5ec80222014-03-25 20:08:05 -070069 : m_hasFields(CONTROL_PARAMETER_UBOUND)
Junxiao Shibc19b372014-03-23 16:59:25 -070070 {
71 wireDecode(block);
72 }
73
74 template<bool T>
75 size_t
76 wireEncode(EncodingImpl<T>& encoder) const;
77
78 const Block&
79 wireEncode() const;
80
81 void
82 wireDecode(const Block& wire);
83
84public: // getters & setters
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070085
Junxiao Shibc19b372014-03-23 16:59:25 -070086 bool
87 hasName() const
88 {
Junxiao Shi5ec80222014-03-25 20:08:05 -070089 return m_hasFields[CONTROL_PARAMETER_NAME];
Junxiao Shibc19b372014-03-23 16:59:25 -070090 }
91
92 const Name&
93 getName() const
94 {
Junxiao Shi5ec80222014-03-25 20:08:05 -070095 BOOST_ASSERT(this->hasName());
Junxiao Shibc19b372014-03-23 16:59:25 -070096 return m_name;
97 }
98
99 ControlParameters&
100 setName(const Name& name)
101 {
102 m_wire.reset();
103 m_name = name;
Junxiao Shi5ec80222014-03-25 20:08:05 -0700104 m_hasFields[CONTROL_PARAMETER_NAME] = true;
Junxiao Shibc19b372014-03-23 16:59:25 -0700105 return *this;
106 }
107
108 ControlParameters&
109 unsetName()
110 {
111 m_wire.reset();
Junxiao Shi5ec80222014-03-25 20:08:05 -0700112 m_hasFields[CONTROL_PARAMETER_NAME] = false;
Junxiao Shibc19b372014-03-23 16:59:25 -0700113 return *this;
114 }
115
116 bool
117 hasFaceId() const
118 {
Junxiao Shi5ec80222014-03-25 20:08:05 -0700119 return m_hasFields[CONTROL_PARAMETER_FACE_ID];
Junxiao Shibc19b372014-03-23 16:59:25 -0700120 }
121
122 uint64_t
123 getFaceId() const
124 {
Junxiao Shi5ec80222014-03-25 20:08:05 -0700125 BOOST_ASSERT(this->hasFaceId());
Junxiao Shibc19b372014-03-23 16:59:25 -0700126 return m_faceId;
127 }
128
129 ControlParameters&
130 setFaceId(uint64_t faceId)
131 {
132 m_wire.reset();
133 m_faceId = faceId;
Junxiao Shi5ec80222014-03-25 20:08:05 -0700134 m_hasFields[CONTROL_PARAMETER_FACE_ID] = true;
Junxiao Shibc19b372014-03-23 16:59:25 -0700135 return *this;
136 }
137
138 ControlParameters&
139 unsetFaceId()
140 {
141 m_wire.reset();
Junxiao Shi5ec80222014-03-25 20:08:05 -0700142 m_hasFields[CONTROL_PARAMETER_FACE_ID] = false;
Junxiao Shibc19b372014-03-23 16:59:25 -0700143 return *this;
144 }
145
146 bool
147 hasUri() const
148 {
Junxiao Shi5ec80222014-03-25 20:08:05 -0700149 return m_hasFields[CONTROL_PARAMETER_URI];
Junxiao Shibc19b372014-03-23 16:59:25 -0700150 }
151
152 const std::string&
153 getUri() const
154 {
Junxiao Shi5ec80222014-03-25 20:08:05 -0700155 BOOST_ASSERT(this->hasUri());
Junxiao Shibc19b372014-03-23 16:59:25 -0700156 return m_uri;
157 }
158
159 ControlParameters&
160 setUri(const std::string& uri)
161 {
162 m_wire.reset();
163 m_uri = uri;
Junxiao Shi5ec80222014-03-25 20:08:05 -0700164 m_hasFields[CONTROL_PARAMETER_URI] = true;
Junxiao Shibc19b372014-03-23 16:59:25 -0700165 return *this;
166 }
167
168 ControlParameters&
169 unsetUri()
170 {
171 m_wire.reset();
Junxiao Shi5ec80222014-03-25 20:08:05 -0700172 m_hasFields[CONTROL_PARAMETER_URI] = false;
Junxiao Shibc19b372014-03-23 16:59:25 -0700173 return *this;
174 }
175
176 bool
177 hasLocalControlFeature() const
178 {
Junxiao Shi5ec80222014-03-25 20:08:05 -0700179 return m_hasFields[CONTROL_PARAMETER_LOCAL_CONTROL_FEATURE];
Junxiao Shibc19b372014-03-23 16:59:25 -0700180 }
181
182 LocalControlFeature
183 getLocalControlFeature() const
184 {
Junxiao Shi5ec80222014-03-25 20:08:05 -0700185 BOOST_ASSERT(this->hasLocalControlFeature());
Junxiao Shibc19b372014-03-23 16:59:25 -0700186 return m_localControlFeature;
187 }
188
189 ControlParameters&
190 setLocalControlFeature(LocalControlFeature localControlFeature)
191 {
192 m_wire.reset();
193 m_localControlFeature = localControlFeature;
Junxiao Shi5ec80222014-03-25 20:08:05 -0700194 m_hasFields[CONTROL_PARAMETER_LOCAL_CONTROL_FEATURE] = true;
Junxiao Shibc19b372014-03-23 16:59:25 -0700195 return *this;
196 }
197
198 ControlParameters&
199 unsetLocalControlFeature()
200 {
201 m_wire.reset();
Junxiao Shi5ec80222014-03-25 20:08:05 -0700202 m_hasFields[CONTROL_PARAMETER_LOCAL_CONTROL_FEATURE] = false;
Junxiao Shibc19b372014-03-23 16:59:25 -0700203 return *this;
204 }
205
206 bool
Junxiao Shi5f6c74f2014-04-18 16:29:44 -0700207 hasOrigin() const
208 {
209 return m_hasFields[CONTROL_PARAMETER_ORIGIN];
210 }
211
212 uint64_t
213 getOrigin() const
214 {
215 BOOST_ASSERT(this->hasOrigin());
216 return m_origin;
217 }
218
219 ControlParameters&
220 setOrigin(uint64_t origin)
221 {
222 m_wire.reset();
223 m_origin = origin;
224 m_hasFields[CONTROL_PARAMETER_ORIGIN] = true;
225 return *this;
226 }
227
228 ControlParameters&
229 unsetOrigin()
230 {
231 m_wire.reset();
232 m_hasFields[CONTROL_PARAMETER_ORIGIN] = false;
233 return *this;
234 }
235
236 bool
Junxiao Shibc19b372014-03-23 16:59:25 -0700237 hasCost() const
238 {
Junxiao Shi5ec80222014-03-25 20:08:05 -0700239 return m_hasFields[CONTROL_PARAMETER_COST];
Junxiao Shibc19b372014-03-23 16:59:25 -0700240 }
241
242 uint64_t
243 getCost() const
244 {
Junxiao Shi5ec80222014-03-25 20:08:05 -0700245 BOOST_ASSERT(this->hasCost());
Junxiao Shibc19b372014-03-23 16:59:25 -0700246 return m_cost;
247 }
248
249 ControlParameters&
250 setCost(uint64_t cost)
251 {
252 m_wire.reset();
253 m_cost = cost;
Junxiao Shi5ec80222014-03-25 20:08:05 -0700254 m_hasFields[CONTROL_PARAMETER_COST] = true;
Junxiao Shibc19b372014-03-23 16:59:25 -0700255 return *this;
256 }
257
258 ControlParameters&
259 unsetCost()
260 {
261 m_wire.reset();
Junxiao Shi5ec80222014-03-25 20:08:05 -0700262 m_hasFields[CONTROL_PARAMETER_COST] = false;
Junxiao Shibc19b372014-03-23 16:59:25 -0700263 return *this;
264 }
265
266 bool
Junxiao Shi5f6c74f2014-04-18 16:29:44 -0700267 hasFlags() const
268 {
269 return m_hasFields[CONTROL_PARAMETER_FLAGS];
270 }
271
272 uint64_t
273 getFlags() const
274 {
275 BOOST_ASSERT(this->hasFlags());
276 return m_flags;
277 }
278
279 ControlParameters&
280 setFlags(uint64_t flags)
281 {
282 m_wire.reset();
283 m_flags = flags;
284 m_hasFields[CONTROL_PARAMETER_FLAGS] = true;
285 return *this;
286 }
287
288 ControlParameters&
289 unsetFlags()
290 {
291 m_wire.reset();
292 m_hasFields[CONTROL_PARAMETER_FLAGS] = false;
293 return *this;
294 }
295
296 bool
Junxiao Shibc19b372014-03-23 16:59:25 -0700297 hasStrategy() const
298 {
Junxiao Shi5ec80222014-03-25 20:08:05 -0700299 return m_hasFields[CONTROL_PARAMETER_STRATEGY];
Junxiao Shibc19b372014-03-23 16:59:25 -0700300 }
301
302 const Name&
303 getStrategy() const
304 {
Junxiao Shi5ec80222014-03-25 20:08:05 -0700305 BOOST_ASSERT(this->hasStrategy());
Junxiao Shibc19b372014-03-23 16:59:25 -0700306 return m_strategy;
307 }
308
309 ControlParameters&
310 setStrategy(const Name& strategy)
311 {
312 m_wire.reset();
313 m_strategy = strategy;
Junxiao Shi5ec80222014-03-25 20:08:05 -0700314 m_hasFields[CONTROL_PARAMETER_STRATEGY] = true;
Junxiao Shibc19b372014-03-23 16:59:25 -0700315 return *this;
316 }
317
318 ControlParameters&
319 unsetStrategy()
320 {
321 m_wire.reset();
Junxiao Shi5ec80222014-03-25 20:08:05 -0700322 m_hasFields[CONTROL_PARAMETER_STRATEGY] = false;
Junxiao Shibc19b372014-03-23 16:59:25 -0700323 return *this;
324 }
325
Junxiao Shi5f6c74f2014-04-18 16:29:44 -0700326 bool
327 hasExpirationPeriod() const
328 {
329 return m_hasFields[CONTROL_PARAMETER_EXPIRATION_PERIOD];
330 }
331
332 const time::milliseconds&
333 getExpirationPeriod() const
334 {
335 BOOST_ASSERT(this->hasExpirationPeriod());
336 return m_expirationPeriod;
337 }
338
339 ControlParameters&
340 setExpirationPeriod(const time::milliseconds& expirationPeriod)
341 {
342 m_wire.reset();
343 m_expirationPeriod = expirationPeriod;
344 m_hasFields[CONTROL_PARAMETER_EXPIRATION_PERIOD] = true;
345 return *this;
346 }
347
348 ControlParameters&
349 unsetExpirationPeriod()
350 {
351 m_wire.reset();
352 m_hasFields[CONTROL_PARAMETER_EXPIRATION_PERIOD] = false;
353 return *this;
354 }
355
Junxiao Shi5ec80222014-03-25 20:08:05 -0700356 const std::vector<bool>&
357 getPresentFields() const
358 {
359 return m_hasFields;
360 }
361
Junxiao Shibc19b372014-03-23 16:59:25 -0700362private: // fields
Junxiao Shi5ec80222014-03-25 20:08:05 -0700363 std::vector<bool> m_hasFields;
364
Junxiao Shibc19b372014-03-23 16:59:25 -0700365 Name m_name;
366 uint64_t m_faceId;
367 std::string m_uri;
368 LocalControlFeature m_localControlFeature;
Junxiao Shi5f6c74f2014-04-18 16:29:44 -0700369 uint64_t m_origin;
Junxiao Shibc19b372014-03-23 16:59:25 -0700370 uint64_t m_cost;
Junxiao Shi5f6c74f2014-04-18 16:29:44 -0700371 uint64_t m_flags;
Junxiao Shibc19b372014-03-23 16:59:25 -0700372 Name m_strategy;
Junxiao Shi5f6c74f2014-04-18 16:29:44 -0700373 time::milliseconds m_expirationPeriod;
Junxiao Shibc19b372014-03-23 16:59:25 -0700374
Junxiao Shibc19b372014-03-23 16:59:25 -0700375private:
376 mutable Block m_wire;
377};
378
379
Junxiao Shibc19b372014-03-23 16:59:25 -0700380template<bool T>
381inline size_t
382ControlParameters::wireEncode(EncodingImpl<T>& encoder) const
383{
384 size_t totalLength = 0;
385
Junxiao Shi5f6c74f2014-04-18 16:29:44 -0700386 if (this->hasExpirationPeriod()) {
387 totalLength += prependNonNegativeIntegerBlock(encoder,
388 tlv::nfd::ExpirationPeriod, m_expirationPeriod.count());
389 }
Junxiao Shi5ec80222014-03-25 20:08:05 -0700390 if (this->hasStrategy()) {
Junxiao Shibc19b372014-03-23 16:59:25 -0700391 totalLength += prependNestedBlock(encoder, tlv::nfd::Strategy, m_strategy);
392 }
Junxiao Shi5f6c74f2014-04-18 16:29:44 -0700393 if (this->hasFlags()) {
394 totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::Flags, m_flags);
395 }
Junxiao Shi5ec80222014-03-25 20:08:05 -0700396 if (this->hasCost()) {
Junxiao Shibc19b372014-03-23 16:59:25 -0700397 totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::Cost, m_cost);
398 }
Junxiao Shi5f6c74f2014-04-18 16:29:44 -0700399 if (this->hasOrigin()) {
400 totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::Origin, m_origin);
401 }
Junxiao Shi5ec80222014-03-25 20:08:05 -0700402 if (this->hasLocalControlFeature()) {
Junxiao Shibc19b372014-03-23 16:59:25 -0700403 totalLength += prependNonNegativeIntegerBlock(encoder,
404 tlv::nfd::LocalControlFeature, m_localControlFeature);
405 }
Junxiao Shi5ec80222014-03-25 20:08:05 -0700406 if (this->hasUri()) {
Junxiao Shibc19b372014-03-23 16:59:25 -0700407 size_t valLength = encoder.prependByteArray(
408 reinterpret_cast<const uint8_t*>(m_uri.c_str()), m_uri.size());
409 totalLength += valLength;
410 totalLength += encoder.prependVarNumber(valLength);
411 totalLength += encoder.prependVarNumber(tlv::nfd::Uri);
412 }
Junxiao Shi5ec80222014-03-25 20:08:05 -0700413 if (this->hasFaceId()) {
Junxiao Shibc19b372014-03-23 16:59:25 -0700414 totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::FaceId, m_faceId);
415 }
Junxiao Shi5ec80222014-03-25 20:08:05 -0700416 if (this->hasName()) {
Junxiao Shibc19b372014-03-23 16:59:25 -0700417 totalLength += m_name.wireEncode(encoder);
418 }
419
420 totalLength += encoder.prependVarNumber(totalLength);
421 totalLength += encoder.prependVarNumber(tlv::nfd::ControlParameters);
422 return totalLength;
423}
424
425inline const Block&
426ControlParameters::wireEncode() const
427{
428 if (m_wire.hasWire())
429 return m_wire;
430
431 EncodingEstimator estimator;
432 size_t estimatedSize = wireEncode(estimator);
433
434 EncodingBuffer buffer(estimatedSize, 0);
435 wireEncode(buffer);
436
437 m_wire = buffer.block();
438 return m_wire;
439}
440
441inline void
442ControlParameters::wireDecode(const Block& block)
443{
444 if (block.type() != tlv::nfd::ControlParameters) {
445 throw Error("expecting TLV-TYPE ControlParameters");
446 }
447 m_wire = block;
448 m_wire.parse();
449 Block::element_const_iterator val;
450
451 val = m_wire.find(Tlv::Name);
Junxiao Shi5ec80222014-03-25 20:08:05 -0700452 m_hasFields[CONTROL_PARAMETER_NAME] = val != m_wire.elements_end();
453 if (this->hasName()) {
Junxiao Shibc19b372014-03-23 16:59:25 -0700454 m_name.wireDecode(*val);
455 }
456
457 val = m_wire.find(tlv::nfd::FaceId);
Junxiao Shi5ec80222014-03-25 20:08:05 -0700458 m_hasFields[CONTROL_PARAMETER_FACE_ID] = val != m_wire.elements_end();
459 if (this->hasFaceId()) {
Junxiao Shibc19b372014-03-23 16:59:25 -0700460 m_faceId = static_cast<uint64_t>(readNonNegativeInteger(*val));
461 }
462
463 val = m_wire.find(tlv::nfd::Uri);
Junxiao Shi5ec80222014-03-25 20:08:05 -0700464 m_hasFields[CONTROL_PARAMETER_URI] = val != m_wire.elements_end();
465 if (this->hasUri()) {
Junxiao Shibc19b372014-03-23 16:59:25 -0700466 m_uri.assign(reinterpret_cast<const char*>(val->value()), val->value_size());
467 }
468
469 val = m_wire.find(tlv::nfd::LocalControlFeature);
Junxiao Shi5ec80222014-03-25 20:08:05 -0700470 m_hasFields[CONTROL_PARAMETER_LOCAL_CONTROL_FEATURE] = val != m_wire.elements_end();
471 if (this->hasLocalControlFeature()) {
Junxiao Shibc19b372014-03-23 16:59:25 -0700472 m_localControlFeature = static_cast<LocalControlFeature>(readNonNegativeInteger(*val));
473 }
474
Junxiao Shi5f6c74f2014-04-18 16:29:44 -0700475 val = m_wire.find(tlv::nfd::Origin);
476 m_hasFields[CONTROL_PARAMETER_ORIGIN] = val != m_wire.elements_end();
477 if (this->hasOrigin()) {
478 m_origin = static_cast<uint64_t>(readNonNegativeInteger(*val));
479 }
480
Junxiao Shibc19b372014-03-23 16:59:25 -0700481 val = m_wire.find(tlv::nfd::Cost);
Junxiao Shi5ec80222014-03-25 20:08:05 -0700482 m_hasFields[CONTROL_PARAMETER_COST] = val != m_wire.elements_end();
483 if (this->hasCost()) {
Junxiao Shibc19b372014-03-23 16:59:25 -0700484 m_cost = static_cast<uint64_t>(readNonNegativeInteger(*val));
485 }
486
Junxiao Shi5f6c74f2014-04-18 16:29:44 -0700487 val = m_wire.find(tlv::nfd::Flags);
488 m_hasFields[CONTROL_PARAMETER_FLAGS] = val != m_wire.elements_end();
489 if (this->hasFlags()) {
490 m_flags = static_cast<uint64_t>(readNonNegativeInteger(*val));
491 }
492
Junxiao Shibc19b372014-03-23 16:59:25 -0700493 val = m_wire.find(tlv::nfd::Strategy);
Junxiao Shi5ec80222014-03-25 20:08:05 -0700494 m_hasFields[CONTROL_PARAMETER_STRATEGY] = val != m_wire.elements_end();
495 if (this->hasStrategy()) {
Junxiao Shibc19b372014-03-23 16:59:25 -0700496 val->parse();
497 if (val->elements().empty()) {
498 throw Error("expecting Strategy/Name");
499 }
500 else {
501 m_strategy.wireDecode(*val->elements_begin());
502 }
503 }
Junxiao Shi5f6c74f2014-04-18 16:29:44 -0700504
505 val = m_wire.find(tlv::nfd::ExpirationPeriod);
506 m_hasFields[CONTROL_PARAMETER_EXPIRATION_PERIOD] = val != m_wire.elements_end();
507 if (this->hasExpirationPeriod()) {
508 m_expirationPeriod = time::milliseconds(readNonNegativeInteger(*val));
509 }
Junxiao Shibc19b372014-03-23 16:59:25 -0700510}
511
512inline std::ostream&
513operator<<(std::ostream& os, const ControlParameters& parameters)
514{
515 os << "ControlParameters(";
516
517 if (parameters.hasName()) {
518 os << "Name: " << parameters.getName() << ", ";
519 }
520
521 if (parameters.hasFaceId()) {
522 os << "FaceId: " << parameters.getFaceId() << ", ";
523 }
524
525 if (parameters.hasUri()) {
526 os << "Uri: " << parameters.getUri() << ", ";
527 }
528
529 if (parameters.hasLocalControlFeature()) {
530 os << "LocalControlFeature: " << parameters.getLocalControlFeature() << ", ";
531 }
532
Junxiao Shi5f6c74f2014-04-18 16:29:44 -0700533 if (parameters.hasOrigin()) {
534 os << "Origin: " << parameters.getOrigin() << ", ";
535 }
536
Junxiao Shibc19b372014-03-23 16:59:25 -0700537 if (parameters.hasCost()) {
538 os << "Cost: " << parameters.getCost() << ", ";
539 }
540
Junxiao Shi5f6c74f2014-04-18 16:29:44 -0700541 if (parameters.hasFlags()) {
542 os << "Flags: " << parameters.getFlags() << ", ";
543 }
544
Junxiao Shibc19b372014-03-23 16:59:25 -0700545 if (parameters.hasStrategy()) {
546 os << "Strategy: " << parameters.getStrategy() << ", ";
547 }
548
Junxiao Shi5f6c74f2014-04-18 16:29:44 -0700549 if (parameters.hasExpirationPeriod()) {
550 os << "ExpirationPeriod: " << parameters.getExpirationPeriod() << ", ";
551 }
552
Junxiao Shibc19b372014-03-23 16:59:25 -0700553 os << ")";
554 return os;
555}
556
557
558} // namespace nfd
559} // namespace ndn
560
561#endif // NDN_MANAGEMENT_NFD_CONTROL_PARAMETERS_HPP