nftnl 0.9.2

Safe abstraction for libnftnl. Provides low-level userspace access to the in-kernel nf_tables subsystem
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::ptr;

use super::{Expression, Rule};
use nftnl_sys as sys;

/// Sets the source IP to that of the output interface.
pub struct Masquerade;

impl Expression for Masquerade {
    fn to_expr(&self, _rule: &Rule) -> ptr::NonNull<sys::nftnl_expr> {
        try_alloc!(unsafe { sys::nftnl_expr_alloc(c"masq".as_ptr()) })
    }
}