26 #ifndef NFD_DAEMON_FACE_TRANSPORT_HPP
27 #define NFD_DAEMON_FACE_TRANSPORT_HPP
172 send(
const Block& packet);
192 ndn::nfd::FacePersistency
248 time::steady_clock::TimePoint
278 setScope(ndn::nfd::FaceScope scope);
338 doSend(
const Block& packet) = 0;
345 ndn::nfd::FaceScope m_scope;
346 ndn::nfd::FacePersistency m_persistency;
347 ndn::nfd::LinkType m_linkType;
349 ssize_t m_sendQueueCapacity;
351 time::steady_clock::TimePoint m_expirationTime;
402 inline ndn::nfd::FaceScope
414 inline ndn::nfd::FacePersistency
417 return m_persistency;
420 inline ndn::nfd::LinkType
429 m_linkType = linkType;
441 return m_sendQueueCapacity;
447 m_sendQueueCapacity = sendQueueCapacity;
456 inline time::steady_clock::TimePoint
459 return m_expirationTime;
465 m_expirationTime = expirationTime;
472 typename std::enable_if<std::is_base_of<Transport, T>::value &&
473 !std::is_same<Transport, T>::value, std::ostream&>::type
476 return os << FaceLogHelper<Transport>(flh.
obj);
represents a counter of number of bytes
represents a counter of number of packets
generalization of a network interface
For internal use by FaceLogging macros.
Counters provided by a transport.
ByteCounter nInBytes
total incoming bytes
PacketCounter nInPackets
count of incoming packets
PacketCounter nOutPackets
count of outgoing packets
ByteCounter nOutBytes
total outgoing bytes
The lower half of a Face.
FaceUri getRemoteUri() const
void setPersistency(ndn::nfd::FacePersistency newPersistency)
changes face persistency setting
void setScope(ndn::nfd::FaceScope scope)
ndn::nfd::LinkType getLinkType() const
void setLinkType(ndn::nfd::LinkType linkType)
virtual void afterChangePersistency(ndn::nfd::FacePersistency oldPersistency)
invoked after the persistency has been changed
virtual const Counters & getCounters() const
void send(const Block &packet)
Send a link-layer packet.
void setSendQueueCapacity(ssize_t sendQueueCapacity)
void setLocalUri(const FaceUri &uri)
const LinkService * getLinkService() const
void setRemoteUri(const FaceUri &uri)
virtual void doClose()=0
performs Transport specific operations to close the transport
TransportState getState() const
ssize_t getSendQueueCapacity() const
bool canChangePersistencyTo(ndn::nfd::FacePersistency newPersistency) const
check whether the face persistency can be changed to newPersistency
time::steady_clock::TimePoint getExpirationTime() const
const Face * getFace() const
Transport()
Default constructor.
virtual bool canChangePersistencyToImpl(ndn::nfd::FacePersistency newPersistency) const
invoked by canChangePersistencyTo to perform the check
signal::Signal< Transport, TransportState, TransportState > afterStateChange
signals when transport state changes
FaceUri getLocalUri() const
void setFaceAndLinkService(Face &face, LinkService &service)
set Face and LinkService for Transport
void setState(TransportState newState)
set transport state
void receive(const Block &packet, const EndpointId &endpoint=0)
Pass a received link-layer packet to the upper layer for further processing.
ndn::nfd::FacePersistency getPersistency() const
ndn::nfd::FaceScope getScope() const
void setExpirationTime(const time::steady_clock::TimePoint &expirationTime)
virtual ssize_t getSendQueueLength()
void close()
Request the transport to be closed.
std::ostream & operator<<(std::ostream &os, const FaceLogHelper< Face > &flh)
const ssize_t QUEUE_UNSUPPORTED
indicates that the transport does not support reading the queue capacity/length
uint64_t EndpointId
Identifies a remote endpoint on the link.
TransportState
Indicates the state of a transport.
@ CLOSED
the transport is closed, and can be safely deallocated
@ CLOSING
the transport is being closed gracefully, either by the peer or by a call to close()
@ FAILED
the transport is being closed due to a failure
@ DOWN
the transport is temporarily down, and is being recovered
@ UP
the transport is up and can transmit packets
const ssize_t MTU_UNLIMITED
indicates the transport has no limit on payload size
const ssize_t MTU_INVALID
(for internal use) indicates MTU field is unset
const ssize_t QUEUE_ERROR
indicates that the transport was unable to retrieve the queue capacity/length
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents,...