From a030b4e828797888a48fa661bafd59c46e7c5ca5 Mon Sep 17 00:00:00 2001 From: Olexiy Trushkovsky Date: Thu, 9 Jan 2025 06:23:47 +0200 Subject: [PATCH] Fixed adding a gateway with a dynamic address to Firewall Rules. Added tag field to Firewall Rules (#636) * Update FirewallRule.inc * added allow_empty to tag --- .../files/usr/local/pkg/RESTAPI/Models/FirewallRule.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/FirewallRule.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/FirewallRule.inc index 965cff52e..3b63f24dd 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/FirewallRule.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/FirewallRule.inc @@ -35,6 +35,7 @@ class FirewallRule extends Model { public StringField $descr; public BooleanField $disabled; public BooleanField $log; + public StringField $tag; public StringField $statetype; public BooleanField $tcp_flags_any; public StringField $tcp_flags_out_of; @@ -171,6 +172,11 @@ class FirewallRule extends Model { default: false, help_text: 'Enable or disable logging of traffic that matches this rule.', ); + $this->tag = new StringField( + default: '', + allow_empty: true, + help_text: 'A packet matching this rule can be marked and this mark used to match on other NAT/filter rules. It is called ', + ); $this->statetype = new StringField( default: 'keep state', choices: ['keep state', 'sloppy state', 'synproxy state', 'none'], @@ -200,7 +206,7 @@ class FirewallRule extends Model { help_text: 'The TCP flags that must be set for this rule to match.', ); $this->gateway = new ForeignModelField( - model_name: ['RoutingGateway', 'RoutingGatewayGroup'], + model_name: ['RoutingGateway', 'RoutingGatewayGroup', 'RoutingGatewayStatus'], model_field: 'name', default: null, allow_null: true,