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 7C5051FF14F for ; Wed, 17 Jun 2026 13:11:37 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B7128312AD; Wed, 17 Jun 2026 13:11:02 +0200 (CEST) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox 02/13] iproute2: add missing getters Date: Wed, 17 Jun 2026 13:09:59 +0200 Message-ID: <20260617111012.312710-3-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260617111012.312710-1-s.hanreich@proxmox.com> References: <20260617111012.312710-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: 1781694568483 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.598 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. [lib.rs] Message-ID-Hash: DFQ2Y62MW6RB7BTXDUSVWXAHZCLBGOIQ X-Message-ID-Hash: DFQ2Y62MW6RB7BTXDUSVWXAHZCLBGOIQ 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: Not all parsed fields provided getters for their value. Make them available at use sites by providing the missing getters. Signed-off-by: Stefan Hanreich --- proxmox-iproute2/src/lib.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/proxmox-iproute2/src/lib.rs b/proxmox-iproute2/src/lib.rs index 9bafb228..f00d3475 100644 --- a/proxmox-iproute2/src/lib.rs +++ b/proxmox-iproute2/src/lib.rs @@ -18,12 +18,28 @@ pub struct LinkInfo { info_kind: Option, } +impl LinkInfo { + pub fn info_slave_data(&self) -> Option<&SlaveData> { + self.info_slave_data.as_ref() + } + + pub fn info_kind(&self) -> Option<&String> { + self.info_kind.as_ref() + } +} + /// The fields specific to an interface of type `ether`. #[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, serde::Deserialize)] pub struct EtherLink { address: MacAddress, } +impl EtherLink { + pub fn address(&self) -> MacAddress { + self.address + } +} + /// Catch all variant for all unknown link types. #[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, serde::Deserialize)] pub struct UnknownLink { @@ -117,6 +133,16 @@ impl IpLink { None } + /// The [`LinkInfo`] for this link. + pub fn linkinfo(&self) -> Option<&LinkInfo> { + self.linkinfo.as_ref() + } + + /// The operating state of the interface. + pub fn operstate(&self) -> &str { + &self.operstate + } + /// Returns an iterator over the altnames of an interface. pub fn altnames(&self) -> impl Iterator { self.altnames.iter() -- 2.47.3