nfd::face::EthernetChannel Class Referencefinal

Class implementing Ethernet-based channel to create faces. More...

#include <daemon/face/ethernet-channel.hpp>

+ Inheritance diagram for nfd::face::EthernetChannel:
+ Collaboration diagram for nfd::face::EthernetChannel:

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...
 
void connect (const ethernet::Address &remoteEndpoint, const FaceParams &params, const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onConnectFailed)
 Create a unicast Ethernet face toward remoteEndpoint. More...
 
size_t getDefaultMtu () const
 Returns the default MTU for all faces created by this channel. More...
 
const FaceUri & getUri () const
 
bool isListening () const final
 Returns whether the channel is listening. More...
 
void listen (const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onFaceCreationFailed)
 Start listening. More...
 
size_t size () const final
 Returns the number of faces in the channel. More...
 

Protected Member Functions

void setDefaultMtu (size_t mtu)
 
void setUri (const FaceUri &uri)
 

Detailed Description

Class implementing Ethernet-based channel to create faces.

Definition at line 41 of file ethernet-channel.hpp.

Constructor & Destructor Documentation

◆ EthernetChannel()

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.

Member Function Documentation

◆ connect()

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.

◆ getDefaultMtu()

size_t nfd::face::Channel::getDefaultMtu ( ) const
inlineinherited

Returns the default MTU for all faces created by this channel.

Definition at line 56 of file channel.hpp.

◆ getUri()

const FaceUri& nfd::face::Channel::getUri ( ) const
inlineinherited

Definition at line 48 of file channel.hpp.

◆ isListening()

bool nfd::face::EthernetChannel::isListening ( ) const
inlinefinalvirtual

Returns whether the channel is listening.

Implements nfd::face::Channel.

Definition at line 67 of file ethernet-channel.hpp.

◆ listen()

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.

Parameters
onFaceCreatedCallback to notify successful creation of a face
onFaceCreationFailedCallback to notify errors
Exceptions
Error

Definition at line 79 of file ethernet-channel.cpp.

◆ setDefaultMtu()

void nfd::face::Channel::setDefaultMtu ( size_t  mtu)
protectedinherited

Definition at line 41 of file channel.cpp.

◆ setUri()

void nfd::face::Channel::setUri ( const FaceUri &  uri)
protectedinherited

Definition at line 35 of file channel.cpp.

◆ size()

size_t nfd::face::EthernetChannel::size ( ) const
inlinefinalvirtual

Returns the number of faces in the channel.

Implements nfd::face::Channel.

Definition at line 73 of file ethernet-channel.hpp.