26 #ifndef NFD_DAEMON_FACE_TRANSPORT_HPP 27 #define NFD_DAEMON_FACE_TRANSPORT_HPP 32 #include <ndn-cxx/encoding/nfd-constants.hpp> 364 doSend(
Packet&& packet) = 0;
375 size_t m_sendQueueCapacity;
443 return m_persistency;
455 m_linkType = linkType;
474 return m_sendQueueCapacity;
480 m_sendQueueCapacity = sendQueueCapacity;
492 return m_expirationTime;
498 m_expirationTime = expirationTime;
502 operator<<(std::ostream& os, const FaceLogHelper<Transport>& flh);
505 typename std::enable_if<std::is_base_of<Transport, T>::value &&
506 !std::is_same<Transport, T>::value, std::ostream&>::type
507 operator<<(std::ostream& os, const FaceLogHelper<T>& flh)
509 return os << FaceLogHelper<Transport>(flh.obj);
515 #endif // NFD_DAEMON_FACE_TRANSPORT_HPP virtual void afterChangePersistency(ndn::nfd::FacePersistency oldPersistency)
invoked after the persistency has been changed
const ssize_t QUEUE_UNSUPPORTED
indicates that the transport does not support reading the queue capacity/length
void setPersistency(ndn::nfd::FacePersistency newPersistency)
changes face persistency setting
void setFaceAndLinkService(Face &face, LinkService &service)
set Face and LinkService for Transport
void setExpirationTime(const time::steady_clock::TimePoint &expirationTime)
TransportCounters Counters
counters provided by Transport
generalization of a network interface
std::ostream & operator<<(std::ostream &os, const Face &face)
time::steady_clock::TimePoint getExpirationTime() const
const ssize_t MTU_UNLIMITED
indicates the transport has no limit on payload size
TransportState
indicates the state of a transport
void setRemoteUri(const FaceUri &uri)
const ssize_t MTU_INVALID
(for internal use) indicates MTU field is unset
virtual bool canChangePersistencyToImpl(ndn::nfd::FacePersistency newPersistency) const
invoked by canChangePersistencyTo to perform the check
stores a packet along with the remote endpoint
counters provided by Transport
PacketCounter nOutPackets
count of outgoing packets
const ssize_t QUEUE_ERROR
indicates that the transport was unable to retrieve the queue capacity/length
ndn::nfd::FaceScope getScope() const
void close()
request the transport to be closed
Represents a TLV element of NDN packet format.
void setLinkType(ndn::nfd::LinkType linkType)
represents a counter of number of packets
const Face * getFace() const
ByteCounter nOutBytes
total outgoing bytes
provides a lightweight signal / event system
FaceUri getRemoteUri() const
void send(Packet &&packet)
send a link-layer packet
the transport is being closed due to a failure
void setScope(ndn::nfd::FaceScope scope)
bool canChangePersistencyTo(ndn::nfd::FacePersistency newPersistency) const
check whether the face persistency can be changed to newPersistency
ByteCounter nInBytes
total incoming bytes
represents a counter of number of bytes
FaceUri getLocalUri() const
TransportState getState() const
Copyright (c) 2011-2015 Regents of the University of California.
EndpointId remoteEndpoint
identifies the remote endpoint
signal::Signal< Transport, TransportState, TransportState > afterStateChange
signals when transport state changes
the transport is closed, and can be safely deallocated
ssize_t getSendQueueCapacity() const
void setLocalUri(const FaceUri &uri)
const LinkService * getLinkService() const
the transport is being closed gracefully, either by the peer or by a call to close() ...
represents the underlying protocol and address used by a Face
ndn::nfd::LinkType getLinkType() const
virtual const Counters & getCounters() const
ndn::nfd::FacePersistency getPersistency() const
void setSendQueueCapacity(ssize_t sendQueueCapacity)
void setState(TransportState newState)
set transport state
the transport is up and can transmit packets
void receive(Packet &&packet)
receive a link-layer packet
PacketCounter nInPackets
count of incoming packets
virtual void doClose()=0
performs Transport specific operations to close the transport
uint64_t EndpointId
identifies an endpoint on the link
virtual ssize_t getSendQueueLength()
Block packet
the packet as a TLV block
the transport is temporarily down, and is being recovered