|
SatCat5
|
Diagnostic logging system for the Ethernet switch.
The classes defined in this file read or write diagnostic logs of packets that reach the switch or router, providing basic information about packet source/destination/type, and where it was directed or why it was dropped.
In low-rate debugging (i.e., only a few packets per second), the log will record every single packet. At higher rates, it will attempt to record packet information on a best-effort basis, with placeholders indicating how many packets were skipped between complete records.
The message format uses the same 24-byte format as "mac_log_core":
The eth::SwitchLogMessage struct represents one such message.
For some errors, frame information may not be available. In such cases, the header information is filled in with zeros, marking it as invalid.
The eth::SwitchLogWriter is notified for each individual packet, then writes the stream of log data. At low rates, every packet is logged individually. If the output buffer is nearly full, it instead generates a summary of skipped packets to provide rate-limiting of the log data.
The eth::SwitchLogReader class reads a stream of log data and notifies a callback for each received message. The eth::SwitchLogFormatter class is a child that generates human-readable log::Log messages.
The eth::SwitchLogStats class is an alternative to SwitchLogWriter that counts sent and received packets, rather than reporting the details of each one. Its API is similar to the one provided by cfg::NetworkStats.
Definition in file eth_sw_log.h.
#include <satcat5/cfgbus_core.h>#include <satcat5/eth_address.h>#include <satcat5/eth_switch.h>#include <satcat5/io_writeable.h>#include <satcat5/pkt_buffer.h>#include <satcat5/polling.h>#include <satcat5/udp_core.h>Go to the source code of this file.
Classes | |
| struct | satcat5::eth::SwitchLogMessage |
| A single 24-byte packet-log message. More... | |
| class | satcat5::eth::SwitchLogHardware |
| Poll a hardware switch or router for log data. More... | |
| class | satcat5::eth::SwitchLogStats |
| Record packet statistics based on switch log events. More... | |
| struct | satcat5::eth::SwitchLogStats::TrafficStats |
| Data structure for reporting per-port traffic statistics. More... | |
| class | satcat5::eth::SwitchLogStatsStatic< SIZE > |
| Static allocation wrapper for eth::SwitchLogStats. More... | |
| class | satcat5::eth::SwitchLogWriter |
| Record rate-limited packet-logs for a switch or router. More... | |
| class | satcat5::eth::SwitchLogBuffer< NPKT > |
| Combine a SwitchLogWriter with a built-in output buffer. More... | |
| class | satcat5::eth::SwitchLogReader |
| Read packet-logs from an input stream or network interface. More... | |
| class | satcat5::eth::SwitchLogFormatter |
| Read binary packet logs to produce human-readable log messages. More... | |
| class | satcat5::eth::SwitchLogToPort |
| Forward binary packet logs to a network interface. More... | |