25 #include <satcat5/ethernet.h>
28 #include <satcat5/udp_core.h>
31 #if SATCAT5_CBOR_ENABLE
58 virtual void log_event(s8 priority,
unsigned nbytes,
const char* msg);
88 void log_event(s8 priority,
unsigned nbytes,
const char* msg)
override;
94 void set_min_priority(s8 priority) {m_min_priority = priority;}
131 { m_addr.
connect(addr, type); }
170 { m_addr.
connect(dstaddr, dstport, 0);}
Inheritable container for a eth::Address.
void close() override
Close any open connections and revert to idle.
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.
Implemention of "net::Dispatch" for Ethernet frames.
Specialization of satcat5::log::FromCbor for raw-Ethernet frames.
LogFromCbor(satcat5::eth::Dispatch *iface, const satcat5::eth::MacType &typ)
Constructor binds to a specific interface and EtherType.
Specialization of satcat5::log::ToCbor for raw-Ethernet frames.
void connect(const satcat5::eth::MacAddr &addr, const satcat5::eth::MacType &type)
Set the destination address.
void close()
Stop message forwarding.
LogToCbor(satcat5::eth::Dispatch *eth, const satcat5::eth::MacType &typ)
Constructor binds to a specific interface and EtherType.
Limited read of next N bytes.
Defines the interface for accepting Log messages.
Read CBOR-formatted network messages and copy to the local log.
virtual void log_event(s8 priority, unsigned nbytes, const char *msg)
Event handler for validated messages.
void set_min_priority(s8 priority)
Set the minimum priority for message forwarding.
satcat5::net::Dispatch *const m_src
Pointer to the interface object.
FromCbor(satcat5::net::Dispatch *src, satcat5::net::Type filter)
Only children can safely access constructor/destructor.
void frame_rcvd(satcat5::io::LimitedRead &src) override
Event handler for incoming messages.
Write local logs to a CBOR-formatted network message.
ToCbor(satcat5::net::Address *dst)
Only children can safely access constructor/destructor.
void log_event(s8 priority, unsigned nbytes, const char *msg) override
Callback for each formatted Log message.
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...
A net::Protocol is the counterpart to net::Dispatch that handles a particular data stream,...
Inheritable container for a udp::Address.
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.
Dispatcher sorts incoming UDP messages by port index.
Specialization of satcat5::log::FromCbor for UDP datagrams.
LogFromCbor(satcat5::udp::Dispatch *iface, const satcat5::udp::Port &port)
Constructor binds to a specific incoming UDP port.
Specialization of satcat5::log::ToCbor for UDP datagrams.
void connect(const satcat5::udp::Addr &dstaddr, const satcat5::udp::Port &dstport)
Set the destination address.
void close()
Stop message forwarding.
LogToCbor(satcat5::udp::Dispatch *udp, const satcat5::udp::Port &dstport)
Constructor binds to a specific interface and port number.
Diagnostic logging to UART and/or Ethernet ports.
constexpr s8 DEBUG
Define basic priority codes for log messages.
An Ethernet MAC address (with serializable interface).
EtherType field (uint16) is used a protocol-ID [1536..65535].
IPv4 address is a 32-bit unsigned integer.
UDP and TCP ports are both 16-bit unsigned integers.
Multipurpose filter for matching fields in network packets.
Basic type aliases and prototypes used throughout SatCat5.