|
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.
39 time::nanoseconds idleTimeout,
40 optional<ssize_t> overrideMtu)
42 , m_idleTimeout(idleTimeout)
51 this->
setMtu(std::min<ssize_t>(localEndpoint.
getMtu(), *overrideMtu));
64 snprintf(filter,
sizeof(filter),
65 "(ether proto 0x%x) && (ether src %s) && (ether dst %s) && (not vlan)",
72 m_idleTimeout > time::nanoseconds::zero()) {
73 scheduleClosureWhenIdle();
87 m_idleTimeout > time::nanoseconds::zero()) {
88 scheduleClosureWhenIdle();
91 m_closeIfIdleEvent.
cancel();
97 UnicastEthernetTransport::scheduleClosureWhenIdle()
99 m_closeIfIdleEvent =
getScheduler().schedule(m_idleTimeout, [
this] {
106 scheduleClosureWhenIdle();
void cancel()
Cancel the operation.
@ FACE_SCOPE_NON_LOCAL
face is non-local
void setRemoteUri(const FaceUri &uri)
ethernet::Address m_destAddress
Represents one network interface attached to the host.
@ LINK_TYPE_POINT_TO_POINT
link is point-to-point
represents the underlying protocol and address used by a Face
represents an Ethernet hardware address
void setScope(ndn::nfd::FaceScope scope)
static time_point now() noexcept
const uint16_t ETHERTYPE_NDN
ethernet::Address m_srcAddress
#define NFD_LOG_FACE_DEBUG(msg)
Log a message at DEBUG level.
UnicastEthernetTransport(const ndn::net::NetworkInterface &localEndpoint, const ethernet::Address &remoteEndpoint, ndn::nfd::FacePersistency persistency, time::nanoseconds idleTimeout, optional< ssize_t > overrideMtu={})
Creates an Ethernet-based transport for unicast communication.
bool hasRecentlyReceived() const
ndn::nfd::FacePersistency getPersistency() const
void setExpirationTime(const time::steady_clock::TimePoint &expirationTime)
void resetRecentlyReceived()
Copyright (c) 2011-2015 Regents of the University of California.
Scheduler & getScheduler()
Returns the global Scheduler instance for the calling thread.
static FaceUri fromDev(const std::string &ifname)
create dev FaceUri from network device name
A unicast Transport that uses raw Ethernet II frames.
void afterChangePersistency(ndn::nfd::FacePersistency oldPersistency) final
invoked after the persistency has been changed
void setLinkType(ndn::nfd::LinkType linkType)
uint32_t getMtu() const
Returns the MTU (maximum transmission unit) of the interface.
std::string toString(char sep=':') const
Converts the address to a human-readable string.
Base class for Ethernet-based Transports.
@ FACE_PERSISTENCY_ON_DEMAND
face is on-demand
std::string m_interfaceName
void setPersistency(ndn::nfd::FacePersistency newPersistency)
changes face persistency setting
#define NFD_LOG_FACE_INFO(msg)
Log a message at INFO level.
bool canChangePersistencyToImpl(ndn::nfd::FacePersistency newPersistency) const final
invoked by canChangePersistencyTo to perform the check
void setPacketFilter(const char *filter) const
Install a BPF filter on the receiving socket.
void close()
Request the transport to be closed.
#define NFD_LOG_INIT(name)
void setLocalUri(const FaceUri &uri)