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-2024, 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 #include <limits>
40 
41 namespace nfd {
42 
43 NFD_LOG_INIT(FaceManager);
44 
46  Dispatcher& dispatcher, CommandAuthenticator& authenticator)
47  : ManagerBase("faces", dispatcher, authenticator)
48  , m_faceSystem(faceSystem)
49  , m_faceTable(faceSystem.getFaceTable())
50 {
51  // register handlers for ControlCommand
52  registerCommandHandler<ndn::nfd::FaceCreateCommand>("create",
53  [this] (auto&&, auto&&, auto&&, auto&&... args) { createFace(std::forward<decltype(args)>(args)...); });
54  registerCommandHandler<ndn::nfd::FaceUpdateCommand>("update",
55  [this] (auto&&, auto&&, auto&&... args) { updateFace(std::forward<decltype(args)>(args)...); });
56  registerCommandHandler<ndn::nfd::FaceDestroyCommand>("destroy",
57  [this] (auto&&, auto&&, auto&&, auto&&... args) { destroyFace(std::forward<decltype(args)>(args)...); });
58 
59  // register handlers for StatusDataset
61  [this] (auto&&, auto&&, auto&&... args) { listFaces(std::forward<decltype(args)>(args)...); });
63  [this] (auto&&, auto&&, auto&&... args) { listChannels(std::forward<decltype(args)>(args)...); });
65  [this] (auto&&, auto&&... args) { queryFaces(std::forward<decltype(args)>(args)...); });
66 
67  // register notification stream
68  m_postNotification = registerNotificationStream("events");
69  m_faceAddConn = m_faceTable.afterAdd.connect([this] (const Face& face) {
70  connectFaceStateChangeSignal(face);
71  notifyFaceEvent(face, ndn::nfd::FACE_EVENT_CREATED);
72  });
73  m_faceRemoveConn = m_faceTable.beforeRemove.connect([this] (const Face& face) {
74  notifyFaceEvent(face, ndn::nfd::FACE_EVENT_DESTROYED);
75  });
76 }
77 
78 void
79 FaceManager::createFace(const ControlParameters& parameters,
80  const ndn::mgmt::CommandContinuation& done)
81 {
82  FaceUri remoteUri;
83  if (!remoteUri.parse(parameters.getUri())) {
84  NFD_LOG_TRACE("failed to parse remote URI: " << parameters.getUri());
85  done(ControlResponse(400, "Malformed command"));
86  return;
87  }
88 
89  if (!remoteUri.isCanonical()) {
90  NFD_LOG_TRACE("received non-canonical remote URI: " << remoteUri.toString());
91  done(ControlResponse(400, "Non-canonical remote URI"));
92  return;
93  }
94 
95  std::optional<FaceUri> localUri;
96  if (parameters.hasLocalUri()) {
97  localUri = FaceUri{};
98 
99  if (!localUri->parse(parameters.getLocalUri())) {
100  NFD_LOG_TRACE("failed to parse local URI: " << parameters.getLocalUri());
101  done(ControlResponse(400, "Malformed command"));
102  return;
103  }
104 
105  if (!localUri->isCanonical()) {
106  NFD_LOG_TRACE("received non-canonical local URI: " << localUri->toString());
107  done(ControlResponse(400, "Non-canonical local URI"));
108  return;
109  }
110  }
111 
112  face::ProtocolFactory* factory = m_faceSystem.getFactoryByScheme(remoteUri.getScheme());
113  if (factory == nullptr) {
114  NFD_LOG_TRACE("received create request for unsupported protocol: " << remoteUri.getScheme());
115  done(ControlResponse(406, "Unsupported protocol"));
116  return;
117  }
118 
119  face::FaceParams faceParams;
120  faceParams.persistency = parameters.getFacePersistency();
121  if (parameters.hasBaseCongestionMarkingInterval()) {
122  faceParams.baseCongestionMarkingInterval = parameters.getBaseCongestionMarkingInterval();
123  }
124  if (parameters.hasDefaultCongestionThreshold()) {
125  faceParams.defaultCongestionThreshold = parameters.getDefaultCongestionThreshold();
126  }
127  if (parameters.hasMtu()) {
128  // The face system limits MTUs to ssize_t, but the management protocol uses uint64_t
129  faceParams.mtu = std::min<uint64_t>(std::numeric_limits<ssize_t>::max(), parameters.getMtu());
130  }
131  faceParams.wantLocalFields = parameters.hasFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED) &&
132  parameters.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED);
133  faceParams.wantLpReliability = parameters.hasFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED) &&
134  parameters.getFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED);
135  if (parameters.hasFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED)) {
136  faceParams.wantCongestionMarking = parameters.getFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED);
137  }
138  try {
139  factory->createFace({remoteUri, localUri, faceParams},
140  [this, parameters, done] (const auto& face) {
141  this->afterCreateFaceSuccess(face, parameters, done);
142  },
143  [done] (uint32_t status, const std::string& reason) {
144  NFD_LOG_DEBUG("Face creation failed: " << reason);
145  done(ControlResponse(status, reason));
146  });
147  }
148  catch (const std::runtime_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  catch (const std::logic_error& error) {
154  NFD_LOG_ERROR("Face creation failed: " << error.what());
155  done(ControlResponse(500, "Face creation failed due to internal error"));
156  return;
157  }
158 }
159 
160 template<typename T>
161 static void
162 copyMtu(const Face& face, T& to)
163 {
164  if (face.getMtu() >= 0) {
165  to.setMtu(std::min<size_t>(face.getMtu(), ndn::MAX_NDN_PACKET_SIZE));
166  }
167  else if (face.getMtu() == face::MTU_UNLIMITED) {
168  to.setMtu(ndn::MAX_NDN_PACKET_SIZE);
169  }
170 }
171 
172 static ControlParameters
174 {
175  ControlParameters params;
176  params.setFaceId(face.getId())
177  .setFacePersistency(face.getPersistency());
178  copyMtu(face, params);
179 
180  auto linkService = dynamic_cast<face::GenericLinkService*>(face.getLinkService());
181  if (linkService != nullptr) {
182  const auto& options = linkService->getOptions();
183  params.setBaseCongestionMarkingInterval(options.baseCongestionMarkingInterval)
184  .setDefaultCongestionThreshold(options.defaultCongestionThreshold)
185  .setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED, options.allowLocalFields, false)
186  .setFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED, options.reliabilityOptions.isEnabled, false)
187  .setFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED, options.allowCongestionMarking, false);
188  }
189 
190  return params;
191 }
192 
193 static ControlParameters
195 {
196  ControlParameters params = makeUpdateFaceResponse(face);
197  params.setUri(face.getRemoteUri().toString())
198  .setLocalUri(face.getLocalUri().toString());
199 
200  return params;
201 }
202 
203 void
204 FaceManager::afterCreateFaceSuccess(const shared_ptr<Face>& face,
205  const ControlParameters& parameters,
206  const ndn::mgmt::CommandContinuation& done)
207 {
208  if (face->getId() != face::INVALID_FACEID) { // Face already exists
209  NFD_LOG_TRACE("Attempted to create duplicate face of " << face->getId());
210  ControlParameters response = makeCreateFaceResponse(*face);
211  done(ControlResponse(409, "Face with remote URI already exists").setBody(response.wireEncode()));
212  return;
213  }
214 
215  // If scope non-local and flags set to enable local fields, request shouldn't
216  // have made it this far
217  BOOST_ASSERT(face->getScope() == ndn::nfd::FACE_SCOPE_LOCAL ||
218  !parameters.hasFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED) ||
219  (parameters.hasFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED) &&
220  !parameters.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED)));
221 
222  m_faceTable.add(face);
223 
224  ControlParameters response = makeCreateFaceResponse(*face);
225  done(ControlResponse(200, "OK").setBody(response.wireEncode()));
226 }
227 
228 static void
229 updateLinkServiceOptions(Face& face, const ControlParameters& parameters)
230 {
231  auto linkService = dynamic_cast<face::GenericLinkService*>(face.getLinkService());
232  if (linkService == nullptr) {
233  return;
234  }
235  auto options = linkService->getOptions();
236 
237  if (parameters.hasFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED) &&
238  face.getScope() == ndn::nfd::FACE_SCOPE_LOCAL) {
239  options.allowLocalFields = parameters.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED);
240  }
241  if (parameters.hasFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED)) {
242  options.reliabilityOptions.isEnabled = parameters.getFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED);
243  }
244  if (parameters.hasFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED)) {
245  options.allowCongestionMarking = parameters.getFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED);
246  }
247  if (parameters.hasBaseCongestionMarkingInterval()) {
248  options.baseCongestionMarkingInterval = parameters.getBaseCongestionMarkingInterval();
249  }
250  if (parameters.hasDefaultCongestionThreshold()) {
251  options.defaultCongestionThreshold = parameters.getDefaultCongestionThreshold();
252  }
253 
254  if (parameters.hasMtu()) {
255  // The face system limits MTUs to ssize_t, but the management protocol uses uint64_t
256  options.overrideMtu = std::min<uint64_t>(std::numeric_limits<ssize_t>::max(), parameters.getMtu());
257  }
258 
259  linkService->setOptions(options);
260 }
261 
262 void
263 FaceManager::updateFace(const Interest& interest,
264  const ControlParameters& parameters,
265  const ndn::mgmt::CommandContinuation& done)
266 {
267  FaceId faceId = parameters.getFaceId();
268  if (faceId == face::INVALID_FACEID) { // Self-update
269  auto incomingFaceIdTag = interest.getTag<lp::IncomingFaceIdTag>();
270  if (incomingFaceIdTag == nullptr) {
271  NFD_LOG_TRACE("unable to determine face for self-update");
272  done(ControlResponse(404, "No FaceId specified and IncomingFaceId not available"));
273  return;
274  }
275  faceId = *incomingFaceIdTag;
276  }
277 
278  Face* face = m_faceTable.get(faceId);
279  if (face == nullptr) {
280  NFD_LOG_TRACE("invalid face specified");
281  done(ControlResponse(404, "Specified face does not exist"));
282  return;
283  }
284 
285  // Verify validity of requested changes
286  ControlParameters response;
287  bool areParamsValid = true;
288 
289  if (parameters.hasFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED) &&
290  parameters.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED) &&
291  face->getScope() != ndn::nfd::FACE_SCOPE_LOCAL) {
292  NFD_LOG_TRACE("received request to enable local fields on non-local face");
293  areParamsValid = false;
294  response.setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED,
295  parameters.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED));
296  }
297 
298  // check whether the requested FacePersistency change is valid if it's present
299  if (parameters.hasFacePersistency()) {
300  auto persistency = parameters.getFacePersistency();
301  if (!face->getTransport()->canChangePersistencyTo(persistency)) {
302  NFD_LOG_TRACE("cannot change face persistency to " << persistency);
303  areParamsValid = false;
304  response.setFacePersistency(persistency);
305  }
306  }
307 
308  // check whether the requested MTU override is valid (if it's present)
309  if (parameters.hasMtu()) {
310  auto mtu = parameters.getMtu();
311  // The face system limits MTUs to ssize_t, but the management protocol uses uint64_t
312  auto actualMtu = std::min<uint64_t>(std::numeric_limits<ssize_t>::max(), mtu);
313  auto linkService = dynamic_cast<face::GenericLinkService*>(face->getLinkService());
314  if (linkService == nullptr || !linkService->canOverrideMtuTo(actualMtu)) {
315  NFD_LOG_TRACE("cannot override face MTU to " << mtu);
316  areParamsValid = false;
317  response.setMtu(mtu);
318  }
319  }
320 
321  if (!areParamsValid) {
322  done(ControlResponse(409, "Invalid properties specified").setBody(response.wireEncode()));
323  return;
324  }
325 
326  // All specified properties are valid, so make changes
327  if (parameters.hasFacePersistency()) {
328  face->setPersistency(parameters.getFacePersistency());
329  }
330  updateLinkServiceOptions(*face, parameters);
331 
332  // Prepare and send ControlResponse
333  response = makeUpdateFaceResponse(*face);
334  done(ControlResponse(200, "OK").setBody(response.wireEncode()));
335 }
336 
337 void
338 FaceManager::destroyFace(const ControlParameters& parameters,
339  const ndn::mgmt::CommandContinuation& done)
340 {
341  Face* face = m_faceTable.get(parameters.getFaceId());
342  if (face != nullptr) {
343  face->close();
344  }
345 
346  done(ControlResponse(200, "OK").setBody(parameters.wireEncode()));
347 }
348 
349 template<typename T>
350 static void
351 copyFaceProperties(const Face& face, T& to)
352 {
353  to.setFaceId(face.getId())
354  .setRemoteUri(face.getRemoteUri().toString())
355  .setLocalUri(face.getLocalUri().toString())
356  .setFaceScope(face.getScope())
357  .setFacePersistency(face.getPersistency())
358  .setLinkType(face.getLinkType());
359 
360  auto linkService = dynamic_cast<face::GenericLinkService*>(face.getLinkService());
361  if (linkService != nullptr) {
362  const auto& options = linkService->getOptions();
363  to.setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED, options.allowLocalFields)
364  .setFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED, options.reliabilityOptions.isEnabled)
365  .setFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED, options.allowCongestionMarking);
366  }
367 }
368 
369 static ndn::nfd::FaceStatus
370 makeFaceStatus(const Face& face, const time::steady_clock::time_point& now)
371 {
372  ndn::nfd::FaceStatus status;
373  copyFaceProperties(face, status);
374 
375  auto expirationTime = face.getExpirationTime();
376  if (expirationTime != time::steady_clock::time_point::max()) {
377  status.setExpirationPeriod(std::max(0_ms,
378  time::duration_cast<time::milliseconds>(expirationTime - now)));
379  }
380 
381  auto linkService = dynamic_cast<face::GenericLinkService*>(face.getLinkService());
382  if (linkService != nullptr) {
383  const auto& options = linkService->getOptions();
384  status.setBaseCongestionMarkingInterval(options.baseCongestionMarkingInterval)
385  .setDefaultCongestionThreshold(options.defaultCongestionThreshold);
386  }
387 
388  copyMtu(face, status);
389 
390  const auto& counters = face.getCounters();
391  status.setNInInterests(counters.nInInterests)
392  .setNOutInterests(counters.nOutInterests)
393  .setNInData(counters.nInData)
394  .setNOutData(counters.nOutData)
395  .setNInNacks(counters.nInNacks)
396  .setNOutNacks(counters.nOutNacks)
397  .setNInBytes(counters.nInBytes)
398  .setNOutBytes(counters.nOutBytes);
399 
400  return status;
401 }
402 
403 void
404 FaceManager::listFaces(ndn::mgmt::StatusDatasetContext& context)
405 {
406  auto now = time::steady_clock::now();
407  for (const auto& face : m_faceTable) {
408  ndn::nfd::FaceStatus status = makeFaceStatus(face, now);
409  context.append(status.wireEncode());
410  }
411  context.end();
412 }
413 
414 void
415 FaceManager::listChannels(ndn::mgmt::StatusDatasetContext& context)
416 {
417  auto factories = m_faceSystem.listProtocolFactories();
418  for (const auto* factory : factories) {
419  for (const auto& channel : factory->getChannels()) {
420  ndn::nfd::ChannelStatus entry;
421  entry.setLocalUri(channel->getUri().toString());
422  context.append(entry.wireEncode());
423  }
424  }
425  context.end();
426 }
427 
428 static bool
429 matchFilter(const ndn::nfd::FaceQueryFilter& filter, const Face& face)
430 {
431  if (filter.hasFaceId() &&
432  filter.getFaceId() != static_cast<uint64_t>(face.getId())) {
433  return false;
434  }
435 
436  if (filter.hasUriScheme() &&
437  filter.getUriScheme() != face.getRemoteUri().getScheme() &&
438  filter.getUriScheme() != face.getLocalUri().getScheme()) {
439  return false;
440  }
441 
442  if (filter.hasRemoteUri() &&
443  filter.getRemoteUri() != face.getRemoteUri().toString()) {
444  return false;
445  }
446 
447  if (filter.hasLocalUri() &&
448  filter.getLocalUri() != face.getLocalUri().toString()) {
449  return false;
450  }
451 
452  if (filter.hasFaceScope() &&
453  filter.getFaceScope() != face.getScope()) {
454  return false;
455  }
456 
457  if (filter.hasFacePersistency() &&
458  filter.getFacePersistency() != face.getPersistency()) {
459  return false;
460  }
461 
462  if (filter.hasLinkType() &&
463  filter.getLinkType() != face.getLinkType()) {
464  return false;
465  }
466 
467  return true;
468 }
469 
470 void
471 FaceManager::queryFaces(const Interest& interest,
472  ndn::mgmt::StatusDatasetContext& context)
473 {
474  ndn::nfd::FaceQueryFilter faceFilter;
475  try {
476  faceFilter.wireDecode(interest.getName()[-1].blockFromValue());
477  }
478  catch (const tlv::Error& e) {
479  NFD_LOG_DEBUG("Malformed query filter: " << e.what());
480  return context.reject(ControlResponse(400, "Malformed filter"));
481  }
482 
483  auto now = time::steady_clock::now();
484  for (const auto& face : m_faceTable) {
485  if (matchFilter(faceFilter, face)) {
486  ndn::nfd::FaceStatus status = makeFaceStatus(face, now);
487  context.append(status.wireEncode());
488  }
489  }
490  context.end();
491 }
492 
493 void
494 FaceManager::notifyFaceEvent(const Face& face, ndn::nfd::FaceEventKind kind)
495 {
496  ndn::nfd::FaceEventNotification notification;
497  notification.setKind(kind);
498  copyFaceProperties(face, notification);
499 
500  m_postNotification(notification.wireEncode());
501 }
502 
503 void
504 FaceManager::connectFaceStateChangeSignal(const Face& face)
505 {
506  using face::FaceState;
507 
508  FaceId faceId = face.getId();
509  m_faceStateChangeConn[faceId] = face.afterStateChange.connect(
510  [this, faceId, &face] (FaceState oldState, FaceState newState) {
511  if (newState == FaceState::UP) {
512  notifyFaceEvent(face, ndn::nfd::FACE_EVENT_UP);
513  }
514  else if (newState == FaceState::DOWN) {
515  notifyFaceEvent(face, ndn::nfd::FACE_EVENT_DOWN);
516  }
517  else if (newState == FaceState::CLOSED) {
518  // cannot use face.getId() because it may already be reset to INVALID_FACEID
519  m_faceStateChangeConn.erase(faceId);
520  }
521  });
522 }
523 
524 } // 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:89
signal::Signal< FaceTable, Face > afterAdd
Fires immediately after a face is added.
Definition: face-table.hpp:83
Face * get(FaceId id) const noexcept
Get face by FaceId.
Definition: face-table.cpp:38
void add(shared_ptr< Face > face)
Add a face.
Definition: face-table.cpp:51
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:118
ndn::nfd::FaceScope getScope() const noexcept
Returns whether the face is local or non-local for scope control purposes.
Definition: face.hpp:232
FaceUri getLocalUri() const noexcept
Returns a FaceUri representing the local endpoint.
Definition: face.hpp:214
ndn::nfd::LinkType getLinkType() const noexcept
Returns the link type of the face (point-to-point, multi-access, ...).
Definition: face.hpp:259
FaceUri getRemoteUri() const noexcept
Returns a FaceUri representing the remote endpoint.
Definition: face.hpp:223
ssize_t getMtu() const
Returns the effective MTU of the face.
Definition: face.hpp:270
LinkService * getLinkService() const noexcept
Definition: face.hpp:123
FaceId getId() const noexcept
Returns the face ID.
Definition: face.hpp:195
void close()
Request that the face be closed.
Definition: face.hpp:145
const FaceCounters & getCounters() const noexcept
Definition: face.hpp:298
ndn::nfd::FacePersistency getPersistency() const noexcept
Returns the current persistency setting of the face.
Definition: face.hpp:241
time::steady_clock::time_point getExpirationTime() const noexcept
Returns the expiration time of the face.
Definition: face.hpp:292
Entry point of NFD's face system.
Definition: face-system.hpp:55
std::set< const ProtocolFactory * > listProtocolFactories() const
Returns all ProtocolFactory objects owned by the face system.
Definition: face-system.cpp:63
ProtocolFactory * getFactoryByScheme(const std::string &scheme) const
Definition: face-system.cpp:80
#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:41
constexpr FaceId INVALID_FACEID
Indicates an invalid FaceId.
Definition: face-common.hpp:51
constexpr ssize_t MTU_UNLIMITED
Indicates that the transport has no limit on payload size.
Definition: transport.hpp:101
uint64_t FaceId
Identifies a face.
Definition: face-common.hpp:48
-status-http-server
Definition: common.hpp:71
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)