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 716491FF13A for ; Wed, 13 May 2026 15:02:59 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0F7C8CFAF; Wed, 13 May 2026 15:02:59 +0200 (CEST) Message-ID: Date: Wed, 13 May 2026 15:02:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH proxmox-perl-rs v4 3/7] sdn: fabrics: add BGP status endpoints To: Stefan Hanreich , pve-devel@lists.proxmox.com References: <20260512141305.199664-1-h.laimer@proxmox.com> <20260512141305.199664-4-h.laimer@proxmox.com> <03e0b16c-79df-44cc-bf18-bf2e89c4982d@proxmox.com> From: Hannes Laimer Content-Language: en-US In-Reply-To: <03e0b16c-79df-44cc-bf18-bf2e89c4982d@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1778677337099 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.081 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [status.rs,fabrics.rs] Message-ID-Hash: FOO6JHB63JJEMJ3RPHTYF6ARDUDH6K3B X-Message-ID-Hash: FOO6JHB63JJEMJ3RPHTYF6ARDUDH6K3B X-MailFrom: h.laimer@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: On 2026-05-13 14:33, Stefan Hanreich wrote: > On 5/12/26 4:12 PM, Hannes Laimer wrote: >> Expose BGP fabric status through the existing fabric status API. >> Routes are fetched for both IPv4 and IPv6, and neighbor/interface >> state is derived from BGP session info. >> >> Signed-off-by: Hannes Laimer >> --- >> pve-rs/src/bindings/sdn/fabrics.rs | 97 +++++++++++++++++++++++++- >> pve-rs/src/sdn/status.rs | 106 ++++++++++++++++++++++++++++- >> 2 files changed, 198 insertions(+), 5 deletions(-) >> >> diff --git a/pve-rs/src/bindings/sdn/fabrics.rs b/pve-rs/src/bindings/sdn/fabrics.rs >> index f914094..0189ecd 100644 >> --- a/pve-rs/src/bindings/sdn/fabrics.rs >> +++ b/pve-rs/src/bindings/sdn/fabrics.rs >> @@ -12,8 +12,8 @@ pub mod pve_rs_sdn_fabrics { >> use std::process::Command; >> use std::sync::Mutex; >> >> - use anyhow::{Context, Error, format_err}; >> - use openssl::hash::{MessageDigest, hash}; >> + use anyhow::{format_err, Context, Error}; >> + use openssl::hash::{hash, MessageDigest}; >> use proxmox_ve_config::sdn::fabric::section_config::node::api::{Node, NodeUpdater}; >> use serde::{Deserialize, Serialize}; >> >> @@ -31,8 +31,8 @@ pub mod pve_rs_sdn_fabrics { >> }; >> use proxmox_ve_config::sdn::fabric::section_config::interface::InterfaceName; >> use proxmox_ve_config::sdn::fabric::section_config::node::{Node as ConfigNode, NodeId}; >> - use proxmox_ve_config::sdn::fabric::section_config::Section; >> use proxmox_ve_config::sdn::fabric::section_config::protocol::bgp::BgpNode; >> + use proxmox_ve_config::sdn::fabric::section_config::Section; >> use proxmox_ve_config::sdn::fabric::{FabricConfig, FabricEntry}; >> use proxmox_ve_config::sdn::wireguard::WireGuardConfigBuilder; >> >> @@ -840,6 +840,35 @@ pub mod pve_rs_sdn_fabrics { >> status::get_routes(fabric_id, config, ospf_routes, proxmox_sys::nodename()) >> } >> FabricEntry::WireGuard(_) => Ok(Vec::new()), >> + FabricEntry::Bgp(_) => { >> + let bgp_ipv4_routes_string = String::from_utf8( >> + Command::new("sh") >> + .args(["-c", "vtysh -c 'show ip route bgp json'"]) >> + .output()? >> + .stdout, >> + )?; >> + >> + let bgp_ipv6_routes_string = String::from_utf8( >> + Command::new("sh") >> + .args(["-c", "vtysh -c 'show ipv6 route bgp json'"]) >> + .output()? >> + .stdout, >> + )?; > > pre-existing but something that really irks me is that we pollute the > vtysh history with our pvestatd invocations. It's possible to set > VTYSH_HISTFILE=/dev/null to avoid writing the commands to history - so > we could do that here for all vtysh invocations? > could also do as a follow-up that does this for all, but can also include in v5 for bgp fabric. fine with me either way > I can prepare a patch for OSPF / Openfabric. >