|
SatCat5
|
Read packet-logs from an input stream or network interface.
In buffered mode, the input may be any io::Readable object, either packetized or an undifferentiated byte-stream. In network mode, the input may be any net::Dispatch object. The user specifies the filter value (i.e., EtherType, UDP port, etc.)
Definition at line 264 of file eth_sw_log.h.
#include <eth_sw_log.h>
Public Member Functions | |
| void | set_polling_interval (unsigned msec) |
| Set polling interval, in milliseconds. More... | |
Protected Member Functions | |
| SwitchLogReader (satcat5::io::Readable *src) | |
| Constructor for buffered mode. More... | |
| SwitchLogReader (satcat5::net::Dispatch *iface, satcat5::net::Type filter) | |
| Constructor for network mode. More... | |
| virtual void | log_event (const satcat5::eth::SwitchLogMessage &msg)=0 |
| The child class MUST override this method. More... | |
| void | data_rcvd (satcat5::io::Readable *src) override |
| The data_rcvd() callback is polled whenever data is available. More... | |
| void | data_unlink (satcat5::io::Readable *src) override |
| Unlink this EventListener from the designated source, because the designated Readable object is being destroyed. More... | |
| void | frame_rcvd (satcat5::io::LimitedRead &src) override |
| Dispatch calls frame_rcvd(...) for each incoming frame with with a matching net::Type value. More... | |
| void | timer_event () override |
| Child class MUST override this method. | |
| void | timer_once (unsigned msec) |
| Configure a one-time notification after X milliseconds. | |
| void | timer_every (unsigned msec) |
| Configure a repeating notification every X milliseconds. | |
| void | timer_stop () |
| Stop all future notifications. | |
| unsigned | timer_interval () const |
| Accessor for recurring timer interval, if one is set. | |
| unsigned | timer_remaining () const |
| Accessor for time to next event, if one is set. | |
Static Protected Member Functions | |
| static unsigned | count_timer () |
| Count all objects of this type, including idle timers. | |
Protected Attributes | |
| satcat5::io::Readable * | m_src |
| satcat5::net::Dispatch *const | m_iface |
| satcat5::net::Type | m_filter |
| Incoming packet filter. | |
Private Member Functions | |
| void | query (unsigned elapsed_msec) |
Private Attributes | |
| satcat5::net::Protocol * | m_next |
| Linked list of Protocols. | |
| unsigned | m_trem |
| unsigned | m_tnext |
|
explicitprotected |
Constructor for buffered mode.
Only children should create or destroy the base class.
Definition at line 244 of file eth_sw_log.cc.
|
protected |
Constructor for network mode.
Only children should create or destroy the base class.
Definition at line 252 of file eth_sw_log.cc.
|
overrideprotectedvirtual |
The data_rcvd() callback is polled whenever data is available.
A pointer is provided to assist handlers with multiple sources. Child objects of io::EventListener MUST override this method.
Implements satcat5::io::EventListener.
Definition at line 278 of file eth_sw_log.cc.
|
overrideprotectedvirtual |
Unlink this EventListener from the designated source, because the designated Readable object is being destroyed.
Child objects of io::EventListener MAY override this method if action is required.
Reimplemented from satcat5::io::EventListener.
Definition at line 286 of file eth_sw_log.cc.
|
overrideprotectedvirtual |
Dispatch calls frame_rcvd(...) for each incoming frame with with a matching net::Type value.
The child class SHOULD read the frame contents from the provided "src" object, which is only valid until the function returns.
To send a reply:
The child class MUST override this method.
Implements satcat5::net::Protocol.
Definition at line 288 of file eth_sw_log.cc.
|
protectedpure virtual |
The child class MUST override this method.
This callback is notified for each parsed log message.
Implemented in satcat5::eth::SwitchLogToPort, and satcat5::eth::SwitchLogFormatter.
| void SwitchLogReader::set_polling_interval | ( | unsigned | msec | ) |
Set polling interval, in milliseconds.
This method applies to buffered sources only. By default (interval = zero), log descriptors are read and processed immediately. To rate-limit outgoing messages, set the desired polling interval in milliseconds.
Definition at line 267 of file eth_sw_log.cc.