37 BOOST_THROW_EXCEPTION(
Error(address.
toString() +
" is not a multicast address"));
39 auto face = findMulticastFace(interface.
name, address);
47 auto linkService = make_unique<face::GenericLinkService>(opts);
48 auto transport = make_unique<face::EthernetTransport>(interface, address);
49 face = make_shared<Face>(std::move(linkService), std::move(transport));
51 auto key = std::make_pair(interface.name, address);
52 m_multicastFaces[key] = face;
64 BOOST_THROW_EXCEPTION(
Error(
"EthernetFactory does not support 'createFace' operation"));
67 std::vector<shared_ptr<const Channel>>
74 EthernetFactory::findMulticastFace(
const std::string& interfaceName,
77 auto i = m_multicastFaces.find({interfaceName, address});
78 if (i != m_multicastFaces.end())
bool allowReassembly
enables reassembly
function< void(const std::string &reason)> FaceCreationFailedCallback
Prototype for the callback that is invoked when the face fails to be created.
represents an Ethernet hardware address
represents the underlying protocol and address used by a Face
void connectFaceClosedSignal(Face &face, const std::function< void()> &f)
invokes a callback when the face is closed
contains information about a network interface
virtual void createFace(const FaceUri &uri, ndn::nfd::FacePersistency persistency, const FaceCreatedCallback &onCreated, const FaceCreationFailedCallback &onConnectFailed) 1
Try to create Face using the supplied FaceUri.
virtual std::vector< shared_ptr< const Channel > > getChannels() const 1
Copyright (c) 2011-2015 Regents of the University of California.
shared_ptr< Face > createMulticastFace(const NetworkInterfaceInfo &interface, const ethernet::Address &address)
Create an EthernetFace to communicate with the given multicast group.
Options that control the behavior of GenericLinkService.
Exception of EthernetFactory.
function< void(const shared_ptr< Face > &newFace)> FaceCreatedCallback
Prototype for the callback that is invoked when the face is created (as a response to incoming connec...
bool isMulticast() const
True if this is a multicast address.
std::string toString(char sep=':') const
Converts the address to a human-readable string.
bool allowFragmentation
enables fragmentation