6 #include <satcat5/eth_address.h>
12 , m_addr(satcat5::eth::MACADDR_NONE)
13 , m_type(satcat5::eth::ETYPE_NONE)
14 , m_vtag(satcat5::eth::VTAG_NONE)
34 return m_iface->
open_write(m_addr, m_type, m_vtag);
38 m_addr = satcat5::eth::MACADDR_NONE;
39 m_type = satcat5::eth::ETYPE_NONE;
40 m_vtag = satcat5::eth::VTAG_NONE;
44 return !(m_addr == satcat5::eth::MACADDR_NONE)
45 && !(m_type == satcat5::eth::ETYPE_NONE);
53 bool dst_match = m_addr.
is_multicast() || m_addr == m_iface->reply_mac();
54 bool vid_match = m_iface->reply_vtag().
vid() == m_vtag.
vid();
55 return dst_match && vid_match;
59 return m_iface->reply_is_multicast();
63 m_addr = m_iface->reply_mac();
64 m_type = m_iface->reply_type();
65 m_vtag = m_iface->reply_vtag();
Send packets to a specific Ethernet address.
bool ready() const override
Is this address object ready for use? Child MUST override this method.
void close() override
Close any open connections and revert to idle.
void save_reply_address() override
Bind this Address object to the parent interface's current reply address, as provided in net::Dispatc...
bool reply_is_multicast() const override
Was the parent interface's incoming message sent to a multicast address? (i.e., Could that message ha...
satcat5::net::Dispatch * iface() const override
Fetch a pointer to the underlying interface.
void connect(const satcat5::eth::MacAddr &addr, const satcat5::eth::MacType &type, const satcat5::eth::VlanTag &vtag=satcat5::eth::VTAG_NONE)
Connect to the designated address.
satcat5::io::Writeable * open_write(unsigned len) override
Open a new frame to the designated address and type.
bool matches_reply_address() const override
Does this Address object match the parent interface's current reply address? Multicast destinations s...
bool is_multicast() const override
Is the destination a broadcast or multicast address? Child MUST override these method.
Implemention of "net::Dispatch" for Ethernet frames.
satcat5::io::Writeable * open_write(const satcat5::eth::MacAddr &dst, const satcat5::eth::MacType &type, satcat5::eth::VlanTag vtag=satcat5::eth::VTAG_NONE)
Send a frame to the designated Ethernet address/VLAN.
Abstract API for writing byte-streams and packets.
The "Dispatch" is a generic interface that knows how to read a designated protocol layer and sort inc...
An Ethernet MAC address (with serializable interface).
bool is_multicast() const
Broadcast, L2 multicast, or L3 multicast.
EtherType field (uint16) is used a protocol-ID [1536..65535].
Header contents for an 802.1Q Virtual-LAN tag.
u16 vid() const
Accessors for each individual field.