Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
Junxiao Shi | 7357ef2 | 2016-09-07 02:39:37 +0000 | [diff] [blame^] | 3 | * Copyright (c) 2013-2016 Regents of the University of California. |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 4 | * |
| 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 Shi | 7357ef2 | 2016-09-07 02:39:37 +0000 | [diff] [blame^] | 22 | #include "face-status.hpp" |
Junxiao Shi | 65f1a71 | 2014-11-20 14:59:36 -0700 | [diff] [blame] | 23 | #include "encoding/tlv-nfd.hpp" |
| 24 | #include "encoding/block-helpers.hpp" |
| 25 | #include "util/concepts.hpp" |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 26 | |
| 27 | namespace ndn { |
| 28 | namespace nfd { |
| 29 | |
Junxiao Shi | 65f1a71 | 2014-11-20 14:59:36 -0700 | [diff] [blame] | 30 | //BOOST_CONCEPT_ASSERT((boost::EqualityComparable<FaceStatus>)); |
| 31 | BOOST_CONCEPT_ASSERT((WireEncodable<FaceStatus>)); |
| 32 | BOOST_CONCEPT_ASSERT((WireDecodable<FaceStatus>)); |
| 33 | static_assert(std::is_base_of<tlv::Error, FaceStatus::Error>::value, |
| 34 | "FaceStatus::Error must inherit from tlv::Error"); |
| 35 | |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 36 | FaceStatus::FaceStatus() |
Junxiao Shi | 65f1a71 | 2014-11-20 14:59:36 -0700 | [diff] [blame] | 37 | : m_hasExpirationPeriod(false) |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 38 | , m_nInInterests(0) |
| 39 | , m_nInDatas(0) |
Eric Newberry | 95bd96a | 2015-09-04 23:34:22 -0700 | [diff] [blame] | 40 | , m_nInNacks(0) |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 41 | , m_nOutInterests(0) |
| 42 | , m_nOutDatas(0) |
Eric Newberry | 95bd96a | 2015-09-04 23:34:22 -0700 | [diff] [blame] | 43 | , m_nOutNacks(0) |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 44 | , m_nInBytes(0) |
| 45 | , m_nOutBytes(0) |
| 46 | { |
| 47 | } |
| 48 | |
Chengyu Fan | 36dca99 | 2014-09-25 13:42:03 -0600 | [diff] [blame] | 49 | FaceStatus::FaceStatus(const Block& block) |
| 50 | { |
| 51 | this->wireDecode(block); |
| 52 | } |
| 53 | |
Alexander Afanasyev | 7463389 | 2015-02-08 18:08:46 -0800 | [diff] [blame] | 54 | template<encoding::Tag TAG> |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 55 | size_t |
Alexander Afanasyev | 7463389 | 2015-02-08 18:08:46 -0800 | [diff] [blame] | 56 | FaceStatus::wireEncode(EncodingImpl<TAG>& encoder) const |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 57 | { |
| 58 | size_t totalLength = 0; |
| 59 | |
| 60 | totalLength += prependNonNegativeIntegerBlock(encoder, |
| 61 | tlv::nfd::NOutBytes, m_nOutBytes); |
| 62 | totalLength += prependNonNegativeIntegerBlock(encoder, |
| 63 | tlv::nfd::NInBytes, m_nInBytes); |
| 64 | totalLength += prependNonNegativeIntegerBlock(encoder, |
Eric Newberry | 95bd96a | 2015-09-04 23:34:22 -0700 | [diff] [blame] | 65 | tlv::nfd::NOutNacks, m_nOutNacks); |
| 66 | totalLength += prependNonNegativeIntegerBlock(encoder, |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 67 | tlv::nfd::NOutDatas, m_nOutDatas); |
| 68 | totalLength += prependNonNegativeIntegerBlock(encoder, |
| 69 | tlv::nfd::NOutInterests, m_nOutInterests); |
| 70 | totalLength += prependNonNegativeIntegerBlock(encoder, |
Eric Newberry | 95bd96a | 2015-09-04 23:34:22 -0700 | [diff] [blame] | 71 | tlv::nfd::NInNacks, m_nInNacks); |
| 72 | totalLength += prependNonNegativeIntegerBlock(encoder, |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 73 | tlv::nfd::NInDatas, m_nInDatas); |
| 74 | totalLength += prependNonNegativeIntegerBlock(encoder, |
| 75 | tlv::nfd::NInInterests, m_nInInterests); |
| 76 | totalLength += prependNonNegativeIntegerBlock(encoder, |
Chengyu Fan | 36dca99 | 2014-09-25 13:42:03 -0600 | [diff] [blame] | 77 | tlv::nfd::LinkType, m_linkType); |
| 78 | totalLength += prependNonNegativeIntegerBlock(encoder, |
| 79 | tlv::nfd::FacePersistency, m_facePersistency); |
| 80 | totalLength += prependNonNegativeIntegerBlock(encoder, |
| 81 | tlv::nfd::FaceScope, m_faceScope); |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 82 | if (m_hasExpirationPeriod) { |
| 83 | totalLength += prependNonNegativeIntegerBlock(encoder, |
| 84 | tlv::nfd::ExpirationPeriod, m_expirationPeriod.count()); |
| 85 | } |
Alexander Afanasyev | 7463389 | 2015-02-08 18:08:46 -0800 | [diff] [blame] | 86 | totalLength += encoder.prependByteArrayBlock(tlv::nfd::LocalUri, |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 87 | reinterpret_cast<const uint8_t*>(m_localUri.c_str()), m_localUri.size()); |
Alexander Afanasyev | 7463389 | 2015-02-08 18:08:46 -0800 | [diff] [blame] | 88 | totalLength += encoder.prependByteArrayBlock(tlv::nfd::Uri, |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 89 | reinterpret_cast<const uint8_t*>(m_remoteUri.c_str()), m_remoteUri.size()); |
| 90 | totalLength += prependNonNegativeIntegerBlock(encoder, |
| 91 | tlv::nfd::FaceId, m_faceId); |
| 92 | |
| 93 | totalLength += encoder.prependVarNumber(totalLength); |
| 94 | totalLength += encoder.prependVarNumber(tlv::nfd::FaceStatus); |
| 95 | return totalLength; |
| 96 | } |
| 97 | |
| 98 | template size_t |
Alexander Afanasyev | 7463389 | 2015-02-08 18:08:46 -0800 | [diff] [blame] | 99 | FaceStatus::wireEncode<encoding::EncoderTag>(EncodingImpl<encoding::EncoderTag>& block) const; |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 100 | |
| 101 | template size_t |
Alexander Afanasyev | 7463389 | 2015-02-08 18:08:46 -0800 | [diff] [blame] | 102 | FaceStatus::wireEncode<encoding::EstimatorTag>(EncodingImpl<encoding::EstimatorTag>& block) const; |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 103 | |
| 104 | const Block& |
| 105 | FaceStatus::wireEncode() const |
| 106 | { |
| 107 | if (m_wire.hasWire()) |
| 108 | return m_wire; |
| 109 | |
| 110 | EncodingEstimator estimator; |
| 111 | size_t estimatedSize = wireEncode(estimator); |
| 112 | |
| 113 | EncodingBuffer buffer(estimatedSize, 0); |
| 114 | wireEncode(buffer); |
| 115 | |
| 116 | m_wire = buffer.block(); |
| 117 | return m_wire; |
| 118 | } |
| 119 | |
| 120 | void |
| 121 | FaceStatus::wireDecode(const Block& block) |
| 122 | { |
| 123 | if (block.type() != tlv::nfd::FaceStatus) { |
Spyridon Mastorakis | 0d2ed2e | 2015-07-27 19:09:12 -0700 | [diff] [blame] | 124 | BOOST_THROW_EXCEPTION(Error("expecting FaceStatus block")); |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 125 | } |
| 126 | m_wire = block; |
| 127 | m_wire.parse(); |
| 128 | Block::element_const_iterator val = m_wire.elements_begin(); |
| 129 | |
| 130 | if (val != m_wire.elements_end() && val->type() == tlv::nfd::FaceId) { |
| 131 | m_faceId = readNonNegativeInteger(*val); |
| 132 | ++val; |
| 133 | } |
| 134 | else { |
Spyridon Mastorakis | 0d2ed2e | 2015-07-27 19:09:12 -0700 | [diff] [blame] | 135 | BOOST_THROW_EXCEPTION(Error("missing required FaceId field")); |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | if (val != m_wire.elements_end() && val->type() == tlv::nfd::Uri) { |
| 139 | m_remoteUri.assign(reinterpret_cast<const char*>(val->value()), val->value_size()); |
| 140 | ++val; |
| 141 | } |
| 142 | else { |
Spyridon Mastorakis | 0d2ed2e | 2015-07-27 19:09:12 -0700 | [diff] [blame] | 143 | BOOST_THROW_EXCEPTION(Error("missing required Uri field")); |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 144 | } |
| 145 | |
| 146 | if (val != m_wire.elements_end() && val->type() == tlv::nfd::LocalUri) { |
| 147 | m_localUri.assign(reinterpret_cast<const char*>(val->value()), val->value_size()); |
| 148 | ++val; |
| 149 | } |
| 150 | else { |
Spyridon Mastorakis | 0d2ed2e | 2015-07-27 19:09:12 -0700 | [diff] [blame] | 151 | BOOST_THROW_EXCEPTION(Error("missing required LocalUri field")); |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 152 | } |
| 153 | |
| 154 | if (val != m_wire.elements_end() && val->type() == tlv::nfd::ExpirationPeriod) { |
| 155 | m_expirationPeriod = time::milliseconds(readNonNegativeInteger(*val)); |
| 156 | m_hasExpirationPeriod = true; |
| 157 | ++val; |
| 158 | } |
| 159 | else { |
| 160 | m_hasExpirationPeriod = false; |
| 161 | // ExpirationPeriod is optional |
| 162 | } |
| 163 | |
Chengyu Fan | 36dca99 | 2014-09-25 13:42:03 -0600 | [diff] [blame] | 164 | if (val != m_wire.elements_end() && val->type() == tlv::nfd::FaceScope) { |
| 165 | m_faceScope = static_cast<FaceScope>(readNonNegativeInteger(*val)); |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 166 | ++val; |
| 167 | } |
| 168 | else { |
Spyridon Mastorakis | 0d2ed2e | 2015-07-27 19:09:12 -0700 | [diff] [blame] | 169 | BOOST_THROW_EXCEPTION(Error("missing required FaceScope field")); |
Chengyu Fan | 36dca99 | 2014-09-25 13:42:03 -0600 | [diff] [blame] | 170 | } |
| 171 | |
| 172 | if (val != m_wire.elements_end() && val->type() == tlv::nfd::FacePersistency) { |
| 173 | m_facePersistency = static_cast<FacePersistency>(readNonNegativeInteger(*val)); |
| 174 | ++val; |
| 175 | } |
| 176 | else { |
Spyridon Mastorakis | 0d2ed2e | 2015-07-27 19:09:12 -0700 | [diff] [blame] | 177 | BOOST_THROW_EXCEPTION(Error("missing required FacePersistency field")); |
Chengyu Fan | 36dca99 | 2014-09-25 13:42:03 -0600 | [diff] [blame] | 178 | } |
| 179 | |
| 180 | if (val != m_wire.elements_end() && val->type() == tlv::nfd::LinkType) { |
| 181 | m_linkType = static_cast<LinkType>(readNonNegativeInteger(*val)); |
| 182 | ++val; |
| 183 | } |
| 184 | else { |
Spyridon Mastorakis | 0d2ed2e | 2015-07-27 19:09:12 -0700 | [diff] [blame] | 185 | BOOST_THROW_EXCEPTION(Error("missing required LinkType field")); |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 186 | } |
| 187 | |
| 188 | if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInInterests) { |
| 189 | m_nInInterests = readNonNegativeInteger(*val); |
| 190 | ++val; |
| 191 | } |
| 192 | else { |
Spyridon Mastorakis | 0d2ed2e | 2015-07-27 19:09:12 -0700 | [diff] [blame] | 193 | BOOST_THROW_EXCEPTION(Error("missing required NInInterests field")); |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 194 | } |
| 195 | |
| 196 | if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInDatas) { |
| 197 | m_nInDatas = readNonNegativeInteger(*val); |
| 198 | ++val; |
| 199 | } |
| 200 | else { |
Spyridon Mastorakis | 0d2ed2e | 2015-07-27 19:09:12 -0700 | [diff] [blame] | 201 | BOOST_THROW_EXCEPTION(Error("missing required NInDatas field")); |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 202 | } |
| 203 | |
Eric Newberry | 95bd96a | 2015-09-04 23:34:22 -0700 | [diff] [blame] | 204 | 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 Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 212 | if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutInterests) { |
| 213 | m_nOutInterests = readNonNegativeInteger(*val); |
| 214 | ++val; |
| 215 | } |
| 216 | else { |
Spyridon Mastorakis | 0d2ed2e | 2015-07-27 19:09:12 -0700 | [diff] [blame] | 217 | BOOST_THROW_EXCEPTION(Error("missing required NOutInterests field")); |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 218 | } |
| 219 | |
| 220 | if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutDatas) { |
| 221 | m_nOutDatas = readNonNegativeInteger(*val); |
| 222 | ++val; |
| 223 | } |
| 224 | else { |
Spyridon Mastorakis | 0d2ed2e | 2015-07-27 19:09:12 -0700 | [diff] [blame] | 225 | BOOST_THROW_EXCEPTION(Error("missing required NOutDatas field")); |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 226 | } |
| 227 | |
Eric Newberry | 95bd96a | 2015-09-04 23:34:22 -0700 | [diff] [blame] | 228 | 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 Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 236 | if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInBytes) { |
| 237 | m_nInBytes = readNonNegativeInteger(*val); |
| 238 | ++val; |
| 239 | } |
| 240 | else { |
Spyridon Mastorakis | 0d2ed2e | 2015-07-27 19:09:12 -0700 | [diff] [blame] | 241 | BOOST_THROW_EXCEPTION(Error("missing required NInBytes field")); |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 242 | } |
| 243 | |
| 244 | if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutBytes) { |
| 245 | m_nOutBytes = readNonNegativeInteger(*val); |
| 246 | ++val; |
| 247 | } |
| 248 | else { |
Spyridon Mastorakis | 0d2ed2e | 2015-07-27 19:09:12 -0700 | [diff] [blame] | 249 | BOOST_THROW_EXCEPTION(Error("missing required NOutBytes field")); |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 250 | } |
| 251 | } |
| 252 | |
Chengyu Fan | 36dca99 | 2014-09-25 13:42:03 -0600 | [diff] [blame] | 253 | FaceStatus& |
| 254 | FaceStatus::setExpirationPeriod(const time::milliseconds& expirationPeriod) |
| 255 | { |
| 256 | m_wire.reset(); |
| 257 | m_expirationPeriod = expirationPeriod; |
| 258 | m_hasExpirationPeriod = true; |
| 259 | return *this; |
| 260 | } |
| 261 | |
| 262 | FaceStatus& |
| 263 | FaceStatus::setNInInterests(uint64_t nInInterests) |
| 264 | { |
| 265 | m_wire.reset(); |
| 266 | m_nInInterests = nInInterests; |
| 267 | return *this; |
| 268 | } |
| 269 | |
| 270 | FaceStatus& |
| 271 | FaceStatus::setNInDatas(uint64_t nInDatas) |
| 272 | { |
| 273 | m_wire.reset(); |
| 274 | m_nInDatas = nInDatas; |
| 275 | return *this; |
| 276 | } |
| 277 | |
| 278 | FaceStatus& |
Eric Newberry | 95bd96a | 2015-09-04 23:34:22 -0700 | [diff] [blame] | 279 | FaceStatus::setNInNacks(uint64_t nInNacks) |
| 280 | { |
| 281 | m_wire.reset(); |
| 282 | m_nInNacks = nInNacks; |
| 283 | return *this; |
| 284 | } |
| 285 | |
| 286 | FaceStatus& |
Chengyu Fan | 36dca99 | 2014-09-25 13:42:03 -0600 | [diff] [blame] | 287 | FaceStatus::setNOutInterests(uint64_t nOutInterests) |
| 288 | { |
| 289 | m_wire.reset(); |
| 290 | m_nOutInterests = nOutInterests; |
| 291 | return *this; |
| 292 | } |
| 293 | |
| 294 | FaceStatus& |
| 295 | FaceStatus::setNOutDatas(uint64_t nOutDatas) |
| 296 | { |
| 297 | m_wire.reset(); |
| 298 | m_nOutDatas = nOutDatas; |
| 299 | return *this; |
| 300 | } |
| 301 | |
| 302 | FaceStatus& |
Eric Newberry | 95bd96a | 2015-09-04 23:34:22 -0700 | [diff] [blame] | 303 | FaceStatus::setNOutNacks(uint64_t nOutNacks) |
| 304 | { |
| 305 | m_wire.reset(); |
| 306 | m_nOutNacks = nOutNacks; |
| 307 | return *this; |
| 308 | } |
| 309 | |
| 310 | FaceStatus& |
Chengyu Fan | 36dca99 | 2014-09-25 13:42:03 -0600 | [diff] [blame] | 311 | FaceStatus::setNInBytes(uint64_t nInBytes) |
| 312 | { |
| 313 | m_wire.reset(); |
| 314 | m_nInBytes = nInBytes; |
| 315 | return *this; |
| 316 | } |
| 317 | |
| 318 | FaceStatus& |
| 319 | FaceStatus::setNOutBytes(uint64_t nOutBytes) |
| 320 | { |
| 321 | m_wire.reset(); |
| 322 | m_nOutBytes = nOutBytes; |
| 323 | return *this; |
| 324 | } |
| 325 | |
| 326 | void |
| 327 | FaceStatus::wireReset() const |
| 328 | { |
| 329 | m_wire.reset(); |
| 330 | } |
| 331 | |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 332 | std::ostream& |
| 333 | operator<<(std::ostream& os, const FaceStatus& status) |
| 334 | { |
| 335 | os << "FaceStatus(" |
| 336 | << "FaceID: " << status.getFaceId() << ",\n" |
| 337 | << "RemoteUri: " << status.getRemoteUri() << ",\n" |
| 338 | << "LocalUri: " << status.getLocalUri() << ",\n"; |
| 339 | |
| 340 | if (status.hasExpirationPeriod()) { |
| 341 | os << "ExpirationPeriod: " << status.getExpirationPeriod() << ",\n"; |
| 342 | } |
| 343 | else { |
| 344 | os << "ExpirationPeriod: infinite,\n"; |
| 345 | } |
| 346 | |
Chengyu Fan | 36dca99 | 2014-09-25 13:42:03 -0600 | [diff] [blame] | 347 | os << "FaceScope: " << status.getFaceScope() << ",\n" |
| 348 | << "FacePersistency: " << status.getFacePersistency() << ",\n" |
| 349 | << "LinkType: " << status.getLinkType() << ",\n" |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 350 | << "Counters: { Interests: {in: " << status.getNInInterests() << ", " |
| 351 | << "out: " << status.getNOutInterests() << "},\n" |
| 352 | << " Data: {in: " << status.getNInDatas() << ", " |
| 353 | << "out: " << status.getNOutDatas() << "},\n" |
Eric Newberry | 95bd96a | 2015-09-04 23:34:22 -0700 | [diff] [blame] | 354 | << " Nack: {in: " << status.getNInNacks() << ", " |
| 355 | << "out: " << status.getNOutNacks() << "},\n" |
Junxiao Shi | 13e637f | 2014-07-16 19:20:40 -0700 | [diff] [blame] | 356 | << " bytes: {in: " << status.getNInBytes() << ", " |
| 357 | << "out: " << status.getNOutBytes() << "} }\n" |
| 358 | << ")"; |
| 359 | return os; |
| 360 | } |
| 361 | |
| 362 | } // namespace nfd |
| 363 | } // namespace ndn |