SatCat5
satcat5::eth::PluginPort Class Reference

Detailed Description

Ethernet port plugin API.

Port plugins are attached to an eth::SwitchPort object, and receive separate ingress and egress queries for each packet passing through a particular port. (In contrast with the eth::PluginCore API for affecting packets on all ports.) The child class must override ingress, egress, or both.

See also
eth_plugin.h, eth::SwitchPort, eth::PluginCore.

Definition at line 198 of file eth_plugin.h.

#include <eth_plugin.h>

Inheritance diagram for satcat5::eth::PluginPort:
[legend]
Collaboration diagram for satcat5::eth::PluginPort:
[legend]

Public Member Functions

virtual void ingress (PluginPacket &pkt)
 Packet-received callback. More...
 
virtual void egress (PluginPacket &pkt)
 Packet-transmit callback. More...
 

Protected Member Functions

 PluginPort (satcat5::eth::SwitchPort *port)
 Associate this plugin object with the designated port. More...
 

Protected Attributes

satcat5::eth::SwitchPort *const m_port
 Pointer to the associated SwitchPort object.
 

Private Attributes

satcat5::eth::PluginPortm_next
 

Constructor & Destructor Documentation

◆ PluginPort()

PluginPort::PluginPort ( satcat5::eth::SwitchPort port)
explicitprotected

Associate this plugin object with the designated port.

Automatically calls plugin_add() and plugin_remove().

Definition at line 62 of file eth_plugin.cc.

Member Function Documentation

◆ egress()

virtual void satcat5::eth::PluginPort::egress ( PluginPacket pkt)
inlinevirtual

Packet-transmit callback.

The egress method is called as each packet is queued for transmission by the eth::SwitchPort. Plugins that alter header fields MUST set FLAG_HEADER_CHANGE. Unlike other contexts, the egress callback may change header length. Override the default implementation to process this event.

Reimplemented in satcat5::router2::BasicNat, and satcat5::eth::SwitchVlanEgress.

Definition at line 215 of file eth_plugin.h.

◆ ingress()

virtual void satcat5::eth::PluginPort::ingress ( PluginPacket pkt)
inlinevirtual

Packet-received callback.

The ingress method is called as each packet enters the associated eth::SwitchPort, immediately before processing by eth::SwitchCore and calls to eth::PluginCore::query. Plugins that alter header fields MUST set FLAG_HEADER_CHANGE and MUST NOT make any change that affects header length. Override the default implementation to process this event.

Reimplemented in satcat5::router2::BasicNat.

Definition at line 207 of file eth_plugin.h.


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