mnl-sys

Crates.iomnl-sys
lib.rsmnl-sys
version0.2.2
created_at2018-08-29 21:01:16.121516+00
updated_at2025-10-29 18:27:19.899728+00
descriptionLow level FFI bindings to libmnl. A minimalistic user-space library oriented to Netlink developers
homepage
repositoryhttps://github.com/mullvad/mnl-rs
max_upload_size
id82022
size16,050
appteam-crates.io (github:mullvad:appteam-crates-io)

documentation

README

mnl-sys

Low level FFI bindings to libmnl. A minimalistic user-space library oriented to Netlink developers. See mnl for a higher level safe abstraction.

These bindings were generated with bindgen. See the generate_bindings.sh script in the repository.

Linking to libmnl

pkg-config

By default this crate uses pkg-config to find and link libmnl.

Manually

To manually configure where to look for the library, set the environment variable LIBMNL_LIB_DIR to point to the directory where libmnl.so or libmnl.a resides, or override the build script to manually set the linker directives for mnl:

# .cargo/config.toml
[target.x86_64-unknown-linux-gnu.mnl]
rustc-link-lib = ["mnl"]
rustc-link-search = ["<type>=<path-to-libmnl>"]

Selecting version of libmnl

This crate has bindings for multiple versions of libmnl. All bindings are generated by bindgen via the generate_bindings.sh script in this repository.

Only one version of libmnl can be exposed via this crate. By default the crate exports the bindings for the oldest supported version (libmnl-1.0.3). To get newer versions activate the corresponding features. See Cargo.toml for available features/versions.

So for example, to get bindings to libmnl-1.0.4 depend on this crate like this:

[dependencies]
mnl-sys = { version = "0.1", features = ["mnl-1-0-4"] }

License: MIT/Apache-2.0

Commit count: 50

cargo fmt