src/config/network.rs: parse bridge-ports

This commit is contained in:
Dietmar Maurer
2020-04-23 09:24:17 +02:00
parent 02269f3dba
commit 1d9a68c2fc
4 changed files with 55 additions and 0 deletions

View File

@ -550,6 +550,10 @@ pub const NETWORK_INTERFACE_NAME_SCHEMA: Schema = StringSchema::new("Network int
.max_length(libc::IFNAMSIZ-1)
.schema();
pub const NETWORK_INTERFACE_LIST_SCHEMA: Schema = ArraySchema::new(
"Network interface list.", &NETWORK_INTERFACE_NAME_SCHEMA)
.schema();
#[api(
properties: {
name: {
@ -582,6 +586,10 @@ pub const NETWORK_INTERFACE_NAME_SCHEMA: Schema = StringSchema::new("Network int
type: String,
},
},
bridge_ports: {
schema: NETWORK_INTERFACE_LIST_SCHEMA,
optional: true,
},
}
)]
#[derive(Debug, Serialize, Deserialize)]
@ -620,6 +628,9 @@ pub struct Interface {
#[serde(skip_serializing_if="Option::is_none")]
/// Maximum Transmission Unit
pub mtu: Option<u64>,
#[serde(skip_serializing_if="Option::is_none")]
pub bridge_ports: Option<Vec<String>>,
}
// Regression tests