38 time::nanoseconds idleTimeout)
40 , m_idleTimeout(idleTimeout)
56 snprintf(filter,
sizeof(filter),
57 "(ether proto 0x%x) && (ether src %s) && (ether dst %s) && (not vlan)",
64 m_idleTimeout > time::nanoseconds::zero()) {
65 scheduleClosureWhenIdle();
79 m_idleTimeout > time::nanoseconds::zero()) {
80 scheduleClosureWhenIdle();
83 m_closeIfIdleEvent.
cancel();
89 UnicastEthernetTransport::scheduleClosureWhenIdle()
98 scheduleClosureWhenIdle();
void setPersistency(ndn::nfd::FacePersistency newPersistency)
changes face persistency setting
void cancel()
Cancels the event manually.
void setExpirationTime(const time::steady_clock::TimePoint &expirationTime)
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)
Represents one network interface attached to the host.
#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
EventId schedule(time::nanoseconds after, const EventCallback &event)
Schedule an event.
Base class for Ethernet-based Transports.
bool hasRecentlyReceived() const
#define NFD_LOG_INIT(name)
std::string m_interfaceName
static FaceUri fromDev(const std::string &ifname)
create dev FaceUri from network device name
ethernet::Address m_srcAddress