26 #ifndef NFD_DAEMON_FACE_ETHERNET_CHANNEL_HPP 27 #define NFD_DAEMON_FACE_ETHERNET_CHANNEL_HPP 32 #include <ndn-cxx/net/network-interface.hpp> 46 class Error :
public std::runtime_error
51 :
std::runtime_error(what)
62 EthernetChannel(shared_ptr<const ndn::net::NetworkInterface> localEndpoint,
63 time::nanoseconds idleTimeout);
74 return m_channelFaces.size();
108 handleRead(
const boost::system::error_code& error,
113 processIncomingPacket(
const uint8_t* packet,
size_t length,
118 std::pair<bool, shared_ptr<Face>>
126 shared_ptr<const ndn::net::NetworkInterface> m_localEndpoint;
128 boost::asio::posix::stream_descriptor m_socket;
130 std::map<ethernet::Address, shared_ptr<Face>> m_channelFaces;
131 const time::nanoseconds m_idleFaceTimeout;
142 #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.
represent a channel that communicates on a local endpoint
Helper class for dealing with libpcap handles.
bool isListening() const override
Returns whether the channel is listening.
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 > &face)> FaceCreatedCallback
Prototype for the callback that is invoked when a face is created (in response to an incoming connect...
Class implementing Ethernet-based channel to create faces.
Parameters used to set Transport properties or LinkService options on a newly created face...
EthernetChannel-related error.
Copyright (c) 2011-2015 Regents of the University of California.
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 override
Returns the number of faces in the channel.