Class implementing Ethernet-based channel to create faces. More...
#include <ethernet-channel.hpp>
Classes | |
class | Error |
EthernetChannel-related error. More... | |
Public Member Functions | |
EthernetChannel (shared_ptr< const ndn::net::NetworkInterface > localEndpoint, time::nanoseconds idleTimeout) | |
Create an Ethernet channel on the given localEndpoint (network interface) More... | |
bool | isListening () const final |
Returns whether the channel is listening. More... | |
size_t | size () const final |
Returns the number of faces in the channel. More... | |
void | connect (const ethernet::Address &remoteEndpoint, const FaceParams ¶ms, const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onConnectFailed) |
Create a unicast Ethernet face toward remoteEndpoint . More... | |
void | listen (const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onFaceCreationFailed) |
Start listening. More... | |
Public Member Functions inherited from nfd::face::Channel | |
virtual | ~Channel () |
const FaceUri & | getUri () const |
size_t | getDefaultMtu () const |
Returns the default MTU for all faces created by this channel. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from nfd::face::Channel | |
void | setUri (const FaceUri &uri) |
void | setDefaultMtu (size_t mtu) |
Class implementing Ethernet-based channel to create faces.
Definition at line 41 of file ethernet-channel.hpp.
nfd::face::EthernetChannel::EthernetChannel | ( | shared_ptr< const ndn::net::NetworkInterface > | localEndpoint, |
time::nanoseconds | idleTimeout | ||
) |
Create an Ethernet channel on the given localEndpoint
(network interface)
To enable creation of faces upon incoming connections, one needs to explicitly call EthernetChannel::listen method.
Definition at line 41 of file ethernet-channel.cpp.
References ndn::FaceUri::fromDev(), NFD_LOG_CHAN_INFO, and nfd::face::Channel::setUri().
Referenced by nfd::face::EthernetChannel::Error::Error().
|
inlinefinalvirtual |
Returns whether the channel is listening.
Implements nfd::face::Channel.
Definition at line 67 of file ethernet-channel.hpp.
Referenced by listen().
|
inlinefinalvirtual |
Returns the number of faces in the channel.
Implements nfd::face::Channel.
Definition at line 73 of file ethernet-channel.hpp.
void nfd::face::EthernetChannel::connect | ( | const ethernet::Address & | remoteEndpoint, |
const FaceParams & | params, | ||
const FaceCreatedCallback & | onFaceCreated, | ||
const FaceCreationFailedCallback & | onConnectFailed | ||
) |
Create a unicast Ethernet face toward remoteEndpoint
.
Definition at line 57 of file ethernet-channel.cpp.
References NFD_LOG_CHAN_DEBUG.
Referenced by size().
void nfd::face::EthernetChannel::listen | ( | const FaceCreatedCallback & | onFaceCreated, |
const FaceCreationFailedCallback & | onFaceCreationFailed | ||
) |
Start listening.
Enable listening on the local endpoint, waiting for incoming frames, and creating a face when a frame is received from a new remote host.
Faces created in this way will have on-demand persistency.
onFaceCreated | Callback to notify successful creation of a face |
onFaceCreationFailed | Callback to notify errors |
Error |
Definition at line 79 of file ethernet-channel.cpp.
References nfd::face::PcapHelper::activate(), nfd::ethernet::checkFrameHeader(), nfd::face::connectFaceClosedSignal(), ndn::ethernet::ETHERTYPE_NDN, ndn::nfd::FACE_PERSISTENCY_ON_DEMAND, nfd::face::PcapHelper::getFd(), nfd::face::PcapHelper::getNDropped(), ndn::ethernet::HDR_LEN, isListening(), nonstd::optional_lite::std11::move(), nfd::face::FaceParams::mtu, NDN_THROW_NESTED, NFD_LOG_CHAN_DEBUG, NFD_LOG_CHAN_TRACE, NFD_LOG_CHAN_WARN, websocketpp::transport::error::operation_aborted, nfd::face::FaceParams::persistency, nfd::face::PcapHelper::readNextPacket(), nfd::face::EthernetTransport::receivePayload(), nfd::face::PcapHelper::setPacketFilter(), ndn::to_string(), and nfd::face::FaceParams::wantLpReliability.
Referenced by size().