NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
udp-factory.cpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014-2019, 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 "udp-factory.hpp"
27 #include "generic-link-service.hpp"
29 #include "common/global.hpp"
30 
31 #include <boost/range/adaptor/map.hpp>
32 #include <boost/range/algorithm/copy.hpp>
33 
34 namespace nfd {
35 namespace face {
36 
37 namespace ip = boost::asio::ip;
38 namespace net = ndn::net;
39 
42 
43 const std::string&
45 {
46  static std::string id("udp");
47  return id;
48 }
49 
51  : ProtocolFactory(params)
52 {
53  m_netifAddConn = netmon->onInterfaceAdded.connect([this] (const auto& netif) {
54  this->applyMcastConfigToNetif(netif);
55  });
56 }
57 
58 void
59 UdpFactory::doProcessConfig(OptionalConfigSection configSection,
61 {
62  // udp
63  // {
64  // listen yes
65  // port 6363
66  // enable_v4 yes
67  // enable_v6 yes
68  // idle_timeout 600
69  // mcast yes
70  // mcast_group 224.0.23.170
71  // mcast_port 56363
72  // mcast_group_v6 ff02::1234
73  // mcast_port_v6 56363
74  // mcast_ad_hoc no
75  // whitelist
76  // {
77  // *
78  // }
79  // blacklist
80  // {
81  // }
82  // }
83 
84  m_wantCongestionMarking = context.generalConfig.wantCongestionMarking;
85 
86  bool wantListen = true;
87  uint16_t port = 6363;
88  bool enableV4 = false;
89  bool enableV6 = false;
90  uint32_t idleTimeout = 600;
91  MulticastConfig mcastConfig;
92 
93  if (configSection) {
94  // These default to 'yes' but only if face_system.udp section is present
95  enableV4 = enableV6 = mcastConfig.isEnabled = true;
96 
97  for (const auto& pair : *configSection) {
98  const std::string& key = pair.first;
99  const ConfigSection& value = pair.second;
100 
101  if (key == "listen") {
102  wantListen = ConfigFile::parseYesNo(pair, "face_system.udp");
103  }
104  else if (key == "port") {
105  port = ConfigFile::parseNumber<uint16_t>(pair, "face_system.udp");
106  }
107  else if (key == "enable_v4") {
108  enableV4 = ConfigFile::parseYesNo(pair, "face_system.udp");
109  }
110  else if (key == "enable_v6") {
111  enableV6 = ConfigFile::parseYesNo(pair, "face_system.udp");
112  }
113  else if (key == "idle_timeout") {
114  idleTimeout = ConfigFile::parseNumber<uint32_t>(pair, "face_system.udp");
115  }
116  else if (key == "keep_alive_interval") {
117  // ignored
118  }
119  else if (key == "mcast") {
120  mcastConfig.isEnabled = ConfigFile::parseYesNo(pair, "face_system.udp");
121  }
122  else if (key == "mcast_group") {
123  const std::string& valueStr = value.get_value<std::string>();
124  boost::system::error_code ec;
125  mcastConfig.group.address(ip::address_v4::from_string(valueStr, ec));
126  if (ec) {
127  NDN_THROW(ConfigFile::Error("face_system.udp.mcast_group: '" +
128  valueStr + "' cannot be parsed as an IPv4 address"));
129  }
130  else if (!mcastConfig.group.address().is_multicast()) {
131  NDN_THROW(ConfigFile::Error("face_system.udp.mcast_group: '" +
132  valueStr + "' is not a multicast address"));
133  }
134  }
135  else if (key == "mcast_port") {
136  mcastConfig.group.port(ConfigFile::parseNumber<uint16_t>(pair, "face_system.udp"));
137  }
138  else if (key == "mcast_group_v6") {
139  const std::string& valueStr = value.get_value<std::string>();
140  boost::system::error_code ec;
141  mcastConfig.groupV6.address(ip::address_v6::from_string(valueStr, ec));
142  if (ec) {
143  NDN_THROW(ConfigFile::Error("face_system.udp.mcast_group_v6: '" +
144  valueStr + "' cannot be parsed as an IPv6 address"));
145  }
146  else if (!mcastConfig.groupV6.address().is_multicast()) {
147  NDN_THROW(ConfigFile::Error("face_system.udp.mcast_group_v6: '" +
148  valueStr + "' is not a multicast address"));
149  }
150  }
151  else if (key == "mcast_port_v6") {
152  mcastConfig.groupV6.port(ConfigFile::parseNumber<uint16_t>(pair, "face_system.udp"));
153  }
154  else if (key == "mcast_ad_hoc") {
155  bool wantAdHoc = ConfigFile::parseYesNo(pair, "face_system.udp");
156  mcastConfig.linkType = wantAdHoc ? ndn::nfd::LINK_TYPE_AD_HOC : ndn::nfd::LINK_TYPE_MULTI_ACCESS;
157  }
158  else if (key == "whitelist") {
159  mcastConfig.netifPredicate.parseWhitelist(value);
160  }
161  else if (key == "blacklist") {
162  mcastConfig.netifPredicate.parseBlacklist(value);
163  }
164  else {
165  NDN_THROW(ConfigFile::Error("Unrecognized option face_system.udp." + key));
166  }
167  }
168 
169  if (!enableV4 && !enableV6 && !mcastConfig.isEnabled) {
170  NDN_THROW(ConfigFile::Error(
171  "IPv4 and IPv6 UDP channels and UDP multicast have been disabled. "
172  "Remove face_system.udp section to disable UDP channels or enable at least one of them."));
173  }
174  }
175 
176  if (context.isDryRun) {
177  return;
178  }
179 
180  if (enableV4) {
181  udp::Endpoint endpoint(ip::udp::v4(), port);
182  shared_ptr<UdpChannel> v4Channel = this->createChannel(endpoint, time::seconds(idleTimeout));
183  if (wantListen && !v4Channel->isListening()) {
184  v4Channel->listen(this->addFace, nullptr);
185  }
186  providedSchemes.insert("udp");
187  providedSchemes.insert("udp4");
188  }
189  else if (providedSchemes.count("udp4") > 0) {
190  NFD_LOG_WARN("Cannot close udp4 channel after its creation");
191  }
192 
193  if (enableV6) {
194  udp::Endpoint endpoint(ip::udp::v6(), port);
195  shared_ptr<UdpChannel> v6Channel = this->createChannel(endpoint, time::seconds(idleTimeout));
196  if (wantListen && !v6Channel->isListening()) {
197  v6Channel->listen(this->addFace, nullptr);
198  }
199  providedSchemes.insert("udp");
200  providedSchemes.insert("udp6");
201  }
202  else if (providedSchemes.count("udp6") > 0) {
203  NFD_LOG_WARN("Cannot close udp6 channel after its creation");
204  }
205 
206  if (m_mcastConfig.isEnabled != mcastConfig.isEnabled) {
207  if (mcastConfig.isEnabled) {
208  NFD_LOG_INFO("enabling multicast on " << mcastConfig.group);
209  NFD_LOG_INFO("enabling multicast on " << mcastConfig.groupV6);
210  }
211  else {
212  NFD_LOG_INFO("disabling multicast");
213  }
214  }
215  else if (mcastConfig.isEnabled) {
216  if (m_mcastConfig.linkType != mcastConfig.linkType && !m_mcastFaces.empty()) {
217  NFD_LOG_WARN("Cannot change ad hoc setting on existing faces");
218  }
219  if (m_mcastConfig.group != mcastConfig.group) {
220  NFD_LOG_INFO("changing IPv4 multicast group from " << m_mcastConfig.group <<
221  " to " << mcastConfig.group);
222  }
223  if (m_mcastConfig.groupV6 != mcastConfig.groupV6) {
224  NFD_LOG_INFO("changing IPv6 multicast group from " << m_mcastConfig.groupV6 <<
225  " to " << mcastConfig.groupV6);
226  }
227  if (m_mcastConfig.netifPredicate != mcastConfig.netifPredicate) {
228  NFD_LOG_INFO("changing whitelist/blacklist");
229  }
230  }
231 
232  // Even if there's no configuration change, we still need to re-apply configuration because
233  // netifs may have changed.
234  m_mcastConfig = mcastConfig;
235  this->applyMcastConfig(context);
236 }
237 
238 void
239 UdpFactory::doCreateFace(const CreateFaceRequest& req,
240  const FaceCreatedCallback& onCreated,
241  const FaceCreationFailedCallback& onFailure)
242 {
243  if (req.localUri) {
244  NFD_LOG_TRACE("Cannot create unicast UDP face with LocalUri");
245  onFailure(406, "Unicast UDP faces cannot be created with a LocalUri");
246  return;
247  }
248 
249  if (req.params.persistency == ndn::nfd::FACE_PERSISTENCY_ON_DEMAND) {
250  NFD_LOG_TRACE("createFace does not support FACE_PERSISTENCY_ON_DEMAND");
251  onFailure(406, "Outgoing UDP faces do not support on-demand persistency");
252  return;
253  }
254 
255  udp::Endpoint endpoint(ip::address::from_string(req.remoteUri.getHost()),
256  boost::lexical_cast<uint16_t>(req.remoteUri.getPort()));
257 
258  if (endpoint.address().is_multicast()) {
259  NFD_LOG_TRACE("createFace does not support multicast faces");
260  onFailure(406, "Cannot create multicast UDP faces");
261  return;
262  }
263 
264  if (req.params.wantLocalFields) {
265  // UDP faces are never local
266  NFD_LOG_TRACE("createFace cannot create non-local face with local fields enabled");
267  onFailure(406, "Local fields can only be enabled on faces with local scope");
268  return;
269  }
270 
271  if (req.params.mtu && *req.params.mtu < Transport::MIN_MTU) {
272  // The specified MTU must be greater than the minimum possible
273  NFD_LOG_TRACE("createFace cannot create a face with MTU less than " << Transport::MIN_MTU);
274  onFailure(406, "MTU cannot be less than " + to_string(Transport::MIN_MTU));
275  return;
276  }
277 
278  // very simple logic for now
279  for (const auto& i : m_channels) {
280  if ((i.first.address().is_v4() && endpoint.address().is_v4()) ||
281  (i.first.address().is_v6() && endpoint.address().is_v6())) {
282  i.second->connect(endpoint, req.params, onCreated, onFailure);
283  return;
284  }
285  }
286 
287  NFD_LOG_TRACE("No channels available to connect to " << endpoint);
288  onFailure(504, "No channels available to connect");
289 }
290 
291 shared_ptr<UdpChannel>
293  time::nanoseconds idleTimeout)
294 {
295  auto it = m_channels.find(localEndpoint);
296  if (it != m_channels.end())
297  return it->second;
298 
299  // check if the endpoint is already used by a multicast face
300  if (m_mcastFaces.find(localEndpoint) != m_mcastFaces.end()) {
301  NDN_THROW(Error("Cannot create UDP channel on " + boost::lexical_cast<std::string>(localEndpoint) +
302  ", endpoint already allocated to a UDP multicast face"));
303  }
304 
305  auto channel = std::make_shared<UdpChannel>(localEndpoint, idleTimeout, m_wantCongestionMarking);
306  m_channels[localEndpoint] = channel;
307  return channel;
308 }
309 
310 std::vector<shared_ptr<const Channel>>
311 UdpFactory::doGetChannels() const
312 {
313  return getChannelsFromMap(m_channels);
314 }
315 
316 shared_ptr<Face>
317 UdpFactory::createMulticastFace(const shared_ptr<const net::NetworkInterface>& netif,
318  const ip::address& localAddress,
319  const udp::Endpoint& multicastEndpoint)
320 {
321  BOOST_ASSERT(multicastEndpoint.address().is_multicast());
322 
323  udp::Endpoint localEp(localAddress, multicastEndpoint.port());
324  BOOST_ASSERT(localEp.protocol() == multicastEndpoint.protocol());
325 
326  auto mcastEp = multicastEndpoint;
327  if (mcastEp.address().is_v6()) {
328  // in IPv6, a scope id on the multicast address is always required
329  auto mcastAddress = mcastEp.address().to_v6();
330  mcastAddress.scope_id(netif->getIndex());
331  mcastEp.address(mcastAddress);
332  }
333 
334  // check if the local endpoint is already used by another multicast face
335  auto it = m_mcastFaces.find(localEp);
336  if (it != m_mcastFaces.end()) {
337  if (it->second->getRemoteUri() == FaceUri(mcastEp))
338  return it->second;
339  else
340  NDN_THROW(Error("Cannot create UDP multicast face on " + boost::lexical_cast<std::string>(localEp) +
341  ", endpoint already allocated to a different UDP multicast face"));
342  }
343 
344  // check if the local endpoint is already used by a unicast channel
345  if (m_channels.find(localEp) != m_channels.end()) {
346  NDN_THROW(Error("Cannot create UDP multicast face on " + boost::lexical_cast<std::string>(localEp) +
347  ", endpoint already allocated to a UDP channel"));
348  }
349 
350  ip::udp::socket rxSock(getGlobalIoService());
351  MulticastUdpTransport::openRxSocket(rxSock, mcastEp, localAddress, netif);
352  ip::udp::socket txSock(getGlobalIoService());
353  MulticastUdpTransport::openTxSocket(txSock, udp::Endpoint(localAddress, 0), netif);
354 
356  options.allowCongestionMarking = m_wantCongestionMarking;
357  auto linkService = make_unique<GenericLinkService>(options);
358  auto transport = make_unique<MulticastUdpTransport>(mcastEp, std::move(rxSock), std::move(txSock),
359  m_mcastConfig.linkType);
360  auto face = make_shared<Face>(std::move(linkService), std::move(transport));
361 
362  m_mcastFaces[localEp] = face;
363  connectFaceClosedSignal(*face, [this, localEp] { m_mcastFaces.erase(localEp); });
364 
365  return face;
366 }
367 
368 static optional<ip::address>
370 {
371  for (const auto& na : netif.getNetworkAddresses()) {
372  if (na.getFamily() == af &&
373  (na.getScope() == net::AddressScope::LINK || na.getScope() == net::AddressScope::GLOBAL)) {
374  return na.getIp();
375  }
376  }
377  return nullopt;
378 }
379 
380 std::vector<shared_ptr<Face>>
381 UdpFactory::applyMcastConfigToNetif(const shared_ptr<const net::NetworkInterface>& netif)
382 {
383  BOOST_ASSERT(netif != nullptr);
384 
385  if (!m_mcastConfig.isEnabled) {
386  return {};
387  }
388 
389  if (!netif->isUp()) {
390  NFD_LOG_DEBUG("Not creating multicast faces on " << netif->getName() << ": netif is down");
391  return {};
392  }
393 
394  if (netif->isLoopback()) {
395  NFD_LOG_DEBUG("Not creating multicast faces on " << netif->getName() << ": netif is loopback");
396  return {};
397  }
398 
399  if (!netif->canMulticast()) {
400  NFD_LOG_DEBUG("Not creating multicast faces on " << netif->getName() << ": netif cannot multicast");
401  return {};
402  }
403 
404  if (!m_mcastConfig.netifPredicate(*netif)) {
405  NFD_LOG_DEBUG("Not creating multicast faces on " << netif->getName() << ": rejected by whitelist/blacklist");
406  return {};
407  }
408 
409  std::vector<ip::address> addrs;
410  for (auto af : {net::AddressFamily::V4, net::AddressFamily::V6}) {
411  auto addr = pickAddress(*netif, af);
412  if (addr)
413  addrs.push_back(*addr);
414  }
415 
416  if (addrs.empty()) {
417  NFD_LOG_DEBUG("Not creating multicast faces on " << netif->getName() << ": no viable IP address");
418  // keep an eye on new addresses
419  m_netifConns[netif->getIndex()].addrAddConn =
420  netif->onAddressAdded.connect([=] (auto...) { this->applyMcastConfigToNetif(netif); });
421  return {};
422  }
423 
424  NFD_LOG_DEBUG("Creating multicast faces on " << netif->getName());
425 
426  std::vector<shared_ptr<Face>> faces;
427  for (const auto& addr : addrs) {
428  auto face = this->createMulticastFace(netif, addr,
429  addr.is_v4() ? m_mcastConfig.group : m_mcastConfig.groupV6);
430  if (face->getId() == INVALID_FACEID) {
431  // new face: register with forwarding
432  this->addFace(face);
433  }
434  faces.push_back(std::move(face));
435  }
436 
437  return faces;
438 }
439 
440 void
441 UdpFactory::applyMcastConfig(const FaceSystem::ConfigContext&)
442 {
443  // collect old faces
444  std::set<shared_ptr<Face>> facesToClose;
445  boost::copy(m_mcastFaces | boost::adaptors::map_values,
446  std::inserter(facesToClose, facesToClose.end()));
447 
448  // create faces if requested by config
449  for (const auto& netif : netmon->listNetworkInterfaces()) {
450  auto facesToKeep = this->applyMcastConfigToNetif(netif);
451  for (const auto& face : facesToKeep) {
452  // don't destroy face
453  facesToClose.erase(face);
454  }
455  }
456 
457  // destroy old faces that are not needed in new configuration
458  for (const auto& face : facesToClose) {
459  face->close();
460  }
461 }
462 
463 } // namespace face
464 } // namespace nfd
NFD_LOG_TRACE
#define NFD_LOG_TRACE
Definition: logger.hpp:37
NFD_LOG_INFO
#define NFD_LOG_INFO
Definition: logger.hpp:39
global.hpp
nfd::ConfigFile::parseYesNo
static bool parseYesNo(const ConfigSection &node, const std::string &key, const std::string &sectionName)
parse a config option that can be either "yes" or "no"
Definition: config-file.cpp:60
nfd::face::ProtocolFactory::netmon
shared_ptr< ndn::net::NetworkMonitor > netmon
NetworkMonitor for listing available network interfaces and monitoring their changes.
Definition: protocol-factory.hpp:246
nonstd::optional_lite::std11::move
T & move(T &t)
Definition: optional.hpp:421
ndn::net::NetworkInterface::getIndex
int getIndex() const
Returns an opaque ID that uniquely identifies the interface on the system.
Definition: network-interface.hpp:92
ndn::net::NetworkInterface
Represents one network interface attached to the host.
Definition: network-interface.hpp:70
ndn::FaceUri
represents the underlying protocol and address used by a Face
Definition: face-uri.hpp:45
nfd::face::GenericLinkService::Options::allowCongestionMarking
bool allowCongestionMarking
enables send queue congestion detection and marking
Definition: generic-link-service.hpp:134
nfd::face::ProtocolFactory::providedSchemes
std::set< std::string > providedSchemes
FaceUri schemes provided by this protocol factory.
Definition: protocol-factory.hpp:238
ndn::nfd::LINK_TYPE_AD_HOC
@ LINK_TYPE_AD_HOC
link is ad hoc
Definition: nfd-constants.hpp:61
nfd::face::ProtocolFactory
Provides support for an underlying protocol.
Definition: protocol-factory.hpp:60
nfd::face::NFD_REGISTER_PROTOCOL_FACTORY
NFD_REGISTER_PROTOCOL_FACTORY(EthernetFactory)
multicast-udp-transport.hpp
nfd::getGlobalIoService
detail::SimulatorIo & getGlobalIoService()
Returns the global io_service instance for the calling thread.
Definition: global.cpp:49
NFD_LOG_WARN
#define NFD_LOG_WARN
Definition: logger.hpp:40
nfd::OptionalConfigSection
boost::optional< const ConfigSection & > OptionalConfigSection
an optional config file section
Definition: config-file.hpp:41
ndn::nfd::LINK_TYPE_MULTI_ACCESS
@ LINK_TYPE_MULTI_ACCESS
link is multi-access
Definition: nfd-constants.hpp:60
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
nfd::face::INVALID_FACEID
const FaceId INVALID_FACEID
indicates an invalid FaceId
Definition: face-common.hpp:47
nfd::face::MulticastUdpTransport::openRxSocket
static void openRxSocket(protocol::socket &sock, const protocol::endpoint &multicastGroup, const boost::asio::ip::address &localAddress, const shared_ptr< const ndn::net::NetworkInterface > &netif=nullptr)
Definition: multicast-udp-transport.cpp:134
ndn::net::NetworkInterface::canMulticast
bool canMulticast() const
Returns true if the interface supports multicast communication.
Definition: network-interface.hpp:188
nfd::face::ProtocolFactory::addFace
FaceCreatedCallback addFace
callback when a new face is created
Definition: protocol-factory.hpp:239
nfd::face::FaceSystem::ConfigContext::generalConfig
GeneralConfig generalConfig
Definition: face-system.hpp:99
NDN_THROW
#define NDN_THROW(e)
Definition: exception.hpp:61
nfd::face::MulticastUdpTransport::openTxSocket
static void openTxSocket(protocol::socket &sock, const protocol::endpoint &localEndpoint, const shared_ptr< const ndn::net::NetworkInterface > &netif=nullptr, bool enableLoopback=false)
Definition: multicast-udp-transport.cpp:169
nfd::face::UdpFactory::UdpFactory
UdpFactory(const CtorParams &params)
Definition: udp-factory.cpp:50
nfd::face::GenericLinkService::Options
Options that control the behavior of GenericLinkService.
Definition: generic-link-service.hpp:101
ndn::net::NetworkInterface::isUp
bool isUp() const
Returns true if the interface is administratively up.
Definition: network-interface.hpp:196
nonstd::optional_lite::nullopt
const nullopt_t nullopt((nullopt_t::init()))
ndn::net::AddressFamily
AddressFamily
Definition: network-address.hpp:34
ndn::net::NetworkInterface::getNetworkAddresses
const std::set< NetworkAddress > & getNetworkAddresses() const
Returns a list of all network-layer addresses present on the interface.
Definition: network-interface.hpp:156
nfd::face::ProtocolFactoryCtorParams
Parameters to ProtocolFactory constructor.
Definition: protocol-factory.hpp:47
udp-factory.hpp
nfd::face::connectFaceClosedSignal
void connectFaceClosedSignal(Face &face, std::function< void()> f)
Invokes a callback when a face is closed.
Definition: channel.cpp:41
ndn::net::NetworkInterface::isLoopback
bool isLoopback() const
Returns true if the interface is a loopback interface.
Definition: network-interface.hpp:164
NFD_LOG_DEBUG
#define NFD_LOG_DEBUG
Definition: logger.hpp:38
ndn::net::NetworkInterface::onAddressAdded
util::Signal< NetworkInterface, NetworkAddress > onAddressAdded
Fires when a network-layer address is added to the interface.
Definition: network-interface.hpp:82
nfd::ConfigSection
boost::property_tree::ptree ConfigSection
a config file section
Definition: ndn-l3-protocol.hpp:39
nfd::face::FaceCreatedCallback
std::function< void(const shared_ptr< Face > &)> FaceCreatedCallback
Prototype for the callback that is invoked when a face is created (in response to an incoming connect...
Definition: channel.hpp:74
ndn::nfd::FACE_PERSISTENCY_ON_DEMAND
@ FACE_PERSISTENCY_ON_DEMAND
face is on-demand
Definition: nfd-constants.hpp:48
nfd::face::pickAddress
static optional< ip::address > pickAddress(const net::NetworkInterface &netif, net::AddressFamily af)
Definition: udp-factory.cpp:369
nfd::face::UdpFactory
Protocol factory for UDP over IPv4 and IPv6.
Definition: udp-factory.hpp:38
ndn::to_string
std::string to_string(const T &val)
Definition: backports.hpp:102
nfd::face::UdpFactory::createMulticastFace
shared_ptr< Face > createMulticastFace(const shared_ptr< const ndn::net::NetworkInterface > &netif, const boost::asio::ip::address &localAddress, const udp::Endpoint &multicastEndpoint)
Create a multicast UDP face.
Definition: udp-factory.cpp:317
nfd::face::FaceSystem::ConfigContext::isDryRun
bool isDryRun
Definition: face-system.hpp:100
ndn::net
Definition: link-type-helper.cpp:30
nfd::face::FaceSystem::GeneralConfig::wantCongestionMarking
bool wantCongestionMarking
Definition: face-system.hpp:91
ndn::net::NetworkInterface::getName
std::string getName() const
Returns the name of the interface, unique on the system.
Definition: network-interface.hpp:100
nfd::face::ProtocolFactory::getChannelsFromMap
static std::vector< shared_ptr< const Channel > > getChannelsFromMap(const ChannelMap &channelMap)
Definition: protocol-factory.hpp:171
nfd::udp::Endpoint
boost::asio::ip::udp::endpoint Endpoint
Definition: udp-protocol.hpp:34
nfd::face::UdpFactory::Error
Definition: udp-factory.hpp:41
nfd::face::Transport::MIN_MTU
static constexpr ssize_t MIN_MTU
minimum MTU that may be set on a transport
Definition: transport.hpp:347
nfd::face::UdpFactory::getId
static const std::string & getId() noexcept
Definition: udp-factory.cpp:44
nfd::face::FaceCreationFailedCallback
std::function< void(uint32_t status, const std::string &reason)> FaceCreationFailedCallback
Prototype for the callback that is invoked when a face fails to be created.
Definition: channel.hpp:78
nfd::face::UdpFactory::createChannel
shared_ptr< UdpChannel > createChannel(const udp::Endpoint &localEndpoint, time::nanoseconds idleTimeout)
Create UDP-based channel using udp::Endpoint.
Definition: udp-factory.cpp:292
NFD_LOG_INIT
#define NFD_LOG_INIT(name)
Definition: logger.hpp:31
nfd::face::FaceSystem::ConfigContext
context for processing a config section in ProtocolFactory
Definition: face-system.hpp:97