From ccab6f2d603efdee761de09b8839864663d2dd24 Mon Sep 17 00:00:00 2001 From: Joakim Hulthe Date: Fri, 1 Nov 2024 10:13:39 +0100 Subject: [PATCH] Add `user` and `group` to NatRule --- src/rule/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/rule/mod.rs b/src/rule/mod.rs index f57871f..9e6f3a4 100644 --- a/src/rule/mod.rs +++ b/src/rule/mod.rs @@ -175,6 +175,10 @@ pub struct NatRule { from: Endpoint, #[builder(default)] to: Endpoint, + #[builder(default)] + user: Uid, + #[builder(default)] + group: Gid, } impl NatRule { @@ -261,6 +265,8 @@ impl TryCopyTo for NatRule { self.from.try_copy_to(&mut pf_rule.src)?; self.to.try_copy_to(&mut pf_rule.dst)?; + self.user.copy_to(&mut pf_rule.uid); + self.group.copy_to(&mut pf_rule.gid); Ok(()) }