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-2021, 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"
27 
28 #include "common/logger.hpp"
31 #include "fw/face-table.hpp"
32 
33 #include <ndn-cxx/lp/tags.hpp>
38 
39 namespace nfd {
40 
42 
44  Dispatcher& dispatcher, CommandAuthenticator& authenticator)
45  : ManagerBase("faces", dispatcher, authenticator)
46  , m_faceSystem(faceSystem)
47  , m_faceTable(faceSystem.getFaceTable())
48 {
49  // register handlers for ControlCommand
50  registerCommandHandler<ndn::nfd::FaceCreateCommand>("create",
51  std::bind(&FaceManager::createFace, this, _4, _5));
52  registerCommandHandler<ndn::nfd::FaceUpdateCommand>("update",
53  std::bind(&FaceManager::updateFace, this, _3, _4, _5));
54  registerCommandHandler<ndn::nfd::FaceDestroyCommand>("destroy",
55  std::bind(&FaceManager::destroyFace, this, _4, _5));
56 
57  // register handlers for StatusDataset
58  registerStatusDatasetHandler("list", std::bind(&FaceManager::listFaces, this, _3));
59  registerStatusDatasetHandler("channels", std::bind(&FaceManager::listChannels, this, _3));
60  registerStatusDatasetHandler("query", std::bind(&FaceManager::queryFaces, this, _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 ControlParameters& parameters,
76 {
77  FaceUri remoteUri;
78  if (!remoteUri.parse(parameters.getUri())) {
79  NFD_LOG_TRACE("failed to parse remote URI: " << parameters.getUri());
80  done(ControlResponse(400, "Malformed command"));
81  return;
82  }
83 
84  if (!remoteUri.isCanonical()) {
85  NFD_LOG_TRACE("received non-canonical remote URI: " << remoteUri.toString());
86  done(ControlResponse(400, "Non-canonical remote URI"));
87  return;
88  }
89 
90  optional<FaceUri> localUri;
91  if (parameters.hasLocalUri()) {
92  localUri = FaceUri{};
93 
94  if (!localUri->parse(parameters.getLocalUri())) {
95  NFD_LOG_TRACE("failed to parse local URI: " << parameters.getLocalUri());
96  done(ControlResponse(400, "Malformed command"));
97  return;
98  }
99 
100  if (!localUri->isCanonical()) {
101  NFD_LOG_TRACE("received non-canonical local URI: " << localUri->toString());
102  done(ControlResponse(400, "Non-canonical local URI"));
103  return;
104  }
105  }
106 
107  face::ProtocolFactory* factory = m_faceSystem.getFactoryByScheme(remoteUri.getScheme());
108  if (factory == nullptr) {
109  NFD_LOG_TRACE("received create request for unsupported protocol: " << remoteUri.getScheme());
110  done(ControlResponse(406, "Unsupported protocol"));
111  return;
112  }
113 
114  face::FaceParams faceParams;
115  faceParams.persistency = parameters.getFacePersistency();
116  if (parameters.hasBaseCongestionMarkingInterval()) {
118  }
119  if (parameters.hasDefaultCongestionThreshold()) {
121  }
122  if (parameters.hasMtu()) {
123  // The face system limits MTUs to ssize_t, but the management protocol uses uint64_t
124  faceParams.mtu = std::min<uint64_t>(std::numeric_limits<ssize_t>::max(), parameters.getMtu());
125  }
132  }
133  try {
134  factory->createFace({remoteUri, localUri, faceParams},
135  [this, parameters, done] (const auto& face) {
136  this->afterCreateFaceSuccess(face, parameters, done);
137  },
138  [done] (uint32_t status, const std::string& reason) {
139  NFD_LOG_DEBUG("Face creation failed: " << reason);
140  done(ControlResponse(status, reason));
141  });
142  }
143  catch (const std::runtime_error& error) {
144  NFD_LOG_ERROR("Face creation failed: " << error.what());
145  done(ControlResponse(500, "Face creation failed due to internal error"));
146  return;
147  }
148  catch (const std::logic_error& error) {
149  NFD_LOG_ERROR("Face creation failed: " << error.what());
150  done(ControlResponse(500, "Face creation failed due to internal error"));
151  return;
152  }
153 }
154 
155 template<typename T>
156 static void
157 copyMtu(const Face& face, T& to)
158 {
159  if (face.getMtu() >= 0) {
160  to.setMtu(std::min<size_t>(face.getMtu(), ndn::MAX_NDN_PACKET_SIZE));
161  }
162  else if (face.getMtu() == face::MTU_UNLIMITED) {
163  to.setMtu(ndn::MAX_NDN_PACKET_SIZE);
164  }
165 }
166 
167 static ControlParameters
169 {
170  ControlParameters params;
171  params.setFaceId(face.getId())
172  .setFacePersistency(face.getPersistency());
173  copyMtu(face, params);
174 
175  auto linkService = dynamic_cast<face::GenericLinkService*>(face.getLinkService());
176  if (linkService != nullptr) {
177  const auto& options = linkService->getOptions();
178  params.setBaseCongestionMarkingInterval(options.baseCongestionMarkingInterval)
179  .setDefaultCongestionThreshold(options.defaultCongestionThreshold)
180  .setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED, options.allowLocalFields, false)
181  .setFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED, options.reliabilityOptions.isEnabled, false)
182  .setFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED, options.allowCongestionMarking, false);
183  }
184 
185  return params;
186 }
187 
188 static ControlParameters
190 {
192  params.setUri(face.getRemoteUri().toString())
193  .setLocalUri(face.getLocalUri().toString());
194 
195  return params;
196 }
197 
198 void
199 FaceManager::afterCreateFaceSuccess(const shared_ptr<Face>& face,
200  const ControlParameters& parameters,
201  const ndn::mgmt::CommandContinuation& done)
202 {
203  if (face->getId() != face::INVALID_FACEID) { // Face already exists
204  NFD_LOG_TRACE("Attempted to create duplicate face of " << face->getId());
205  ControlParameters response = makeCreateFaceResponse(*face);
206  done(ControlResponse(409, "Face with remote URI already exists").setBody(response.wireEncode()));
207  return;
208  }
209 
210  // If scope non-local and flags set to enable local fields, request shouldn't
211  // have made it this far
212  BOOST_ASSERT(face->getScope() == ndn::nfd::FACE_SCOPE_LOCAL ||
216 
217  m_faceTable.add(face);
218 
219  ControlParameters response = makeCreateFaceResponse(*face);
220  done(ControlResponse(200, "OK").setBody(response.wireEncode()));
221 }
222 
223 static void
225 {
226  auto linkService = dynamic_cast<face::GenericLinkService*>(face.getLinkService());
227  if (linkService == nullptr) {
228  return;
229  }
230  auto options = linkService->getOptions();
231 
233  face.getScope() == ndn::nfd::FACE_SCOPE_LOCAL) {
234  options.allowLocalFields = parameters.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED);
235  }
237  options.reliabilityOptions.isEnabled = parameters.getFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED);
238  }
240  options.allowCongestionMarking = parameters.getFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED);
241  }
242  if (parameters.hasBaseCongestionMarkingInterval()) {
243  options.baseCongestionMarkingInterval = parameters.getBaseCongestionMarkingInterval();
244  }
245  if (parameters.hasDefaultCongestionThreshold()) {
246  options.defaultCongestionThreshold = parameters.getDefaultCongestionThreshold();
247  }
248 
249  if (parameters.hasMtu()) {
250  // The face system limits MTUs to ssize_t, but the management protocol uses uint64_t
251  options.overrideMtu = std::min<uint64_t>(std::numeric_limits<ssize_t>::max(), parameters.getMtu());
252  }
253 
254  linkService->setOptions(options);
255 }
256 
257 void
258 FaceManager::updateFace(const Interest& interest,
259  const ControlParameters& parameters,
260  const ndn::mgmt::CommandContinuation& done)
261 {
262  FaceId faceId = parameters.getFaceId();
263  if (faceId == 0) { // Self-update
264  auto incomingFaceIdTag = interest.getTag<lp::IncomingFaceIdTag>();
265  if (incomingFaceIdTag == nullptr) {
266  NFD_LOG_TRACE("unable to determine face for self-update");
267  done(ControlResponse(404, "No FaceId specified and IncomingFaceId not available"));
268  return;
269  }
270  faceId = *incomingFaceIdTag;
271  }
272 
273  Face* face = m_faceTable.get(faceId);
274  if (face == nullptr) {
275  NFD_LOG_TRACE("invalid face specified");
276  done(ControlResponse(404, "Specified face does not exist"));
277  return;
278  }
279 
280  // Verify validity of requested changes
281  ControlParameters response;
282  bool areParamsValid = true;
283 
286  face->getScope() != ndn::nfd::FACE_SCOPE_LOCAL) {
287  NFD_LOG_TRACE("received request to enable local fields on non-local face");
288  areParamsValid = false;
291  }
292 
293  // check whether the requested FacePersistency change is valid if it's present
294  if (parameters.hasFacePersistency()) {
295  auto persistency = parameters.getFacePersistency();
296  if (!face->getTransport()->canChangePersistencyTo(persistency)) {
297  NFD_LOG_TRACE("cannot change face persistency to " << persistency);
298  areParamsValid = false;
299  response.setFacePersistency(persistency);
300  }
301  }
302 
303  // check whether the requested MTU override is valid (if it's present)
304  if (parameters.hasMtu()) {
305  auto mtu = parameters.getMtu();
306  // The face system limits MTUs to ssize_t, but the management protocol uses uint64_t
307  auto actualMtu = std::min<uint64_t>(std::numeric_limits<ssize_t>::max(), mtu);
308  auto linkService = dynamic_cast<face::GenericLinkService*>(face->getLinkService());
309  if (linkService == nullptr || !linkService->canOverrideMtuTo(actualMtu)) {
310  NFD_LOG_TRACE("cannot override face MTU to " << mtu);
311  areParamsValid = false;
312  response.setMtu(mtu);
313  }
314  }
315 
316  if (!areParamsValid) {
317  done(ControlResponse(409, "Invalid properties specified").setBody(response.wireEncode()));
318  return;
319  }
320 
321  // All specified properties are valid, so make changes
322  if (parameters.hasFacePersistency()) {
323  face->setPersistency(parameters.getFacePersistency());
324  }
325  updateLinkServiceOptions(*face, parameters);
326 
327  // Prepare and send ControlResponse
328  response = makeUpdateFaceResponse(*face);
329  done(ControlResponse(200, "OK").setBody(response.wireEncode()));
330 }
331 
332 void
333 FaceManager::destroyFace(const ControlParameters& parameters,
334  const ndn::mgmt::CommandContinuation& done)
335 {
336  Face* face = m_faceTable.get(parameters.getFaceId());
337  if (face != nullptr) {
338  face->close();
339  }
340 
341  done(ControlResponse(200, "OK").setBody(parameters.wireEncode()));
342 }
343 
344 template<typename T>
345 static void
346 copyFaceProperties(const Face& face, T& to)
347 {
348  to.setFaceId(face.getId())
349  .setRemoteUri(face.getRemoteUri().toString())
350  .setLocalUri(face.getLocalUri().toString())
351  .setFaceScope(face.getScope())
352  .setFacePersistency(face.getPersistency())
353  .setLinkType(face.getLinkType());
354 
355  auto linkService = dynamic_cast<face::GenericLinkService*>(face.getLinkService());
356  if (linkService != nullptr) {
357  const auto& options = linkService->getOptions();
358  to.setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED, options.allowLocalFields)
359  .setFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED, options.reliabilityOptions.isEnabled)
360  .setFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED, options.allowCongestionMarking);
361  }
362 }
363 
366 {
367  ndn::nfd::FaceStatus status;
368  copyFaceProperties(face, status);
369 
370  auto expirationTime = face.getExpirationTime();
371  if (expirationTime != time::steady_clock::time_point::max()) {
372  status.setExpirationPeriod(std::max(0_ms,
373  time::duration_cast<time::milliseconds>(expirationTime - now)));
374  }
375 
376  auto linkService = dynamic_cast<face::GenericLinkService*>(face.getLinkService());
377  if (linkService != nullptr) {
378  const auto& options = linkService->getOptions();
379  status.setBaseCongestionMarkingInterval(options.baseCongestionMarkingInterval)
380  .setDefaultCongestionThreshold(options.defaultCongestionThreshold);
381  }
382 
383  copyMtu(face, status);
384 
385  const auto& counters = face.getCounters();
386  status.setNInInterests(counters.nInInterests)
387  .setNOutInterests(counters.nOutInterests)
388  .setNInData(counters.nInData)
389  .setNOutData(counters.nOutData)
390  .setNInNacks(counters.nInNacks)
391  .setNOutNacks(counters.nOutNacks)
392  .setNInBytes(counters.nInBytes)
393  .setNOutBytes(counters.nOutBytes);
394 
395  return status;
396 }
397 
398 void
399 FaceManager::listFaces(ndn::mgmt::StatusDatasetContext& context)
400 {
401  auto now = time::steady_clock::now();
402  for (const auto& face : m_faceTable) {
403  ndn::nfd::FaceStatus status = makeFaceStatus(face, now);
404  context.append(status.wireEncode());
405  }
406  context.end();
407 }
408 
409 void
410 FaceManager::listChannels(ndn::mgmt::StatusDatasetContext& context)
411 {
412  auto factories = m_faceSystem.listProtocolFactories();
413  for (const auto* factory : factories) {
414  for (const auto& channel : factory->getChannels()) {
416  entry.setLocalUri(channel->getUri().toString());
417  context.append(entry.wireEncode());
418  }
419  }
420  context.end();
421 }
422 
423 static bool
424 matchFilter(const ndn::nfd::FaceQueryFilter& filter, const Face& face)
425 {
426  if (filter.hasFaceId() &&
427  filter.getFaceId() != static_cast<uint64_t>(face.getId())) {
428  return false;
429  }
430 
431  if (filter.hasUriScheme() &&
432  filter.getUriScheme() != face.getRemoteUri().getScheme() &&
433  filter.getUriScheme() != face.getLocalUri().getScheme()) {
434  return false;
435  }
436 
437  if (filter.hasRemoteUri() &&
438  filter.getRemoteUri() != face.getRemoteUri().toString()) {
439  return false;
440  }
441 
442  if (filter.hasLocalUri() &&
443  filter.getLocalUri() != face.getLocalUri().toString()) {
444  return false;
445  }
446 
447  if (filter.hasFaceScope() &&
448  filter.getFaceScope() != face.getScope()) {
449  return false;
450  }
451 
452  if (filter.hasFacePersistency() &&
453  filter.getFacePersistency() != face.getPersistency()) {
454  return false;
455  }
456 
457  if (filter.hasLinkType() &&
458  filter.getLinkType() != face.getLinkType()) {
459  return false;
460  }
461 
462  return true;
463 }
464 
465 void
466 FaceManager::queryFaces(const Interest& interest,
468 {
469  ndn::nfd::FaceQueryFilter faceFilter;
470  try {
471  faceFilter.wireDecode(interest.getName()[-1].blockFromValue());
472  }
473  catch (const tlv::Error& e) {
474  NFD_LOG_DEBUG("Malformed query filter: " << e.what());
475  return context.reject(ControlResponse(400, "Malformed filter"));
476  }
477 
478  auto now = time::steady_clock::now();
479  for (const auto& face : m_faceTable) {
480  if (matchFilter(faceFilter, face)) {
481  ndn::nfd::FaceStatus status = makeFaceStatus(face, now);
482  context.append(status.wireEncode());
483  }
484  }
485  context.end();
486 }
487 
488 void
489 FaceManager::notifyFaceEvent(const Face& face, ndn::nfd::FaceEventKind kind)
490 {
491  ndn::nfd::FaceEventNotification notification;
492  notification.setKind(kind);
493  copyFaceProperties(face, notification);
494 
495  m_postNotification(notification.wireEncode());
496 }
497 
498 void
499 FaceManager::connectFaceStateChangeSignal(const Face& face)
500 {
501  using face::FaceState;
502 
503  FaceId faceId = face.getId();
504  m_faceStateChangeConn[faceId] = face.afterStateChange.connect(
505  [this, faceId, &face] (FaceState oldState, FaceState newState) {
506  if (newState == FaceState::UP) {
507  notifyFaceEvent(face, ndn::nfd::FACE_EVENT_UP);
508  }
509  else if (newState == FaceState::DOWN) {
510  notifyFaceEvent(face, ndn::nfd::FACE_EVENT_DOWN);
511  }
512  else if (newState == FaceState::CLOSED) {
513  // cannot use face.getId() because it may already be reset to INVALID_FACEID
514  m_faceStateChangeConn.erase(faceId);
515  }
516  });
517 }
518 
519 } // namespace nfd
void reject(const ControlResponse &resp=ControlResponse().setCode(400))
Rejects the request.
NFD_PUBLIC_WITH_TESTS_ELSE_PROTECTED const Name const Interest & interest
ControlParameters & setFaceId(uint64_t faceId)
A collection of common functions shared by all NFD managers, such as communicating with the dispatche...
optional< uint64_t > defaultCongestionThreshold
Definition: face-common.hpp:82
shared_ptr< T > getTag() const
get a tag item
Definition: tag-host.hpp:66
const std::string & getLocalUri() const
#define NFD_LOG_INIT(name)
Definition: logger.hpp:31
NFD_PUBLIC_WITH_TESTS_ELSE_PROTECTED const Name const Interest const ControlParameters const ndn::mgmt::CommandContinuation done
static void updateLinkServiceOptions(Face &face, const ControlParameters &parameters)
boost::logic::tribool wantCongestionMarking
Definition: face-common.hpp:86
represents parameters in a ControlCommand request or response
time::nanoseconds getBaseCongestionMarkingInterval() const
represents a dispatcher on server side of NFD Management protocol
Definition: dispatcher.hpp:130
const ssize_t MTU_UNLIMITED
indicates the transport has no limit on payload size
Definition: transport.hpp:91
static time_point now() noexcept
Definition: time.cpp:80
ControlParameters & setMtu(uint64_t mtu)
set MTU (measured in bytes)
size_t wireEncode(EncodingImpl< TAG > &encoder) const
boost::chrono::time_point< steady_clock > time_point
Definition: time.hpp:230
std::string toString() const
write as a string
Definition: face-uri.cpp:189
void add(shared_ptr< Face > face)
add a face
Definition: face-table.cpp:58
ProtocolFactory * getFactoryByScheme(const std::string &scheme)
Definition: face-system.cpp:82
ndn::nfd::FacePersistency persistency
Definition: face-common.hpp:80
entry point of the face system
Definition: face-system.hpp:51
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:48
FaceEventNotification & setKind(FaceEventKind kind)
std::set< const ProtocolFactory * > listProtocolFactories() const
Definition: face-system.cpp:65
FaceStatus & setNOutBytes(uint64_t nOutBytes)
FaceStatus & setNOutInterests(uint64_t nOutInterests)
ControlParameters & setUri(const std::string &uri)
Face * get(FaceId id) const
get face by FaceId
Definition: face-table.cpp:45
FaceStatus & setExpirationPeriod(time::milliseconds expirationPeriod)
signal::Signal< FaceTable, Face > beforeRemove
Fires immediately before a face is removed.
Definition: face-table.hpp:91
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
Provides support for an underlying protocol.
uint64_t getMtu() const
get MTU (measured in bytes)
size_t wireEncode(EncodingImpl< TAG > &encoder) const
prepend FaceEventNotification to the encoder
optional< ssize_t > mtu
Definition: face-common.hpp:83
static ControlParameters makeCreateFaceResponse(const Face &face)
optional< time::nanoseconds > baseCongestionMarkingInterval
Definition: face-common.hpp:81
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:39
FaceManager(FaceSystem &faceSystem, Dispatcher &dispatcher, CommandAuthenticator &authenticator)
ControlParameters & setBaseCongestionMarkingInterval(time::nanoseconds interval)
TransportState FaceState
indicates the state of a face
Definition: face.hpp:37
NDN_CXX_NODISCARD bool parse(const std::string &uri)
exception-safe parsing
Definition: face-uri.cpp:64
static void copyMtu(const Face &face, T &to)
FaceStatus & setNOutData(uint64_t nOutData)
const std::string & getLocalUri() const
void end()
Finalizes the response successfully after appending zero or more blocks.
#define NFD_LOG_ERROR
Definition: logger.hpp:41
#define NFD_LOG_DEBUG
Definition: logger.hpp:38
face went UP (from DOWN state)
#define NFD_LOG_TRACE
Definition: logger.hpp:37
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:37
represents the underlying protocol and address used by a Face
Definition: face-uri.hpp:44
static bool matchFilter(const ndn::nfd::FaceQueryFilter &filter, const Face &face)
static ndn::nfd::FaceStatus makeFaceStatus(const Face &face, const time::steady_clock::time_point &now)
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:109
void append(span< const uint8_t > bytes)
Appends a sequence of bytes to the response.
FaceStatus & setBaseCongestionMarkingInterval(time::nanoseconds interval)
Provides ControlCommand authorization according to NFD configuration file.
const Name & getName() const noexcept
Definition: interest.hpp:172
ControlParameters & setFacePersistency(FacePersistency persistency)
NFD_PUBLIC_WITH_TESTS_ELSE_PROTECTED const Name const Interest const ControlParameters & parameters
FaceStatus & setNOutNacks(uint64_t nOutNacks)
ControlParameters & setDefaultCongestionThreshold(uint64_t threshold)
set default congestion threshold (measured in bytes)
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 the response to a StatusDataset request.
FacePersistency getFacePersistency() const
bool isCanonical() const
determine whether this FaceUri is in canonical form
Definition: face-uri.cpp:621
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)
void createFace(const CreateFaceRequest &req, const FaceCreatedCallback &onCreated, const FaceCreationFailedCallback &onFailure)
Create a unicast face.
ControlParameters & setFlagBit(size_t bit, bool value, bool wantMask=true)
set a bit in Flags
uint64_t FaceId
Identifies a face.
Definition: face-common.hpp:44
const FaceId INVALID_FACEID
indicates an invalid FaceId
Definition: face-common.hpp:47
Implements the Face Management of NFD Management Protocol.
static ControlParameters makeUpdateFaceResponse(const Face &face)
static void copyFaceProperties(const Face &face, T &to)
represents an error in TLV encoding or decoding
Definition: tlv.hpp:52
face went DOWN (from UP state)
Parameters used to set Transport properties or LinkService options on a newly created face...
Definition: face-common.hpp:78
FaceStatus & setDefaultCongestionThreshold(uint64_t threshold)
set default congestion threshold (measured in bytes)
const size_t MAX_NDN_PACKET_SIZE
Practical size limit of a network-layer packet.
Definition: tlv.hpp:41
size_t wireEncode(EncodingImpl< TAG > &encoder) const
ChannelStatus & setLocalUri(const std::string localUri)
signal::Signal< FaceTable, Face > afterAdd
Fires immediately after a face is added.
Definition: face-table.hpp:85