|
NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
|
API Documentation
|
Go to the documentation of this file.
45 return os <<
"CLOSING";
47 return os <<
"FAILED";
49 return os <<
"CLOSED";
64 , m_expirationTime(
time::steady_clock::TimePoint::max())
73 BOOST_ASSERT(m_face ==
nullptr);
74 BOOST_ASSERT(m_service ==
nullptr);
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()));
154 if (m_persistency == newPersistency) {
158 auto oldPersistency = m_persistency;
159 m_persistency = newPersistency;
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"));
219 os <<
"[id=" << faceId <<
",local=" << transport.
getLocalUri()
TransportState
Indicates the state of a transport.
const ssize_t MTU_INVALID
(for internal use) indicates MTU field is unset
@ CLOSED
the transport is closed, and can be safely deallocated
bool canChangePersistencyTo(ndn::nfd::FacePersistency newPersistency) const
check whether the face persistency can be changed to newPersistency
const ssize_t MTU_UNLIMITED
indicates the transport has no limit on payload size
FaceUri getRemoteUri() const
virtual void doClose()=0
performs Transport specific operations to close the transport
void setState(TransportState newState)
set transport state
@ DOWN
the transport is temporarily down, and is being recovered
bool isValid() const noexcept
Check if the Block is valid.
@ CLOSING
the transport is being closed gracefully, either by the peer or by a call to close()
Transport()
Default constructor.
void setFaceAndLinkService(Face &face, LinkService &service)
set Face and LinkService for Transport
std::ostream & operator<<(std::ostream &os, const Face &face)
Copyright (c) 2011-2015 Regents of the University of California.
const FaceId INVALID_FACEID
indicates an invalid FaceId
PacketCounter nOutPackets
count of outgoing packets
virtual void afterChangePersistency(ndn::nfd::FacePersistency oldPersistency)
invoked after the persistency has been changed
uint64_t FaceId
Identifies a face.
generalization of a network interface
#define NFD_LOG_FACE_TRACE(msg)
Log a message at TRACE level.
void send(const Block &packet, const EndpointId &endpoint=0)
Send a link-layer packet.
ByteCounter nOutBytes
total outgoing bytes
const ssize_t QUEUE_UNSUPPORTED
indicates that the transport does not support reading the queue capacity/length
const Face * getFace() const
virtual bool canChangePersistencyToImpl(ndn::nfd::FacePersistency newPersistency) const
invoked by canChangePersistencyTo to perform the check
@ UP
the transport is up and can transmit packets
FaceUri getLocalUri() const
Represents a TLV element of NDN packet format.
void setPersistency(ndn::nfd::FacePersistency newPersistency)
changes face persistency setting
size_t size() const
Return the size of the encoded wire, i.e.
#define NFD_LOG_FACE_INFO(msg)
Log a message at INFO level.
ByteCounter nInBytes
total incoming bytes
@ FAILED
the transport is being closed due to a failure
PacketCounter nInPackets
count of incoming packets
TransportState getState() const
static constexpr ssize_t MIN_MTU
minimum MTU that may be set on a transport
uint64_t EndpointId
Identifies a remote endpoint on the link.
void receive(const Block &packet, const EndpointId &endpoint=0)
Pass a received link-layer packet to the upper layer for further processing.
void close()
Request the transport to be closed.
void receivePacket(const Block &packet, const EndpointId &endpoint)
performs LinkService specific operations to receive a lower-layer packet
For internal use by FaceLogging macros.
The lower half of a Face.
#define NFD_LOG_INIT(name)
Copyright (c) 2011-2015 Regents of the University of California.
signal::Signal< Transport, TransportState, TransportState > afterStateChange
signals when transport state changes