6 #include <satcat5/eth_dispatch.h>
9 #include <satcat5/udp_dispatch.h>
13 namespace log = satcat5::log;
16 static const unsigned DEBUG_VERBOSE = 0;
19 satcat5::eth::ProtoEcho::ProtoEcho(
24 Type(type_req.value),
Type(type_ack.value))
29 satcat5::udp::ProtoEcho::ProtoEcho(
45 , m_replytype(type_ack)
50 #if SATCAT5_ALLOW_DELETION
63 if (DEBUG_VERBOSE > 0) {
Implemention of "net::Dispatch" for Ethernet frames.
Limited read of next N bytes.
unsigned get_read_ready() const override
How many bytes can be read without blocking?
u8 read_u8()
One of many functions for reading integer/floating point values, see details.
Abstract API for writing byte-streams and packets.
void write_u8(u8 data)
One of many functions for writing integer/floating point values, see details.
virtual bool write_finalize()
Mark end of frame and release temporary working data.
The Log class creates and formats one log message.
Log & write(const char *str)
Formatting methods for various data types.
The "Dispatch" is a generic interface that knows how to read a designated protocol layer and sort inc...
void add(satcat5::net::Protocol *proto)
Register a Protocol object.
virtual satcat5::io::Writeable * open_reply(const satcat5::net::Type &type, unsigned len)=0
Open a reply to the sender of the most recent message by writing frame header(s) and returning a stre...
void remove(satcat5::net::Protocol *proto)
Unregister a Protocol object.
The Echo protocol can be attached to any Dispatch object.
satcat5::net::Type const m_replytype
Type for replies.
~ProtoEcho() SATCAT5_OPTIONAL_DTOR
Only children can safely access constructor/destructor.
void frame_rcvd(satcat5::io::LimitedRead &src) override
Event handler to process incoming frames and respond.
satcat5::net::Dispatch *const m_iface
Registered iface.
A net::Protocol is the counterpart to net::Dispatch that handles a particular data stream,...
Dispatcher sorts incoming UDP messages by port index.
Diagnostic logging to UART and/or Ethernet ports.
EtherType field (uint16) is used a protocol-ID [1536..65535].
UDP and TCP ports are both 16-bit unsigned integers.
Multipurpose filter for matching fields in network packets.