|
SatCat5
|
Ephemeral data structure provided to plugin callbacks.
New fields may be added to this structure in future versions.
Definition at line 48 of file eth_plugin.h.
#include <eth_plugin.h>
Public Member Functions | |
| constexpr | PluginPacket () |
| Default constructor only, with no copy-constructor. More... | |
| PluginPacket (const PluginPacket &t)=delete | |
| PluginPacket & | operator= (const PluginPacket &t)=delete |
| bool | read_from (satcat5::io::MultiPacket *packet) |
| Read metadata from a packet object. More... | |
| void | write_to (satcat5::io::Writeable *wr) const |
| Copy packet headers to the specified destination. More... | |
| void | adjust () |
| Notify parent that header contents have changed. More... | |
| void | divert () |
| Divert this frame for deferred processing. More... | |
| void | drop (u8 reason) |
| Drop this frame, indicating why. More... | |
| bool | is_adjusted () const |
| Accessors and shortcuts for packet metadata. More... | |
| bool | is_diverted () const |
| Accessors and shortcuts for packet metadata. More... | |
| bool | is_ip () const |
| Accessors and shortcuts for packet metadata. More... | |
| bool | is_arp () const |
| Accessors and shortcuts for packet metadata. More... | |
| bool | is_tcp () const |
| Accessors and shortcuts for packet metadata. More... | |
| bool | is_udp () const |
| Accessors and shortcuts for packet metadata. More... | |
| unsigned | length () const |
| Accessors and shortcuts for packet metadata. More... | |
| SATCAT5_PMASK_TYPE | src_mask () const |
| Accessors and shortcuts for packet metadata. More... | |
| unsigned | src_port () const |
| Accessors and shortcuts for packet metadata. More... | |
| satcat5::eth::VtagPolicy | port_vcfg () const |
| Accessors and shortcuts for packet metadata. More... | |
| u8 | reason () const |
| Accessors and shortcuts for packet metadata. More... | |
Public Attributes | |
| satcat5::io::MultiPacket * | pkt |
| Complete packet contents. | |
| satcat5::eth::Header | hdr |
| Copy of Ethernet header fields. More... | |
| SATCAT5_PMASK_TYPE | dst_mask |
| Destination mask for which port(s) receive this packet. More... | |
| u16 | hlen |
| Original header length. | |
| u16 | flags |
| Additional status flags indicating packet status. | |
| satcat5::eth::ArpHeader | arp |
| Copy of additional header fields, if present. More... | |
| satcat5::ip::Header | ip |
| Copy of additional header fields, if present. More... | |
| satcat5::tcp::Header | tcp |
| Copy of additional header fields, if present. More... | |
| satcat5::udp::Header | udp |
| Copy of additional header fields, if present. More... | |
Protected Member Functions | |
| bool | read_internal (satcat5::io::Readable *rd) |
| Internal use only. | |
Static Protected Attributes | |
| static const u16 | FLAG_DIVERT = (1u << 8) |
| Packet diverted from normal processing. More... | |
| static const u16 | FLAG_HEADER_CHANGE = (1u << 9) |
| Header contents changed. More... | |
|
inlineconstexpr |
Default constructor only, with no copy-constructor.
Use read_from to initialize this data structure.
Definition at line 85 of file eth_plugin.h.
|
inline |
Notify parent that header contents have changed.
Plugins that change frame-header parameters MUST call this method before returning from egress(), ingress(), or query(). When set, the SwitchCore rewrites buffer contents based on the new contents of hdr, ip, arp, tcp, and udp.
Definition at line 105 of file eth_plugin.h.
|
inline |
Divert this frame for deferred processing.
Setting this flag diverts this frame for exclusive use by the plugin itself, skipping any subsequent plugins and SwitchCore processing. In such cases, the plugin takes responsibility, and it MUST eventually call MultiBuffer::free_packet(). The plugin SHOULD NOT call free_packet() before returning.
Definition at line 114 of file eth_plugin.h.
|
inline |
Drop this frame, indicating why.
Definition at line 118 of file eth_plugin.h.
|
inline |
Accessors and shortcuts for packet metadata.
Some packet metadata fields are stored in "pkt->m_user[*]". These values are populated by SwitchPort::write_finalize().
Definition at line 125 of file eth_plugin.h.
|
inline |
Accessors and shortcuts for packet metadata.
Some packet metadata fields are stored in "pkt->m_user[*]". These values are populated by SwitchPort::write_finalize().
Definition at line 131 of file eth_plugin.h.
|
inline |
Accessors and shortcuts for packet metadata.
Some packet metadata fields are stored in "pkt->m_user[*]". These values are populated by SwitchPort::write_finalize().
Definition at line 127 of file eth_plugin.h.
|
inline |
Accessors and shortcuts for packet metadata.
Some packet metadata fields are stored in "pkt->m_user[*]". These values are populated by SwitchPort::write_finalize().
Definition at line 129 of file eth_plugin.h.
|
inline |
Accessors and shortcuts for packet metadata.
Some packet metadata fields are stored in "pkt->m_user[*]". These values are populated by SwitchPort::write_finalize().
Definition at line 133 of file eth_plugin.h.
|
inline |
Accessors and shortcuts for packet metadata.
Some packet metadata fields are stored in "pkt->m_user[*]". These values are populated by SwitchPort::write_finalize().
Definition at line 135 of file eth_plugin.h.
|
inline |
Accessors and shortcuts for packet metadata.
Some packet metadata fields are stored in "pkt->m_user[*]". These values are populated by SwitchPort::write_finalize().
Definition at line 137 of file eth_plugin.h.
|
inline |
Accessors and shortcuts for packet metadata.
Some packet metadata fields are stored in "pkt->m_user[*]". These values are populated by SwitchPort::write_finalize().
Definition at line 143 of file eth_plugin.h.
| bool PluginPacket::read_from | ( | satcat5::io::MultiPacket * | packet | ) |
|
inline |
Accessors and shortcuts for packet metadata.
Some packet metadata fields are stored in "pkt->m_user[*]". These values are populated by SwitchPort::write_finalize().
Definition at line 145 of file eth_plugin.h.
|
inline |
Accessors and shortcuts for packet metadata.
Some packet metadata fields are stored in "pkt->m_user[*]". These values are populated by SwitchPort::write_finalize().
Definition at line 139 of file eth_plugin.h.
|
inline |
Accessors and shortcuts for packet metadata.
Some packet metadata fields are stored in "pkt->m_user[*]". These values are populated by SwitchPort::write_finalize().
Definition at line 141 of file eth_plugin.h.
| void PluginPacket::write_to | ( | satcat5::io::Writeable * | wr | ) | const |
| satcat5::eth::ArpHeader satcat5::eth::PluginPacket::arp |
| SATCAT5_PMASK_TYPE satcat5::eth::PluginPacket::dst_mask |
Destination mask for which port(s) receive this packet.
The destination mask is sets one bit for each destination port eligible to receive a packet. It is initialized to all ones. Plugins may clear bits but should never set them, i.e., plugins should always bitwise-and (&=) with the previous mask value. Example: Return 0x14 = 2^4 + 2^2 = Send to ports #2 and #4. Example: Return 0xFFFF... = Send to all ports (broadcast). Example: Return 0 = Drop packet (no eligible ports).
Definition at line 75 of file eth_plugin.h.
|
staticprotected |
Packet diverted from normal processing.
Definition at line 151 of file eth_plugin.h.
|
staticprotected |
| satcat5::eth::Header satcat5::eth::PluginPacket::hdr |
Copy of Ethernet header fields.
The Ethernet header is present in all valid packets.
Definition at line 55 of file eth_plugin.h.
| satcat5::ip::Header satcat5::eth::PluginPacket::ip |
| satcat5::tcp::Header satcat5::eth::PluginPacket::tcp |
| satcat5::udp::Header satcat5::eth::PluginPacket::udp |