Skip to content

Commit ff238b1

Browse files
committed
Fix forgotten parts of documentation readme generation
1 parent 9867488 commit ff238b1

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,26 @@ nf_tables subsystem. See [`nftnl-sys`] for the low level FFI bindings to the C l
66
Can be used to create and remove tables, chains, sets and rules from the nftables firewall,
77
the successor to iptables.
88

9-
This library currently has quite rough edges and does not make adding and removing nftables
9+
This library currently has quite rough edges and does not make adding and removing netfilter
1010
entries super easy and elegant. That is partly because the library needs more work, but also
1111
partly because nftables is super low level and extremely customizable, making it hard, and
1212
probably wrong, to try and create a too simple/limited wrapper. See examples for inspiration.
1313
One can also look at how the original project this crate was developed to support uses it:
1414
[Mullvad VPN app](https://github.com/mullvad/mullvadvpn-app)
1515

16+
Understanding how to use [`libnftnl`] and implementing this crate has mostly been done by
17+
reading the source code for the [`nftables`] program and attaching debuggers to the `nft`
18+
binary. Since the implementation is mostly based on trial and error, there might of course be
19+
a number of places where the underlying library is used in an invalid or not intended way.
20+
Large portions of [`libnftnl`] are also not covered yet. Contributions are welcome!
21+
1622
## Selecting version of `libnftnl`
1723

1824
See the documentation for the corresponding sys crate for details: [`nftnl-sys`]
1925
This crate has the same features as the sys crate, and selecting version works the same.
2026

2127
[`libnftnl`]: https://netfilter.org/projects/libnftnl/
28+
[`nftables`]: https://netfilter.org/projects/nftables/
2229
[`nftnl-sys`]: https://crates.io/crates/nftnl-sys
2330

2431
License: MIT/Apache-2.0

nftnl-sys/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ See [`nftnl`] for a higher level safe abstraction.
1010
By default this crate uses pkg-config to find and link to its C dependencies, [`libmnl`] and
1111
[`libnftnl`]. To manually configure where to look for these libraries, set the environment
1212
variables `LIBMNL_LIB_DIR` and `LIBNFTNL_LIB_DIR` to point to the directories where `libmnl.so`
13-
(or `libmnl.a`) and `libnftnl.so` (or `libnftnl.a`) resides.
13+
(or `libmnl.a`) and `libnftnl.so` (or `libnftnl.a`) reside.
1414

1515
## Selecting version of `libnftnl`
1616

@@ -24,7 +24,7 @@ corresponding features. See `Cargo.toml` for available features/versions.
2424
So for example, to get bindings to `libnftnl-1.0.9` depend on this crate like this:
2525
```toml
2626
[dependencies]
27-
nftnl = { version = "0.1", features = ["nftnl-1-0-9"] }
27+
nftnl-sys = { version = "0.1", features = ["nftnl-1-0-9"] }
2828
```
2929

3030
[`libnftnl`]: https://netfilter.org/projects/libnftnl/

nftnl/examples/add-rules.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
//! type filter hook output priority 0; policy accept;
1818
//! ip daddr 10.1.0.0/24 counter packets 0 bytes 0 accept
1919
//! }
20-
//!
20+
//!
2121
//! chain chain-for-incoming-packets {
2222
//! type filter hook input priority 0; policy accept;
2323
//! iif "lo" accept
2424
//! }
2525
//! }
2626
//! ```
27-
//!
27+
//!
2828
//! Try pinging any IP in the network range denoted by the outgoing rule and see the counter
2929
//! increment:
3030
//! ```bash

nftnl/src/lib.rs

+7
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,19 @@
1919
//! One can also look at how the original project this crate was developed to support uses it:
2020
//! [Mullvad VPN app](https://github.com/mullvad/mullvadvpn-app)
2121
//!
22+
//! Understanding how to use [`libnftnl`] and implementing this crate has mostly been done by
23+
//! reading the source code for the [`nftables`] program and attaching debuggers to the `nft`
24+
//! binary. Since the implementation is mostly based on trial and error, there might of course be
25+
//! a number of places where the underlying library is used in an invalid or not intended way.
26+
//! Large portions of [`libnftnl`] are also not covered yet. Contributions are welcome!
27+
//!
2228
//! # Selecting version of `libnftnl`
2329
//!
2430
//! See the documentation for the corresponding sys crate for details: [`nftnl-sys`]
2531
//! This crate has the same features as the sys crate, and selecting version works the same.
2632
//!
2733
//! [`libnftnl`]: https://netfilter.org/projects/libnftnl/
34+
//! [`nftables`]: https://netfilter.org/projects/nftables/
2835
//! [`nftnl-sys`]: https://crates.io/crates/nftnl-sys
2936
3037
pub extern crate nftnl_sys;

0 commit comments

Comments
 (0)