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 noexcept
 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 noexcept
 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 noexcept
 Returns the link type of the face (point-to-point, multi-access, ...). More...
 
FaceUri getLocalUri () const noexcept
 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 noexcept
 Returns the current persistency setting of the face. More...
 
FaceUri getRemoteUri () const noexcept
 Returns a FaceUri representing the remote endpoint. More...
 
ndn::nfd::FaceScope getScope () const noexcept
 Returns whether the face is local or non-local for scope control purposes. More...
 
FaceState getState () const noexcept
 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) noexcept
 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
 Called when a Data packet is received. More...
 
signal::Signal< LinkService, Interest, EndpointId > & afterReceiveInterest
 Called when an Interest packet is received. More...
 
signal::Signal< LinkService, lp::Nack, EndpointId > & afterReceiveNack
 Called when a Nack packet is received. More...
 
signal::Signal< Transport, FaceState, FaceState > & afterStateChange
 Called when the transport state changes. More...
 
signal::Signal< LinkService, Interest > & onDroppedInterest
 Called when an Interest is dropped by the reliability system for exceeding the allowed number of retransmissions. 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 117 of file face.hpp.

Constructor & Destructor Documentation

◆ Face()

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

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

◆ getChannel()

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

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

Definition at line 313 of file face.hpp.

◆ getCounters() [1/2]

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

Definition at line 298 of file face.hpp.

◆ getCounters() [2/2]

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

Definition at line 304 of file face.hpp.

◆ getExpirationTime()

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

Returns the expiration time of the face.

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

Definition at line 292 of file face.hpp.

◆ getId()

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

Returns the face ID.

Definition at line 195 of file face.hpp.

◆ getLinkService()

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

Definition at line 123 of file face.hpp.

◆ getLinkType()

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

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

Definition at line 259 of file face.hpp.

◆ getLocalUri()

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

Returns a FaceUri representing the local endpoint.

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

◆ getPersistency()

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

Returns the current persistency setting of the face.

Definition at line 241 of file face.hpp.

◆ getRemoteUri()

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

Returns a FaceUri representing the remote endpoint.

Definition at line 223 of file face.hpp.

◆ getScope()

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

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

Definition at line 232 of file face.hpp.

◆ getState()

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

Returns the face state.

Definition at line 279 of file face.hpp.

◆ getTransport()

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

Definition at line 129 of file face.hpp.

◆ sendData()

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

Send Data.

Definition at line 164 of file face.hpp.

◆ sendInterest()

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

Send Interest.

Definition at line 155 of file face.hpp.

◆ sendNack()

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

Send Nack.

Definition at line 173 of file face.hpp.

◆ setChannel()

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

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

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

◆ setPersistency()

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

Changes the face persistency setting.

Definition at line 250 of file face.hpp.

Member Data Documentation

◆ afterReceiveData

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

Called when a Data packet is received.

Definition at line 182 of file face.hpp.

◆ afterReceiveInterest

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

Called when an Interest packet is received.

Definition at line 179 of file face.hpp.

◆ afterReceiveNack

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

Called when a Nack packet is received.

Definition at line 185 of file face.hpp.

◆ afterStateChange

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

Called when the transport state changes.

Definition at line 285 of file face.hpp.

◆ onDroppedInterest

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

Called when an Interest is dropped by the reliability system for exceeding the allowed number of retransmissions.

Definition at line 188 of file face.hpp.