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 C79BA1FF142 for ; Mon, 16 Feb 2026 11:45:16 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4579FD294; Mon, 16 Feb 2026 11:45:01 +0100 (CET) From: Dietmar Maurer To: pve-devel@lists.proxmox.com Subject: [RFC proxmox 06/22] firewall-api-types: add FirewallGuestOptions Date: Mon, 16 Feb 2026 11:43:44 +0100 Message-ID: <20260216104401.3959270-7-dietmar@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260216104401.3959270-1-dietmar@proxmox.com> References: <20260216104401.3959270-1-dietmar@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.573 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 KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods RDNS_NONE 0.793 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Message-ID-Hash: PD64Z7XGX6SUP6JGSQ3XIUARKD2V7ULV X-Message-ID-Hash: PD64Z7XGX6SUP6JGSQ3XIUARKD2V7ULV X-MailFrom: dietmar@zilli.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: Extracted form perl api. Signed-off-by: Dietmar Maurer --- .../src/guest_options.rs | 97 +++++++++++++++++++ proxmox-firewall-api-types/src/lib.rs | 3 + 2 files changed, 100 insertions(+) create mode 100644 proxmox-firewall-api-types/src/guest_options.rs diff --git a/proxmox-firewall-api-types/src/guest_options.rs b/proxmox-firewall-api-types/src/guest_options.rs new file mode 100644 index 00000000..3c2dd774 --- /dev/null +++ b/proxmox-firewall-api-types/src/guest_options.rs @@ -0,0 +1,97 @@ +use proxmox_schema::api; + +use super::{FirewallIOPolicy, FirewallLogLevel}; + +#[api( + properties: { + dhcp: { + default: false, + optional: true, + }, + enable: { + default: false, + optional: true, + }, + ipfilter: { + default: false, + optional: true, + }, + log_level_in: { + optional: true, + type: FirewallLogLevel, + }, + log_level_out: { + optional: true, + type: FirewallLogLevel, + }, + macfilter: { + default: true, + optional: true, + }, + ndp: { + default: true, + optional: true, + }, + policy_in: { + optional: true, + type: FirewallIOPolicy, + }, + policy_out: { + optional: true, + type: FirewallIOPolicy, + }, + radv: { + default: false, + optional: true, + }, + }, +)] +/// Guest Firewall Options +#[derive(Debug, serde::Deserialize, serde::Serialize)] +pub struct FirewallGuestOptions { + /// Enable DHCP. + #[serde(deserialize_with = "proxmox_serde::perl::deserialize_bool")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub dhcp: Option, + + /// Enable/disable firewall rules. + #[serde(deserialize_with = "proxmox_serde::perl::deserialize_bool")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enable: Option, + + /// Enable default IP filters. This is equivalent to adding an empty + /// ipfilter-net ipset for every interface. Such ipsets implicitly + /// contain sane default restrictions such as restricting IPv6 link local + /// addresses to the one derived from the interface's MAC address. For + /// containers the configured IP addresses will be implicitly added. + #[serde(deserialize_with = "proxmox_serde::perl::deserialize_bool")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ipfilter: Option, + + #[serde(default, skip_serializing_if = "Option::is_none")] + pub log_level_in: Option, + + #[serde(default, skip_serializing_if = "Option::is_none")] + pub log_level_out: Option, + + /// Enable/disable MAC address filter. + #[serde(deserialize_with = "proxmox_serde::perl::deserialize_bool")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub macfilter: Option, + + /// Enable NDP (Neighbor Discovery Protocol). + #[serde(deserialize_with = "proxmox_serde::perl::deserialize_bool")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ndp: Option, + + #[serde(default, skip_serializing_if = "Option::is_none")] + pub policy_in: Option, + + #[serde(default, skip_serializing_if = "Option::is_none")] + pub policy_out: Option, + + /// Allow sending Router Advertisement. + #[serde(deserialize_with = "proxmox_serde::perl::deserialize_bool")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub radv: Option, +} diff --git a/proxmox-firewall-api-types/src/lib.rs b/proxmox-firewall-api-types/src/lib.rs index cbd4b804..c66262cc 100644 --- a/proxmox-firewall-api-types/src/lib.rs +++ b/proxmox-firewall-api-types/src/lib.rs @@ -8,3 +8,6 @@ pub use policy::{FirewallFWPolicy, FirewallIOPolicy}; mod cluster_options; pub use cluster_options::FirewallClusterOptions; + +mod guest_options; +pub use guest_options::FirewallGuestOptions; -- 2.47.3