nfd::face::Face Class Referencefinal

Generalization of a network interface. More...

#include <daemon/face/face.hpp>

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

Public Member Functions

 Face (unique_ptr< LinkService > service, unique_ptr< Transport > transport)
 
void close ()
 Request that the face be closed. More...
 
weak_ptr< ChannelgetChannel () const
 Get channel on which face was created (unicast) or the associated channel (multicast). More...
 
const FaceCountersgetCounters () const noexcept
 
FaceCountersgetCounters () noexcept
 
time::steady_clock::time_point getExpirationTime () const
 Returns the expiration time of the face. More...
 
FaceId getId () const noexcept
 Returns the face ID. More...
 
LinkServicegetLinkService () const noexcept
 
ndn::nfd::LinkType getLinkType () const
 Returns the link type of the face (point-to-point, multi-access, ...). More...
 
FaceUri getLocalUri () const
 Returns a FaceUri representing the local endpoint. More...
 
ssize_t getMtu () const
 Returns the effective MTU of the face. More...
 
ndn::nfd::FacePersistency getPersistency () const
 Returns the current persistency setting of the face. More...
 
FaceUri getRemoteUri () const
 Returns a FaceUri representing the remote endpoint. More...
 
ndn::nfd::FaceScope getScope () const
 Returns whether the face is local or non-local for scope control purposes. More...
 
FaceState getState () const
 Returns the face state. More...
 
TransportgetTransport () const noexcept
 
void sendData (const Data &data)
 Send Data. More...
 
void sendInterest (const Interest &interest)
 Send Interest. More...
 
void sendNack (const lp::Nack &nack)
 Send Nack. More...
 
void setChannel (weak_ptr< Channel > channel)
 Set channel on which face was created (unicast) or the associated channel (multicast). More...
 
void setId (FaceId id) noexcept
 Sets the face ID. More...
 
void setPersistency (ndn::nfd::FacePersistency persistency)
 Changes the face persistency setting. More...
 

Public Attributes

signal::Signal< LinkService, Data, EndpointId > & afterReceiveData
 Signals on Data received. More...
 
signal::Signal< LinkService, Interest, EndpointId > & afterReceiveInterest
 Signals on Interest received. More...
 
signal::Signal< LinkService, lp::Nack, EndpointId > & afterReceiveNack
 Signals on Nack received. More...
 
signal::Signal< Transport, FaceState, FaceState > & afterStateChange
 Signals after face state changed. More...
 
signal::Signal< LinkService, Interest > & onDroppedInterest
 Signals on Interest dropped by reliability system for exceeding allowed number of retx. More...
 

Detailed Description

Generalization of a network interface.

A face generalizes a network interface. It provides best-effort network-layer packet delivery services on a physical interface, an overlay tunnel, or a link to a local application.

A face combines two parts: LinkService and Transport. Transport is the lower part, which provides best-effort TLV block deliveries. LinkService is the upper part, which translates between network-layer packets and TLV blocks, and may provide additional services such as fragmentation and reassembly.

Definition at line 55 of file face.hpp.

Constructor & Destructor Documentation

◆ Face()

nfd::face::Face::Face ( unique_ptr< LinkService service,
unique_ptr< Transport transport 
)

Definition at line 30 of file face.cpp.

Member Function Documentation

◆ close()

void nfd::face::Face::close ( )
inline

Request that the face be closed.

This operation is effective only if face is in the UP or DOWN state; otherwise, it has no effect. The face will change state to CLOSING, and then perform a cleanup procedure. When the cleanup is complete, the state will be changed to CLOSED, which may happen synchronously or asynchronously.

Warning
The face must not be deallocated until its state changes to CLOSED.

Definition at line 237 of file face.hpp.

◆ getChannel()

weak_ptr<Channel> nfd::face::Face::getChannel ( ) const
inline

Get channel on which face was created (unicast) or the associated channel (multicast).

Definition at line 214 of file face.hpp.

◆ getCounters() [1/2]

const FaceCounters& nfd::face::Face::getCounters ( ) const
inlinenoexcept

Definition at line 199 of file face.hpp.

◆ getCounters() [2/2]

FaceCounters& nfd::face::Face::getCounters ( )
inlinenoexcept

Definition at line 205 of file face.hpp.

◆ getExpirationTime()

time::steady_clock::time_point nfd::face::Face::getExpirationTime ( ) const
inline

Returns the expiration time of the face.

Return values
time::steady_clock::time_point::max()The face has an indefinite lifetime.

Definition at line 309 of file face.hpp.

◆ getId()

FaceId nfd::face::Face::getId ( ) const
inlinenoexcept

Returns the face ID.

Definition at line 121 of file face.hpp.

◆ getLinkService()

LinkService* nfd::face::Face::getLinkService ( ) const
inlinenoexcept

Definition at line 61 of file face.hpp.

◆ getLinkType()

ndn::nfd::LinkType nfd::face::Face::getLinkType ( ) const
inline

Returns the link type of the face (point-to-point, multi-access, ...).

Definition at line 291 of file face.hpp.

◆ getLocalUri()

FaceUri nfd::face::Face::getLocalUri ( ) const
inline

Returns a FaceUri representing the local endpoint.

Definition at line 261 of file face.hpp.

◆ getMtu()

ssize_t nfd::face::Face::getMtu ( ) const
inline

Returns the effective MTU of the face.

This function is a wrapper. The effective MTU of a face is determined by the link service.

Definition at line 297 of file face.hpp.

◆ getPersistency()

ndn::nfd::FacePersistency nfd::face::Face::getPersistency ( ) const
inline

Returns the current persistency setting of the face.

Definition at line 279 of file face.hpp.

◆ getRemoteUri()

FaceUri nfd::face::Face::getRemoteUri ( ) const
inline

Returns a FaceUri representing the remote endpoint.

Definition at line 267 of file face.hpp.

◆ getScope()

ndn::nfd::FaceScope nfd::face::Face::getScope ( ) const
inline

Returns whether the face is local or non-local for scope control purposes.

Definition at line 273 of file face.hpp.

◆ getState()

FaceState nfd::face::Face::getState ( ) const
inline

Returns the face state.

Definition at line 303 of file face.hpp.

◆ getTransport()

Transport* nfd::face::Face::getTransport ( ) const
inlinenoexcept

Definition at line 67 of file face.hpp.

◆ sendData()

void nfd::face::Face::sendData ( const Data &  data)
inline

Send Data.

Definition at line 249 of file face.hpp.

◆ sendInterest()

void nfd::face::Face::sendInterest ( const Interest &  interest)
inline

Send Interest.

Definition at line 243 of file face.hpp.

◆ sendNack()

void nfd::face::Face::sendNack ( const lp::Nack &  nack)
inline

Send Nack.

Definition at line 255 of file face.hpp.

◆ setChannel()

void nfd::face::Face::setChannel ( weak_ptr< Channel channel)
inline

Set channel on which face was created (unicast) or the associated channel (multicast).

Definition at line 223 of file face.hpp.

◆ setId()

void nfd::face::Face::setId ( FaceId  id)
inlinenoexcept

Sets the face ID.

Note
Normally, this should only be invoked by FaceTable.

Definition at line 131 of file face.hpp.

◆ setPersistency()

void nfd::face::Face::setPersistency ( ndn::nfd::FacePersistency  persistency)
inline

Changes the face persistency setting.

Definition at line 285 of file face.hpp.

Member Data Documentation

◆ afterReceiveData

signal::Signal<LinkService, Data, EndpointId>& nfd::face::Face::afterReceiveData

Signals on Data received.

Definition at line 106 of file face.hpp.

◆ afterReceiveInterest

signal::Signal<LinkService, Interest, EndpointId>& nfd::face::Face::afterReceiveInterest

Signals on Interest received.

Definition at line 102 of file face.hpp.

◆ afterReceiveNack

signal::Signal<LinkService, lp::Nack, EndpointId>& nfd::face::Face::afterReceiveNack

Signals on Nack received.

Definition at line 110 of file face.hpp.

◆ afterStateChange

signal::Signal<Transport, FaceState, FaceState>& nfd::face::Face::afterStateChange

Signals after face state changed.

Definition at line 189 of file face.hpp.

◆ onDroppedInterest

signal::Signal<LinkService, Interest>& nfd::face::Face::onDroppedInterest

Signals on Interest dropped by reliability system for exceeding allowed number of retx.

Definition at line 114 of file face.hpp.