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 441F31FF0DF for ; Fri, 28 Aug 2026 13:33:15 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 3A99C21586; Fri, 28 Aug 2026 13:33:05 +0200 (CEST) From: Gabriel Goller To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox-ve-rs v3 04/13] ve-config: add IS-IS status deserialization types Date: Fri, 28 Aug 2026 13:32:43 +0200 Message-ID: <20260828113255.176546-5-g.goller@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260828113255.176546-1-g.goller@proxmox.com> References: <20260828113255.176546-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: 1787916770558 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.547 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: T3ITG4CTHH3RPTLH4QVZZTUDA44HNN3U X-Message-ID-Hash: T3ITG4CTHH3RPTLH4QVZZTUDA44HNN3U 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: Add types to deserialize the FRR json output when getting the status of a fabric. Signed-off-by: Gabriel Goller --- proxmox-frr/src/de/isis.rs | 103 +++++++++++++++++++++++++++++++++++++ proxmox-frr/src/de/mod.rs | 1 + 2 files changed, 104 insertions(+) create mode 100644 proxmox-frr/src/de/isis.rs diff --git a/proxmox-frr/src/de/isis.rs b/proxmox-frr/src/de/isis.rs new file mode 100644 index 000000000000..46c4357125a8 --- /dev/null +++ b/proxmox-frr/src/de/isis.rs @@ -0,0 +1,103 @@ +use serde::{Deserialize, Serialize}; + +/// State of the adjacency of a Isis neighbor +#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)] +pub enum AdjacencyState { + Initializing, + Up, + Down, + #[serde(other)] + Unknown, +} + +/// Neighbor Interface +/// +/// Interface used to communicate with a specific neighbor +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +pub struct NeighborInterface { + /// The name of the interface + pub name: String, + /// The state of the adjacency, this is "Up" when everything is well + pub state: Option, + /// Time since the last adj-flap (basically the uptime) + #[serde(rename = "last-ago")] + pub last_ago: String, +} + +/// Adjacency information +/// +/// Circuits are Layer-2 Broadcast domains (Either point-to-point or LAN). +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +pub struct Circuit { + /// The hostname of the adjacency peer + pub adj: Option, + /// The interface of the neighbor + pub interface: Option, +} + +/// An isis area the same as SDN fabric. +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +pub struct Area { + /// The are name, this is the same as the fabric_id, so the name of the fabric. + pub area: String, + /// Circuits are Layer-2 Broadcast domains (Either point-to-point or LAN). + pub circuits: Vec, +} + +/// The parsed neighbors. +/// +/// This models the output of: +/// `vtysh -c 'show isis neighbor json'`. +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq)] +pub struct Neighbors { + /// Every sdn fabric is also an isis 'area' + pub areas: Vec, +} + +/// The NetworkType of a isis interface +#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)] +pub enum NetworkType { + #[serde(rename(deserialize = "p2p", serialize = "Point-To-Point"))] + PointToPoint, + #[serde(rename(deserialize = "lan", serialize = "Broadcast"))] + Lan, + #[serde(rename(deserialize = "loopback", serialize = "Loopback"))] + Loopback, + #[serde(rename = "Unknown", other)] + Unknown, +} + +/// The State of a isis interface +#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)] +pub enum CircuitState { + Init, + Config, + Up, + #[serde(other)] + Unknown, +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +#[serde(rename_all = "kebab-case")] +pub struct Interface { + pub name: String, + pub state: CircuitState, + #[serde(rename = "type")] + pub ty: NetworkType, +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +pub struct InterfaceCircuits { + pub interface: Interface, +} + +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq)] +pub struct InterfaceArea { + pub area: String, + pub circuits: Vec, +} + +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq)] +pub struct Interfaces { + pub areas: Vec, +} diff --git a/proxmox-frr/src/de/mod.rs b/proxmox-frr/src/de/mod.rs index 3f2bd68d9cec..d5ba35b3c7a6 100644 --- a/proxmox-frr/src/de/mod.rs +++ b/proxmox-frr/src/de/mod.rs @@ -4,6 +4,7 @@ use proxmox_network_types::ip_address::Cidr; use serde::{Deserialize, Serialize}; pub mod evpn; +pub mod isis; pub mod openfabric; pub mod ospf; -- 2.47.3