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 7278E1FF0DA for ; Thu, 19 Nov 2026 20:42:27 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 41B2C21779; Thu, 19 Nov 2026 20:41:49 +0100 (CET) From: Gabriel Goller To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox-perl-rs v3 12/28] sdn: expose static routes for simple zone uplinks Date: Thu, 19 Nov 2026 20:40:58 +0100 Message-ID: <20261119194116.575520-13-g.goller@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261119194116.575520-1-g.goller@proxmox.com> References: <20261119194116.575520-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: 1795117282103 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.232 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: 53NLXOT57MDXGOTU53PSEFLC7TQUW3VT X-Message-ID-Hash: 53NLXOT57MDXGOTU53PSEFLC7TQUW3VT 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 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pve-rs/src/bindings/sdn/mod.rs b/pve-rs/src/bindings/sdn/mod.rs index dcae046a7e46..742e02329eef 100644 --- a/pve-rs/src/bindings/sdn/mod.rs +++ b/pve-rs/src/bindings/sdn/mod.rs @@ -10,15 +10,31 @@ 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 zones participating on this node. + /// + /// Invalid routes are skipped with a warning. + #[export] + pub fn get_zone_routes(zones: ZoneRoutesConfig, node_id: NodeId) -> Vec { + 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