45 return os <<
"CLOSING";
47 return os <<
"FAILED";
49 return os <<
"CLOSED";
58 , m_scope(
ndn::
nfd::FACE_SCOPE_NONE)
59 , m_persistency(
ndn::
nfd::FACE_PERSISTENCY_NONE)
60 , m_linkType(
ndn::
nfd::LINK_TYPE_NONE)
64 , m_expirationTime(time::steady_clock::TimePoint::max())
73 BOOST_ASSERT(m_face ==
nullptr);
74 BOOST_ASSERT(m_service ==
nullptr);
96 BOOST_ASSERT(packet.isValid());
98 packet.size() <=
static_cast<size_t>(this->
getMtu()));
111 this->doSend(packet, endpoint);
117 BOOST_ASSERT(packet.isValid());
119 packet.size() <=
static_cast<size_t>(this->
getMtu()));
131 if (m_persistency == newPersistency || m_persistency == ndn::nfd::FACE_PERSISTENCY_NONE) {
135 if (newPersistency == ndn::nfd::FACE_PERSISTENCY_NONE) {
154 if (m_persistency == newPersistency) {
158 auto oldPersistency = m_persistency;
159 m_persistency = newPersistency;
161 if (oldPersistency != ndn::nfd::FACE_PERSISTENCY_NONE) {
162 NFD_LOG_FACE_INFO(
"setPersistency " << oldPersistency <<
" -> " << newPersistency);
175 if (m_state == newState) {
179 bool isValid =
false;
200 NDN_THROW(std::runtime_error(
"Invalid state transition"));
213 operator<<(std::ostream& os, const FaceLogHelper<Transport>& flh)
219 os <<
"[id=" << faceId <<
",local=" << transport.
getLocalUri()
const ssize_t QUEUE_UNSUPPORTED
indicates that the transport does not support reading the queue capacity/length
virtual void doClose()=0
performs Transport specific operations to close the transport
Copyright (c) 2014-2017, Regents of the University of California, Arizona Board of Regents...
#define NFD_LOG_FACE_TRACE(msg)
Log a message at TRACE level.
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
std::ostream & operator<<(std::ostream &os, const FaceLogHelper< Face > &flh)
void send(const Block &packet, const EndpointId &endpoint=0)
Send a link-layer packet.
signal::Signal< Transport, TransportState, TransportState > afterStateChange
signals when transport state changes
The lower half of a Face.
uint64_t EndpointId
Identifies a remote endpoint on the link.
FaceUri getRemoteUri() const
ByteCounter nInBytes
total incoming bytes
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
#define NFD_LOG_FACE_INFO(msg)
Log a message at INFO level.
const Face * getFace() const
generalization of a network interface
the transport is being closed gracefully, either by the peer or by a call to close() ...
PacketCounter nOutPackets
count of outgoing packets
void setPersistency(ndn::nfd::FacePersistency newPersistency)
changes face persistency setting
void close()
Request the transport to be closed.
#define NFD_LOG_INIT(name)
void receivePacket(const Block &packet, const EndpointId &endpoint)
performs LinkService specific operations to receive a lower-layer packet
void receive(const Block &packet, const EndpointId &endpoint=0)
Pass a received link-layer packet to the upper layer for further processing.
TransportState getState() const
FaceUri getLocalUri() const
void setState(TransportState newState)
set transport state
the transport is up and can transmit packets
static constexpr ssize_t MIN_MTU
minimum MTU that may be set on a transport
ByteCounter nOutBytes
total outgoing bytes
bool canChangePersistencyTo(ndn::nfd::FacePersistency newPersistency) const
check whether the face persistency can be changed to newPersistency
uint64_t FaceId
Identifies a face.
const FaceId INVALID_FACEID
indicates an invalid FaceId
void setFaceAndLinkService(Face &face, LinkService &service)
set Face and LinkService for Transport
Transport()
Default constructor.
the transport is temporarily down, and is being recovered