36 const ethernet::Address& remoteEndpoint,
37 ndn::nfd::FacePersistency persistency,
38 time::nanoseconds idleTimeout)
40 , m_idleTimeout(idleTimeout)
44 this->
setScope(ndn::nfd::FACE_SCOPE_NON_LOCAL);
46 this->
setLinkType(ndn::nfd::LINK_TYPE_POINT_TO_POINT);
47 this->
setMtu(localEndpoint.getMtu());
56 snprintf(filter,
sizeof(filter),
57 "(ether proto 0x%x) && (ether src %s) && (ether dst %s) && (not vlan)",
58 ethernet::ETHERTYPE_NDN,
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();
ethernet::Address m_srcAddress
void setLocalUri(const FaceUri &uri)
ethernet::Address m_destAddress
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.
void setScope(ndn::nfd::FaceScope scope)
void resetRecentlyReceived()
bool canChangePersistencyToImpl(ndn::nfd::FacePersistency newPersistency) const final
invoked by canChangePersistencyTo to perform the check
std::string m_interfaceName
Base class for Ethernet-based Transports.
void afterChangePersistency(ndn::nfd::FacePersistency oldPersistency) final
invoked after the persistency has been changed
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
#define NFD_LOG_FACE_INFO(msg)
Log a message at INFO level.
void setLinkType(ndn::nfd::LinkType linkType)
void setPersistency(ndn::nfd::FacePersistency newPersistency)
changes face persistency setting
void close()
request the transport to be closed
ndn::nfd::FacePersistency getPersistency() const
#define NFD_LOG_INIT(name)
EventId schedule(time::nanoseconds after, const EventCallback &event)
schedule an event
bool hasRecentlyReceived() const
void setRemoteUri(const FaceUri &uri)
void cancel()
cancels the event manually
void setExpirationTime(const time::steady_clock::TimePoint &expirationTime)
void setPacketFilter(const char *filter) const
Install a BPF filter on the receiving socket.