From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id D28EE1FF391 for ; Thu, 27 Jun 2024 12:55:01 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5523913A9C; Thu, 27 Jun 2024 12:55:10 +0200 (CEST) Date: Thu, 27 Jun 2024 12:54:36 +0200 From: Gabriel Goller To: Proxmox VE development discussion Message-ID: <20240627105436.d4fvbme4wvoo5ic3@luna.proxmox.com> References: <20240626121550.292290-1-s.hanreich@proxmox.com> <20240626121550.292290-13-s.hanreich@proxmox.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240626121550.292290-13-s.hanreich@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL -0.057 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH proxmox-ve-rs 12/21] sdn: add config module X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" 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, >+} >+ >+/// 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. >+ ), >+ ( >+ "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