26 #ifndef NFD_DAEMON_FACE_TRANSPORT_HPP 27 #define NFD_DAEMON_FACE_TRANSPORT_HPP 144 getLinkService()
const;
173 send(
const Block& packet,
const EndpointId& endpoint = 0);
184 getRemoteUri()
const;
193 ndn::nfd::FacePersistency
194 getPersistency()
const;
205 canChangePersistencyTo(ndn::nfd::FacePersistency newPersistency)
const;
210 setPersistency(ndn::nfd::FacePersistency newPersistency);
234 getSendQueueCapacity()
const;
249 time::steady_clock::TimePoint
250 getExpirationTime()
const;
269 receive(
const Block& packet,
const EndpointId& endpoint = 0);
273 setLocalUri(
const FaceUri& uri);
276 setRemoteUri(
const FaceUri& uri);
279 setScope(ndn::nfd::FaceScope scope);
282 setLinkType(ndn::nfd::LinkType linkType);
288 setSendQueueCapacity(ssize_t sendQueueCapacity);
298 setState(TransportState newState);
301 setExpirationTime(
const time::steady_clock::TimePoint& expirationTime);
311 canChangePersistencyToImpl(ndn::nfd::FacePersistency newPersistency)
const;
320 afterChangePersistency(ndn::nfd::FacePersistency oldPersistency);
340 doSend(
const Block& packet,
const EndpointId& endpoint) = 0;
347 static constexpr ssize_t MIN_MTU = 64;
354 ndn::nfd::FaceScope m_scope;
355 ndn::nfd::FacePersistency m_persistency;
356 ndn::nfd::LinkType m_linkType;
358 ssize_t m_sendQueueCapacity;
359 TransportState m_state;
360 time::steady_clock::TimePoint m_expirationTime;
411 inline ndn::nfd::FaceScope
423 inline ndn::nfd::FacePersistency
426 return m_persistency;
429 inline ndn::nfd::LinkType
438 m_linkType = linkType;
450 BOOST_ASSERT(mtu == MTU_UNLIMITED || mtu > 0);
457 return m_sendQueueCapacity;
463 m_sendQueueCapacity = sendQueueCapacity;
472 inline time::steady_clock::TimePoint
475 return m_expirationTime;
481 m_expirationTime = expirationTime;
485 operator<<(std::ostream& os, const FaceLogHelper<Transport>& flh);
488 typename std::enable_if<std::is_base_of<Transport, T>::value &&
489 !std::is_same<Transport, T>::value, std::ostream&>::type
490 operator<<(std::ostream& os, const FaceLogHelper<T>& flh)
492 return os << FaceLogHelper<Transport>(flh.obj);
498 #endif // NFD_DAEMON_FACE_TRANSPORT_HPP void setSendQueueCapacity(ssize_t sendQueueCapacity)
const ssize_t QUEUE_UNSUPPORTED
indicates that the transport does not support reading the queue capacity/length
void setLocalUri(const FaceUri &uri)
ndn::nfd::LinkType getLinkType() const
void setScope(ndn::nfd::FaceScope scope)
represents a counter of number of bytes
ssize_t getSendQueueCapacity() const
virtual ssize_t getSendQueueLength()
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
time::steady_clock::TimePoint getExpirationTime() const
std::ostream & operator<<(std::ostream &os, const FaceLogHelper< Face > &flh)
const ssize_t QUEUE_ERROR
indicates that the transport was unable to retrieve the queue capacity/length
signal::Signal< Transport, TransportState, TransportState > afterStateChange
signals when transport state changes
The lower half of a Face.
FaceUri getRemoteUri() const
uint64_t EndpointId
Identifies a remote endpoint on the link.
ByteCounter nInBytes
total incoming bytes
represents a counter of number of packets
the transport is being closed due to a failure
ndn::nfd::FaceScope getScope() const
TransportState getState() const
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
the transport is closed, and can be safely deallocated
PacketCounter nInPackets
count of incoming packets
const Face * getFace() const
generalization of a network interface
void setLinkType(ndn::nfd::LinkType linkType)
the transport is being closed gracefully, either by the peer or by a call to close() ...
PacketCounter nOutPackets
count of outgoing packets
FaceUri getLocalUri() const
Counters provided by a transport.
ndn::nfd::FacePersistency getPersistency() const
void setRemoteUri(const FaceUri &uri)
the transport is up and can transmit packets
ByteCounter nOutBytes
total outgoing bytes
virtual const Counters & getCounters() const
const LinkService * getLinkService() const
void setExpirationTime(const time::steady_clock::TimePoint &expirationTime)
the transport is temporarily down, and is being recovered