43 return os <<
"CLOSING";
45 return os <<
"FAILED";
47 return os <<
"CLOSED";
54 : packet(
std::move(packet1))
67 , m_expirationTime(
time::steady_clock::TimePoint::max())
78 BOOST_ASSERT(m_face ==
nullptr);
79 BOOST_ASSERT(m_service ==
nullptr);
102 packet.packet.size() <=
static_cast<size_t>(this->
getMtu()));
115 this->doSend(std::move(packet));
122 packet.packet.size() <=
static_cast<size_t>(this->
getMtu()));
125 this->
nInBytes += packet.packet.size();
133 if (m_persistency == newPersistency) {
138 throw std::runtime_error(
"invalid persistency transition");
146 m_persistency = newPersistency;
152 if (m_state == newState) {
156 bool isValid =
false;
177 throw std::runtime_error(
"invalid state transition");
190 operator<<(std::ostream& os, const FaceLogHelper<Transport>& flh)
196 os <<
"[id=" << faceId <<
",local=" << transport.
getLocalUri()
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_FACE_TRACE(msg)
Log a message at TRACE level.
std::ostream & operator<<(std::ostream &os, const Face &face)
void setPersistency(ndn::nfd::FacePersistency persistency)
changes face persistency setting
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
stores a packet along with the remote endpoint
PacketCounter nOutPackets
count of outgoing packets
void close()
request the transport to be closed
Class representing a wire element of NDN-TLV packet format.
const Face * getFace() const
ByteCounter nOutBytes
total outgoing bytes
FaceUri getRemoteUri() const
void send(Packet &&packet)
send a link-layer packet
the transport is being closed due to a failure
#define NFD_LOG_FACE_DEBUG(msg)
Log a message at DEBUG level.
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
virtual void beforeChangePersistency(ndn::nfd::FacePersistency newPersistency)=0
invoked before persistency is changed
the transport is closed, and can be safely deallocated
void receivePacket(Transport::Packet &&packet)
performs LinkService specific operations to receive a lower-layer packet
the transport is requested to be closed
#define NFD_LOG_INIT(name)
void setState(TransportState newState)
set transport state
uint64_t FaceId
identifies a face
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
const FaceId INVALID_FACEID
indicates an invalid FaceId
the transport is down temporarily, and is being recovered