43 return os <<
"CLOSING";
45 return os <<
"FAILED";
47 return os <<
"CLOSED";
54 : packet(
std::move(packet1))
62 , m_scope(
ndn::
nfd::FACE_SCOPE_NONE)
63 , m_persistency(
ndn::
nfd::FACE_PERSISTENCY_NONE)
64 , m_linkType(
ndn::
nfd::LINK_TYPE_NONE)
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) {
137 if (newPersistency == ndn::nfd::FACE_PERSISTENCY_NONE) {
138 throw std::runtime_error(
"invalid persistency transition");
141 if (m_persistency != ndn::nfd::FACE_PERSISTENCY_NONE) {
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()
virtual void doClose()=0
performs Transport specific operations to close the transport
Copyright (c) 2014-2016, 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
#define NFD_LOG_FACE_DEBUG(msg)
Log a message at DEBUG level.
virtual void beforeChangePersistency(ndn::nfd::FacePersistency newPersistency)=0
invoked before persistency is changed
std::ostream & operator<<(std::ostream &os, const FaceLogHelper< Face > &flh)
void setPersistency(ndn::nfd::FacePersistency persistency)
changes face persistency setting
signal::Signal< Transport, TransportState, TransportState > afterStateChange
signals when transport state changes
FaceUri getRemoteUri() const
void receive(Packet &&packet)
receive a link-layer packet
stores a packet along with the remote endpoint
ByteCounter nInBytes
total incoming bytes
the transport is being closed due to a failure
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
#define NFD_LOG_FACE_INFO(msg)
Log a message at INFO level.
const Face * getFace() const
generalization of a network interface
the transport is requested to be closed
PacketCounter nOutPackets
count of outgoing packets
void send(Packet &&packet)
send a link-layer packet
void close()
request the transport to be closed
#define NFD_LOG_INIT(name)
TransportState getState() const
void receivePacket(Transport::Packet &&packet)
performs LinkService specific operations to receive a lower-layer packet
FaceUri getLocalUri() const
void setState(TransportState newState)
set transport state
uint64_t FaceId
identifies a face
ByteCounter nOutBytes
total outgoing bytes
const FaceId INVALID_FACEID
indicates an invalid FaceId
void setFaceAndLinkService(Face &face, LinkService &service)
set Face and LinkService for Transport
the transport is down temporarily, and is being recovered