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 2F4781FF136 for ; Mon, 04 May 2026 13:41:22 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8AB7A1BE49; Mon, 4 May 2026 13:40:36 +0200 (CEST) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox-perl-rs v3 19/44] sdn: add prefix list / route maps to frr config generation helper Date: Mon, 4 May 2026 13:39:16 +0200 Message-ID: <20260504113943.159905-20-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260504113943.159905-1-s.hanreich@proxmox.com> References: <20260504113943.159905-1-s.hanreich@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1777894689306 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.686 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 Message-ID-Hash: LCNARGWQXMUTFJZCH6KE33AIPIR2GSFP X-Message-ID-Hash: LCNARGWQXMUTFJZCH6KE33AIPIR2GSFP X-MailFrom: s.hanreich@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: With the addition of prefix lists and route maps, the helper needs to be adapted so the FRR configuration for prefix lists and route maps gets generated as well. Prefix lists and route maps are generated before generating the fabric configuration, so it is possible for the fabric config generation logic to check for the existence of prefix lists and route maps. Signed-off-by: Stefan Hanreich --- pve-rs/src/bindings/sdn/mod.rs | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/pve-rs/src/bindings/sdn/mod.rs b/pve-rs/src/bindings/sdn/mod.rs index 9bddf1c..c6361c3 100644 --- a/pve-rs/src/bindings/sdn/mod.rs +++ b/pve-rs/src/bindings/sdn/mod.rs @@ -15,17 +15,39 @@ pub mod pve_rs_sdn { use proxmox_ve_config::sdn::fabric::section_config::node::NodeId; use crate::bindings::pve_rs_sdn_fabrics::PerlFabricConfig; + use crate::bindings::sdn::prefix_lists::pve_rs_sdn_prefix_lists::PerlPrefixListConfig; + use crate::bindings::sdn::route_maps::pve_rs_sdn_route_maps::PerlRouteMapConfig; /// Return the FRR configuration for the passed FrrConfig and the FabricsConfig as an array of /// strings, where each line represents a line in the FRR configuration. #[export] pub fn get_frr_raw_config( mut frr_config: FrrConfig, - #[try_from_ref] cfg: &PerlFabricConfig, + #[try_from_ref] prefix_list_config: &PerlPrefixListConfig, + #[try_from_ref] route_map_config: &PerlRouteMapConfig, + #[try_from_ref] fabric_config: &PerlFabricConfig, node_id: NodeId, ) -> Result, Error> { - let fabric_config = cfg.fabric_config.lock().unwrap().clone().into_valid()?; + let prefix_list_config = prefix_list_config.prefix_lists.lock().unwrap(); + proxmox_ve_config::sdn::prefix_list::frr::build_frr_prefix_lists( + prefix_list_config.values().cloned(), + &mut frr_config, + )?; + + let route_map_config = route_map_config.route_maps.lock().unwrap(); + proxmox_ve_config::sdn::route_map::frr::build_frr_route_maps( + route_map_config.values().cloned(), + &mut frr_config, + )?; + + let fabric_config = fabric_config + .fabric_config + .lock() + .unwrap() + .clone() + .into_valid()?; proxmox_ve_config::sdn::fabric::frr::build_fabric(node_id, fabric_config, &mut frr_config)?; + to_raw_config(&frr_config) } } -- 2.47.3