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();
87 connect(
const ethernet::Address& remoteEndpoint,
88 ndn::nfd::FacePersistency persistency,
89 bool wantLpReliability,
115 handleRead(
const boost::system::error_code& error,
120 processIncomingPacket(
const uint8_t* packet,
size_t length,
121 const ethernet::Address& sender,
125 std::pair<bool, shared_ptr<Face>>
126 createFace(
const ethernet::Address& remoteEndpoint,
127 ndn::nfd::FacePersistency persistency,
128 bool wantLpReliability);
134 shared_ptr<const ndn::net::NetworkInterface> m_localEndpoint;
136 boost::asio::posix::stream_descriptor m_socket;
138 std::map<ethernet::Address, shared_ptr<Face>> m_channelFaces;
139 const time::nanoseconds m_idleFaceTimeout;
150 #endif // NFD_DAEMON_FACE_ETHERNET_CHANNEL_HPP void connect(const ethernet::Address &remoteEndpoint, ndn::nfd::FacePersistency persistency, bool wantLpReliability, const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onConnectFailed)
Create a unicast Ethernet face toward remoteEndpoint.
void listen(const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onFaceCreationFailed)
Start listening.
size_t size() const override
Returns the number of faces in the channel.
EthernetChannel-related error.
Class implementing Ethernet-based channel to create faces.
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
EthernetChannel(shared_ptr< const ndn::net::NetworkInterface > localEndpoint, time::nanoseconds idleTimeout)
Create an Ethernet channel on the given localEndpoint (network interface)
Error(const std::string &what)
function< void(uint32_t status, const std::string &reason)> FaceCreationFailedCallback
Prototype for the callback that is invoked when a face fails to be created.
represent a channel that communicates on a local endpoint
bool isListening() const override
Returns whether the channel is listening.
Helper class for dealing with libpcap handles.
function< void(const shared_ptr< Face > &newFace)> FaceCreatedCallback
Prototype for the callback that is invoked when a face is created (in response to an incoming connect...