From: Stefan Hanreich <s.hanreich@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH proxmox v2 02/11] network-api: add support for parsing interface flags
Date: Tue, 17 Nov 2026 19:34:49 +0100 [thread overview]
Message-ID: <20261117183500.750636-3-s.hanreich@proxmox.com> (raw)
In-Reply-To: <20261117183500.750636-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-network-api/src/config/helper.rs | 22 ++++++++++++++++++++++
proxmox-network-api/src/config/mod.rs | 3 ++-
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/proxmox-network-api/src/config/helper.rs b/proxmox-network-api/src/config/helper.rs
index 7feaaa51..d16adf76 100644
--- a/proxmox-network-api/src/config/helper.rs
+++ b/proxmox-network-api/src/config/helper.rs
@@ -172,6 +172,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
@@ -187,6 +202,8 @@ pub struct IpLink {
link_type: Link,
linkinfo: Option<LinkInfo>,
operstate: String,
+ #[serde(default)]
+ flags: Vec<LinkFlag>,
}
impl IpLink {
@@ -256,6 +273,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"
diff --git a/proxmox-network-api/src/config/mod.rs b/proxmox-network-api/src/config/mod.rs
index 25ddd13f..9a9a0f07 100644
--- a/proxmox-network-api/src/config/mod.rs
+++ b/proxmox-network-api/src/config/mod.rs
@@ -3,7 +3,8 @@ mod lexer;
mod parser;
pub use helper::{
- AltnameMapping, IpLink, LinkInfo, assert_ifupdown2_installed, network_reload, parse_cidr,
+ AltnameMapping, IpLink, LinkFlag, LinkInfo, assert_ifupdown2_installed, network_reload,
+ parse_cidr,
};
use std::collections::{BTreeMap, HashMap, HashSet};
--
2.47.3
next prev parent reply other threads:[~2026-11-17 18:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 18:34 [PATCH docs/manager/network/proxmox{,-ve-rs,-perl-rs} v2 00/11] Status reporting for WireGuard fabrics Stefan Hanreich
2026-11-17 18:34 ` [PATCH proxmox v2 01/11] network-api: add missing getters Stefan Hanreich
2026-11-17 18:34 ` Stefan Hanreich [this message]
2026-11-17 18:34 ` [PATCH proxmox v2 03/11] wireguard: derive additional traits for public key Stefan Hanreich
2026-11-17 18:34 ` [PATCH proxmox-ve-rs v2 04/11] ve-config: sdn: wireguard: add getters for interface listen port and " Stefan Hanreich
2026-11-17 18:34 ` [PATCH proxmox-ve-rs v2 05/11] ve-config: sdn: wireguard: add helper for resolving the peers of an interface Stefan Hanreich
2026-11-17 18:34 ` [PATCH proxmox-perl-rs v2 06/11] sdn status: fabrics: add status reporting for wireguard Stefan Hanreich
2026-11-17 18:34 ` [PATCH proxmox-perl-rs v2 07/11] sdn status: fabrics: check interfaces and peers for wireguard status Stefan Hanreich
2026-11-17 18:34 ` [PATCH proxmox-perl-rs v2 08/11] sdn status: fabrics: report status of wireguard neighbors Stefan Hanreich
2026-11-17 18:34 ` [PATCH pve-network v2 09/11] api: fabric status: add schema for wireguard properties Stefan Hanreich
2026-11-17 18:34 ` [PATCH pve-manager v2 10/11] ui: fabric content: add wireguard protocol Stefan Hanreich
2026-11-17 18:34 ` [PATCH pve-docs v2 11/11] sdn: add documentation for wireguard status reporting Stefan Hanreich
2026-11-18 15:20 ` [PATCH docs/manager/network/proxmox{,-ve-rs,-perl-rs} v2 00/11] Status reporting for WireGuard fabrics Arthur Bied-Charreton
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=20261117183500.750636-3-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.