43 return os <<
"CLOSING";
45 return os <<
"FAILED";
47 return os <<
"CLOSED";
62 , m_expirationTime(
time::steady_clock::TimePoint::max())
71 BOOST_ASSERT(m_face ==
nullptr);
72 BOOST_ASSERT(m_service ==
nullptr);
96 packet.
size() <=
static_cast<size_t>(this->
getMtu()));
109 this->doSend(packet);
115 BOOST_ASSERT(packet.
isValid());
117 packet.
size() <=
static_cast<size_t>(this->
getMtu()));
168 if (m_persistency == newPersistency) {
172 auto oldPersistency = m_persistency;
173 m_persistency = newPersistency;
176 NFD_LOG_FACE_INFO(
"setPersistency " << oldPersistency <<
" -> " << newPersistency);
189 if (m_state == newState) {
193 bool isValid =
false;
214 NDN_THROW(std::runtime_error(
"Invalid state transition"));
227 operator<<(std::ostream& os, const FaceLogHelper<Transport>& flh)
233 os <<
"[id=" << faceId <<
",local=" << transport.
getLocalUri()
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
Copyright (c) 2011-2015 Regents of the University of California.
#define NFD_LOG_INIT(name)
#define NFD_LOG_FACE_TRACE(msg)
Log a message at TRACE level.
std::ostream & operator<<(std::ostream &os, const Face &face)
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
void receivePacket(const Block &packet, const EndpointId &endpoint)
performs LinkService specific operations to receive a lower-layer packet
virtual bool canChangePersistencyToImpl(ndn::nfd::FacePersistency newPersistency) const
invoked by canChangePersistencyTo to perform the check
void send(const Block &packet)
Send a link-layer packet.
PacketCounter nOutPackets
count of outgoing packets
void close()
Request the transport to be closed.
Represents a TLV element of the NDN packet format.
const Face * getFace() const
ByteCounter nOutBytes
total outgoing bytes
uint64_t EndpointId
Identifies a remote endpoint on the link.
FaceUri getRemoteUri() const
the transport is being closed due to a failure
bool canChangePersistencyTo(ndn::nfd::FacePersistency newPersistency) const
check whether the face persistency can be changed to newPersistency
void receive(const Block &packet, const EndpointId &endpoint=0)
Pass a received link-layer packet to the upper layer for further processing.
size_t size() const
Return the size of the encoded wire, i.e., of the whole TLV.
ByteCounter nInBytes
total incoming bytes
FaceUri getLocalUri() const
#define NFD_LOG_FACE_INFO(msg)
Log a message at INFO level.
TransportState getState() const
Copyright (c) 2011-2015 Regents of the University of California.
signal::Signal< Transport, TransportState, TransportState > afterStateChange
signals when transport state changes
the transport is closed, and can be safely deallocated
the transport is being closed gracefully, either by the peer or by a call to close() ...
bool isValid() const noexcept
Check if the Block is valid.
void setState(TransportState newState)
set transport state
the transport is up and can transmit packets
PacketCounter nInPackets
count of incoming packets
virtual void doClose()=0
performs Transport specific operations to close the transport
uint64_t FaceId
Identifies a face.
The lower half of a Face.
const FaceId INVALID_FACEID
indicates an invalid FaceId
Transport()
Default constructor.
the transport is temporarily down, and is being recovered