26 #ifndef NFD_DAEMON_FACE_ETHERNET_FACTORY_HPP
27 #define NFD_DAEMON_FACE_ETHERNET_FACTORY_HPP
41 static const std::string&
57 shared_ptr<EthernetChannel>
58 createChannel(
const shared_ptr<const ndn::net::NetworkInterface>& localEndpoint,
59 time::nanoseconds idleTimeout);
74 const ethernet::Address& group);
86 std::vector<shared_ptr<const Channel>>
87 doGetChannels()
const final;
93 shared_ptr<EthernetChannel>
94 applyUnicastConfigToNetif(
const shared_ptr<const ndn::net::NetworkInterface>& netif);
101 applyMcastConfigToNetif(
const ndn::net::NetworkInterface& netif);
108 std::map<std::string, shared_ptr<EthernetChannel>> m_channels;
112 bool isEnabled =
false;
113 bool wantListen =
false;
114 time::nanoseconds idleTimeout = 10_min;
116 UnicastConfig m_unicastConfig;
118 struct MulticastConfig
120 bool isEnabled =
false;
121 ethernet::Address group = ethernet::getDefaultMulticastAddress();
122 ndn::nfd::LinkType linkType = ndn::nfd::LINK_TYPE_MULTI_ACCESS;
125 MulticastConfig m_mcastConfig;
128 std::map<std::pair<std::string, ethernet::Address>, shared_ptr<Face>> m_mcastFaces;
130 signal::ScopedConnection m_netifAddConn;
Protocol factory for Ethernet.
EthernetFactory(const CtorParams ¶ms)
static const std::string & getId() noexcept
shared_ptr< Face > createMulticastFace(const ndn::net::NetworkInterface &localEndpoint, const ethernet::Address &group)
Create a face to communicate on the given Ethernet multicast group.
shared_ptr< EthernetChannel > createChannel(const shared_ptr< const ndn::net::NetworkInterface > &localEndpoint, time::nanoseconds idleTimeout)
Create Ethernet-based channel on the specified network interface.
Context for processing a config section in ProtocolFactory.
Represents a predicate to accept or reject a ndn::net::NetworkInterface.
Provides support for an underlying protocol.
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.
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...
boost::optional< const ConfigSection & > OptionalConfigSection
An optional configuration file section.
Encapsulates a face creation request and all its parameters.
Parameters to ProtocolFactory constructor.