NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
face-manager.cpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014-2018, Regents of the University of California,
4  * Arizona Board of Regents,
5  * Colorado State University,
6  * University Pierre & Marie Curie, Sorbonne University,
7  * Washington University in St. Louis,
8  * Beijing Institute of Technology,
9  * The University of Memphis.
10  *
11  * This file is part of NFD (Named Data Networking Forwarding Daemon).
12  * See AUTHORS.md for complete list of NFD authors and contributors.
13  *
14  * NFD is free software: you can redistribute it and/or modify it under the terms
15  * of the GNU General Public License as published by the Free Software Foundation,
16  * either version 3 of the License, or (at your option) any later version.
17  *
18  * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
19  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
20  * PURPOSE. See the GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License along with
23  * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
24  */
25 
26 #include "face-manager.hpp"
29 #include "fw/face-table.hpp"
30 
31 #include <boost/logic/tribool.hpp>
32 
33 #include <ndn-cxx/lp/tags.hpp>
34 #include <ndn-cxx/mgmt/nfd/channel-status.hpp>
35 
36 namespace nfd {
37 
38 NFD_LOG_INIT("FaceManager");
39 
41  Dispatcher& dispatcher,
42  CommandAuthenticator& authenticator)
43  : NfdManagerBase(dispatcher, authenticator, "faces")
44  , m_faceSystem(faceSystem)
45  , m_faceTable(faceSystem.getFaceTable())
46 {
47  // register handlers for ControlCommand
48  registerCommandHandler<ndn::nfd::FaceCreateCommand>("create",
49  bind(&FaceManager::createFace, this, _2, _3, _4, _5));
50 
51  registerCommandHandler<ndn::nfd::FaceUpdateCommand>("update",
52  bind(&FaceManager::updateFace, this, _2, _3, _4, _5));
53 
54  registerCommandHandler<ndn::nfd::FaceDestroyCommand>("destroy",
55  bind(&FaceManager::destroyFace, this, _2, _3, _4, _5));
56 
57  // register handlers for StatusDataset
58  registerStatusDatasetHandler("list", bind(&FaceManager::listFaces, this, _1, _2, _3));
59  registerStatusDatasetHandler("channels", bind(&FaceManager::listChannels, this, _1, _2, _3));
60  registerStatusDatasetHandler("query", bind(&FaceManager::queryFaces, this, _1, _2, _3));
61 
62  // register notification stream
63  m_postNotification = registerNotificationStream("events");
64  m_faceAddConn = m_faceTable.afterAdd.connect([this] (const Face& face) {
65  connectFaceStateChangeSignal(face);
66  notifyFaceEvent(face, ndn::nfd::FACE_EVENT_CREATED);
67  });
68  m_faceRemoveConn = m_faceTable.beforeRemove.connect([this] (const Face& face) {
69  notifyFaceEvent(face, ndn::nfd::FACE_EVENT_DESTROYED);
70  });
71 }
72 
73 void
74 FaceManager::createFace(const Name& topPrefix, const Interest& interest,
75  const ControlParameters& parameters,
77 {
78  FaceUri remoteUri;
79  if (!remoteUri.parse(parameters.getUri())) {
80  NFD_LOG_TRACE("failed to parse remote URI: " << parameters.getUri());
81  done(ControlResponse(400, "Malformed command"));
82  return;
83  }
84 
85  if (!remoteUri.isCanonical()) {
86  NFD_LOG_TRACE("received non-canonical remote URI: " << remoteUri.toString());
87  done(ControlResponse(400, "Non-canonical remote URI"));
88  return;
89  }
90 
91  optional<FaceUri> localUri;
92  if (parameters.hasLocalUri()) {
93  localUri = FaceUri{};
94 
95  if (!localUri->parse(parameters.getLocalUri())) {
96  NFD_LOG_TRACE("failed to parse local URI: " << parameters.getLocalUri());
97  done(ControlResponse(400, "Malformed command"));
98  return;
99  }
100 
101  if (!localUri->isCanonical()) {
102  NFD_LOG_TRACE("received non-canonical local URI: " << localUri->toString());
103  done(ControlResponse(400, "Non-canonical local URI"));
104  return;
105  }
106  }
107 
108  face::ProtocolFactory* factory = m_faceSystem.getFactoryByScheme(remoteUri.getScheme());
109  if (factory == nullptr) {
110  NFD_LOG_TRACE("received create request for unsupported protocol: " << remoteUri.getScheme());
111  done(ControlResponse(406, "Unsupported protocol"));
112  return;
113  }
114 
115  face::FaceParams faceParams;
116  faceParams.persistency = parameters.getFacePersistency();
117  if (parameters.hasBaseCongestionMarkingInterval()) {
118  faceParams.baseCongestionMarkingInterval = parameters.getBaseCongestionMarkingInterval();
119  }
120  if (parameters.hasDefaultCongestionThreshold()) {
121  faceParams.defaultCongestionThreshold = parameters.getDefaultCongestionThreshold();
122  }
123  faceParams.wantLocalFields = parameters.hasFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED) &&
125  faceParams.wantLpReliability = parameters.hasFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED) &&
128  faceParams.wantCongestionMarking = parameters.getFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED);
129  }
130  try {
131  factory->createFace({remoteUri, localUri, faceParams},
132  bind(&FaceManager::afterCreateFaceSuccess, this, parameters, _1, done),
133  bind(&FaceManager::afterCreateFaceFailure, this, _1, _2, done));
134  }
135  catch (const std::runtime_error& error) {
136  NFD_LOG_ERROR("Face creation failed: " << error.what());
137  done(ControlResponse(500, "Face creation failed due to internal error"));
138  return;
139  }
140  catch (const std::logic_error& error) {
141  NFD_LOG_ERROR("Face creation failed: " << error.what());
142  done(ControlResponse(500, "Face creation failed due to internal error"));
143  return;
144  }
145 }
146 
147 void
148 FaceManager::afterCreateFaceSuccess(const ControlParameters& parameters,
149  const shared_ptr<Face>& face,
150  const ndn::mgmt::CommandContinuation& done)
151 {
152  if (face->getId() != face::INVALID_FACEID) {// Face already exists
153  NFD_LOG_TRACE("Attempted to create duplicate face of " << face->getId());
154 
155  ControlParameters response = collectFaceProperties(*face, true);
156  done(ControlResponse(409, "Face with remote URI already exists").setBody(response.wireEncode()));
157  return;
158  }
159 
160  // If scope non-local and flags set to enable local fields, request shouldn't
161  // have made it this far
162  BOOST_ASSERT(face->getScope() == ndn::nfd::FACE_SCOPE_LOCAL ||
163  !parameters.hasFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED) ||
164  (parameters.hasFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED) &&
165  !parameters.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED)));
166 
167  m_faceTable.add(face);
168 
169  ControlParameters response = collectFaceProperties(*face, true);
170  done(ControlResponse(200, "OK").setBody(response.wireEncode()));
171 }
172 
173 void
174 FaceManager::afterCreateFaceFailure(uint32_t status,
175  const std::string& reason,
176  const ndn::mgmt::CommandContinuation& done)
177 {
178  NFD_LOG_DEBUG("Face creation failed: " << reason);
179 
180  done(ControlResponse(status, reason));
181 }
182 
183 void
184 FaceManager::updateFace(const Name& topPrefix, const Interest& interest,
185  const ControlParameters& parameters,
186  const ndn::mgmt::CommandContinuation& done)
187 {
188  FaceId faceId = parameters.getFaceId();
189  if (faceId == 0) {
190  // Self-updating
191  shared_ptr<lp::IncomingFaceIdTag> incomingFaceIdTag = interest.getTag<lp::IncomingFaceIdTag>();
192  if (incomingFaceIdTag == nullptr) {
193  NFD_LOG_TRACE("unable to determine face for self-update");
194  done(ControlResponse(404, "No FaceId specified and IncomingFaceId not available"));
195  return;
196  }
197  faceId = *incomingFaceIdTag;
198  }
199 
200  Face* face = m_faceTable.get(faceId);
201 
202  if (face == nullptr) {
203  NFD_LOG_TRACE("invalid face specified");
204  done(ControlResponse(404, "Specified face does not exist"));
205  return;
206  }
207 
208  // Verify validity of requested changes
209  ControlParameters response;
210  bool areParamsValid = true;
211 
212  if (parameters.hasFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED) &&
213  parameters.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED) &&
214  face->getScope() != ndn::nfd::FACE_SCOPE_LOCAL) {
215  NFD_LOG_TRACE("received request to enable local fields on non-local face");
216  areParamsValid = false;
217  response.setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED,
218  parameters.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED));
219  }
220 
221  // check whether the requested FacePersistency change is valid if it's present
222  if (parameters.hasFacePersistency()) {
223  auto persistency = parameters.getFacePersistency();
224  if (!face->getTransport()->canChangePersistencyTo(persistency)) {
225  NFD_LOG_TRACE("cannot change face persistency to " << persistency);
226  areParamsValid = false;
227  response.setFacePersistency(persistency);
228  }
229  }
230 
231  if (!areParamsValid) {
232  done(ControlResponse(409, "Invalid properties specified").setBody(response.wireEncode()));
233  return;
234  }
235 
236  // All specified properties are valid, so make changes
237  if (parameters.hasFacePersistency()) {
238  face->setPersistency(parameters.getFacePersistency());
239  }
240  setLinkServiceOptions(*face, parameters);
241 
242  // Set ControlResponse fields
243  response = collectFaceProperties(*face, false);
244 
245  done(ControlResponse(200, "OK").setBody(response.wireEncode()));
246 }
247 
248 void
249 FaceManager::destroyFace(const Name& topPrefix, const Interest& interest,
250  const ControlParameters& parameters,
251  const ndn::mgmt::CommandContinuation& done)
252 {
253  Face* face = m_faceTable.get(parameters.getFaceId());
254  if (face != nullptr) {
255  face->close();
256  }
257 
258  done(ControlResponse(200, "OK").setBody(parameters.wireEncode()));
259 }
260 
261 void
262 FaceManager::setLinkServiceOptions(Face& face,
263  const ControlParameters& parameters)
264 {
265  auto linkService = dynamic_cast<face::GenericLinkService*>(face.getLinkService());
266  BOOST_ASSERT(linkService != nullptr);
267 
268  auto options = linkService->getOptions();
269  if (parameters.hasFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED) &&
270  face.getScope() == ndn::nfd::FACE_SCOPE_LOCAL) {
271  options.allowLocalFields = parameters.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED);
272  }
273  if (parameters.hasFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED)) {
274  options.reliabilityOptions.isEnabled = parameters.getFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED);
275  }
276  if (parameters.hasFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED)) {
277  options.allowCongestionMarking = parameters.getFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED);
278  }
279  if (parameters.hasBaseCongestionMarkingInterval()) {
280  options.baseCongestionMarkingInterval = parameters.getBaseCongestionMarkingInterval();
281  }
282  if (parameters.hasDefaultCongestionThreshold()) {
283  options.defaultCongestionThreshold = parameters.getDefaultCongestionThreshold();
284  }
285  linkService->setOptions(options);
286 }
287 
289 FaceManager::collectFaceProperties(const Face& face, bool wantUris)
290 {
291  auto linkService = dynamic_cast<face::GenericLinkService*>(face.getLinkService());
292  BOOST_ASSERT(linkService != nullptr);
293  auto options = linkService->getOptions();
294 
295  ControlParameters params;
296  params.setFaceId(face.getId())
297  .setFacePersistency(face.getPersistency())
298  .setBaseCongestionMarkingInterval(options.baseCongestionMarkingInterval)
299  .setDefaultCongestionThreshold(options.defaultCongestionThreshold)
300  .setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED, options.allowLocalFields, false)
301  .setFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED, options.reliabilityOptions.isEnabled, false)
302  .setFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED, options.allowCongestionMarking, false);
303  if (wantUris) {
304  params.setUri(face.getRemoteUri().toString())
305  .setLocalUri(face.getLocalUri().toString());
306  }
307  return params;
308 }
309 
310 void
311 FaceManager::listFaces(const Name& topPrefix, const Interest& interest,
313 {
314  auto now = time::steady_clock::now();
315  for (const Face& face : m_faceTable) {
316  ndn::nfd::FaceStatus status = collectFaceStatus(face, now);
317  context.append(status.wireEncode());
318  }
319  context.end();
320 }
321 
322 void
323 FaceManager::listChannels(const Name& topPrefix, const Interest& interest,
325 {
326  std::set<const face::ProtocolFactory*> factories = m_faceSystem.listProtocolFactories();
327  for (const auto* factory : factories) {
328  for (const auto& channel : factory->getChannels()) {
330  entry.setLocalUri(channel->getUri().toString());
331  context.append(entry.wireEncode());
332  }
333  }
334  context.end();
335 }
336 
337 void
338 FaceManager::queryFaces(const Name& topPrefix, const Interest& interest,
340 {
341  ndn::nfd::FaceQueryFilter faceFilter;
342  const Name& query = interest.getName();
343  try {
344  faceFilter.wireDecode(query[-1].blockFromValue());
345  }
346  catch (const tlv::Error& e) {
347  NFD_LOG_DEBUG("Malformed query filter: " << e.what());
348  return context.reject(ControlResponse(400, "Malformed filter"));
349  }
350 
351  auto now = time::steady_clock::now();
352  for (const Face& face : m_faceTable) {
353  if (!matchFilter(faceFilter, face)) {
354  continue;
355  }
356  ndn::nfd::FaceStatus status = collectFaceStatus(face, now);
357  context.append(status.wireEncode());
358  }
359 
360  context.end();
361 }
362 
363 bool
364 FaceManager::matchFilter(const ndn::nfd::FaceQueryFilter& filter, const Face& face)
365 {
366  if (filter.hasFaceId() &&
367  filter.getFaceId() != static_cast<uint64_t>(face.getId())) {
368  return false;
369  }
370 
371  if (filter.hasUriScheme() &&
372  filter.getUriScheme() != face.getRemoteUri().getScheme() &&
373  filter.getUriScheme() != face.getLocalUri().getScheme()) {
374  return false;
375  }
376 
377  if (filter.hasRemoteUri() &&
378  filter.getRemoteUri() != face.getRemoteUri().toString()) {
379  return false;
380  }
381 
382  if (filter.hasLocalUri() &&
383  filter.getLocalUri() != face.getLocalUri().toString()) {
384  return false;
385  }
386 
387  if (filter.hasFaceScope() &&
388  filter.getFaceScope() != face.getScope()) {
389  return false;
390  }
391 
392  if (filter.hasFacePersistency() &&
393  filter.getFacePersistency() != face.getPersistency()) {
394  return false;
395  }
396 
397  if (filter.hasLinkType() &&
398  filter.getLinkType() != face.getLinkType()) {
399  return false;
400  }
401 
402  return true;
403 }
404 
406 FaceManager::collectFaceStatus(const Face& face, const time::steady_clock::TimePoint& now)
407 {
408  ndn::nfd::FaceStatus status;
409 
410  collectFaceProperties(face, status);
411 
412  time::steady_clock::TimePoint expirationTime = face.getExpirationTime();
413  if (expirationTime != time::steady_clock::TimePoint::max()) {
414  status.setExpirationPeriod(std::max(0_ms,
415  time::duration_cast<time::milliseconds>(expirationTime - now)));
416  }
417 
418  // Get LinkService options
419  auto linkService = dynamic_cast<face::GenericLinkService*>(face.getLinkService());
420  if (linkService != nullptr) {
421  auto linkServiceOptions = linkService->getOptions();
422  status.setBaseCongestionMarkingInterval(linkServiceOptions.baseCongestionMarkingInterval);
423  status.setDefaultCongestionThreshold(linkServiceOptions.defaultCongestionThreshold);
424  }
425 
426  const face::FaceCounters& counters = face.getCounters();
427  status.setNInInterests(counters.nInInterests)
428  .setNOutInterests(counters.nOutInterests)
429  .setNInData(counters.nInData)
430  .setNOutData(counters.nOutData)
431  .setNInNacks(counters.nInNacks)
432  .setNOutNacks(counters.nOutNacks)
433  .setNInBytes(counters.nInBytes)
434  .setNOutBytes(counters.nOutBytes);
435 
436  return status;
437 }
438 
439 template<typename FaceTraits>
440 void
441 FaceManager::collectFaceProperties(const Face& face, FaceTraits& traits)
442 {
443  traits.setFaceId(face.getId())
444  .setRemoteUri(face.getRemoteUri().toString())
445  .setLocalUri(face.getLocalUri().toString())
446  .setFaceScope(face.getScope())
447  .setFacePersistency(face.getPersistency())
448  .setLinkType(face.getLinkType());
449 
450  // Set Flag bits
451  auto linkService = dynamic_cast<face::GenericLinkService*>(face.getLinkService());
452  if (linkService != nullptr) {
453  auto linkServiceOptions = linkService->getOptions();
454  traits.setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED, linkServiceOptions.allowLocalFields);
455  traits.setFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED,
456  linkServiceOptions.reliabilityOptions.isEnabled);
458  linkServiceOptions.allowCongestionMarking);
459  }
460 }
461 
462 void
463 FaceManager::notifyFaceEvent(const Face& face, ndn::nfd::FaceEventKind kind)
464 {
465  ndn::nfd::FaceEventNotification notification;
466  notification.setKind(kind);
467  collectFaceProperties(face, notification);
468 
469  m_postNotification(notification.wireEncode());
470 }
471 
472 void
473 FaceManager::connectFaceStateChangeSignal(const Face& face)
474 {
475  using face::FaceState;
476 
477  FaceId faceId = face.getId();
478  m_faceStateChangeConn[faceId] = face.afterStateChange.connect(
479  [this, faceId, &face] (FaceState oldState, FaceState newState) {
480  if (newState == FaceState::UP) {
481  notifyFaceEvent(face, ndn::nfd::FACE_EVENT_UP);
482  }
483  else if (newState == FaceState::DOWN) {
484  notifyFaceEvent(face, ndn::nfd::FACE_EVENT_DOWN);
485  }
486  else if (newState == FaceState::CLOSED) {
487  // cannot use face.getId() because it may already be reset to INVALID_FACEID
488  m_faceStateChangeConn.erase(faceId);
489  }
490  });
491 }
492 
493 } // namespace nfd
signal::Signal< FaceTable, Face & > afterAdd
fires after a face is added
Definition: face-table.hpp:84
void reject(const ControlResponse &resp=ControlResponse().setCode(400))
declare the non-existence of a response
time_point TimePoint
Definition: time.hpp:226
const std::string & getLocalUri() const
represents parameters in a ControlCommand request or response
time::nanoseconds getBaseCongestionMarkingInterval() const
generalization of a network interface
Definition: face.hpp:67
represents a dispatcher on server side of NFD Management protocol
Definition: dispatcher.hpp:130
static time_point now() noexcept
Definition: time.cpp:80
std::string toString() const
write as a string
Definition: face-uri.cpp:205
void add(shared_ptr< Face > face)
add a face
Definition: face-table.cpp:58
ProtocolFactory * getFactoryByScheme(const std::string &scheme)
Definition: face-system.cpp:74
entry point of the face system
Definition: face-system.hpp:50
signal::Signal< FaceTable, Face & > beforeRemove
fires before a face is removed
Definition: face-table.hpp:90
represents a Face status change notification
whether congestion detection and marking is enabled on a face
const std::string & getRemoteUri() const
Represents an Interest packet.
Definition: interest.hpp:42
#define NFD_LOG_DEBUG(expression)
Definition: logger.hpp:55
FaceEventNotification & setKind(FaceEventKind kind)
std::set< const ProtocolFactory * > listProtocolFactories() const
Definition: face-system.cpp:57
FaceStatus & setNOutBytes(uint64_t nOutBytes)
FaceStatus & setNOutInterests(uint64_t nOutInterests)
C & setFaceId(uint64_t faceId)
Definition: face-traits.hpp:57
Face * get(FaceId id) const
get face by FaceId
Definition: face-table.cpp:45
FaceStatus & setExpirationPeriod(time::milliseconds expirationPeriod)
provides a tag type for simple types
Definition: tag.hpp:58
FaceStatus & setNInInterests(uint64_t nInInterests)
FacePersistency getFacePersistency() const
FaceStatus & setNInBytes(uint64_t nInBytes)
ndn Face
Definition: face-impl.hpp:42
#define NFD_LOG_TRACE(expression)
Definition: logger.hpp:54
#define NFD_LOG_ERROR(expression)
Definition: logger.hpp:57
size_t wireEncode(EncodingImpl< TAG > &encoder) const
prepend FaceEventNotification to the encoder
mgmt::ControlResponse ControlResponse
whether the link reliability feature is enabled on a face
FaceStatus & setNInNacks(uint64_t nInNacks)
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
FaceManager(FaceSystem &faceSystem, Dispatcher &dispatcher, CommandAuthenticator &authenticator)
TransportState FaceState
indicates the state of a face
Definition: face.hpp:54
bool parse(const std::string &uri)
exception-safe parsing
Definition: face-uri.cpp:64
FaceStatus & setNOutData(uint64_t nOutData)
const std::string & getLocalUri() const
void end()
end the response successfully after appending zero or more blocks
face went UP (from DOWN state)
uint64_t getDefaultCongestionThreshold() const
get default congestion threshold (measured in bytes)
size_t wireEncode(EncodingImpl< TAG > &encoder) const
prepend FaceStatus to the encoder
Definition: face-status.cpp:53
represents an item in NFD Face dataset
Definition: face-status.hpp:36
Represents an absolute name.
Definition: name.hpp:42
represents the underlying protocol and address used by a Face
Definition: face-uri.hpp:44
bool hasFlagBit(size_t bit) const
std::function< void(const ControlResponse &resp)> CommandContinuation
a function to be called after ControlCommandHandler completes
Definition: dispatcher.hpp:95
represents Face Query Filter
const std::string & getUri() const
const std::string & getScheme() const
get scheme (protocol)
Definition: face-uri.hpp:113
FaceStatus & setBaseCongestionMarkingInterval(time::nanoseconds interval)
provides ControlCommand authorization according to NFD configuration file
FaceStatus & setNOutNacks(uint64_t nOutNacks)
void append(const Block &block)
append a Block to the response
represents an item in NFD Channel dataset
bool getFlagBit(size_t bit) const
FaceStatus & setNInData(uint64_t nInData)
ndn::mgmt::PostNotification registerNotificationStream(const std::string &verb)
const std::string & getUriScheme() const
provides a context for generating response to a StatusDataset request
FacePersistency getFacePersistency() const
uint64_t FaceId
identifies a face
Definition: face.hpp:39
bool isCanonical() const
determine whether this FaceUri is in canonical form
Definition: face-uri.cpp:637
a collection of common functions shared by all NFD managers, such as communicating with the dispatche...
#define NFD_LOG_INIT(name)
Definition: logger.hpp:34
whether local fields are enabled on a face
void wireDecode(const Block &wire)
decode FaceQueryFilter
void registerStatusDatasetHandler(const std::string &verb, const ndn::mgmt::StatusDatasetHandler &handler)
const FaceId INVALID_FACEID
indicates an invalid FaceId
Definition: face.hpp:42
face went DOWN (from UP state)
FaceStatus & setDefaultCongestionThreshold(uint64_t threshold)
set default congestion threshold (measured in bytes)
size_t wireEncode(EncodingImpl< TAG > &encoder) const
ChannelStatus & setLocalUri(const std::string localUri)