From f2633b462f1c95a55a6c3dfb1be1bfba478523c5 Mon Sep 17 00:00:00 2001 From: Stefan Lendl Date: Thu, 4 Apr 2024 12:00:31 +0200 Subject: [PATCH] config: write vlan network interface * Add vlan_id and vlan_raw_device fields to the Interface api type * Write to the network config the vlan specific properties for vlan interface type * Add several tests to verify the functionally Signed-off-by: Stefan Lendl Tested-by: Lukas Wagner Reviewed-by: Lukas Wagner Tested-by: Folke Gleumes Signed-off-by: Thomas Lamprecht --- pbs-api-types/src/network.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pbs-api-types/src/network.rs b/pbs-api-types/src/network.rs index e3a5e481..fe083dc6 100644 --- a/pbs-api-types/src/network.rs +++ b/pbs-api-types/src/network.rs @@ -224,6 +224,15 @@ pub const NETWORK_INTERFACE_LIST_SCHEMA: Schema = schema: NETWORK_INTERFACE_ARRAY_SCHEMA, optional: true, }, + "vlan-id": { + description: "VLAN ID.", + type: u16, + optional: true, + }, + "vlan-raw-device": { + schema: NETWORK_INTERFACE_NAME_SCHEMA, + optional: true, + }, bond_mode: { type: LinuxBondMode, optional: true, @@ -287,6 +296,12 @@ pub struct Interface { /// Enable bridge vlan support. #[serde(skip_serializing_if = "Option::is_none")] pub bridge_vlan_aware: Option, + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "vlan-id")] + pub vlan_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "vlan-raw-device")] + pub vlan_raw_device: Option, #[serde(skip_serializing_if = "Option::is_none")] pub slaves: Option>, @@ -319,6 +334,8 @@ impl Interface { mtu: None, bridge_ports: None, bridge_vlan_aware: None, + vlan_id: None, + vlan_raw_device: None, slaves: None, bond_mode: None, bond_primary: None,