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-2022, 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>
34 #include <ndn-cxx/mgmt/nfd/channel-status.hpp>
35 #include <ndn-cxx/mgmt/nfd/face-event-notification.hpp>
36 #include <ndn-cxx/mgmt/nfd/face-query-filter.hpp>
37 #include <ndn-cxx/mgmt/nfd/face-status.hpp>
38 
39 namespace nfd {
40 
41 NFD_LOG_INIT(FaceManager);
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,
75  const ndn::mgmt::CommandContinuation& done)
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  std::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()) {
117  faceParams.baseCongestionMarkingInterval = parameters.getBaseCongestionMarkingInterval();
118  }
119  if (parameters.hasDefaultCongestionThreshold()) {
120  faceParams.defaultCongestionThreshold = parameters.getDefaultCongestionThreshold();
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  }
126  faceParams.wantLocalFields = parameters.hasFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED) &&
127  parameters.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED);
128  faceParams.wantLpReliability = parameters.hasFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED) &&
129  parameters.getFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED);
130  if (parameters.hasFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED)) {
131  faceParams.wantCongestionMarking = parameters.getFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED);
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 {
191  ControlParameters params = makeUpdateFaceResponse(face);
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 ||
213  !parameters.hasFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED) ||
214  (parameters.hasFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED) &&
215  !parameters.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED)));
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
224 updateLinkServiceOptions(Face& face, const ControlParameters& parameters)
225 {
226  auto linkService = dynamic_cast<face::GenericLinkService*>(face.getLinkService());
227  if (linkService == nullptr) {
228  return;
229  }
230  auto options = linkService->getOptions();
231 
232  if (parameters.hasFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED) &&
233  face.getScope() == ndn::nfd::FACE_SCOPE_LOCAL) {
234  options.allowLocalFields = parameters.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED);
235  }
236  if (parameters.hasFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED)) {
237  options.reliabilityOptions.isEnabled = parameters.getFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED);
238  }
239  if (parameters.hasFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED)) {
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 == face::INVALID_FACEID) { // 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 
284  if (parameters.hasFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED) &&
285  parameters.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED) &&
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;
289  response.setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED,
290  parameters.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED));
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 
364 static ndn::nfd::FaceStatus
365 makeFaceStatus(const Face& face, const time::steady_clock::time_point& now)
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()) {
415  ndn::nfd::ChannelStatus entry;
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,
467  ndn::mgmt::StatusDatasetContext& context)
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
Provides ControlCommand authorization according to NFD's configuration file.
FaceManager(FaceSystem &faceSystem, Dispatcher &dispatcher, CommandAuthenticator &authenticator)
signal::Signal< FaceTable, Face > beforeRemove
Fires immediately before a face is removed.
Definition: face-table.hpp:87
signal::Signal< FaceTable, Face > afterAdd
Fires immediately after a face is added.
Definition: face-table.hpp:81
Face * get(FaceId id) const noexcept
Get face by FaceId.
Definition: face-table.cpp:40
void add(shared_ptr< Face > face)
Add a face.
Definition: face-table.cpp:53
A collection of common functions shared by all NFD managers, such as communicating with the dispatche...
ndn::mgmt::PostNotification registerNotificationStream(const std::string &verb)
void registerStatusDatasetHandler(const std::string &verb, const ndn::mgmt::StatusDatasetHandler &handler)
Generalization of a network interface.
Definition: face.hpp:56
time::steady_clock::time_point getExpirationTime() const
Returns the expiration time of the face.
Definition: face.hpp:309
ndn::nfd::FaceScope getScope() const
Returns whether the face is local or non-local for scope control purposes.
Definition: face.hpp:273
FaceUri getRemoteUri() const
Returns a FaceUri representing the remote endpoint.
Definition: face.hpp:267
ndn::nfd::FacePersistency getPersistency() const
Returns the current persistency setting of the face.
Definition: face.hpp:279
ssize_t getMtu() const
Returns the effective MTU of the face.
Definition: face.hpp:297
LinkService * getLinkService() const noexcept
Definition: face.hpp:61
FaceId getId() const noexcept
Returns the face ID.
Definition: face.hpp:121
void close()
Request that the face be closed.
Definition: face.hpp:237
FaceUri getLocalUri() const
Returns a FaceUri representing the local endpoint.
Definition: face.hpp:261
const FaceCounters & getCounters() const noexcept
Definition: face.hpp:199
ndn::nfd::LinkType getLinkType() const
Returns the link type of the face (point-to-point, multi-access, ...).
Definition: face.hpp:291
Entry point of NFD's face system.
Definition: face-system.hpp:53
std::set< const ProtocolFactory * > listProtocolFactories() const
Returns all ProtocolFactory objects owned by the face system.
Definition: face-system.cpp:64
ProtocolFactory * getFactoryByScheme(const std::string &scheme)
Definition: face-system.cpp:81
#define NFD_LOG_ERROR
Definition: logger.hpp:41
#define NFD_LOG_INIT(name)
Definition: logger.hpp:31
#define NFD_LOG_DEBUG
Definition: logger.hpp:38
#define NFD_LOG_TRACE
Definition: logger.hpp:37
TransportState FaceState
Indicates the state of a face.
Definition: face.hpp:42
constexpr FaceId INVALID_FACEID
Indicates an invalid FaceId.
Definition: face-common.hpp:50
constexpr ssize_t MTU_UNLIMITED
Indicates that the transport has no limit on payload size.
Definition: transport.hpp:92
uint64_t FaceId
Identifies a face.
Definition: face-common.hpp:47
Definition: common.hpp:77
static void copyFaceProperties(const Face &face, T &to)
static ControlParameters makeUpdateFaceResponse(const Face &face)
static void updateLinkServiceOptions(Face &face, const ControlParameters &parameters)
static bool matchFilter(const ndn::nfd::FaceQueryFilter &filter, const Face &face)
static ControlParameters makeCreateFaceResponse(const Face &face)
static void copyMtu(const Face &face, T &to)
static ndn::nfd::FaceStatus makeFaceStatus(const Face &face, const time::steady_clock::time_point &now)