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