26 #ifndef NFD_DAEMON_FACE_FACE_HPP
27 #define NFD_DAEMON_FACE_FACE_HPP
63 std::enable_if_t<std::is_base_of_v<LinkService::Counters, T>,
const T&>
66 return dynamic_cast<const T&
>(m_linkServiceCounters);
75 std::enable_if_t<std::is_base_of_v<Transport::Counters, T>,
const T&>
78 return dynamic_cast<const T&
>(m_transportCounters);
120 Face(unique_ptr<LinkService> service, unique_ptr<Transport> transport);
125 return m_service.get();
131 return m_transport.get();
147 m_transport->close();
157 m_service->sendInterest(interest);
166 m_service->sendData(data);
175 m_service->sendNack(nack);
216 return m_transport->getLocalUri();
225 return m_transport->getRemoteUri();
234 return m_transport->getScope();
240 ndn::nfd::FacePersistency
243 return m_transport->getPersistency();
252 return m_transport->setPersistency(persistency);
261 return m_transport->getLinkType();
272 return m_service->getEffectiveMtu();
281 return m_transport->getState();
291 time::steady_clock::time_point
294 return m_transport->getExpirationTime();
324 m_channel = std::move(channel);
329 unique_ptr<LinkService> m_service;
330 unique_ptr<Transport> m_transport;
332 weak_ptr<Channel> m_channel;
336 operator<<(std::ostream& os,
const FaceLogHelper<Face>& flh);
Represents a counter of number of bytes.
Represents a counter of number of packets.
Gives access to the counters provided by Face.
PacketCounter nInHopLimitZero
Count of incoming Interests dropped due to HopLimit == 0.
const PacketCounter & nInPackets
Count of incoming packets.
PacketCounter nOutHopLimitZero
Count of outgoing Interests dropped due to HopLimit == 0 on non-local faces.
const ByteCounter & nInBytes
Total bytes received.
const PacketCounter & nOutPackets
Count of outgoing packets.
std::enable_if_t< std::is_base_of_v< LinkService::Counters, T >, const T & > get() const
Returns the counters provided by (a subclass of) LinkService.
FaceCounters(const LinkService::Counters &linkServiceCounters, const Transport::Counters &transportCounters)
const PacketCounter & nInInterests
Count of incoming Interest packets.
std::enable_if_t< std::is_base_of_v< Transport::Counters, T >, const T & > get() const
Returns the counters provided by (a subclass of) Transport.
const PacketCounter & nInNacks
Count of incoming Nack packets.
const PacketCounter & nInData
Count of incoming Data packets.
const PacketCounter & nOutNacks
Count of outgoing Nack packets.
const ByteCounter & nOutBytes
Total bytes sent.
const PacketCounter & nInterestsExceededRetx
Count of Interests dropped by reliability system for exceeding allowed number of retx.
const PacketCounter & nOutInterests
Count of outgoing Interest packets.
const PacketCounter & nOutData
Count of outgoing Data packets.
Generalization of a network interface.
FaceState getState() const noexcept
Returns the face state.
Face(unique_ptr< LinkService > service, unique_ptr< Transport > transport)
signal::Signal< LinkService, Data, EndpointId > & afterReceiveData
Called when a Data packet is received.
ndn::nfd::FaceScope getScope() const noexcept
Returns whether the face is local or non-local for scope control purposes.
FaceCounters & getCounters() noexcept
void setPersistency(ndn::nfd::FacePersistency persistency)
Changes the face persistency setting.
signal::Signal< LinkService, Interest > & onDroppedInterest
Called when an Interest is dropped by the reliability system for exceeding the allowed number of retr...
void sendInterest(const Interest &interest)
Send Interest.
void setChannel(weak_ptr< Channel > channel) noexcept
Set channel on which face was created (unicast) or the associated channel (multicast).
signal::Signal< Transport, FaceState, FaceState > & afterStateChange
Called when the transport state changes.
signal::Signal< LinkService, lp::Nack, EndpointId > & afterReceiveNack
Called when a Nack packet is received.
FaceUri getLocalUri() const noexcept
Returns a FaceUri representing the local endpoint.
ndn::nfd::LinkType getLinkType() const noexcept
Returns the link type of the face (point-to-point, multi-access, ...).
FaceUri getRemoteUri() const noexcept
Returns a FaceUri representing the remote endpoint.
void setId(FaceId id) noexcept
Sets the face ID.
ssize_t getMtu() const
Returns the effective MTU of the face.
LinkService * getLinkService() const noexcept
FaceId getId() const noexcept
Returns the face ID.
void sendNack(const lp::Nack &nack)
Send Nack.
signal::Signal< LinkService, Interest, EndpointId > & afterReceiveInterest
Called when an Interest packet is received.
void close()
Request that the face be closed.
const FaceCounters & getCounters() const noexcept
void sendData(const Data &data)
Send Data.
weak_ptr< Channel > getChannel() const noexcept
Get channel on which face was created (unicast) or the associated channel (multicast).
ndn::nfd::FacePersistency getPersistency() const noexcept
Returns the current persistency setting of the face.
time::steady_clock::time_point getExpirationTime() const noexcept
Returns the expiration time of the face.
Transport * getTransport() const noexcept
Counters provided by LinkService.
The upper half of a Face.
Counters provided by a transport.
The lower half of a Face.
#define NFD_FINAL_UNLESS_WITH_TESTS
std::ostream & operator<<(std::ostream &os, const FaceLogHelper< Face > &flh)
TransportState
Indicates the state of a transport.
constexpr FaceId INVALID_FACEID
Indicates an invalid FaceId.
uint64_t FaceId
Identifies a face.