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;
61 bool wantLocalFieldsEnabled,
65 onFailure(406,
"Unsupported protocol");
68 std::vector<shared_ptr<const Channel>>
75 EthernetFactory::findMulticastFace(
const std::string& interfaceName,
78 auto i = m_multicastFaces.find({interfaceName, address});
79 if (i != m_multicastFaces.end())
bool allowReassembly
enables reassembly
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 std::vector< shared_ptr< const Channel > > getChannels() const override
Copyright (c) 2011-2015 Regents of the University of California.
virtual void createFace(const FaceUri &uri, ndn::nfd::FacePersistency persistency, bool wantLocalFieldsEnabled, const FaceCreatedCallback &onCreated, const FaceCreationFailedCallback &onFailure) override
Try to create Face using the supplied FaceUri.
shared_ptr< Face > createMulticastFace(const NetworkInterfaceInfo &interface, const ethernet::Address &address)
Create an EthernetFace to communicate with the given multicast group.
function< void(uint32_t status, const std::string &reason)> FaceCreationFailedCallback
Prototype for the callback that is invoked when the face fails to be created.
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