method_v4,
/// Delete the whole IPv6 configuration entry.
method_v6,
+ /// Delete IPv4 comments
+ comments_v4,
+ /// Delete IPv6 comments
+ comments_v6,
/// Delete mtu.
mtu,
/// Delete auto flag
type: NetworkConfigMethod,
optional: true,
},
+ comments_v4: {
+ description: "Comments (inet)",
+ type: String,
+ optional: true,
+ },
+ comments_v6: {
+ description: "Comments (inet6)",
+ type: String,
+ optional: true,
+ },
address: {
schema: CIDR_SCHEMA,
optional: true,
auto: Option<bool>,
method_v4: Option<NetworkConfigMethod>,
method_v6: Option<NetworkConfigMethod>,
+ comments_v4: Option<String>,
+ comments_v6: Option<String>,
address: Option<String>,
gateway: Option<String>,
mtu: Option<u64>,
DeletableProperty::gateway_v6 => { interface.gateway_v6 = None; },
DeletableProperty::method_v4 => { interface.method_v4 = None; },
DeletableProperty::method_v6 => { interface.method_v6 = None; },
+ DeletableProperty::comments_v4 => { interface.comments_v4 = Vec::new(); },
+ DeletableProperty::comments_v6 => { interface.comments_v6 = Vec::new(); },
DeletableProperty::mtu => { interface.mtu = None; },
DeletableProperty::auto => { interface.auto = false; },
DeletableProperty::bridge_ports => { interface.set_bridge_ports(Vec::new())?; }
}
}
+ if let Some(comments) = comments_v4 {
+ interface.comments_v4 = comments.lines().map(String::from).collect();
+ }
+
+ if let Some(comments) = comments_v6 {
+ interface.comments_v6 = comments.lines().map(String::from).collect();
+ }
+
network::save_config(&config)?;
Ok(())