NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
status-dataset.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013-2017 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_STATUS_DATASET_HPP
23 #define NDN_MGMT_NFD_STATUS_DATASET_HPP
24 
25 #include "../../name.hpp"
26 #include "forwarder-status.hpp"
27 #include "face-status.hpp"
28 #include "face-query-filter.hpp"
29 #include "channel-status.hpp"
30 #include "fib-entry.hpp"
31 #include "cs-info.hpp"
32 #include "strategy-choice.hpp"
33 #include "rib-entry.hpp"
34 
35 namespace ndn {
36 namespace nfd {
37 
43 class StatusDataset : noncopyable
44 {
45 public:
46  virtual
48 
49 #ifdef DOXYGEN
50 
54  using ParamType = int;
55 #endif
56 
62  Name
63  getDatasetPrefix(const Name& prefix) const;
64 
65 #ifdef DOXYGEN
66 
69  using ResultType = std::vector<int>;
70 #endif
71 
76  {
77  public:
78  explicit
79  ParseResultError(const std::string& what)
80  : tlv::Error(what)
81  {
82  }
83  };
84 
85 #ifdef DOXYGEN
86 
92  parseResult(ConstBufferPtr payload) const;
93 #endif
94 
95 protected:
100  explicit
101  StatusDataset(const PartialName& datasetName);
102 
103 private:
108  virtual void
109  addParameters(Name& name) const;
110 
111 private:
112  PartialName m_datasetName;
113 };
114 
121 {
122 public:
124 
126 
127  ResultType
128  parseResult(ConstBufferPtr payload) const;
129 };
130 
136 {
137 public:
138  using ResultType = std::vector<FaceStatus>;
139 
140  ResultType
141  parseResult(ConstBufferPtr payload) const;
142 
143 protected:
144  explicit
145  FaceDatasetBase(const PartialName& datasetName);
146 };
147 
154 {
155 public:
156  FaceDataset();
157 };
158 
165 {
166 public:
168 
169  explicit
170  FaceQueryDataset(const FaceQueryFilter& filter);
171 
172 private:
173  void
174  addParameters(Name& name) const override;
175 
176 private:
177  FaceQueryFilter m_filter;
178 };
179 
186 {
187 public:
188  ChannelDataset();
189 
190  using ResultType = std::vector<ChannelStatus>;
191 
192  ResultType
193  parseResult(ConstBufferPtr payload) const;
194 };
195 
201 class FibDataset : public StatusDataset
202 {
203 public:
204  FibDataset();
205 
206  using ResultType = std::vector<FibEntry>;
207 
208  ResultType
209  parseResult(ConstBufferPtr payload) const;
210 };
211 
218 {
219 public:
220  CsInfoDataset();
221 
223 
224  ResultType
225  parseResult(ConstBufferPtr payload) const;
226 };
227 
234 {
235 public:
237 
238  using ResultType = std::vector<StrategyChoice>;
239 
240  ResultType
241  parseResult(ConstBufferPtr payload) const;
242 };
243 
249 class RibDataset : public StatusDataset
250 {
251 public:
252  RibDataset();
253 
254  using ResultType = std::vector<RibEntry>;
255 
256  ResultType
257  parseResult(ConstBufferPtr payload) const;
258 };
259 
260 } // namespace nfd
261 } // namespace ndn
262 
263 #endif // NDN_MGMT_NFD_STATUS_DATASET_HPP
ResultType parseResult(ConstBufferPtr payload) const
provides common functionality among FaceDataset and FaceQueryDataset
indicates reassembled payload cannot be parsed as ResultType
represents NFD General Status dataset
Copyright (c) 2011-2015 Regents of the University of California.
represents a status/general dataset
Error(const std::string &what)
Definition: tlv.hpp:54
represents a cs/info dataset
std::vector< int > ResultType
provides the result type, usually a vector
FaceDatasetBase(const PartialName &datasetName)
ResultType parseResult(ConstBufferPtr payload) const
base class of NFD StatusDataset
Name getDatasetPrefix(const Name &prefix) const
constructs a name prefix for the dataset
ResultType parseResult(ConstBufferPtr payload) const
represents a rib/list dataset
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
StatusDataset(const PartialName &datasetName)
constructs a StatusDataset instance with given sub-prefix
represents a strategy-choice/list dataset
ResultType parseResult(ConstBufferPtr payload) const
Represents an absolute name.
Definition: name.hpp:42
ResultType parseResult(ConstBufferPtr payload) const
represents Face Query Filter
ResultType parseResult(ConstBufferPtr payload) const
int ParamType
if defined, specifies constructor argument type; otherwise, constructor has no argument ...
represents a faces/list dataset
represents a faces/channels dataset
FaceQueryDataset(const FaceQueryFilter &filter)
ResultType parseResult(ConstBufferPtr payload) const
parses a result from reassembled payload
represents a faces/query dataset
represents a fib/list dataset
represents an error in TLV encoding or decoding
Definition: tlv.hpp:50
ResultType parseResult(ConstBufferPtr payload) const
shared_ptr< const Buffer > ConstBufferPtr
Definition: buffer.hpp:89