NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
forwarder-status.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013-2018 Regents of the University of California.
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 
22 #ifndef NDN_MGMT_NFD_FORWARDER_STATUS_HPP
23 #define NDN_MGMT_NFD_FORWARDER_STATUS_HPP
24 
26 #include "ndn-cxx/util/time.hpp"
27 
28 namespace ndn {
29 namespace nfd {
30 
37 {
38 public:
39  class Error : public tlv::Error
40  {
41  public:
42  using tlv::Error::Error;
43  };
44 
46 
47  explicit
48  ForwarderStatus(const Block& payload);
49 
54  template<encoding::Tag TAG>
55  size_t
56  wireEncode(EncodingImpl<TAG>& encoder) const;
57 
62  const Block&
63  wireEncode() const;
64 
69  void
70  wireDecode(const Block& wire);
71 
72 public: // getters & setters
73  const std::string&
74  getNfdVersion() const
75  {
76  return m_nfdVersion;
77  }
78 
80  setNfdVersion(const std::string& nfdVersion);
81 
84  {
85  return m_startTimestamp;
86  }
87 
89  setStartTimestamp(const time::system_clock::TimePoint& startTimestamp);
90 
93  {
94  return m_currentTimestamp;
95  }
96 
98  setCurrentTimestamp(const time::system_clock::TimePoint& currentTimestamp);
99 
100  uint64_t
102  {
103  return m_nNameTreeEntries;
104  }
105 
107  setNNameTreeEntries(uint64_t nNameTreeEntries);
108 
109  uint64_t
111  {
112  return m_nFibEntries;
113  }
114 
116  setNFibEntries(uint64_t nFibEntries);
117 
118  uint64_t
120  {
121  return m_nPitEntries;
122  }
123 
125  setNPitEntries(uint64_t nPitEntries);
126 
127  uint64_t
129  {
130  return m_nMeasurementsEntries;
131  }
132 
134  setNMeasurementsEntries(uint64_t nMeasurementsEntries);
135 
136  uint64_t
138  {
139  return m_nCsEntries;
140  }
141 
143  setNCsEntries(uint64_t nCsEntries);
144 
145  uint64_t
147  {
148  return m_nInInterests;
149  }
150 
152  setNInInterests(uint64_t nInInterests);
153 
154  uint64_t
155  getNInData() const
156  {
157  return m_nInData;
158  }
159 
161  setNInData(uint64_t nInData);
162 
163  uint64_t
164  getNInNacks() const
165  {
166  return m_nInNacks;
167  }
168 
170  setNInNacks(uint64_t nInNacks);
171 
172  uint64_t
174  {
175  return m_nOutInterests;
176  }
177 
179  setNOutInterests(uint64_t nOutInterests);
180 
181  uint64_t
182  getNOutData() const
183  {
184  return m_nOutData;
185  }
186 
188  setNOutData(uint64_t nOutData);
189 
190  uint64_t
191  getNOutNacks() const
192  {
193  return m_nOutNacks;
194  }
195 
197  setNOutNacks(uint64_t nOutNacks);
198 
199  uint64_t
201  {
202  return m_nSatisfiedInterests;
203  }
204 
206  setNSatisfiedInterests(uint64_t nSatisfiedInterests);
207 
208  uint64_t
210  {
211  return m_nUnsatisfiedInterests;
212  }
213 
215  setNUnsatisfiedInterests(uint64_t nUnsatisfiedInterests);
216 
217 private:
218  std::string m_nfdVersion;
219  time::system_clock::TimePoint m_startTimestamp;
220  time::system_clock::TimePoint m_currentTimestamp;
221  uint64_t m_nNameTreeEntries;
222  uint64_t m_nFibEntries;
223  uint64_t m_nPitEntries;
224  uint64_t m_nMeasurementsEntries;
225  uint64_t m_nCsEntries;
226  uint64_t m_nInInterests;
227  uint64_t m_nInData;
228  uint64_t m_nInNacks;
229  uint64_t m_nOutInterests;
230  uint64_t m_nOutData;
231  uint64_t m_nOutNacks;
232  uint64_t m_nSatisfiedInterests;
233  uint64_t m_nUnsatisfiedInterests;
234 
235  mutable Block m_wire;
236 };
237 
239 
240 bool
241 operator==(const ForwarderStatus& a, const ForwarderStatus& b);
242 
243 inline bool
245 {
246  return !(a == b);
247 }
248 
249 std::ostream&
250 operator<<(std::ostream& os, const ForwarderStatus& status);
251 
252 } // namespace nfd
253 } // namespace ndn
254 
255 #endif // NDN_MGMT_NFD_FORWARDER_STATUS_HPP
ndn::nfd::ForwarderStatus::setNInInterests
ForwarderStatus & setNInInterests(uint64_t nInInterests)
Definition: forwarder-status.cpp:308
ndn::nfd::ForwarderStatus::setNNameTreeEntries
ForwarderStatus & setNNameTreeEntries(uint64_t nNameTreeEntries)
Definition: forwarder-status.cpp:268
ndn::nfd::ForwarderStatus::setNfdVersion
ForwarderStatus & setNfdVersion(const std::string &nfdVersion)
Definition: forwarder-status.cpp:244
ndn::nfd::ForwarderStatus::setNOutInterests
ForwarderStatus & setNOutInterests(uint64_t nOutInterests)
Definition: forwarder-status.cpp:332
ndn::nfd::ForwarderStatus::setNUnsatisfiedInterests
ForwarderStatus & setNUnsatisfiedInterests(uint64_t nUnsatisfiedInterests)
Definition: forwarder-status.cpp:364
ndn::time::system_clock::TimePoint
time_point TimePoint
Definition: time.hpp:195
ndn::nfd::ForwarderStatus::setNInNacks
ForwarderStatus & setNInNacks(uint64_t nInNacks)
Definition: forwarder-status.cpp:324
ndn::nfd::NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(ChannelStatus)
ndn::nfd::ForwarderStatus::setNPitEntries
ForwarderStatus & setNPitEntries(uint64_t nPitEntries)
Definition: forwarder-status.cpp:284
ndn::nfd::ForwarderStatus::getNNameTreeEntries
uint64_t getNNameTreeEntries() const
Definition: forwarder-status.hpp:101
ndn::nfd::ForwarderStatus::getNSatisfiedInterests
uint64_t getNSatisfiedInterests() const
Definition: forwarder-status.hpp:200
ndn::nfd::ForwarderStatus::ForwarderStatus
ForwarderStatus()
Definition: forwarder-status.cpp:33
ndn::nfd::ForwarderStatus::setNCsEntries
ForwarderStatus & setNCsEntries(uint64_t nCsEntries)
Definition: forwarder-status.cpp:300
ndn::nfd::operator<<
std::ostream & operator<<(std::ostream &os, FaceScope faceScope)
Definition: nfd-constants.cpp:36
ndn::nfd::ForwarderStatus::getNfdVersion
const std::string & getNfdVersion() const
Definition: forwarder-status.hpp:74
block.hpp
ndn::nfd::ForwarderStatus::wireEncode
const Block & wireEncode() const
encode ForwarderStatus as a Content block
Definition: forwarder-status.cpp:88
ndn::nfd::ForwarderStatus::wireDecode
void wireDecode(const Block &wire)
decode ForwarderStatus from a Content block
Definition: forwarder-status.cpp:104
ndn::nfd::ForwarderStatus::setNSatisfiedInterests
ForwarderStatus & setNSatisfiedInterests(uint64_t nSatisfiedInterests)
Definition: forwarder-status.cpp:356
ndn::nfd::ForwarderStatus::getNInNacks
uint64_t getNInNacks() const
Definition: forwarder-status.hpp:164
ndn::nfd::ForwarderStatus::getCurrentTimestamp
const time::system_clock::TimePoint & getCurrentTimestamp() const
Definition: forwarder-status.hpp:92
ndn::nfd::ForwarderStatus::setNMeasurementsEntries
ForwarderStatus & setNMeasurementsEntries(uint64_t nMeasurementsEntries)
Definition: forwarder-status.cpp:292
ndn::nfd::ForwarderStatus::getNOutData
uint64_t getNOutData() const
Definition: forwarder-status.hpp:182
ndn::nfd::ForwarderStatus::setStartTimestamp
ForwarderStatus & setStartTimestamp(const time::system_clock::TimePoint &startTimestamp)
Definition: forwarder-status.cpp:252
ndn::nfd::ForwarderStatus::setNOutData
ForwarderStatus & setNOutData(uint64_t nOutData)
Definition: forwarder-status.cpp:340
ndn::nfd::ForwarderStatus::getNInData
uint64_t getNInData() const
Definition: forwarder-status.hpp:155
ndn::nfd::ForwarderStatus::getNOutNacks
uint64_t getNOutNacks() const
Definition: forwarder-status.hpp:191
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
ndn::nfd::ForwarderStatus::getNOutInterests
uint64_t getNOutInterests() const
Definition: forwarder-status.hpp:173
ndn::nfd::ForwarderStatus::setNInData
ForwarderStatus & setNInData(uint64_t nInData)
Definition: forwarder-status.cpp:316
ndn::nfd::ForwarderStatus::Error
Definition: forwarder-status.hpp:40
ndn::nfd::ForwarderStatus::getNCsEntries
uint64_t getNCsEntries() const
Definition: forwarder-status.hpp:137
ndn::nfd::ForwarderStatus::setCurrentTimestamp
ForwarderStatus & setCurrentTimestamp(const time::system_clock::TimePoint &currentTimestamp)
Definition: forwarder-status.cpp:260
ndn::nfd::ForwarderStatus::setNFibEntries
ForwarderStatus & setNFibEntries(uint64_t nFibEntries)
Definition: forwarder-status.cpp:276
ndn::nfd::ForwarderStatus::getNUnsatisfiedInterests
uint64_t getNUnsatisfiedInterests() const
Definition: forwarder-status.hpp:209
ndn::encoding::EncodingImpl
Definition: encoding-buffer-fwd.hpp:36
ndn::Block
Represents a TLV element of NDN packet format.
Definition: block.hpp:43
ndn::nfd::ForwarderStatus::getStartTimestamp
const time::system_clock::TimePoint & getStartTimestamp() const
Definition: forwarder-status.hpp:83
ndn::nfd::ForwarderStatus::getNPitEntries
uint64_t getNPitEntries() const
Definition: forwarder-status.hpp:119
ndn::nfd::operator!=
bool operator!=(const ChannelStatus &a, const ChannelStatus &b)
Definition: channel-status.hpp:81
ndn::nfd::operator==
bool operator==(const ChannelStatus &a, const ChannelStatus &b)
Definition: channel-status.cpp:97
ndn::nfd::ForwarderStatus::setNOutNacks
ForwarderStatus & setNOutNacks(uint64_t nOutNacks)
Definition: forwarder-status.cpp:348
time.hpp
ndn::nfd::ForwarderStatus::getNInInterests
uint64_t getNInInterests() const
Definition: forwarder-status.hpp:146
ndn::tlv::Error
represents an error in TLV encoding or decoding
Definition: tlv.hpp:53
ndn::nfd::ForwarderStatus::getNMeasurementsEntries
uint64_t getNMeasurementsEntries() const
Definition: forwarder-status.hpp:128
ndn::nfd::ForwarderStatus::getNFibEntries
uint64_t getNFibEntries() const
Definition: forwarder-status.hpp:110
ndn::tlv::Error::Error
Error(const char *expectedType, uint32_t actualType)
Definition: tlv.cpp:27
ndn::nfd::ForwarderStatus
represents NFD General Status dataset
Definition: forwarder-status.hpp:37
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-strategy-choice-helper.hpp:34