Skip to content

Commit

Permalink
Add user and group to NatRule
Browse files Browse the repository at this point in the history
  • Loading branch information
hulthe committed Nov 1, 2024
1 parent d47081f commit ccab6f2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/rule/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ pub struct NatRule {
from: Endpoint,
#[builder(default)]
to: Endpoint,
#[builder(default)]
user: Uid,
#[builder(default)]
group: Gid,
}

impl NatRule {
Expand Down Expand Up @@ -261,6 +265,8 @@ impl TryCopyTo<ffi::pfvar::pf_rule> 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(())
}
Expand Down

0 comments on commit ccab6f2

Please sign in to comment.