[pbs-devel] [PATCH proxmox-ve-rs v2 1/1] host: network: move to proxmox-network-api
Stefan Hanreich
s.hanreich at proxmox.com
Wed Jul 30 16:15:41 CEST 2025
The structs have been moved to the proxmox-network-api, so they can be
reused across all projects. Initially it has been added here for
convenience, since the only user was proxmox-firewall - which is not
the case anymore.
Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
---
proxmox-ve-config/src/host/mod.rs | 1 -
proxmox-ve-config/src/host/network.rs | 35 ---------------------------
2 files changed, 36 deletions(-)
delete mode 100644 proxmox-ve-config/src/host/network.rs
diff --git a/proxmox-ve-config/src/host/mod.rs b/proxmox-ve-config/src/host/mod.rs
index a9da919..b4ab6a6 100644
--- a/proxmox-ve-config/src/host/mod.rs
+++ b/proxmox-ve-config/src/host/mod.rs
@@ -1,3 +1,2 @@
-pub mod network;
pub mod types;
pub mod utils;
diff --git a/proxmox-ve-config/src/host/network.rs b/proxmox-ve-config/src/host/network.rs
deleted file mode 100644
index 09f4fb1..0000000
--- a/proxmox-ve-config/src/host/network.rs
+++ /dev/null
@@ -1,35 +0,0 @@
-use std::collections::HashMap;
-
-#[derive(Debug, Clone, serde::Deserialize)]
-pub struct IpLink {
- ifname: String,
- #[serde(default)]
- altnames: Vec<String>,
-}
-
-#[derive(Debug, Clone, serde::Deserialize)]
-pub struct InterfaceMapping {
- mapping: HashMap<String, String>,
-}
-
-impl std::ops::Deref for InterfaceMapping {
- type Target = HashMap<String, String>;
-
- fn deref(&self) -> &Self::Target {
- &self.mapping
- }
-}
-
-impl FromIterator<IpLink> for InterfaceMapping {
- fn from_iter<T: IntoIterator<Item = IpLink>>(iter: T) -> Self {
- let mut mapping = HashMap::new();
-
- for iface in iter.into_iter() {
- for altname in iface.altnames {
- mapping.insert(altname, iface.ifname.clone());
- }
- }
-
- Self { mapping }
- }
-}
--
2.47.2
More information about the pbs-devel
mailing list