1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! nftables-rs is a Rust library designed to provide a safe and easy-to-use abstraction over the nftables JSON API, known as libnftables-json.
//!
//! This library is engineered for developers who need to interact with nftables,
//! the Linux kernel's next-generation firewalling tool, directly from Rust applications.
//!
//! By abstracting the underlying JSON API, nftables-rs facilitates the creation, manipulation,
//! and application of firewall rulesets without requiring deep knowledge of nftables' internal workings.
// TODO: add example usage to library doc
/// Contains Batch object to be used to prepare Nftables payloads.
/// Contains [expressions](crate::expr::Expression).
/// Expressions are the building blocks of (most) statements.
///
/// See <https://manpages.debian.org/testing/libnftables1/libnftables-json.5.en.html#EXPRESSIONS>.
/// Contains the global structure of an Nftables document.
///
/// See <https://manpages.debian.org/testing/libnftables1/libnftables-json.5.en.html#GLOBAL_STRUCTURE>.
/// Contains Statements.
/// Statements are the building blocks for rules.
///
/// See <https://manpages.debian.org/testing/libnftables1/libnftables-json.5.en.html#STATEMENTS>.
/// Contains common type definitions referred to in the schema.
/// Contains methods to communicate with nftables JSON API.
/// Contains node visitors for serde.
/// Contains handling and parsing of command line arguments.
// Default values for Default implementations.
const DEFAULT_FAMILY: NfFamily = INet;
const DEFAULT_TABLE: &str = "filter";
const DEFAULT_CHAIN: &str = "forward";