34 const ethernet::Address& address)
36 if (!address.isMulticast())
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;
60 ndn::nfd::FacePersistency persistency,
61 bool wantLocalFieldsEnabled,
65 onFailure(406,
"Unsupported protocol");
68 std::vector<shared_ptr<const Channel>>
75 EthernetFactory::findMulticastFace(
const std::string& interfaceName,
76 const ethernet::Address& address)
const
78 auto i = m_multicastFaces.find({interfaceName, address});
79 if (i != m_multicastFaces.end())
contains information about a network interface
bool allowFragmentation
enables fragmentation
virtual std::vector< shared_ptr< const Channel > > getChannels() const override
void connectFaceClosedSignal(Face &face, const std::function< void()> &f)
invokes a callback when the face is closed
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
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.
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...
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.
bool allowReassembly
enables reassembly
Exception of EthernetFactory.