37 #include <satcat5/ip_core.h>
41 #include <satcat5/udp_core.h>
130 {
return hdr.
type == satcat5::eth::ETYPE_IPV4; }
132 {
return hdr.
type == satcat5::eth::ETYPE_ARP; }
134 {
return is_ip() &&
ip.
proto() == satcat5::ip::PROTO_TCP; }
136 {
return is_ip() &&
ip.
proto() == satcat5::ip::PROTO_UDP; }
146 {
return u8(
flags & 0xFF); }
187 friend satcat5::util::ListCore;
228 friend satcat5::util::ListCore;
Ethernet switch plugin API.
PluginCore(satcat5::eth::SwitchCore *sw)
Associate this plugin object with the designated switch.
virtual void query(PluginPacket &pkt)=0
Packet-received callback.
satcat5::eth::SwitchCore *const m_switch
Pointer to the associated SwitchCore object.
Ethernet port plugin API.
virtual void egress(PluginPacket &pkt)
Packet-transmit callback.
virtual void ingress(PluginPacket &pkt)
Packet-received callback.
A shared-memory Ethernet switch based on the MultiBuffer class.
Generic packetized I/O interface for use with SwitchCore.
Abstract API for reading byte-streams and packets.
Abstract API for writing byte-streams and packets.
Protocol handler for the Address Resolution Protocol (ARP)
Software-defined Ethernet switch.
#define SATCAT5_PMASK_TYPE
Set the integer type used to identify source and destination ports.
constexpr SATCAT5_PMASK_TYPE idx2mask(unsigned idx)
Macro converting port-index to a bit-mask.
Templated functions for manipulating singly-linked lists.
Ephemeral data structure provided to plugin callbacks.
satcat5::io::MultiPacket * pkt
Complete packet contents.
bool is_udp() const
Accessors and shortcuts for packet metadata.
satcat5::ip::Header ip
Copy of additional header fields, if present.
bool is_ip() const
Accessors and shortcuts for packet metadata.
void drop(u8 reason)
Drop this frame, indicating why.
u8 reason() const
Accessors and shortcuts for packet metadata.
satcat5::tcp::Header tcp
Copy of additional header fields, if present.
constexpr PluginPacket()
Default constructor only, with no copy-constructor.
unsigned src_port() const
Accessors and shortcuts for packet metadata.
u16 hlen
Original header length.
static const u16 FLAG_DIVERT
Packet diverted from normal processing.
bool is_arp() const
Accessors and shortcuts for packet metadata.
u16 flags
Additional status flags indicating packet status.
bool is_adjusted() const
Accessors and shortcuts for packet metadata.
unsigned length() const
Accessors and shortcuts for packet metadata.
bool read_internal(satcat5::io::Readable *rd)
Internal use only.
SATCAT5_PMASK_TYPE dst_mask
Destination mask for which port(s) receive this packet.
bool is_diverted() const
Accessors and shortcuts for packet metadata.
SATCAT5_PMASK_TYPE src_mask() const
Accessors and shortcuts for packet metadata.
satcat5::eth::VtagPolicy port_vcfg() const
Accessors and shortcuts for packet metadata.
satcat5::eth::ArpHeader arp
Copy of additional header fields, if present.
void divert()
Divert this frame for deferred processing.
satcat5::eth::Header hdr
Copy of Ethernet header fields.
bool is_tcp() const
Accessors and shortcuts for packet metadata.
void write_to(satcat5::io::Writeable *wr) const
Copy packet headers to the specified destination.
bool read_from(satcat5::io::MultiPacket *packet)
Read metadata from a packet object.
static const u16 FLAG_HEADER_CHANGE
Header contents changed.
void adjust()
Notify parent that header contents have changed.
satcat5::udp::Header udp
Copy of additional header fields, if present.
Data structure for configuring VLAN tagging policy of each port.
A packet is a linked-list of memory blocks, plus metadata.
unsigned m_length
Packet length in bytes.
u32 m_user[SATCAT5_MBUFF_USER]
Packet metadata.
Type definitions for manipulating TCP segments.
Basic type aliases and prototypes used throughout SatCat5.