aboutsummaryrefslogtreecommitdiff
path: root/nftnl-sys/src/lib.rs
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2018-08-29 15:49:12 +0200
committerLinus Färnstrand <linus@mullvad.net>2018-08-29 21:14:56 +0200
commit13d64e0a448c74d692e445a26bcfc2897dea44f3 (patch)
tree95df28a65dddf8d4ffa67d969c6be178921c0268 /nftnl-sys/src/lib.rs
parent5065cdf6c2f428b438b9d61881d12832ecb1d1ec (diff)
Add documentation and generate readmes
Diffstat (limited to 'nftnl-sys/src/lib.rs')
-rw-r--r--nftnl-sys/src/lib.rs26
1 files changed, 25 insertions, 1 deletions
diff --git a/nftnl-sys/src/lib.rs b/nftnl-sys/src/lib.rs
index 3c0a75f..884f304 100644
--- a/nftnl-sys/src/lib.rs
+++ b/nftnl-sys/src/lib.rs
@@ -6,13 +6,37 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-//! Low level FFI bindings to [`libnftnl`]. a userspace library providing a low-level netlink
+//! Low level FFI bindings to [`libnftnl`], a userspace library providing a low-level netlink
//! programming interface (API) to the in-kernel nf_tables subsystem.
//!
//! See [`nftnl`] for a higher level safe abstraction.
//!
+//! # Linking to libmnl and libnftnl
+//!
+//! By default this crate uses pkg-config to find and link to its C dependencies, [`libmnl`] and
+//! [`libnftnl`]. To manually configure where to look for these libraries, set the environment
+//! variables `LIBMNL_LIB_DIR` and `LIBNFTNL_LIB_DIR` to point to the directories where `libmnl.so`
+//! (or `libmnl.a`) and `libnftnl.so` (or `libnftnl.a`) reside.
+//!
+//! # Selecting version of `libnftnl`
+//!
+//! This crate has bindings for most versions of [`libnftnl`]. All bindings are generated by
+//! [`bindgen`] via the `generate_bindings.sh` script in this repository.
+//!
+//! Only one version of `libnftnl` can be exposed via this crate. By default the crate exports the
+//! bindings for the oldest supported version (`libnftnl-1.0.6`). To get newer versions activate the
+//! corresponding features. See `Cargo.toml` for available features/versions.
+//!
+//! So for example, to get bindings to `libnftnl-1.0.9` depend on this crate like this:
+//! ```toml
+//! [dependencies]
+//! nftnl-sys = { version = "0.1", features = ["nftnl-1-0-9"] }
+//! ```
+//!
//! [`libnftnl`]: https://netfilter.org/projects/libnftnl/
+//! [`libmnl`]: https://netfilter.org/projects/libmnl/
//! [`nftnl`]: https://crates.io/crates/nftnl
+//! [`bindgen`]: https://crates.io/crates/bindgen
#![no_std]
#![cfg(target_os = "linux")]