nftnl_rs/
lib.rs

1/*-
2 * nftnl-rs - a netlink NFtables firewall.
3 * Copyright (C) 2020 Aleksandr Morozov
4 * 
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 *  file, You can obtain one at https://mozilla.org/MPL/2.0/.
8 */
9
10
11//! nftnl-rs 
12//! 
13//! Provides a partial userspace interface for the Linux Netlink Nftables.
14//! 
15//! <img src="https://cdn.4neko.org/nftable.webp" width="280"/> <img src="https://cdn.4neko.org/source_avail.webp" width="280"/> <img src="https://cdn.4neko.org/mpl.webp" width="280"/>
16//!
17//! Supports:
18//! - Add, Delete multiple hosts from set
19//! - Get the content of the set.
20
21
22extern crate bitflags;
23extern crate libc;
24extern crate byteorder;
25
26
27pub mod error;
28mod netlink;
29
30pub mod nftnl;
31
32
33pub use nftnl::{add_hosts_to_table, check_in_table, erase_hosts_from_table, flush_hosts_from_table};
34
35pub use crate::netlink::
36{
37    netlink::{Nlmsghdr, NlmFFlags}, 
38    linux::{Nfproto, NETLINK_NETFILTER}, 
39    socket::MnlSocket,  
40    MNL_SOCKET_BUFFER_SIZE
41};