26 #ifndef NFD_DAEMON_FACE_TRANSPORT_HPP
27 #define NFD_DAEMON_FACE_TRANSPORT_HPP
31 #include <ndn-cxx/encoding/nfd-constants.hpp>
174 virtual const Counters&
221 ndn::nfd::FacePersistency
270 time::steady_clock::TimePoint
281 setScope(ndn::nfd::FaceScope scope);
338 doSend(
Packet&& packet) = 0;
345 ndn::nfd::FaceScope m_scope;
346 ndn::nfd::FacePersistency m_persistency;
347 ndn::nfd::LinkType m_linkType;
349 TransportState m_state;
350 time::steady_clock::TimePoint m_expirationTime;
401 inline ndn::nfd::FaceScope
413 inline ndn::nfd::FacePersistency
416 return m_persistency;
419 inline ndn::nfd::LinkType
428 m_linkType = linkType;
440 BOOST_ASSERT(mtu == MTU_UNLIMITED || mtu > 0);
450 inline time::steady_clock::TimePoint
453 return m_expirationTime;
459 m_expirationTime = expirationTime;
463 operator<<(std::ostream& os, const FaceLogHelper<Transport>& flh);
466 typename std::enable_if<std::is_base_of<Transport, T>::value &&
467 !std::is_same<Transport, T>::value, std::ostream&>::type
468 operator<<(std::ostream& os, const FaceLogHelper<T>& flh)
470 return os << FaceLogHelper<Transport>(flh.obj);
476 #endif // NFD_DAEMON_FACE_TRANSPORT_HPP
virtual void doClose()=0
performs Transport specific operations to close the transport
void setLocalUri(const FaceUri &uri)
void setScope(ndn::nfd::FaceScope scope)
represents a counter of number of bytes
const ssize_t MTU_UNLIMITED
indicates the transport has no limit on payload size
TransportState
indicates the state of a transport
const ssize_t MTU_INVALID
(for internal use) indicates MTU field is unset
Block packet
the packet as a TLV block
std::ostream & operator<<(std::ostream &os, const FaceLogHelper< Face > &flh)
ndn::nfd::LinkType getLinkType() const
signal::Signal< Transport, TransportState, TransportState > afterStateChange
signals when transport state changes
FaceUri getRemoteUri() const
void receive(Packet &&packet)
receive a link-layer packet
stores a packet along with the remote endpoint
ByteCounter nInBytes
total incoming bytes
represents a counter of number of packets
TransportCounters Counters
counters provided by Transport
the transport is being closed due to a failure
virtual bool canChangePersistencyToImpl(ndn::nfd::FacePersistency newPersistency) const
invoked by canChangePersistencyTo to perform the check
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
the transport is closed, and can be safely deallocated
virtual void afterChangePersistency(ndn::nfd::FacePersistency oldPersistency)
invoked after the persistency has been changed
PacketCounter nInPackets
count of incoming packets
uint64_t EndpointId
identifies an endpoint on the link
const Face * getFace() const
generalization of a network interface
void setLinkType(ndn::nfd::LinkType linkType)
ndn::nfd::FaceScope getScope() const
the transport is requested to be closed
PacketCounter nOutPackets
count of outgoing packets
void send(Packet &&packet)
send a link-layer packet
void setPersistency(ndn::nfd::FacePersistency newPersistency)
changes face persistency setting
void close()
request the transport to be closed
ndn::nfd::FacePersistency getPersistency() const
counters provided by Transport
const LinkService * getLinkService() const
TransportState getState() const
EndpointId remoteEndpoint
identifies the remote endpoint
FaceUri getLocalUri() const
void setState(TransportState newState)
set transport state
void setRemoteUri(const FaceUri &uri)
time::steady_clock::TimePoint getExpirationTime() const
ByteCounter nOutBytes
total outgoing bytes
bool canChangePersistencyTo(ndn::nfd::FacePersistency newPersistency) const
check whether the face persistency can be changed to newPersistency
void setExpirationTime(const time::steady_clock::TimePoint &expirationTime)
void setFaceAndLinkService(Face &face, LinkService &service)
set Face and LinkService for Transport
virtual const Counters & getCounters() const
the transport is down temporarily, and is being recovered