A multicast Transport that uses raw Ethernet II frames. More...
#include <ethernet-transport.hpp>
Classes | |
class | Error |
Public Member Functions | |
EthernetTransport (const NetworkInterfaceInfo &interface, const ethernet::Address &mcastAddress) | |
Creates an Ethernet-based transport for multicast communication. More... | |
Public Member Functions inherited from nfd::face::Transport | |
Transport () | |
constructor More... | |
virtual | ~Transport () |
void | setFaceAndLinkService (Face &face, LinkService &service) |
set Face and LinkService for Transport More... | |
const Face * | getFace () const |
const LinkService * | getLinkService () const |
LinkService * | getLinkService () |
virtual const Counters & | getCounters () const |
void | close () |
request the transport to be closed More... | |
void | send (Packet &&packet) |
send a link-layer packet More... | |
FaceUri | getLocalUri () const |
FaceUri | getRemoteUri () const |
ndn::nfd::FaceScope | getScope () const |
ndn::nfd::FacePersistency | getPersistency () const |
void | setPersistency (ndn::nfd::FacePersistency persistency) |
changes face persistency setting More... | |
ndn::nfd::LinkType | getLinkType () const |
ssize_t | getMtu () const |
TransportState | getState () const |
time::steady_clock::TimePoint | getExpirationTime () const |
Protected Member Functions | |
virtual void | beforeChangePersistency (ndn::nfd::FacePersistency newPersistency) final |
invoked before persistency is changed More... | |
virtual void | doClose () final |
performs Transport specific operations to close the transport More... | |
Protected Member Functions inherited from nfd::face::Transport | |
void | receive (Packet &&packet) |
receive a link-layer packet More... | |
void | setLocalUri (const FaceUri &uri) |
void | setRemoteUri (const FaceUri &uri) |
void | setScope (ndn::nfd::FaceScope scope) |
void | setLinkType (ndn::nfd::LinkType linkType) |
void | setMtu (ssize_t mtu) |
void | setState (TransportState newState) |
set transport state More... | |
void | setExpirationTime (const time::steady_clock::TimePoint &expirationTime) |
Additional Inherited Members | |
Public Types inherited from nfd::face::Transport | |
typedef uint64_t | EndpointId |
identifies an endpoint on the link More... | |
typedef TransportCounters | Counters |
counters provided by Transport More... | |
Public Attributes inherited from nfd::face::Transport | |
signal::Signal< Transport, TransportState, TransportState > | afterStateChange |
signals when transport state changes More... | |
Protected Attributes inherited from nfd::face::TransportCounters | |
PacketCounter | nInPackets |
count of incoming packets More... | |
PacketCounter | nOutPackets |
count of outgoing packets More... | |
ByteCounter | nInBytes |
total incoming bytes More... | |
ByteCounter | nOutBytes |
total outgoing bytes More... | |
A multicast Transport that uses raw Ethernet II frames.
Definition at line 48 of file ethernet-transport.hpp.
nfd::face::EthernetTransport::EthernetTransport | ( | const NetworkInterfaceInfo & | interface, |
const ethernet::Address & | mcastAddress | ||
) |
Creates an Ethernet-based transport for multicast communication.
Definition at line 64 of file ethernet-transport.cpp.
References ndn::util::ethernet::ETHERTYPE_NDN, ndn::nfd::FACE_PERSISTENCY_PERMANENT, ndn::nfd::FACE_SCOPE_NON_LOCAL, ndn::util::FaceUri::fromDev(), ndn::util::ethernet::Address::isBroadcast(), ndn::nfd::LINK_TYPE_MULTI_ACCESS, nfd::NetworkInterfaceInfo::name, NFD_LOG_FACE_INFO, NFD_LOG_FACE_WARN, nfd::face::Transport::setLinkType(), nfd::face::Transport::setLocalUri(), nfd::face::Transport::setMtu(), nfd::face::Transport::setPersistency(), nfd::face::Transport::setRemoteUri(), nfd::face::Transport::setScope(), and ndn::util::ethernet::Address::toString().
Referenced by nfd::face::EthernetTransport::Error::Error().
|
finalprotectedvirtual |
invoked before persistency is changed
std::invalid_argument | new persistency is not supported |
std::runtime_error | transition is disallowed |
Implements nfd::face::Transport.
Definition at line 123 of file ethernet-transport.cpp.
References ndn::nfd::FACE_PERSISTENCY_PERMANENT, and NFD_LOG_FACE_TRACE.
Referenced by nfd::face::EthernetTransport::Error::Error().
|
finalprotectedvirtual |
performs Transport specific operations to close the transport
This is invoked once by close()
after changing state to CLOSING. It will not be invoked by Transport class if the transport is already CLOSING or CLOSED.
When the cleanup procedure is complete, this method should change state to CLOSED. This transition can happen synchronously or asynchronously.
Implements nfd::face::Transport.
Definition at line 138 of file ethernet-transport.cpp.
References ndn::util::ethernet::ADDR_LEN, nfd::face::CLOSED, nfd::face::CLOSING, ndn::util::ethernet::ETHERTYPE_NDN, nfd::face::FAILED, ndn::Block::fromBuffer(), nfd::getGlobalIoService(), nfd::face::Transport::getState(), ndn::util::ethernet::HDR_LEN, ndn::util::ethernet::MAX_DATA_LEN, ndn::util::ethernet::MIN_DATA_LEN, NFD_LOG_FACE_DEBUG, NFD_LOG_FACE_ERROR, NFD_LOG_FACE_TRACE, NFD_LOG_FACE_WARN, PCAP_NETMASK_UNKNOWN, nfd::detail::SimulatorIo::post(), nfd::face::Transport::receive(), nfd::face::Transport::setState(), ndn::Block::size(), ndn::util::ethernet::Address::toString(), and ndn::util::ethernet::TYPE_LEN.
Referenced by nfd::face::EthernetTransport::Error::Error().