diff options
Diffstat (limited to 'rustables/src/expr/masquerade.rs')
-rw-r--r-- | rustables/src/expr/masquerade.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/rustables/src/expr/masquerade.rs b/rustables/src/expr/masquerade.rs index 31b98c0..bf4e0de 100644 --- a/rustables/src/expr/masquerade.rs +++ b/rustables/src/expr/masquerade.rs @@ -3,6 +3,7 @@ use rustables_sys as sys; use std::os::raw::c_char; /// Sets the source IP to that of the output interface. +#[derive(Debug, PartialEq)] pub struct Masquerade; impl Expression for Masquerade { @@ -10,6 +11,13 @@ impl Expression for Masquerade { b"masq\0" as *const _ as *const c_char } + fn from_expr(_expr: *const sys::nftnl_expr) -> Option<Self> + where + Self: Sized, + { + Some(Masquerade) + } + fn to_expr(&self, _rule: &Rule) -> *mut sys::nftnl_expr { try_alloc!(unsafe { sys::nftnl_expr_alloc(Self::get_raw_name()) }) } |