On 6/27/24 12:54, Gabriel Goller wrote: > On 26.06.2024 14:15, Stefan Hanreich wrote: >> diff --git a/proxmox-ve-config/src/sdn/config.rs >> b/proxmox-ve-config/src/sdn/config.rs >> new file mode 100644 >> index 0000000..8454adf >> --- /dev/null >> +++ b/proxmox-ve-config/src/sdn/config.rs >> @@ -0,0 +1,571 @@ >> [snip] >> +impl Display for DhcpType { >> + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { >> + f.write_str(match self { >> + DhcpType::Dnsmasq => "dnsmasq", >> + }) >> + } >> +} >> + >> +/// struct for deserializing a zone entry of the SDN running config > > I think we usually begin doc-strings with a capital letter :) > >> +#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Hash, PartialOrd, >> Ord)] >> +pub struct ZoneRunningConfig { >> + #[serde(rename = "type")] >> + ty: ZoneType, >> + dhcp: DhcpType, >> +} >> + >> +/// struct for deserializing the zones of the SDN running config >> +#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Default)] >> +pub struct ZonesRunningConfig { >> + ids: HashMap<ZoneName, ZoneRunningConfig>, >> +} >> + >> +/// represents the dhcp-range property string used in the SDN >> configuration >> +#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Hash, PartialOrd, >> Ord)] >> +pub struct DhcpRange { >> + #[serde(rename = "start-address")] >> + start: IpAddr, >> + #[serde(rename = "end-address")] >> + end: IpAddr, >> +} >> + >> +impl ApiType for DhcpRange { >> + const API_SCHEMA: proxmox_schema::Schema = ObjectSchema::new( >> + "DHCP range", >> + &[ >> + ( >> + "end-address", >> + false, >> + &StringSchema::new("start address of DHCP >> range").schema(), > > Shouldn't this be "end address..." or is this intended? > Same below.
Good catch, seems like i messed up when copy-pasting. >> + ), >> + ( >> + "start-address", >> + false, >> + &StringSchema::new("end address of DHCP >> range").schema(), >> + ), >> + ], >> + ) >> + .schema(); >> +} >> + > > > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel > > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel