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
 
time::steady_clock::TimePoint getExpirationTime () const
 
FaceId getId () const
 
LinkServicegetLinkService () const
 
ndn::nfd::LinkType getLinkType () const
 
FaceUri getLocalUri () const
 
ssize_t getMtu () const
 Returns face effective MTU. More...
 
ndn::nfd::FacePersistency getPersistency () const
 
FaceUri getRemoteUri () const
 
ndn::nfd::FaceScope getScope () const
 
FaceState getState () const
 
TransportgetTransport () const
 
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)
 sets face ID More...
 
void setPersistency (ndn::nfd::FacePersistency persistency)
 changes 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 54 of file face.hpp.

Constructor & Destructor Documentation

◆ Face()

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

Definition at line 31 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 215 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 180 of file face.hpp.

◆ getCounters()

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

Definition at line 305 of file face.hpp.

◆ getExpirationTime()

time::steady_clock::TimePoint nfd::face::Face::getExpirationTime ( ) const
inline
Returns
expiration time of the face
Return values
time::steady_clock::TimePoint::max()the face has an indefinite lifetime

Definition at line 299 of file face.hpp.

◆ getId()

FaceId nfd::face::Face::getId ( ) const
inline
Returns
face ID

Definition at line 239 of file face.hpp.

◆ getLinkService()

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

Definition at line 203 of file face.hpp.

◆ getLinkType()

ndn::nfd::LinkType nfd::face::Face::getLinkType ( ) const
inline
Returns
whether face is point-to-point or multi-access

Definition at line 281 of file face.hpp.

◆ getLocalUri()

FaceUri nfd::face::Face::getLocalUri ( ) const
inline
Returns
a FaceUri representing local endpoint

Definition at line 251 of file face.hpp.

◆ getMtu()

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

Returns face effective MTU.

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

Definition at line 287 of file face.hpp.

◆ getPersistency()

ndn::nfd::FacePersistency nfd::face::Face::getPersistency ( ) const
inline
Returns
face persistency setting

Definition at line 269 of file face.hpp.

◆ getRemoteUri()

FaceUri nfd::face::Face::getRemoteUri ( ) const
inline
Returns
a FaceUri representing remote endpoint

Definition at line 257 of file face.hpp.

◆ getScope()

ndn::nfd::FaceScope nfd::face::Face::getScope ( ) const
inline
Returns
whether face is local or non-local for scope control purpose

Definition at line 263 of file face.hpp.

◆ getState()

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

Definition at line 293 of file face.hpp.

◆ getTransport()

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

Definition at line 209 of file face.hpp.

◆ sendData()

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

send Data

Definition at line 227 of file face.hpp.

◆ sendInterest()

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

send Interest

Definition at line 221 of file face.hpp.

◆ sendNack()

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

send Nack

Definition at line 233 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 189 of file face.hpp.

◆ setId()

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

sets face ID

Note
Normally, this should only be invoked by FaceTable.

Definition at line 245 of file face.hpp.

◆ setPersistency()

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

changes face persistency setting

Definition at line 275 of file face.hpp.

Member Data Documentation

◆ afterReceiveData

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

signals on Data received

Definition at line 99 of file face.hpp.

◆ afterReceiveInterest

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

signals on Interest received

Definition at line 95 of file face.hpp.

◆ afterReceiveNack

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

signals on Nack received

Definition at line 103 of file face.hpp.

◆ afterStateChange

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

signals after face state changed

Definition at line 165 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 107 of file face.hpp.