9 #include <satcat5/ip_address.h>
19 static constexpr
unsigned HEADER_BYTES = 8;
69 {satcat5::udp::PORT_NONE, satcat5::udp::PORT_NONE, 0};
116 {
return m_addr.dstaddr();}
118 {
return m_addr.dstmac();}
122 {
return m_addr.eth(); }
124 {
return m_addr.eth_header(); }
127 {
return m_addr.gateway(); }
129 {
return m_addr.srcmac(); }
131 {
return m_srcport; }
135 {
return {m_srcport, m_dstport, u16(len + 8)}; }
137 {
return m_addr.vtag(); }
153 {
return m_addr.dstaddr(); }
155 {
return m_addr.dstmac(); }
157 {
return m_addr.dstport(); }
159 {
return m_addr.eth(); }
161 {
return m_addr.
iface(); }
163 {
return m_addr.gateway(); }
165 {
return m_addr.srcport(); }
167 {
return m_addr.udp(); }
Implemention of "net::Dispatch" for Ethernet frames.
Abstract API for reading byte-streams and packets.
Abstract API for writing byte-streams and packets.
Connection metadata for an IPv4 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.
bool reply_is_multicast() const override
Was the parent interface's incoming message sent to a multicast address? (i.e., Could that message ha...
bool is_multicast() const override
Is the destination a broadcast or multicast address? Child MUST override these method.
void retry() override
If this Address is not in the ready() state, reattempt any steps required to do so,...
Defines a generic API for sending data to a specific destination, such as a MAC address,...
The "Dispatch" is a generic interface that knows how to read a designated protocol layer and sort inc...
Inheritable container for a udp::Address.
Implementation of "net::Address" for UDP Dispatch.
bool ready() const override
Is this address object ready for use? Child MUST override this method.
bool reply_is_multicast() const override
Was the parent interface's incoming message sent to a multicast address? (i.e., Could that message ha...
void save_reply_address() override
Bind this Address object to the parent interface's current reply address, as provided in net::Dispatc...
satcat5::net::Dispatch * iface() const override
Fetch a pointer to the underlying interface.
void retry() override
If this Address is not in the ready() state, reattempt any steps required to do so,...
Address(satcat5::udp::Dispatch *iface)
Connect through the specified UDP interface.
satcat5::io::Writeable * open_write(unsigned len) override
Open a new frame to the designated address and type.
void connect(const satcat5::udp::Addr &dstaddr, const satcat5::eth::MacAddr &dstmac, const satcat5::udp::Port &dstport, const satcat5::udp::Port &srcport=satcat5::udp::PORT_NONE, const satcat5::eth::VlanTag &vtag=satcat5::eth::VTAG_NONE)
Manual address resolution (user supplies IP + MAC).
void close() override
Close any open connections and revert to idle.
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.
void init(satcat5::udp::Dispatch *iface)
Deferred initialization of the upstream interface.
Dispatcher sorts incoming UDP messages by port index.
Generic network Dispatch API.
An Ethernet MAC address (with serializable interface).
Header contents for an 802.1Q Virtual-LAN tag.
IPv4 address is a 32-bit unsigned integer.
UDP and TCP ports are both 16-bit unsigned integers.