SatCat5
eth_header.h File Reference

Detailed Description

Type definitions for Ethernet frames and protocol handlers.

This file defines various data structures relating to Ethernet frames and their headers, including the MAC address and EtherType fields.

Note: Due to byte-alignment and byte-ordering issues, direct use of write_bytes and read_bytes on header data structures is not recommended. Please use the provided write and read methods.

Definition in file eth_header.h.

#include <satcat5/io_core.h>
#include <satcat5/types.h>
Include dependency graph for eth_header.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  satcat5::eth::MacAddr
 An Ethernet MAC address (with serializable interface). More...
 
struct  satcat5::eth::MacType
 EtherType field (uint16) is used a protocol-ID [1536..65535]. More...
 
struct  satcat5::eth::VlanTag
 Header contents for an 802.1Q Virtual-LAN tag. More...
 
struct  satcat5::eth::Header
 An Ethernet frame header. More...
 

Macros

#define SATCAT5_VLAN_ENABLE   1
 

Variables

constexpr satcat5::eth::MacAddr satcat5::eth::MACADDR_NONE
 
constexpr satcat5::eth::MacAddr satcat5::eth::MACADDR_BROADCAST
 
constexpr satcat5::eth::MacAddr satcat5::eth::MACADDR_FLOWCTRL
 
constexpr satcat5::eth::MacAddr satcat5::eth::BASEADDR_LINKLOCAL
 
constexpr satcat5::eth::MacAddr satcat5::eth::BASEADDR_L2MULTICAST
 
constexpr satcat5::eth::MacAddr satcat5::eth::BASEADDR_L3MULTICAST
 
constexpr satcat5::eth::MacType satcat5::eth::ETYPE_NONE = {0x0000}
 
constexpr satcat5::eth::MacType satcat5::eth::ETYPE_IPV4 = {0x0800}
 
constexpr satcat5::eth::MacType satcat5::eth::ETYPE_ARP = {0x0806}
 
constexpr satcat5::eth::MacType satcat5::eth::ETYPE_RECOVERY = {0x5252}
 
constexpr satcat5::eth::MacType satcat5::eth::ETYPE_CFGBUS_CMD = {0x5C01}
 
constexpr satcat5::eth::MacType satcat5::eth::ETYPE_CFGBUS_ACK = {0x5C02}
 
constexpr satcat5::eth::MacType satcat5::eth::ETYPE_SLINGSHOT_LOG = {0x5C03}
 
constexpr satcat5::eth::MacType satcat5::eth::ETYPE_CBOR_TLM = {0x5C04}
 
constexpr satcat5::eth::MacType satcat5::eth::ETYPE_SWITCH_LOG = {0x5C05}
 
constexpr satcat5::eth::MacType satcat5::eth::ETYPE_VTAG = {0x8100}
 
constexpr satcat5::eth::MacType satcat5::eth::ETYPE_FLOWCTRL = {0x8808}
 
constexpr satcat5::eth::MacType satcat5::eth::ETYPE_MACSEC = {0x88E5}
 
constexpr satcat5::eth::MacType satcat5::eth::ETYPE_PTP = {0x88F7}
 
constexpr satcat5::eth::VlanTag satcat5::eth::VTAG_NONE = {0x0000}
 
constexpr satcat5::eth::VlanTag satcat5::eth::VTAG_DEFAULT = {0x0001}
 
constexpr satcat5::eth::VlanTag satcat5::eth::VTAG_PRIORITY1 = {0x2000}
 
constexpr satcat5::eth::VlanTag satcat5::eth::VTAG_PRIORITY2 = {0x4000}
 
constexpr satcat5::eth::VlanTag satcat5::eth::VTAG_PRIORITY3 = {0x6000}
 
constexpr satcat5::eth::VlanTag satcat5::eth::VTAG_PRIORITY4 = {0x8000}
 
constexpr satcat5::eth::VlanTag satcat5::eth::VTAG_PRIORITY5 = {0xA000}
 
constexpr satcat5::eth::VlanTag satcat5::eth::VTAG_PRIORITY6 = {0xC000}
 
constexpr satcat5::eth::VlanTag satcat5::eth::VTAG_PRIORITY7 = {0xE000}
 
constexpr u16 satcat5::eth::VID_NONE = 0
 
constexpr u16 satcat5::eth::VID_MIN = 1
 
constexpr u16 satcat5::eth::VID_MAX = 4094
 
constexpr u16 satcat5::eth::VID_RSVD = 4095
 
constexpr satcat5::eth::Header satcat5::eth::HEADER_NULL
 

Variable Documentation

◆ BASEADDR_L2MULTICAST

constexpr satcat5::eth::MacAddr satcat5::eth::BASEADDR_L2MULTICAST
constexpr
Initial value:
=
{{0x01, 0x80, 0xC2, 0x00, 0x01, 0x00}}

Definition at line 200 of file eth_header.h.

◆ BASEADDR_L3MULTICAST

constexpr satcat5::eth::MacAddr satcat5::eth::BASEADDR_L3MULTICAST
constexpr
Initial value:
=
{{0x01, 0x00, 0x5E, 0x00, 0x00, 0x00}}

Definition at line 202 of file eth_header.h.

◆ BASEADDR_LINKLOCAL

constexpr satcat5::eth::MacAddr satcat5::eth::BASEADDR_LINKLOCAL
constexpr
Initial value:
=
{{0x01, 0x80, 0xC2, 0x00, 0x00, 0x00}}

Definition at line 198 of file eth_header.h.

◆ HEADER_NULL

constexpr satcat5::eth::Header satcat5::eth::HEADER_NULL
constexpr
Initial value:
=
{MACADDR_NONE, MACADDR_NONE, ETYPE_NONE, VTAG_NONE}

Definition at line 238 of file eth_header.h.

◆ MACADDR_BROADCAST

constexpr satcat5::eth::MacAddr satcat5::eth::MACADDR_BROADCAST
constexpr
Initial value:
=
{{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}}

Definition at line 194 of file eth_header.h.

◆ MACADDR_FLOWCTRL

constexpr satcat5::eth::MacAddr satcat5::eth::MACADDR_FLOWCTRL
constexpr
Initial value:
=
{{0x01, 0x80, 0xC2, 0x00, 0x00, 0x01}}

Definition at line 196 of file eth_header.h.

◆ MACADDR_NONE

constexpr satcat5::eth::MacAddr satcat5::eth::MACADDR_NONE
constexpr
Initial value:
=
{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}

Definition at line 192 of file eth_header.h.