nfd::face::LinkService Class Referenceabstract

The upper half of a Face. More...

#include <daemon/face/link-service.hpp>

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

Public Types

using Counters = LinkServiceCounters
 Counters provided by LinkService. More...
 

Public Member Functions

virtual ~LinkService ()
 
virtual const CountersgetCounters () const
 
virtual ssize_t getEffectiveMtu () const
 
const FacegetFace () const noexcept
 Returns the Face to which this LinkService is attached. More...
 
const TransportgetTransport () const noexcept
 Returns the Transport to which this LinkService is attached. More...
 
TransportgetTransport () noexcept
 Returns the Transport to which this LinkService is attached. More...
 
void receivePacket (const Block &packet, const EndpointId &endpoint)
 Performs LinkService-specific operations to receive a lower-layer packet. More...
 
void sendData (const Data &data)
 Send Data. More...
 
void sendInterest (const Interest &interest)
 Send Interest. More...
 
void sendNack (const ndn::lp::Nack &nack)
 Send Nack. More...
 
void setFaceAndTransport (Face &face, Transport &transport) noexcept
 Set Face and Transport for this LinkService. More...
 

Public Attributes

signal::Signal< LinkService, Data, EndpointIdafterReceiveData
 Called when a Data packet is received. More...
 
signal::Signal< LinkService, Interest, EndpointIdafterReceiveInterest
 Called when an Interest packet is received. More...
 
signal::Signal< LinkService, lp::Nack, EndpointIdafterReceiveNack
 Called when a Nack packet is received. More...
 
signal::Signal< LinkService, Interest > onDroppedInterest
 Called when an Interest is dropped by the reliability system for exceeding the allowed number of retransmissions. More...
 

Protected Member Functions

void notifyDroppedInterest (const Interest &packet)
 
void receiveData (const Data &data, const EndpointId &endpoint)
 Delivers received Data to forwarding. More...
 
void receiveInterest (const Interest &interest, const EndpointId &endpoint)
 Delivers received Interest to forwarding. More...
 
void receiveNack (const lp::Nack &nack, const EndpointId &endpoint)
 Delivers received Nack to forwarding. More...
 
void sendPacket (const Block &packet)
 Send a lower-layer packet via Transport. More...
 

Protected Attributes

PacketCounter nInData
 Count of incoming Data packets. More...
 
PacketCounter nInInterests
 Count of incoming Interest packets. More...
 
PacketCounter nInNacks
 Count of incoming Nack packets. More...
 
PacketCounter nInterestsExceededRetx
 Count of Interests dropped by reliability system for exceeding allowed number of retx. More...
 
PacketCounter nOutData
 Count of outgoing Data packets. More...
 
PacketCounter nOutInterests
 Count of outgoing Interest packets. More...
 
PacketCounter nOutNacks
 Count of outgoing Nack packets. More...
 

Detailed Description

The upper half of a Face.

See also
Face, Transport

Definition at line 63 of file link-service.hpp.

Member Typedef Documentation

◆ Counters

Counters provided by LinkService.

Definition at line 69 of file link-service.hpp.

Constructor & Destructor Documentation

◆ ~LinkService()

nfd::face::LinkService::~LinkService ( )
virtualdefault

Member Function Documentation

◆ getCounters()

virtual const Counters& nfd::face::LinkService::getCounters ( ) const
inlinevirtual

Reimplemented in nfd::face::GenericLinkService.

Definition at line 110 of file link-service.hpp.

◆ getEffectiveMtu()

virtual ssize_t nfd::face::LinkService::getEffectiveMtu ( ) const
inlinevirtual

Reimplemented in nfd::face::GenericLinkService.

Definition at line 116 of file link-service.hpp.

◆ getFace()

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

Returns the Face to which this LinkService is attached.

Definition at line 86 of file link-service.hpp.

◆ getTransport() [1/2]

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

Returns the Transport to which this LinkService is attached.

Definition at line 95 of file link-service.hpp.

◆ getTransport() [2/2]

Transport* nfd::face::LinkService::getTransport ( )
inlinenoexcept

Returns the Transport to which this LinkService is attached.

Definition at line 104 of file link-service.hpp.

◆ notifyDroppedInterest()

void nfd::face::LinkService::notifyDroppedInterest ( const Interest &  packet)
protected

Definition at line 109 of file link-service.cpp.

◆ receiveData()

void nfd::face::LinkService::receiveData ( const Data &  data,
const EndpointId endpoint 
)
protected

Delivers received Data to forwarding.

Definition at line 89 of file link-service.cpp.

◆ receiveInterest()

void nfd::face::LinkService::receiveInterest ( const Interest &  interest,
const EndpointId endpoint 
)
protected

Delivers received Interest to forwarding.

Definition at line 79 of file link-service.cpp.

◆ receiveNack()

void nfd::face::LinkService::receiveNack ( const lp::Nack &  nack,
const EndpointId endpoint 
)
protected

Delivers received Nack to forwarding.

Definition at line 99 of file link-service.cpp.

◆ receivePacket()

void nfd::face::LinkService::receivePacket ( const Block &  packet,
const EndpointId endpoint 
)
inline

Performs LinkService-specific operations to receive a lower-layer packet.

Definition at line 169 of file link-service.hpp.

◆ sendData()

void nfd::face::LinkService::sendData ( const Data &  data)

Send Data.

Precondition
setFaceAndTransport() has been called.

Definition at line 57 of file link-service.cpp.

◆ sendInterest()

void nfd::face::LinkService::sendInterest ( const Interest &  interest)

Send Interest.

Precondition
setFaceAndTransport() has been called.

Definition at line 46 of file link-service.cpp.

◆ sendNack()

void nfd::face::LinkService::sendNack ( const ndn::lp::Nack &  nack)

Send Nack.

Precondition
setFaceAndTransport() has been called.

Definition at line 68 of file link-service.cpp.

◆ sendPacket()

void nfd::face::LinkService::sendPacket ( const Block &  packet)
inlineprotected

Send a lower-layer packet via Transport.

Definition at line 198 of file link-service.hpp.

◆ setFaceAndTransport()

void nfd::face::LinkService::setFaceAndTransport ( Face face,
Transport transport 
)
noexcept

Set Face and Transport for this LinkService.

Precondition
setFaceAndTransport() has not been called.

Definition at line 36 of file link-service.cpp.

Member Data Documentation

◆ afterReceiveData

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

Called when a Data packet is received.

Definition at line 151 of file link-service.hpp.

◆ afterReceiveInterest

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

Called when an Interest packet is received.

Definition at line 146 of file link-service.hpp.

◆ afterReceiveNack

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

Called when a Nack packet is received.

Definition at line 156 of file link-service.hpp.

◆ nInData

PacketCounter nfd::face::LinkServiceCounters::nInData
inherited

Count of incoming Data packets.

Definition at line 50 of file link-service.hpp.

◆ nInInterests

PacketCounter nfd::face::LinkServiceCounters::nInInterests
inherited

Count of incoming Interest packets.

Definition at line 44 of file link-service.hpp.

◆ nInNacks

PacketCounter nfd::face::LinkServiceCounters::nInNacks
inherited

Count of incoming Nack packets.

Definition at line 54 of file link-service.hpp.

◆ nInterestsExceededRetx

PacketCounter nfd::face::LinkServiceCounters::nInterestsExceededRetx
inherited

Count of Interests dropped by reliability system for exceeding allowed number of retx.

Definition at line 48 of file link-service.hpp.

◆ nOutData

PacketCounter nfd::face::LinkServiceCounters::nOutData
inherited

Count of outgoing Data packets.

Definition at line 52 of file link-service.hpp.

◆ nOutInterests

PacketCounter nfd::face::LinkServiceCounters::nOutInterests
inherited

Count of outgoing Interest packets.

Definition at line 46 of file link-service.hpp.

◆ nOutNacks

PacketCounter nfd::face::LinkServiceCounters::nOutNacks
inherited

Count of outgoing Nack packets.

Definition at line 56 of file link-service.hpp.

◆ onDroppedInterest

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

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

Definition at line 162 of file link-service.hpp.