blob: 0a284cd6538568b714d684a88b3de317bcc4893f [file] [log] [blame]
Junxiao Shi13e637f2014-07-16 19:20:40 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Junxiao Shi5d75fd92017-08-08 18:09:20 +00002/*
Eric Newberry07d05c92018-01-22 16:08:01 -07003 * Copyright (c) 2013-2018 Regents of the University of California.
Junxiao Shi13e637f2014-07-16 19:20:40 -07004 *
5 * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
6 *
7 * 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.
20 */
21
Junxiao Shi7357ef22016-09-07 02:39:37 +000022#include "face-status.hpp"
Junxiao Shi65f1a712014-11-20 14:59:36 -070023#include "encoding/block-helpers.hpp"
Davide Pesavento4ec7a5a2017-02-07 23:13:39 -050024#include "encoding/encoding-buffer.hpp"
25#include "encoding/tlv-nfd.hpp"
Junxiao Shi65f1a712014-11-20 14:59:36 -070026#include "util/concepts.hpp"
Davide Pesaventoe78eeca2017-02-23 23:22:32 -050027#include "util/string-helper.hpp"
Davide Pesavento4ec7a5a2017-02-07 23:13:39 -050028
Junxiao Shi13e637f2014-07-16 19:20:40 -070029namespace ndn {
30namespace nfd {
31
Davide Pesavento4ec7a5a2017-02-07 23:13:39 -050032BOOST_CONCEPT_ASSERT((StatusDatasetItem<FaceStatus>));
Junxiao Shi65f1a712014-11-20 14:59:36 -070033
Junxiao Shi13e637f2014-07-16 19:20:40 -070034FaceStatus::FaceStatus()
Eric Newberry07d05c92018-01-22 16:08:01 -070035 : m_baseCongestionMarkingInterval(0)
36 , m_defaultCongestionThreshold(0)
37 , m_nInInterests(0)
Davide Pesavento4ec7a5a2017-02-07 23:13:39 -050038 , m_nInData(0)
Eric Newberry95bd96a2015-09-04 23:34:22 -070039 , m_nInNacks(0)
Junxiao Shi13e637f2014-07-16 19:20:40 -070040 , m_nOutInterests(0)
Davide Pesavento4ec7a5a2017-02-07 23:13:39 -050041 , m_nOutData(0)
Eric Newberry95bd96a2015-09-04 23:34:22 -070042 , m_nOutNacks(0)
Junxiao Shi13e637f2014-07-16 19:20:40 -070043 , m_nInBytes(0)
44 , m_nOutBytes(0)
45{
46}
47
Chengyu Fan36dca992014-09-25 13:42:03 -060048FaceStatus::FaceStatus(const Block& block)
49{
50 this->wireDecode(block);
51}
52
Alexander Afanasyev74633892015-02-08 18:08:46 -080053template<encoding::Tag TAG>
Junxiao Shi13e637f2014-07-16 19:20:40 -070054size_t
Alexander Afanasyev74633892015-02-08 18:08:46 -080055FaceStatus::wireEncode(EncodingImpl<TAG>& encoder) const
Junxiao Shi13e637f2014-07-16 19:20:40 -070056{
57 size_t totalLength = 0;
58
Junxiao Shi9a53d782017-04-04 20:09:57 +000059 totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::Flags, m_flags);
60 totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NOutBytes, m_nOutBytes);
61 totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NInBytes, m_nInBytes);
62 totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NOutNacks, m_nOutNacks);
63 totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NOutData, m_nOutData);
64 totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NOutInterests, m_nOutInterests);
65 totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NInNacks, m_nInNacks);
66 totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NInData, m_nInData);
67 totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NInInterests, m_nInInterests);
Eric Newberry07d05c92018-01-22 16:08:01 -070068 totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::DefaultCongestionThreshold,
69 m_defaultCongestionThreshold);
70 totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::BaseCongestionMarkingInterval,
71 m_baseCongestionMarkingInterval.count());
Junxiao Shi9a53d782017-04-04 20:09:57 +000072 totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::LinkType, m_linkType);
73 totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::FacePersistency, m_facePersistency);
74 totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::FaceScope, m_faceScope);
Davide Pesavento4ec7a5a2017-02-07 23:13:39 -050075 if (m_expirationPeriod) {
Junxiao Shi5d75fd92017-08-08 18:09:20 +000076 totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::ExpirationPeriod,
77 m_expirationPeriod->count());
Junxiao Shi13e637f2014-07-16 19:20:40 -070078 }
Junxiao Shi5d75fd92017-08-08 18:09:20 +000079 totalLength += prependStringBlock(encoder, tlv::nfd::LocalUri, m_localUri);
80 totalLength += prependStringBlock(encoder, tlv::nfd::Uri, m_remoteUri);
81 totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::FaceId, m_faceId);
Junxiao Shi13e637f2014-07-16 19:20:40 -070082
83 totalLength += encoder.prependVarNumber(totalLength);
84 totalLength += encoder.prependVarNumber(tlv::nfd::FaceStatus);
85 return totalLength;
86}
87
Davide Pesavento88a0d812017-08-19 21:31:42 -040088NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(FaceStatus);
Junxiao Shi13e637f2014-07-16 19:20:40 -070089
90const Block&
91FaceStatus::wireEncode() const
92{
93 if (m_wire.hasWire())
94 return m_wire;
95
96 EncodingEstimator estimator;
97 size_t estimatedSize = wireEncode(estimator);
98
99 EncodingBuffer buffer(estimatedSize, 0);
100 wireEncode(buffer);
101
102 m_wire = buffer.block();
103 return m_wire;
104}
105
106void
107FaceStatus::wireDecode(const Block& block)
108{
109 if (block.type() != tlv::nfd::FaceStatus) {
Spyridon Mastorakis0d2ed2e2015-07-27 19:09:12 -0700110 BOOST_THROW_EXCEPTION(Error("expecting FaceStatus block"));
Junxiao Shi13e637f2014-07-16 19:20:40 -0700111 }
112 m_wire = block;
113 m_wire.parse();
114 Block::element_const_iterator val = m_wire.elements_begin();
115
116 if (val != m_wire.elements_end() && val->type() == tlv::nfd::FaceId) {
117 m_faceId = readNonNegativeInteger(*val);
118 ++val;
119 }
120 else {
Spyridon Mastorakis0d2ed2e2015-07-27 19:09:12 -0700121 BOOST_THROW_EXCEPTION(Error("missing required FaceId field"));
Junxiao Shi13e637f2014-07-16 19:20:40 -0700122 }
123
124 if (val != m_wire.elements_end() && val->type() == tlv::nfd::Uri) {
Junxiao Shi5d75fd92017-08-08 18:09:20 +0000125 m_remoteUri = readString(*val);
Junxiao Shi13e637f2014-07-16 19:20:40 -0700126 ++val;
127 }
128 else {
Spyridon Mastorakis0d2ed2e2015-07-27 19:09:12 -0700129 BOOST_THROW_EXCEPTION(Error("missing required Uri field"));
Junxiao Shi13e637f2014-07-16 19:20:40 -0700130 }
131
132 if (val != m_wire.elements_end() && val->type() == tlv::nfd::LocalUri) {
Junxiao Shi5d75fd92017-08-08 18:09:20 +0000133 m_localUri = readString(*val);
Junxiao Shi13e637f2014-07-16 19:20:40 -0700134 ++val;
135 }
136 else {
Spyridon Mastorakis0d2ed2e2015-07-27 19:09:12 -0700137 BOOST_THROW_EXCEPTION(Error("missing required LocalUri field"));
Junxiao Shi13e637f2014-07-16 19:20:40 -0700138 }
139
140 if (val != m_wire.elements_end() && val->type() == tlv::nfd::ExpirationPeriod) {
Davide Pesavento4ec7a5a2017-02-07 23:13:39 -0500141 m_expirationPeriod.emplace(readNonNegativeInteger(*val));
Junxiao Shi13e637f2014-07-16 19:20:40 -0700142 ++val;
143 }
144 else {
Davide Pesavento4ec7a5a2017-02-07 23:13:39 -0500145 m_expirationPeriod = nullopt;
Junxiao Shi13e637f2014-07-16 19:20:40 -0700146 }
147
Chengyu Fan36dca992014-09-25 13:42:03 -0600148 if (val != m_wire.elements_end() && val->type() == tlv::nfd::FaceScope) {
Junxiao Shi5d75fd92017-08-08 18:09:20 +0000149 m_faceScope = readNonNegativeIntegerAs<FaceScope>(*val);
Junxiao Shi13e637f2014-07-16 19:20:40 -0700150 ++val;
151 }
152 else {
Spyridon Mastorakis0d2ed2e2015-07-27 19:09:12 -0700153 BOOST_THROW_EXCEPTION(Error("missing required FaceScope field"));
Chengyu Fan36dca992014-09-25 13:42:03 -0600154 }
155
156 if (val != m_wire.elements_end() && val->type() == tlv::nfd::FacePersistency) {
Junxiao Shi5d75fd92017-08-08 18:09:20 +0000157 m_facePersistency = readNonNegativeIntegerAs<FacePersistency>(*val);
Chengyu Fan36dca992014-09-25 13:42:03 -0600158 ++val;
159 }
160 else {
Spyridon Mastorakis0d2ed2e2015-07-27 19:09:12 -0700161 BOOST_THROW_EXCEPTION(Error("missing required FacePersistency field"));
Chengyu Fan36dca992014-09-25 13:42:03 -0600162 }
163
164 if (val != m_wire.elements_end() && val->type() == tlv::nfd::LinkType) {
Junxiao Shi5d75fd92017-08-08 18:09:20 +0000165 m_linkType = readNonNegativeIntegerAs<LinkType>(*val);
Chengyu Fan36dca992014-09-25 13:42:03 -0600166 ++val;
167 }
168 else {
Spyridon Mastorakis0d2ed2e2015-07-27 19:09:12 -0700169 BOOST_THROW_EXCEPTION(Error("missing required LinkType field"));
Junxiao Shi13e637f2014-07-16 19:20:40 -0700170 }
171
Eric Newberry07d05c92018-01-22 16:08:01 -0700172 if (val != m_wire.elements_end() && val->type() == tlv::nfd::BaseCongestionMarkingInterval) {
173 m_baseCongestionMarkingInterval = time::nanoseconds(readNonNegativeInteger(*val));
174 ++val;
175 }
176 else {
177 BOOST_THROW_EXCEPTION(Error("missing required BaseCongestionMarkingInterval field"));
178 }
179
180 if (val != m_wire.elements_end() && val->type() == tlv::nfd::DefaultCongestionThreshold) {
181 m_defaultCongestionThreshold = readNonNegativeInteger(*val);
182 ++val;
183 }
184 else {
185 BOOST_THROW_EXCEPTION(Error("missing required DefaultCongestionThreshold field"));
186 }
187
Junxiao Shi13e637f2014-07-16 19:20:40 -0700188 if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInInterests) {
189 m_nInInterests = readNonNegativeInteger(*val);
190 ++val;
191 }
192 else {
Spyridon Mastorakis0d2ed2e2015-07-27 19:09:12 -0700193 BOOST_THROW_EXCEPTION(Error("missing required NInInterests field"));
Junxiao Shi13e637f2014-07-16 19:20:40 -0700194 }
195
Junxiao Shi9a53d782017-04-04 20:09:57 +0000196 if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInData) {
Davide Pesavento4ec7a5a2017-02-07 23:13:39 -0500197 m_nInData = readNonNegativeInteger(*val);
Junxiao Shi13e637f2014-07-16 19:20:40 -0700198 ++val;
199 }
200 else {
Junxiao Shi9a53d782017-04-04 20:09:57 +0000201 BOOST_THROW_EXCEPTION(Error("missing required NInData field"));
Junxiao Shi13e637f2014-07-16 19:20:40 -0700202 }
203
Eric Newberry95bd96a2015-09-04 23:34:22 -0700204 if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInNacks) {
205 m_nInNacks = readNonNegativeInteger(*val);
206 ++val;
207 }
208 else {
209 BOOST_THROW_EXCEPTION(Error("missing required NInNacks field"));
210 }
211
Junxiao Shi13e637f2014-07-16 19:20:40 -0700212 if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutInterests) {
213 m_nOutInterests = readNonNegativeInteger(*val);
214 ++val;
215 }
216 else {
Spyridon Mastorakis0d2ed2e2015-07-27 19:09:12 -0700217 BOOST_THROW_EXCEPTION(Error("missing required NOutInterests field"));
Junxiao Shi13e637f2014-07-16 19:20:40 -0700218 }
219
Junxiao Shi9a53d782017-04-04 20:09:57 +0000220 if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutData) {
Davide Pesavento4ec7a5a2017-02-07 23:13:39 -0500221 m_nOutData = readNonNegativeInteger(*val);
Junxiao Shi13e637f2014-07-16 19:20:40 -0700222 ++val;
223 }
224 else {
Junxiao Shi9a53d782017-04-04 20:09:57 +0000225 BOOST_THROW_EXCEPTION(Error("missing required NOutData field"));
Junxiao Shi13e637f2014-07-16 19:20:40 -0700226 }
227
Eric Newberry95bd96a2015-09-04 23:34:22 -0700228 if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutNacks) {
229 m_nOutNacks = readNonNegativeInteger(*val);
230 ++val;
231 }
232 else {
233 BOOST_THROW_EXCEPTION(Error("missing required NOutNacks field"));
234 }
235
Junxiao Shi13e637f2014-07-16 19:20:40 -0700236 if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInBytes) {
237 m_nInBytes = readNonNegativeInteger(*val);
238 ++val;
239 }
240 else {
Spyridon Mastorakis0d2ed2e2015-07-27 19:09:12 -0700241 BOOST_THROW_EXCEPTION(Error("missing required NInBytes field"));
Junxiao Shi13e637f2014-07-16 19:20:40 -0700242 }
243
244 if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutBytes) {
245 m_nOutBytes = readNonNegativeInteger(*val);
246 ++val;
247 }
248 else {
Spyridon Mastorakis0d2ed2e2015-07-27 19:09:12 -0700249 BOOST_THROW_EXCEPTION(Error("missing required NOutBytes field"));
Junxiao Shi13e637f2014-07-16 19:20:40 -0700250 }
Eric Newberry1ce8ab22016-09-24 11:57:21 -0700251
252 if (val != m_wire.elements_end() && val->type() == tlv::nfd::Flags) {
253 m_flags = readNonNegativeInteger(*val);
254 ++val;
255 }
256 else {
257 BOOST_THROW_EXCEPTION(Error("missing required Flags field"));
258 }
Junxiao Shi13e637f2014-07-16 19:20:40 -0700259}
260
Chengyu Fan36dca992014-09-25 13:42:03 -0600261FaceStatus&
Davide Pesavento4ec7a5a2017-02-07 23:13:39 -0500262FaceStatus::setExpirationPeriod(time::milliseconds expirationPeriod)
Chengyu Fan36dca992014-09-25 13:42:03 -0600263{
264 m_wire.reset();
265 m_expirationPeriod = expirationPeriod;
Chengyu Fan36dca992014-09-25 13:42:03 -0600266 return *this;
267}
268
269FaceStatus&
Davide Pesavento156c1ea2017-03-19 16:09:33 -0400270FaceStatus::unsetExpirationPeriod()
271{
272 m_wire.reset();
273 m_expirationPeriod = nullopt;
274 return *this;
275}
276
277FaceStatus&
Eric Newberry07d05c92018-01-22 16:08:01 -0700278FaceStatus::setBaseCongestionMarkingInterval(time::nanoseconds interval)
279{
280 m_wire.reset();
281 m_baseCongestionMarkingInterval = interval;
282 return *this;
283}
284
285FaceStatus&
286FaceStatus::setDefaultCongestionThreshold(uint64_t threshold)
287{
288 m_wire.reset();
289 m_defaultCongestionThreshold = threshold;
290 return *this;
291}
292
293FaceStatus&
Chengyu Fan36dca992014-09-25 13:42:03 -0600294FaceStatus::setNInInterests(uint64_t nInInterests)
295{
296 m_wire.reset();
297 m_nInInterests = nInInterests;
298 return *this;
299}
300
301FaceStatus&
Junxiao Shi9a53d782017-04-04 20:09:57 +0000302FaceStatus::setNInData(uint64_t nInData)
Chengyu Fan36dca992014-09-25 13:42:03 -0600303{
304 m_wire.reset();
Davide Pesavento4ec7a5a2017-02-07 23:13:39 -0500305 m_nInData = nInData;
Chengyu Fan36dca992014-09-25 13:42:03 -0600306 return *this;
307}
308
309FaceStatus&
Eric Newberry95bd96a2015-09-04 23:34:22 -0700310FaceStatus::setNInNacks(uint64_t nInNacks)
311{
312 m_wire.reset();
313 m_nInNacks = nInNacks;
314 return *this;
315}
316
317FaceStatus&
Chengyu Fan36dca992014-09-25 13:42:03 -0600318FaceStatus::setNOutInterests(uint64_t nOutInterests)
319{
320 m_wire.reset();
321 m_nOutInterests = nOutInterests;
322 return *this;
323}
324
325FaceStatus&
Junxiao Shi9a53d782017-04-04 20:09:57 +0000326FaceStatus::setNOutData(uint64_t nOutData)
Chengyu Fan36dca992014-09-25 13:42:03 -0600327{
328 m_wire.reset();
Davide Pesavento4ec7a5a2017-02-07 23:13:39 -0500329 m_nOutData = nOutData;
Chengyu Fan36dca992014-09-25 13:42:03 -0600330 return *this;
331}
332
333FaceStatus&
Eric Newberry95bd96a2015-09-04 23:34:22 -0700334FaceStatus::setNOutNacks(uint64_t nOutNacks)
335{
336 m_wire.reset();
337 m_nOutNacks = nOutNacks;
338 return *this;
339}
340
341FaceStatus&
Chengyu Fan36dca992014-09-25 13:42:03 -0600342FaceStatus::setNInBytes(uint64_t nInBytes)
343{
344 m_wire.reset();
345 m_nInBytes = nInBytes;
346 return *this;
347}
348
349FaceStatus&
350FaceStatus::setNOutBytes(uint64_t nOutBytes)
351{
352 m_wire.reset();
353 m_nOutBytes = nOutBytes;
354 return *this;
355}
356
Davide Pesavento4ec7a5a2017-02-07 23:13:39 -0500357bool
358operator==(const FaceStatus& a, const FaceStatus& b)
359{
360 return a.getFaceId() == b.getFaceId() &&
361 a.getRemoteUri() == b.getRemoteUri() &&
362 a.getLocalUri() == b.getLocalUri() &&
363 a.getFaceScope() == b.getFaceScope() &&
364 a.getFacePersistency() == b.getFacePersistency() &&
365 a.getLinkType() == b.getLinkType() &&
366 a.getFlags() == b.getFlags() &&
367 a.hasExpirationPeriod() == b.hasExpirationPeriod() &&
368 (!a.hasExpirationPeriod() || a.getExpirationPeriod() == b.getExpirationPeriod()) &&
Eric Newberry07d05c92018-01-22 16:08:01 -0700369 a.getBaseCongestionMarkingInterval() == b.getBaseCongestionMarkingInterval() &&
370 a.getDefaultCongestionThreshold() == b.getDefaultCongestionThreshold() &&
Davide Pesavento4ec7a5a2017-02-07 23:13:39 -0500371 a.getNInInterests() == b.getNInInterests() &&
Junxiao Shi9a53d782017-04-04 20:09:57 +0000372 a.getNInData() == b.getNInData() &&
Davide Pesavento4ec7a5a2017-02-07 23:13:39 -0500373 a.getNInNacks() == b.getNInNacks() &&
374 a.getNOutInterests() == b.getNOutInterests() &&
Junxiao Shi9a53d782017-04-04 20:09:57 +0000375 a.getNOutData() == b.getNOutData() &&
Davide Pesavento4ec7a5a2017-02-07 23:13:39 -0500376 a.getNOutNacks() == b.getNOutNacks() &&
377 a.getNInBytes() == b.getNInBytes() &&
378 a.getNOutBytes() == b.getNOutBytes();
379}
380
Junxiao Shi13e637f2014-07-16 19:20:40 -0700381std::ostream&
382operator<<(std::ostream& os, const FaceStatus& status)
383{
Davide Pesavento4ec7a5a2017-02-07 23:13:39 -0500384 os << "Face(FaceId: " << status.getFaceId() << ",\n"
385 << " RemoteUri: " << status.getRemoteUri() << ",\n"
386 << " LocalUri: " << status.getLocalUri() << ",\n";
Junxiao Shi13e637f2014-07-16 19:20:40 -0700387
388 if (status.hasExpirationPeriod()) {
Davide Pesavento4ec7a5a2017-02-07 23:13:39 -0500389 os << " ExpirationPeriod: " << status.getExpirationPeriod() << ",\n";
Junxiao Shi13e637f2014-07-16 19:20:40 -0700390 }
391 else {
Davide Pesavento4ec7a5a2017-02-07 23:13:39 -0500392 os << " ExpirationPeriod: infinite,\n";
Junxiao Shi13e637f2014-07-16 19:20:40 -0700393 }
394
Davide Pesavento4ec7a5a2017-02-07 23:13:39 -0500395 os << " FaceScope: " << status.getFaceScope() << ",\n"
396 << " FacePersistency: " << status.getFacePersistency() << ",\n"
Davide Pesaventoe78eeca2017-02-23 23:22:32 -0500397 << " LinkType: " << status.getLinkType() << ",\n"
Eric Newberry07d05c92018-01-22 16:08:01 -0700398 << " BaseCongestionMarkingInterval: " << status.getBaseCongestionMarkingInterval() << ",\n"
399 << " DefaultCongestionThreshold: " << status.getDefaultCongestionThreshold() << " bytes,\n"
Davide Pesaventoe78eeca2017-02-23 23:22:32 -0500400 << " Flags: " << AsHex{status.getFlags()} << ",\n"
401 << " Counters: {Interests: {in: " << status.getNInInterests() << ", "
Junxiao Shi13e637f2014-07-16 19:20:40 -0700402 << "out: " << status.getNOutInterests() << "},\n"
Junxiao Shi9a53d782017-04-04 20:09:57 +0000403 << " Data: {in: " << status.getNInData() << ", "
404 << "out: " << status.getNOutData() << "},\n"
Davide Pesavento4ec7a5a2017-02-07 23:13:39 -0500405 << " Nacks: {in: " << status.getNInNacks() << ", "
Eric Newberry95bd96a2015-09-04 23:34:22 -0700406 << "out: " << status.getNOutNacks() << "},\n"
Davide Pesavento4ec7a5a2017-02-07 23:13:39 -0500407 << " bytes: {in: " << status.getNInBytes() << ", "
408 << "out: " << status.getNOutBytes() << "}}\n";
409
410 return os << " )";
Junxiao Shi13e637f2014-07-16 19:20:40 -0700411}
412
413} // namespace nfd
414} // namespace ndn