From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 4E0A31FF0BC for ; Mon, 16 Nov 2026 17:13:31 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 60A852175F; Mon, 16 Nov 2026 17:12:38 +0100 (CET) From: Gabriel Goller To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox-perl-rs v3 13/32] sdn: expose static routes for simple zone uplinks Date: Mon, 16 Nov 2026 17:11:33 +0100 Message-ID: <20261116161154.343743-14-g.goller@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261116161154.343743-1-g.goller@proxmox.com> References: <20261116161154.343743-1-g.goller@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794845520588 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.215 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust 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: 5I7M5OWWGAB2VPSZHV6T2BMVM4JZHHJY X-Message-ID-Hash: 5I7M5OWWGAB2VPSZHV6T2BMVM4JZHHJY X-MailFrom: g.goller@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: Allow zone configuration to provide static routes for simple zone VRFs, so upstream connectivity does not require node-local FRR overrides. Signed-off-by: Gabriel Goller --- pve-rs/src/bindings/sdn/mod.rs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/pve-rs/src/bindings/sdn/mod.rs b/pve-rs/src/bindings/sdn/mod.rs index dcae046a7e46..5231e05e3c2e 100644 --- a/pve-rs/src/bindings/sdn/mod.rs +++ b/pve-rs/src/bindings/sdn/mod.rs @@ -10,15 +10,32 @@ pub mod pve_rs_sdn { //! This provides general methods for generating the frr config. use anyhow::Error; - use proxmox_frr::ser::{FrrConfig, serializer::to_raw_config}; + use proxmox_frr::ser::{FrrConfig, IpRoute, serializer::to_raw_config}; + use proxmox_schema::property_string::PropertyString; use proxmox_ve_config::common::valid::Validatable; use proxmox_ve_config::sdn::fabric::section_config::node::NodeId; + use proxmox_ve_config::sdn::static_route::{StaticRoute, ZoneRoutesConfig}; 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; + /// Validate a route property string before storing it in zones.cfg. + #[export] + pub fn validate_static_route(route: &str) -> Result<(), Error> { + route.parse::>()?.validate() + } + + /// Return static routes for Simple/EVPN zones participating on this node. + #[export] + pub fn get_zone_routes( + zones: ZoneRoutesConfig, + node_id: NodeId, + ) -> Result, Error> { + zones.routes_for_node(node_id.as_ref()) + } + /// 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] -- 2.47.3