aboutsummaryrefslogtreecommitdiff
path: root/rustables/src/expr/masquerade.rs
diff options
context:
space:
mode:
authorlafleur <lafleur@boum.org>2021-10-18 23:43:35 +0200
committerlafleur <lafleur@boum.org>2021-10-19 00:39:55 +0200
commit4a87680c89017730f0a8715f87118c63bb8b7ae8 (patch)
tree9ea0780ef6fb8f3320dedb3c3dc65aebc58ee7a0 /rustables/src/expr/masquerade.rs
parent26bfea8ed713ab68f0ffe3945e94fee1d766c98e (diff)
rename the crates, update copyright notices
Diffstat (limited to 'rustables/src/expr/masquerade.rs')
-rw-r--r--rustables/src/expr/masquerade.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/rustables/src/expr/masquerade.rs b/rustables/src/expr/masquerade.rs
new file mode 100644
index 0000000..66e9e0e
--- /dev/null
+++ b/rustables/src/expr/masquerade.rs
@@ -0,0 +1,12 @@
+use super::{Expression, Rule};
+use rustables_sys as sys;
+use std::os::raw::c_char;
+
+/// Sets the source IP to that of the output interface.
+pub struct Masquerade;
+
+impl Expression for Masquerade {
+ fn to_expr(&self, _rule: &Rule) -> *mut sys::nftnl_expr {
+ try_alloc!(unsafe { sys::nftnl_expr_alloc(b"masq\0" as *const _ as *const c_char) })
+ }
+}