26 #ifndef NFD_DAEMON_FACE_ETHERNET_TRANSPORT_HPP
27 #define NFD_DAEMON_FACE_ETHERNET_TRANSPORT_HPP
33 #include <boost/asio/posix/stream_descriptor.hpp>
34 #include <ndn-cxx/net/network-interface.hpp>
44 class Error :
public std::runtime_error
47 using std::runtime_error::runtime_error;
56 receivePayload(span<const uint8_t> payload,
const ethernet::Address& sender);
60 const ethernet::Address& remoteEndpoint);
68 return m_hasRecentlyReceived;
74 m_hasRecentlyReceived =
false;
79 handleNetifStateChange(ndn::net::InterfaceState netifState);
82 doSend(
const Block& packet)
final;
88 sendPacket(
const ndn::Block& block);
94 handleRead(
const boost::system::error_code& error);
97 handleError(
const std::string& errorMessage);
107 signal::ScopedConnection m_netifStateChangedConn;
108 signal::ScopedConnection m_netifMtuChangedConn;
109 bool m_hasRecentlyReceived =
false;
112 size_t m_nDropped = 0;
Base class for Ethernet-based Transports.
bool hasRecentlyReceived() const
void receivePayload(span< const uint8_t > payload, const ethernet::Address &sender)
Processes the payload of an incoming frame.
void doClose() final
Performs Transport specific operations to close the transport.
std::string m_interfaceName
boost::asio::posix::stream_descriptor m_socket
ethernet::Address m_srcAddress
ethernet::Address m_destAddress
void resetRecentlyReceived()
EthernetTransport(const ndn::net::NetworkInterface &localEndpoint, const ethernet::Address &remoteEndpoint)
Helper class for dealing with libpcap handles.
The lower half of a Face.