From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 39F9D1FF142 for ; Mon, 16 Feb 2026 11:44:56 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 73F91CF4A; Mon, 16 Feb 2026 11:44:58 +0100 (CET) From: Dietmar Maurer To: pve-devel@lists.proxmox.com Subject: [RFC proxmox 05/22] firewall-api-types: add FirewallClusterOptions Date: Mon, 16 Feb 2026 11:43:43 +0100 Message-ID: <20260216104401.3959270-6-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.577 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: TBJGJHDSO2AWZ3BIEFF3WB5DATOLG7L4 X-Message-ID-Hash: TBJGJHDSO2AWZ3BIEFF3WB5DATOLG7L4 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/cluster_options.rs | 61 +++++++++++++++++++ proxmox-firewall-api-types/src/lib.rs | 3 + 2 files changed, 64 insertions(+) create mode 100644 proxmox-firewall-api-types/src/cluster_options.rs diff --git a/proxmox-firewall-api-types/src/cluster_options.rs b/proxmox-firewall-api-types/src/cluster_options.rs new file mode 100644 index 00000000..bd01a529 --- /dev/null +++ b/proxmox-firewall-api-types/src/cluster_options.rs @@ -0,0 +1,61 @@ +use proxmox_schema::{api, ApiStringFormat}; + +use super::{FirewallFWPolicy, FirewallIOPolicy, FirewallLogRateLimit}; + +#[api( + properties: { + ebtables: { + default: true, + optional: true, + }, + enable: { + default: 0, + minimum: 0, + optional: true, + type: Integer, + }, + log_ratelimit: { + format: &ApiStringFormat::PropertyString(&FirewallLogRateLimit::API_SCHEMA), + optional: true, + type: String, + }, + policy_forward: { + optional: true, + type: FirewallFWPolicy, + }, + policy_in: { + optional: true, + type: FirewallIOPolicy, + }, + policy_out: { + optional: true, + type: FirewallIOPolicy, + }, + }, +)] +/// Cluster Firewall Options +#[derive(Debug, serde::Deserialize, serde::Serialize)] +pub struct FirewallClusterOptions { + /// Enable ebtables rules cluster wide. + #[serde(deserialize_with = "proxmox_serde::perl::deserialize_bool")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ebtables: Option, + + /// Enable or disable the firewall cluster wide. + #[serde(deserialize_with = "proxmox_serde::perl::deserialize_u64")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enable: Option, + + /// Log ratelimiting settings + #[serde(default, skip_serializing_if = "Option::is_none")] + pub log_ratelimit: Option, + + #[serde(default, skip_serializing_if = "Option::is_none")] + pub policy_forward: 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, +} diff --git a/proxmox-firewall-api-types/src/lib.rs b/proxmox-firewall-api-types/src/lib.rs index d9ff4548..cbd4b804 100644 --- a/proxmox-firewall-api-types/src/lib.rs +++ b/proxmox-firewall-api-types/src/lib.rs @@ -5,3 +5,6 @@ pub use log::{ mod policy; pub use policy::{FirewallFWPolicy, FirewallIOPolicy}; + +mod cluster_options; +pub use cluster_options::FirewallClusterOptions; -- 2.47.3