aboutsummaryrefslogtreecommitdiff
path: root/src/rule_methods.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/rule_methods.rs')
-rw-r--r--src/rule_methods.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rule_methods.rs b/src/rule_methods.rs
index 4ee3a16..161c2a4 100644
--- a/src/rule_methods.rs
+++ b/src/rule_methods.rs
@@ -218,6 +218,12 @@ impl Rule {
self.add_expr(Immediate::new_verdict(VerdictKind::Drop));
self
}
+ /// Adds the `Masquerade` verdict to the rule. The packet will have its
+ /// source address rewritten.
+ pub fn masquerade(mut self) -> Self {
+ self.add_expr(Immediate::new_verdict(VerdictKind::Masquerade));
+ self
+ }
}
/// Looks up the interface index for a given interface name.