26 #ifndef NFD_DAEMON_FACE_ETHERNET_CHANNEL_HPP 27 #define NFD_DAEMON_FACE_ETHERNET_CHANNEL_HPP 47 class Error :
public std::runtime_error
52 :
std::runtime_error(what)
63 EthernetChannel(shared_ptr<const ndn::net::NetworkInterface> localEndpoint,
75 return m_channelFaces.size();
109 handleRead(
const boost::system::error_code& error,
114 processIncomingPacket(span<const uint8_t> packet,
119 std::pair<bool, shared_ptr<Face>>
127 shared_ptr<const ndn::net::NetworkInterface> m_localEndpoint;
129 boost::asio::posix::stream_descriptor m_socket;
131 std::map<ethernet::Address, shared_ptr<Face>> m_channelFaces;
143 #endif // NFD_DAEMON_FACE_ETHERNET_CHANNEL_HPP void connect(const ethernet::Address &remoteEndpoint, const FaceParams ¶ms, const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onConnectFailed)
Create a unicast Ethernet face toward remoteEndpoint.
Represents a channel that listens on a local endpoint.
Helper class for dealing with libpcap handles.
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.
Class implementing Ethernet-based channel to create faces.
EthernetChannel-related error.
Copyright (c) 2011-2015 Regents of the University of California.
bool isListening() const final
Returns whether the channel is listening.
void listen(const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onFaceCreationFailed)
Start listening.
Error(const std::string &what)
represents an Ethernet hardware address
EthernetChannel(shared_ptr< const ndn::net::NetworkInterface > localEndpoint, time::nanoseconds idleTimeout)
Create an Ethernet channel on the given localEndpoint (network interface)
size_t size() const final
Returns the number of faces in the channel.
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::chrono::nanoseconds nanoseconds
Parameters used to set Transport properties or LinkService options on a newly created face...