SatCat5
switch_cfg.h File Reference

Detailed Description

Configuration for a managed SatCat5 switch.

SatCat5 switches can operate autonomously. However, an optional management interface allows runtime changes to the configuration, such as prioritizing frames with certain EtherType(s) or marking specific ports as "promiscuous" so they can monitor global traffic.

Definition in file switch_cfg.h.

#include <satcat5/cfgbus_core.h>
#include <satcat5/ethernet.h>
Include dependency graph for switch_cfg.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  satcat5::eth::VtagPolicy
 Data structure for configuring VLAN tagging policy of each port. More...
 
struct  satcat5::eth::VlanRate
 Data structure for configuring VLAN rate-limiter parameters. More...
 
class  satcat5::eth::SwitchConfig
 Management functions for a SatCat5 Ethernet switch. More...
 

Functions

constexpr satcat5::eth::VtagPolicy satcat5::eth::VCFG_DEFAULT (0, VTAG_ADMIT_ALL, VTAG_DEFAULT)
 Default VLAN tagging policy.
 
constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_ZERO (VPOL_STRICT, 0, 0)
 Define some commonly-used rate-limiter configurations. More...
 
constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_8KBPS (VPOL_STRICT, 8000ull, 4096)
 Define some commonly-used rate-limiter configurations. More...
 
constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_16KBPS (VPOL_STRICT, 16000ull, 2048)
 Define some commonly-used rate-limiter configurations. More...
 
constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_32KBPS (VPOL_STRICT, 32000ull, 1024)
 Define some commonly-used rate-limiter configurations. More...
 
constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_64KBPS (VPOL_STRICT, 64000ull, 512)
 Define some commonly-used rate-limiter configurations. More...
 
constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_128KBPS (VPOL_STRICT, 128000ull, 256)
 Define some commonly-used rate-limiter configurations. More...
 
constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_256KBPS (VPOL_STRICT, 256000ull, 128)
 Define some commonly-used rate-limiter configurations. More...
 
constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_512KBPS (VPOL_STRICT, 512000ull, 64)
 Define some commonly-used rate-limiter configurations. More...
 
constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_1MBPS (VPOL_STRICT, 1000000ull, 32)
 Define some commonly-used rate-limiter configurations. More...
 
constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_2MBPS (VPOL_STRICT, 2000000ull, 16)
 Define some commonly-used rate-limiter configurations. More...
 
constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_4MBPS (VPOL_STRICT, 4000000ull, 8)
 Define some commonly-used rate-limiter configurations. More...
 
constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_8MBPS (VPOL_STRICT, 8000000ull, 4)
 Define some commonly-used rate-limiter configurations. More...
 
constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_10MBPS (VPOL_STRICT, 10000000ull, 3)
 Define some commonly-used rate-limiter configurations. More...
 
constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_16MBPS (VPOL_STRICT, 16000000ull, 2)
 Define some commonly-used rate-limiter configurations. More...
 
constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_100MBPS (VPOL_STRICT, 100000000ull)
 Define some commonly-used rate-limiter configurations. More...
 
constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_1GBPS (VPOL_STRICT, 1000000000ull)
 Define some commonly-used rate-limiter configurations. More...
 
constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_10GBPS (VPOL_STRICT, 10000000000ull)
 Define some commonly-used rate-limiter configurations. More...
 
constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_UNLIMITED (VPOL_UNLIMITED, 0, 0)
 Define some commonly-used rate-limiter configurations. More...
 

Variables

constexpr u32 satcat5::eth::VRATE_SCALE_1X = 0x00000000u
 
constexpr u32 satcat5::eth::VRATE_SCALE_256X = 0x08000000u
 
constexpr u64 satcat5::eth::VRATE_THRESHOLD = 100000000
 
constexpr u32 satcat5::eth::VTAG_ADMIT_ALL = 0x00000000u
 Define VLAN policy modes for a given switch port. More...
 
constexpr u32 satcat5::eth::VTAG_RESTRICT = 0x00010000u
 Define VLAN policy modes for a given switch port. More...
 
constexpr u32 satcat5::eth::VTAG_PRIORITY = 0x00110000u
 Define VLAN policy modes for a given switch port. More...
 
constexpr u32 satcat5::eth::VTAG_MANDATORY = 0x00220000u
 Define VLAN policy modes for a given switch port. More...
 
constexpr u32 satcat5::eth::VPOL_UNLIMITED = 0x80000000u
 Define VLAN rate-limiter modes for each VID. More...
 
constexpr u32 satcat5::eth::VPOL_DEMOTE = 0x90000000u
 Define VLAN rate-limiter modes for each VID. More...
 
constexpr u32 satcat5::eth::VPOL_STRICT = 0xA0000000u
 Define VLAN rate-limiter modes for each VID. More...
 
constexpr u32 satcat5::eth::VPOL_AUTO = 0xB0000000u
 Define VLAN rate-limiter modes for each VID. More...
 
constexpr u32 satcat5::eth::VLAN_CONNECT_ALL = (u32)(-1)
 Common port-connection masks. More...
 
constexpr u32 satcat5::eth::VLAN_CONNECT_NONE = 0
 Common port-connection masks. More...
 

Function Documentation

◆ VRATE_100MBPS()

constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_100MBPS ( VPOL_STRICT  ,
100000000ull   
)

Define some commonly-used rate-limiter configurations.

Note: For moderate rates, it is safe to increase "burst_msec" without requiring large buffers. Default target is ~4 kiB.

◆ VRATE_10GBPS()

constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_10GBPS ( VPOL_STRICT  ,
10000000000ull   
)

Define some commonly-used rate-limiter configurations.

Note: For moderate rates, it is safe to increase "burst_msec" without requiring large buffers. Default target is ~4 kiB.

◆ VRATE_10MBPS()

constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_10MBPS ( VPOL_STRICT  ,
10000000ull  ,
 
)

Define some commonly-used rate-limiter configurations.

Note: For moderate rates, it is safe to increase "burst_msec" without requiring large buffers. Default target is ~4 kiB.

◆ VRATE_128KBPS()

constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_128KBPS ( VPOL_STRICT  ,
128000ull  ,
256   
)

Define some commonly-used rate-limiter configurations.

Note: For moderate rates, it is safe to increase "burst_msec" without requiring large buffers. Default target is ~4 kiB.

◆ VRATE_16KBPS()

constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_16KBPS ( VPOL_STRICT  ,
16000ull  ,
2048   
)

Define some commonly-used rate-limiter configurations.

Note: For moderate rates, it is safe to increase "burst_msec" without requiring large buffers. Default target is ~4 kiB.

◆ VRATE_16MBPS()

constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_16MBPS ( VPOL_STRICT  ,
16000000ull  ,
 
)

Define some commonly-used rate-limiter configurations.

Note: For moderate rates, it is safe to increase "burst_msec" without requiring large buffers. Default target is ~4 kiB.

◆ VRATE_1GBPS()

constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_1GBPS ( VPOL_STRICT  ,
1000000000ull   
)

Define some commonly-used rate-limiter configurations.

Note: For moderate rates, it is safe to increase "burst_msec" without requiring large buffers. Default target is ~4 kiB.

◆ VRATE_1MBPS()

constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_1MBPS ( VPOL_STRICT  ,
1000000ull  ,
32   
)

Define some commonly-used rate-limiter configurations.

Note: For moderate rates, it is safe to increase "burst_msec" without requiring large buffers. Default target is ~4 kiB.

◆ VRATE_256KBPS()

constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_256KBPS ( VPOL_STRICT  ,
256000ull  ,
128   
)

Define some commonly-used rate-limiter configurations.

Note: For moderate rates, it is safe to increase "burst_msec" without requiring large buffers. Default target is ~4 kiB.

◆ VRATE_2MBPS()

constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_2MBPS ( VPOL_STRICT  ,
2000000ull  ,
16   
)

Define some commonly-used rate-limiter configurations.

Note: For moderate rates, it is safe to increase "burst_msec" without requiring large buffers. Default target is ~4 kiB.

◆ VRATE_32KBPS()

constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_32KBPS ( VPOL_STRICT  ,
32000ull  ,
1024   
)

Define some commonly-used rate-limiter configurations.

Note: For moderate rates, it is safe to increase "burst_msec" without requiring large buffers. Default target is ~4 kiB.

◆ VRATE_4MBPS()

constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_4MBPS ( VPOL_STRICT  ,
4000000ull  ,
 
)

Define some commonly-used rate-limiter configurations.

Note: For moderate rates, it is safe to increase "burst_msec" without requiring large buffers. Default target is ~4 kiB.

◆ VRATE_512KBPS()

constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_512KBPS ( VPOL_STRICT  ,
512000ull  ,
64   
)

Define some commonly-used rate-limiter configurations.

Note: For moderate rates, it is safe to increase "burst_msec" without requiring large buffers. Default target is ~4 kiB.

◆ VRATE_64KBPS()

constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_64KBPS ( VPOL_STRICT  ,
64000ull  ,
512   
)

Define some commonly-used rate-limiter configurations.

Note: For moderate rates, it is safe to increase "burst_msec" without requiring large buffers. Default target is ~4 kiB.

◆ VRATE_8KBPS()

constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_8KBPS ( VPOL_STRICT  ,
8000ull  ,
4096   
)

Define some commonly-used rate-limiter configurations.

Note: For moderate rates, it is safe to increase "burst_msec" without requiring large buffers. Default target is ~4 kiB.

◆ VRATE_8MBPS()

constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_8MBPS ( VPOL_STRICT  ,
8000000ull  ,
 
)

Define some commonly-used rate-limiter configurations.

Note: For moderate rates, it is safe to increase "burst_msec" without requiring large buffers. Default target is ~4 kiB.

◆ VRATE_UNLIMITED()

constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_UNLIMITED ( VPOL_UNLIMITED  ,
,
 
)

Define some commonly-used rate-limiter configurations.

Note: For moderate rates, it is safe to increase "burst_msec" without requiring large buffers. Default target is ~4 kiB.

◆ VRATE_ZERO()

constexpr satcat5::eth::VlanRate satcat5::eth::VRATE_ZERO ( VPOL_STRICT  ,
,
 
)
constexpr

Define some commonly-used rate-limiter configurations.

Note: For moderate rates, it is safe to increase "burst_msec" without requiring large buffers. Default target is ~4 kiB.

Variable Documentation

◆ VLAN_CONNECT_ALL

constexpr u32 satcat5::eth::VLAN_CONNECT_ALL = (u32)(-1)
constexpr

Common port-connection masks.

See also
SwitchConfig::vlan_set_mask.

Definition at line 63 of file switch_cfg.h.

◆ VLAN_CONNECT_NONE

constexpr u32 satcat5::eth::VLAN_CONNECT_NONE = 0
constexpr

Common port-connection masks.

See also
SwitchConfig::vlan_set_mask.

Definition at line 64 of file switch_cfg.h.

◆ VPOL_AUTO

constexpr u32 satcat5::eth::VPOL_AUTO = 0xB0000000u
constexpr

Define VLAN rate-limiter modes for each VID.

UNLIMITED: Default, rate-limits are ignored. DEMOTE: Excess packets are low-priority. STRICT: Excess packets are dropped immediately. AUTO: Excess packet policy set by DEI flag. If the VLAN header sets the "drop eligible indicator" (DEI) flag, use the STRICT policy, otherwise use the DEMOTE policy.

Definition at line 52 of file switch_cfg.h.

◆ VPOL_DEMOTE

constexpr u32 satcat5::eth::VPOL_DEMOTE = 0x90000000u
constexpr

Define VLAN rate-limiter modes for each VID.

UNLIMITED: Default, rate-limits are ignored. DEMOTE: Excess packets are low-priority. STRICT: Excess packets are dropped immediately. AUTO: Excess packet policy set by DEI flag. If the VLAN header sets the "drop eligible indicator" (DEI) flag, use the STRICT policy, otherwise use the DEMOTE policy.

Definition at line 50 of file switch_cfg.h.

◆ VPOL_STRICT

constexpr u32 satcat5::eth::VPOL_STRICT = 0xA0000000u
constexpr

Define VLAN rate-limiter modes for each VID.

UNLIMITED: Default, rate-limits are ignored. DEMOTE: Excess packets are low-priority. STRICT: Excess packets are dropped immediately. AUTO: Excess packet policy set by DEI flag. If the VLAN header sets the "drop eligible indicator" (DEI) flag, use the STRICT policy, otherwise use the DEMOTE policy.

Definition at line 51 of file switch_cfg.h.

◆ VPOL_UNLIMITED

constexpr u32 satcat5::eth::VPOL_UNLIMITED = 0x80000000u
constexpr

Define VLAN rate-limiter modes for each VID.

UNLIMITED: Default, rate-limits are ignored. DEMOTE: Excess packets are low-priority. STRICT: Excess packets are dropped immediately. AUTO: Excess packet policy set by DEI flag. If the VLAN header sets the "drop eligible indicator" (DEI) flag, use the STRICT policy, otherwise use the DEMOTE policy.

Definition at line 49 of file switch_cfg.h.

◆ VTAG_ADMIT_ALL

constexpr u32 satcat5::eth::VTAG_ADMIT_ALL = 0x00000000u
constexpr

Define VLAN policy modes for a given switch port.

ADMIT_ALL: Default, suitable for most network endpoints. Rx: Accept any frame, tagged or untagged. Tx: Never emit tagged frames. RESTRICTED: Suitable for locking devices to a single VID. Rx: Accept tagged frames with VID = 0, or untagged frames. Tx: Never emit tagged frames. PRIORITY: Suitable for VLAN-aware devices with a single VID. Rx: Accept tagged frames with VID = 0, or untagged frames. Tx: Always emit tagged frames with VID = 0. MANDATORY: Recommended for crosslinks to another VLAN-aware switch. Rx: Accept only tagged frames with VID > 0. Tx: Always emit tagged frames with VID > 0.

Definition at line 35 of file switch_cfg.h.

◆ VTAG_MANDATORY

constexpr u32 satcat5::eth::VTAG_MANDATORY = 0x00220000u
constexpr

Define VLAN policy modes for a given switch port.

ADMIT_ALL: Default, suitable for most network endpoints. Rx: Accept any frame, tagged or untagged. Tx: Never emit tagged frames. RESTRICTED: Suitable for locking devices to a single VID. Rx: Accept tagged frames with VID = 0, or untagged frames. Tx: Never emit tagged frames. PRIORITY: Suitable for VLAN-aware devices with a single VID. Rx: Accept tagged frames with VID = 0, or untagged frames. Tx: Always emit tagged frames with VID = 0. MANDATORY: Recommended for crosslinks to another VLAN-aware switch. Rx: Accept only tagged frames with VID > 0. Tx: Always emit tagged frames with VID > 0.

Definition at line 38 of file switch_cfg.h.

◆ VTAG_PRIORITY

constexpr u32 satcat5::eth::VTAG_PRIORITY = 0x00110000u
constexpr

Define VLAN policy modes for a given switch port.

ADMIT_ALL: Default, suitable for most network endpoints. Rx: Accept any frame, tagged or untagged. Tx: Never emit tagged frames. RESTRICTED: Suitable for locking devices to a single VID. Rx: Accept tagged frames with VID = 0, or untagged frames. Tx: Never emit tagged frames. PRIORITY: Suitable for VLAN-aware devices with a single VID. Rx: Accept tagged frames with VID = 0, or untagged frames. Tx: Always emit tagged frames with VID = 0. MANDATORY: Recommended for crosslinks to another VLAN-aware switch. Rx: Accept only tagged frames with VID > 0. Tx: Always emit tagged frames with VID > 0.

Definition at line 37 of file switch_cfg.h.

◆ VTAG_RESTRICT

constexpr u32 satcat5::eth::VTAG_RESTRICT = 0x00010000u
constexpr

Define VLAN policy modes for a given switch port.

ADMIT_ALL: Default, suitable for most network endpoints. Rx: Accept any frame, tagged or untagged. Tx: Never emit tagged frames. RESTRICTED: Suitable for locking devices to a single VID. Rx: Accept tagged frames with VID = 0, or untagged frames. Tx: Never emit tagged frames. PRIORITY: Suitable for VLAN-aware devices with a single VID. Rx: Accept tagged frames with VID = 0, or untagged frames. Tx: Always emit tagged frames with VID = 0. MANDATORY: Recommended for crosslinks to another VLAN-aware switch. Rx: Accept only tagged frames with VID > 0. Tx: Always emit tagged frames with VID > 0.

Definition at line 36 of file switch_cfg.h.