pub struct VlanManager { /* private fields */ }Expand description
Manages VLAN interfaces across all network devices.
Implementations§
Source§impl VlanManager
impl VlanManager
Sourcepub fn create_vlan(
&mut self,
parent: &str,
vid: u16,
mode: VlanMode,
) -> Result<(), VlanError>
pub fn create_vlan( &mut self, parent: &str, vid: u16, mode: VlanMode, ) -> Result<(), VlanError>
Create a VLAN interface on the given parent device.
Sourcepub fn delete_vlan(&mut self, parent: &str, vid: u16) -> Result<(), VlanError>
pub fn delete_vlan(&mut self, parent: &str, vid: u16) -> Result<(), VlanError>
Delete a VLAN interface.
Sourcepub fn list_vlans(&self) -> Vec<VlanInterface>
pub fn list_vlans(&self) -> Vec<VlanInterface>
List all configured VLAN interfaces.
Sourcepub fn process_ingress(
&self,
parent: &str,
frame: &[u8],
) -> Option<(u16, Vec<u8>)>
pub fn process_ingress( &self, parent: &str, frame: &[u8], ) -> Option<(u16, Vec<u8>)>
Process an incoming (ingress) frame on a parent device.
Returns Some((vid, untagged_frame)) if the frame should be accepted,
or None if it should be dropped.
Sourcepub fn process_egress(&self, parent: &str, vid: u16, frame: &[u8]) -> Vec<u8>
pub fn process_egress(&self, parent: &str, vid: u16, frame: &[u8]) -> Vec<u8>
Process an outgoing (egress) frame for a given VLAN on a parent device.
For access ports the frame is sent untagged (already stripped). For trunk ports the frame is sent with an 802.1Q tag.