SatCat5
satcat5::eth::SwitchVlanInner Class Reference

Detailed Description

Switch plugin for Virtual-LAN connectivity and rate-limiting rules.

See also
eth_sw_vlan.h

Configuration methods mimic the eth::SwitchConfig API. (See also: SwitchVlan template, defined below.)

Definition at line 41 of file eth_sw_vlan.h.

#include <eth_sw_vlan.h>

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

Classes

struct  VlanPolicy
 

Public Member Functions

void query (PluginPacket &pkt) override
 Packet-received callback. More...
 
void vlan_reset (bool lockdown=false)
 Revert to default VLAN settings for all ports and VIDs. More...
 
SATCAT5_PMASK_TYPE vlan_get_mask (u16 vid)
 Get allowed-connectivity port-mask for designated VID.
 
void vlan_set_mask (u16 vid, SATCAT5_PMASK_TYPE mask)
 Limit the specified VID to the designated port(s).
 
VtagPolicy vlan_get_port (unsigned port) const
 Query a port's tag policy and other VLAN settings.
 
void vlan_set_port (const VtagPolicy &cfg)
 Set a port's tag policy and other VLAN settings.
 
void vlan_join (u16 vid, unsigned port)
 Port should join VLAN, updating vlan_get_mask.
 
void vlan_leave (u16 vid, unsigned port)
 Port should leave VLAN, updating vlan_get_mask.
 
void vlan_set_rate (u16 vid, const satcat5::eth::VlanRate &cfg)
 Set rate-limiting options for the designated VID.
 
void timer_once (unsigned msec)
 Configure a one-time notification after X milliseconds.
 
void timer_every (unsigned msec)
 Configure a repeating notification every X milliseconds.
 
void timer_stop ()
 Stop all future notifications.
 
unsigned timer_interval () const
 Accessor for recurring timer interval, if one is set.
 
unsigned timer_remaining () const
 Accessor for time to next event, if one is set.
 

Static Public Member Functions

static unsigned count_timer ()
 Count all objects of this type, including idle timers.
 

Protected Member Functions

 SwitchVlanInner (satcat5::eth::SwitchCore *sw, VlanPolicy *vptr, unsigned vmax, bool lockdown)
 
void timer_event () override
 Child class MUST override this method.
 

Protected Attributes

VlanPolicy *const m_policy
 
const unsigned m_vmax
 
satcat5::eth::SwitchCore *const m_switch
 Pointer to the associated SwitchCore object.
 

Private Attributes

satcat5::eth::PluginCorem_next
 
unsigned m_trem
 
unsigned m_tnext
 

Member Function Documentation

◆ query()

void SwitchVlanInner::query ( PluginPacket pkt)
overridevirtual

Packet-received callback.

The query method is called for each incoming packet, passing a PluginPacket object that plugins can read or modify in-place. Plugins that alter header fields MUST set FLAG_HEADER_CHANGE and MUST NOT make any change that affects header length. The child class MUST override this method.

Implements satcat5::eth::PluginCore.

Definition at line 65 of file eth_sw_vlan.cc.

◆ vlan_reset()

void SwitchVlanInner::vlan_reset ( bool  lockdown = false)

Revert to default VLAN settings for all ports and VIDs.

The "lockdown" setting controls whether rules default to permissive (i.e., allow by default with a short blocklist) or lockdown (the opposite).

Definition at line 120 of file eth_sw_vlan.cc.


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