From: Stefan Hanreich <s.hanreich@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH proxmox 03/13] iproute2: add support for parsing interface flags
Date: Wed, 17 Jun 2026 13:10:00 +0200 [thread overview]
Message-ID: <20260617111012.312710-4-s.hanreich@proxmox.com> (raw)
In-Reply-To: <20260617111012.312710-1-s.hanreich@proxmox.com>
Interface flags were not available in the parsed ip link output. The
flags are required for determining the status of some interfaces,
since WireGuard for example always sets the operating state to
UNKNOWN, even if the interface is up and working.
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
proxmox-iproute2/src/lib.rs | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/proxmox-iproute2/src/lib.rs b/proxmox-iproute2/src/lib.rs
index f00d3475..1a7efd7e 100644
--- a/proxmox-iproute2/src/lib.rs
+++ b/proxmox-iproute2/src/lib.rs
@@ -64,6 +64,21 @@ pub enum Link {
Unknown(UnknownLink),
}
+#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, serde::Deserialize)]
+#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
+pub enum LinkFlag {
+ Pointopoint,
+ Noarp,
+ Up,
+ LowerUp,
+ Broadcast,
+ Multicast,
+ Loopback,
+ Promisc,
+ #[serde(untagged)]
+ Unknown(String),
+}
+
/// An IpLink entry, as returned by `ip -details -json link show`.
///
/// For now this parses only the fields that are used throughout our stack, the fields of this
@@ -79,6 +94,8 @@ pub struct IpLink {
link_type: Link,
linkinfo: Option<LinkInfo>,
operstate: String,
+ #[serde(default)]
+ flags: Vec<LinkFlag>,
}
impl IpLink {
@@ -148,6 +165,11 @@ impl IpLink {
self.altnames.iter()
}
+ /// Returns the flags of this interface
+ pub fn flags(&self) -> impl Iterator<Item = &LinkFlag> {
+ self.flags.iter()
+ }
+
/// Returns whether the interface is currently in an UP state.
pub fn active(&self) -> bool {
self.operstate == "UP"
--
2.47.3
next prev parent reply other threads:[~2026-06-17 11:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-17 11:09 [PATCH docs/manager/network/proxmox{,-backup,-datacenter-manager,-firewall,-network-interface-pinning,-ve-rs,-perl-rs} 00/13] Status reporting for wireguard fabrics Stefan Hanreich
2026-06-17 11:09 ` [PATCH proxmox 01/13] iproute2: schema: move iproute2 helpers to new create / schema Stefan Hanreich
2026-06-17 11:09 ` [PATCH proxmox 02/13] iproute2: add missing getters Stefan Hanreich
2026-06-17 11:10 ` Stefan Hanreich [this message]
2026-06-17 11:10 ` [PATCH proxmox 04/13] wireguard: derive additional traits for public key Stefan Hanreich
2026-06-17 11:10 ` [PATCH proxmox-backup 05/13] metric_collection: switch to proxmox-iproute2 crate Stefan Hanreich
2026-06-17 11:10 ` [PATCH proxmox-datacenter-manager 06/13] " Stefan Hanreich
2026-06-17 11:10 ` [PATCH proxmox-firewall 07/13] firewall config: " Stefan Hanreich
2026-06-17 11:10 ` [PATCH proxmox-network-interface-pinning 08/13] network-interface-pinning: " Stefan Hanreich
2026-06-17 11:10 ` [PATCH proxmox-ve-rs 09/13] fabric: wireguard: add helper for findings peer based on endpoint Stefan Hanreich
2026-06-17 11:10 ` [PATCH proxmox-perl-rs 10/13] sdn status: fabrics: add status reporting for wireguard Stefan Hanreich
2026-06-17 11:10 ` [PATCH pve-network 11/13] api: fabric status: add schema for wireguard properties Stefan Hanreich
2026-06-17 11:10 ` [PATCH pve-manager 12/13] ui: fabric content: add wireguard protocol Stefan Hanreich
2026-06-17 11:10 ` [PATCH pve-docs 13/13] sdn: add documentation for wireguard status reporting Stefan Hanreich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260617111012.312710-4-s.hanreich@proxmox.com \
--to=s.hanreich@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox