SatCat5
satcat5::test::LogProtocol Class Reference

Detailed Description

Log any received Ethernet traffic of the designated type.

Definition at line 225 of file sim_utils.h.

#include <sim_utils.h>

Inheritance diagram for satcat5::test::LogProtocol:
[legend]
Collaboration diagram for satcat5::test::LogProtocol:
[legend]

Public Member Functions

 LogProtocol (satcat5::eth::Dispatch *dispatch, const satcat5::eth::MacType &ethertype)
 Attach this object to an Ethernet interface and set filter.
 
void frame_rcvd (satcat5::io::LimitedRead &src) override
 Dispatch calls frame_rcvd(...) for each incoming frame with with a matching net::Type value. More...
 

Protected Attributes

satcat5::eth::Dispatch *const m_iface
 Parent interface (e.g., for address and I/O)
 
const satcat5::eth::MacType m_etype
 
satcat5::net::Type m_filter
 Incoming packet filter.
 

Private Attributes

satcat5::net::Protocolm_next
 Linked list of Protocols.
 

Member Function Documentation

◆ frame_rcvd()

void LogProtocol::frame_rcvd ( satcat5::io::LimitedRead src)
overridevirtual

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:

  • Call m_iface->open_reply() to obtain a Writable object. (This also writes out any applicable frame headers.)
  • Write frame contents, then call write_finalize().

The child class MUST override this method.

Implements satcat5::net::Protocol.

Definition at line 247 of file sim_utils.cc.


The documentation for this class was generated from the following files: