Expand description
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:
[dependencies]
nftnl-sys = { version = "0.1", features = ["nftnl-1-0-9"] }
Re-exports§
pub use libc;
Structs§
- nftnl_
batch - nftnl_
chain - nftnl_
chain_ list - nftnl_
chain_ list_ iter - nftnl_
expr - nftnl_
expr_ iter - nftnl_
gen - nftnl_
parse_ ctx - nftnl_
parse_ err - nftnl_
rule - nftnl_
rule_ list - nftnl_
rule_ list_ iter - nftnl_
ruleset - nftnl_
set - nftnl_
set_ elem - nftnl_
set_ elems_ iter - nftnl_
set_ list - nftnl_
set_ list_ iter - nftnl_
table - nftnl_
table_ list - nftnl_
table_ list_ iter - nftnl_
trace - nftnl_
udata - nftnl_
udata_ buf
Constants§
- NFTNL_
CHAIN_ BYTES - NFTNL_
CHAIN_ DEV - NFTNL_
CHAIN_ FAMILY - NFTNL_
CHAIN_ HANDLE - NFTNL_
CHAIN_ HOOKNUM - NFTNL_
CHAIN_ NAME - NFTNL_
CHAIN_ PACKETS - NFTNL_
CHAIN_ POLICY - NFTNL_
CHAIN_ PRIO - NFTNL_
CHAIN_ TABLE - NFTNL_
CHAIN_ TYPE - NFTNL_
CHAIN_ USE - NFTNL_
CMD_ ADD - NFTNL_
CMD_ DELETE - NFTNL_
CMD_ FLUSH - NFTNL_
CMD_ INSERT - NFTNL_
CMD_ MAX - NFTNL_
CMD_ REPLACE - NFTNL_
CMD_ UNSPEC - NFTNL_
EXPR_ BASE - NFTNL_
EXPR_ BITWISE_ DREG - NFTNL_
EXPR_ BITWISE_ LEN - NFTNL_
EXPR_ BITWISE_ MASK - NFTNL_
EXPR_ BITWISE_ SREG - NFTNL_
EXPR_ BITWISE_ XOR - NFTNL_
EXPR_ BYTEORDER_ DREG - NFTNL_
EXPR_ BYTEORDER_ LEN - NFTNL_
EXPR_ BYTEORDER_ OP - NFTNL_
EXPR_ BYTEORDER_ SIZE - NFTNL_
EXPR_ BYTEORDER_ SREG - NFTNL_
EXPR_ CMP_ DATA - NFTNL_
EXPR_ CMP_ OP - NFTNL_
EXPR_ CMP_ SREG - NFTNL_
EXPR_ CTR_ BYTES - NFTNL_
EXPR_ CTR_ PACKETS - NFTNL_
EXPR_ CT_ DIR - NFTNL_
EXPR_ CT_ DREG - NFTNL_
EXPR_ CT_ KEY - NFTNL_
EXPR_ CT_ SREG - NFTNL_
EXPR_ DUP_ SREG_ ADDR - NFTNL_
EXPR_ DUP_ SREG_ DEV - NFTNL_
EXPR_ DYNSET_ EXPR - NFTNL_
EXPR_ DYNSET_ OP - NFTNL_
EXPR_ DYNSET_ SET_ ID - NFTNL_
EXPR_ DYNSET_ SET_ NAME - NFTNL_
EXPR_ DYNSET_ SREG_ DATA - NFTNL_
EXPR_ DYNSET_ SREG_ KEY - NFTNL_
EXPR_ DYNSET_ TIMEOUT - NFTNL_
EXPR_ EXTHDR_ DREG - NFTNL_
EXPR_ EXTHDR_ LEN - NFTNL_
EXPR_ EXTHDR_ OFFSET - NFTNL_
EXPR_ EXTHDR_ TYPE - NFTNL_
EXPR_ FWD_ SREG_ DEV - NFTNL_
EXPR_ IMM_ CHAIN - NFTNL_
EXPR_ IMM_ DATA - NFTNL_
EXPR_ IMM_ DREG - NFTNL_
EXPR_ IMM_ VERDICT - NFTNL_
EXPR_ LIMIT_ BURST - NFTNL_
EXPR_ LIMIT_ FLAGS - NFTNL_
EXPR_ LIMIT_ RATE - NFTNL_
EXPR_ LIMIT_ TYPE - NFTNL_
EXPR_ LIMIT_ UNIT - NFTNL_
EXPR_ LOG_ FLAGS - NFTNL_
EXPR_ LOG_ GROUP - NFTNL_
EXPR_ LOG_ LEVEL - NFTNL_
EXPR_ LOG_ PREFIX - NFTNL_
EXPR_ LOG_ QTHRESHOLD - NFTNL_
EXPR_ LOG_ SNAPLEN - NFTNL_
EXPR_ LOOKUP_ DREG - NFTNL_
EXPR_ LOOKUP_ SET - NFTNL_
EXPR_ LOOKUP_ SET_ ID - NFTNL_
EXPR_ LOOKUP_ SREG - NFTNL_
EXPR_ MASQ_ FLAGS - NFTNL_
EXPR_ MASQ_ REG_ PROTO_ MAX - NFTNL_
EXPR_ MASQ_ REG_ PROTO_ MIN - NFTNL_
EXPR_ META_ DREG - NFTNL_
EXPR_ META_ KEY - NFTNL_
EXPR_ META_ SREG - NFTNL_
EXPR_ MT_ INFO - NFTNL_
EXPR_ MT_ NAME - NFTNL_
EXPR_ MT_ REV - NFTNL_
EXPR_ NAME - NFTNL_
EXPR_ NAT_ FAMILY - NFTNL_
EXPR_ NAT_ FLAGS - NFTNL_
EXPR_ NAT_ REG_ ADDR_ MAX - NFTNL_
EXPR_ NAT_ REG_ ADDR_ MIN - NFTNL_
EXPR_ NAT_ REG_ PROTO_ MAX - NFTNL_
EXPR_ NAT_ REG_ PROTO_ MIN - NFTNL_
EXPR_ NAT_ TYPE - NFTNL_
EXPR_ PAYLOAD_ BASE - NFTNL_
EXPR_ PAYLOAD_ CSUM_ OFFSET - NFTNL_
EXPR_ PAYLOAD_ CSUM_ TYPE - NFTNL_
EXPR_ PAYLOAD_ DREG - NFTNL_
EXPR_ PAYLOAD_ LEN - NFTNL_
EXPR_ PAYLOAD_ OFFSET - NFTNL_
EXPR_ PAYLOAD_ SREG - NFTNL_
EXPR_ QUEUE_ FLAGS - NFTNL_
EXPR_ QUEUE_ NUM - NFTNL_
EXPR_ QUEUE_ TOTAL - NFTNL_
EXPR_ REDIR_ FLAGS - NFTNL_
EXPR_ REDIR_ REG_ PROTO_ MAX - NFTNL_
EXPR_ REDIR_ REG_ PROTO_ MIN - NFTNL_
EXPR_ REJECT_ CODE - NFTNL_
EXPR_ REJECT_ TYPE - NFTNL_
EXPR_ TG_ INFO - NFTNL_
EXPR_ TG_ NAME - NFTNL_
EXPR_ TG_ REV - NFTNL_
GEN_ ID - NFTNL_
OF_ EVENT_ ANY - NFTNL_
OF_ EVENT_ DEL - NFTNL_
OF_ EVENT_ NEW - NFTNL_
OUTPUT_ DEFAULT - NFTNL_
OUTPUT_ JSON - NFTNL_
OUTPUT_ XML - NFTNL_
PARSE_ EBADINPUT - NFTNL_
PARSE_ EBADTYPE - NFTNL_
PARSE_ EMISSINGNODE - NFTNL_
PARSE_ EOPNOTSUPP - NFTNL_
PARSE_ JSON - NFTNL_
PARSE_ MAX - NFTNL_
PARSE_ NONE - NFTNL_
PARSE_ XML - NFTNL_
RULESET_ CHAIN - NFTNL_
RULESET_ CHAINLIST - NFTNL_
RULESET_ CTX_ CHAIN - NFTNL_
RULESET_ CTX_ CMD - NFTNL_
RULESET_ CTX_ DATA - NFTNL_
RULESET_ CTX_ RULE - NFTNL_
RULESET_ CTX_ SET - NFTNL_
RULESET_ CTX_ TABLE - NFTNL_
RULESET_ CTX_ TYPE - NFTNL_
RULESET_ RULE - NFTNL_
RULESET_ RULELIST - NFTNL_
RULESET_ RULESET - NFTNL_
RULESET_ SET - NFTNL_
RULESET_ SETLIST - NFTNL_
RULESET_ SET_ ELEMS - NFTNL_
RULESET_ TABLE - NFTNL_
RULESET_ TABLELIST - NFTNL_
RULESET_ UNSPEC - NFTNL_
RULE_ CHAIN - NFTNL_
RULE_ COMPAT_ FLAGS - NFTNL_
RULE_ COMPAT_ PROTO - NFTNL_
RULE_ FAMILY - NFTNL_
RULE_ HANDLE - NFTNL_
RULE_ POSITION - NFTNL_
RULE_ TABLE - NFTNL_
RULE_ USERDATA - NFTNL_
SET_ DATA_ LEN - NFTNL_
SET_ DATA_ TYPE - NFTNL_
SET_ DESC_ SIZE - NFTNL_
SET_ ELEM_ CHAIN - NFTNL_
SET_ ELEM_ DATA - NFTNL_
SET_ ELEM_ EXPIRATION - NFTNL_
SET_ ELEM_ EXPR - NFTNL_
SET_ ELEM_ FLAGS - NFTNL_
SET_ ELEM_ KEY - NFTNL_
SET_ ELEM_ TIMEOUT - NFTNL_
SET_ ELEM_ USERDATA - NFTNL_
SET_ ELEM_ VERDICT - NFTNL_
SET_ FAMILY - NFTNL_
SET_ FLAGS - NFTNL_
SET_ GC_ INTERVAL - NFTNL_
SET_ ID - NFTNL_
SET_ KEY_ LEN - NFTNL_
SET_ KEY_ TYPE - NFTNL_
SET_ NAME - NFTNL_
SET_ POLICY - NFTNL_
SET_ TABLE - NFTNL_
SET_ TIMEOUT - NFTNL_
TABLE_ FAMILY - NFTNL_
TABLE_ FLAGS - NFTNL_
TABLE_ NAME - NFTNL_
TABLE_ USE - NFTNL_
TRACE_ CHAIN - NFTNL_
TRACE_ FAMILY - NFTNL_
TRACE_ ID - NFTNL_
TRACE_ IIF - NFTNL_
TRACE_ IIFTYPE - NFTNL_
TRACE_ JUMP_ TARGET - NFTNL_
TRACE_ LL_ HEADER - NFTNL_
TRACE_ MARK - NFTNL_
TRACE_ NETWORK_ HEADER - NFTNL_
TRACE_ NFPROTO - NFTNL_
TRACE_ OIF - NFTNL_
TRACE_ OIFTYPE - NFTNL_
TRACE_ POLICY - NFTNL_
TRACE_ RULE_ HANDLE - NFTNL_
TRACE_ TABLE - NFTNL_
TRACE_ TRANSPORT_ HEADER - NFTNL_
TRACE_ TYPE - NFTNL_
TRACE_ VERDICT - __
NFTNL_ CHAIN_ MAX - __
NFTNL_ GEN_ MAX - __
NFTNL_ RULE_ MAX - __
NFTNL_ SET_ MAX - __
NFTNL_ TABLE_ MAX - __
NFTNL_ TRACE_ MAX
Functions§
- nftnl_
batch_ ⚠alloc - nftnl_
batch_ ⚠begin - nftnl_
batch_ ⚠buffer - nftnl_
batch_ ⚠buffer_ len - nftnl_
batch_ ⚠end - nftnl_
batch_ ⚠free - nftnl_
batch_ ⚠iovec - nftnl_
batch_ ⚠iovec_ len - nftnl_
batch_ ⚠is_ supported - nftnl_
batch_ ⚠update - nftnl_
chain_ ⚠alloc - nftnl_
chain_ ⚠fprintf - nftnl_
chain_ ⚠free - nftnl_
chain_ ⚠get - nftnl_
chain_ ⚠get_ data - nftnl_
chain_ ⚠get_ s32 - nftnl_
chain_ ⚠get_ str - nftnl_
chain_ ⚠get_ u8 - nftnl_
chain_ ⚠get_ u32 - nftnl_
chain_ ⚠get_ u64 - nftnl_
chain_ ⚠is_ set - nftnl_
chain_ ⚠list_ add - nftnl_
chain_ ⚠list_ add_ tail - nftnl_
chain_ ⚠list_ alloc - nftnl_
chain_ ⚠list_ del - nftnl_
chain_ ⚠list_ foreach - nftnl_
chain_ ⚠list_ free - nftnl_
chain_ ⚠list_ is_ empty - nftnl_
chain_ ⚠list_ iter_ create - nftnl_
chain_ ⚠list_ iter_ destroy - nftnl_
chain_ ⚠list_ iter_ next - nftnl_
chain_ ⚠nlmsg_ build_ payload - nftnl_
chain_ ⚠nlmsg_ parse - nftnl_
chain_ ⚠parse - nftnl_
chain_ ⚠parse_ file - nftnl_
chain_ ⚠set - nftnl_
chain_ ⚠set_ data - nftnl_
chain_ ⚠set_ s32 - nftnl_
chain_ ⚠set_ str - nftnl_
chain_ ⚠set_ u8 - nftnl_
chain_ ⚠set_ u32 - nftnl_
chain_ ⚠set_ u64 - nftnl_
chain_ ⚠snprintf - nftnl_
chain_ ⚠unset - nftnl_
expr_ ⚠alloc - nftnl_
expr_ ⚠foreach - nftnl_
expr_ ⚠free - nftnl_
expr_ ⚠get - nftnl_
expr_ ⚠get_ str - nftnl_
expr_ ⚠get_ u8 - nftnl_
expr_ ⚠get_ u16 - nftnl_
expr_ ⚠get_ u32 - nftnl_
expr_ ⚠get_ u64 - nftnl_
expr_ ⚠is_ set - nftnl_
expr_ ⚠iter_ create - nftnl_
expr_ ⚠iter_ destroy - nftnl_
expr_ ⚠iter_ next - nftnl_
expr_ ⚠set - nftnl_
expr_ ⚠set_ str - nftnl_
expr_ ⚠set_ u8 - nftnl_
expr_ ⚠set_ u16 - nftnl_
expr_ ⚠set_ u32 - nftnl_
expr_ ⚠set_ u64 - nftnl_
expr_ ⚠snprintf - nftnl_
gen_ ⚠alloc - nftnl_
gen_ ⚠fprintf - nftnl_
gen_ ⚠free - nftnl_
gen_ ⚠get - nftnl_
gen_ ⚠get_ data - nftnl_
gen_ ⚠get_ u32 - nftnl_
gen_ ⚠is_ set - nftnl_
gen_ ⚠nlmsg_ parse - nftnl_
gen_ ⚠set - nftnl_
gen_ ⚠set_ data - nftnl_
gen_ ⚠set_ u32 - nftnl_
gen_ ⚠snprintf - nftnl_
gen_ ⚠unset - nftnl_
nlmsg_ ⚠build_ hdr - nftnl_
parse_ ⚠err_ alloc - nftnl_
parse_ ⚠err_ free - nftnl_
parse_ ⚠perror - nftnl_
rule_ ⚠add_ expr - nftnl_
rule_ ⚠alloc - nftnl_
rule_ ⚠fprintf - nftnl_
rule_ ⚠free - nftnl_
rule_ ⚠get - nftnl_
rule_ ⚠get_ data - nftnl_
rule_ ⚠get_ str - nftnl_
rule_ ⚠get_ u8 - nftnl_
rule_ ⚠get_ u32 - nftnl_
rule_ ⚠get_ u64 - nftnl_
rule_ ⚠is_ set - nftnl_
rule_ ⚠list_ add - nftnl_
rule_ ⚠list_ add_ tail - nftnl_
rule_ ⚠list_ alloc - nftnl_
rule_ ⚠list_ del - nftnl_
rule_ ⚠list_ foreach - nftnl_
rule_ ⚠list_ free - nftnl_
rule_ ⚠list_ is_ empty - nftnl_
rule_ ⚠list_ iter_ create - nftnl_
rule_ ⚠list_ iter_ cur - nftnl_
rule_ ⚠list_ iter_ destroy - nftnl_
rule_ ⚠list_ iter_ next - nftnl_
rule_ ⚠nlmsg_ build_ payload - nftnl_
rule_ ⚠nlmsg_ parse - nftnl_
rule_ ⚠parse - nftnl_
rule_ ⚠parse_ file - nftnl_
rule_ ⚠set - nftnl_
rule_ ⚠set_ data - nftnl_
rule_ ⚠set_ str - nftnl_
rule_ ⚠set_ u32 - nftnl_
rule_ ⚠set_ u64 - nftnl_
rule_ ⚠snprintf - nftnl_
rule_ ⚠unset - nftnl_
ruleset_ ⚠alloc - nftnl_
ruleset_ ⚠ctx_ free - nftnl_
ruleset_ ⚠ctx_ get - nftnl_
ruleset_ ⚠ctx_ get_ u32 - nftnl_
ruleset_ ⚠ctx_ is_ set - nftnl_
ruleset_ ⚠fprintf - nftnl_
ruleset_ ⚠free - nftnl_
ruleset_ ⚠get - nftnl_
ruleset_ ⚠is_ set - nftnl_
ruleset_ ⚠parse - nftnl_
ruleset_ ⚠parse_ buffer_ cb - nftnl_
ruleset_ ⚠parse_ file - nftnl_
ruleset_ ⚠parse_ file_ cb - nftnl_
ruleset_ ⚠set - nftnl_
ruleset_ ⚠snprintf - nftnl_
ruleset_ ⚠unset - nftnl_
set_ ⚠alloc - nftnl_
set_ ⚠clone - nftnl_
set_ ⚠elem_ add - nftnl_
set_ ⚠elem_ alloc - nftnl_
set_ ⚠elem_ clone - nftnl_
set_ ⚠elem_ foreach - nftnl_
set_ ⚠elem_ fprintf - nftnl_
set_ ⚠elem_ free - nftnl_
set_ ⚠elem_ get - nftnl_
set_ ⚠elem_ get_ str - nftnl_
set_ ⚠elem_ get_ u32 - nftnl_
set_ ⚠elem_ get_ u64 - nftnl_
set_ ⚠elem_ is_ set - nftnl_
set_ ⚠elem_ nlmsg_ build_ payload - nftnl_
set_ ⚠elem_ parse - nftnl_
set_ ⚠elem_ parse_ file - nftnl_
set_ ⚠elem_ set - nftnl_
set_ ⚠elem_ set_ str - nftnl_
set_ ⚠elem_ set_ u32 - nftnl_
set_ ⚠elem_ set_ u64 - nftnl_
set_ ⚠elem_ snprintf - nftnl_
set_ ⚠elem_ unset - nftnl_
set_ ⚠elems_ iter_ create - nftnl_
set_ ⚠elems_ iter_ cur - nftnl_
set_ ⚠elems_ iter_ destroy - nftnl_
set_ ⚠elems_ iter_ next - nftnl_
set_ ⚠elems_ nlmsg_ build_ payload - nftnl_
set_ ⚠elems_ nlmsg_ build_ payload_ iter - nftnl_
set_ ⚠elems_ nlmsg_ parse - nftnl_
set_ ⚠fprintf - nftnl_
set_ ⚠free - nftnl_
set_ ⚠get - nftnl_
set_ ⚠get_ data - nftnl_
set_ ⚠get_ str - nftnl_
set_ ⚠get_ u32 - nftnl_
set_ ⚠get_ u64 - nftnl_
set_ ⚠is_ set - nftnl_
set_ ⚠list_ add - nftnl_
set_ ⚠list_ add_ tail - nftnl_
set_ ⚠list_ alloc - nftnl_
set_ ⚠list_ del - nftnl_
set_ ⚠list_ foreach - nftnl_
set_ ⚠list_ free - nftnl_
set_ ⚠list_ is_ empty - nftnl_
set_ ⚠list_ iter_ create - nftnl_
set_ ⚠list_ iter_ cur - nftnl_
set_ ⚠list_ iter_ destroy - nftnl_
set_ ⚠list_ iter_ next - nftnl_
set_ ⚠nlmsg_ build_ payload - nftnl_
set_ ⚠nlmsg_ parse - nftnl_
set_ ⚠parse - nftnl_
set_ ⚠parse_ file - nftnl_
set_ ⚠set - nftnl_
set_ ⚠set_ data - nftnl_
set_ ⚠set_ str - nftnl_
set_ ⚠set_ u32 - nftnl_
set_ ⚠set_ u64 - nftnl_
set_ ⚠snprintf - nftnl_
set_ ⚠unset - nftnl_
table_ ⚠alloc - nftnl_
table_ ⚠fprintf - nftnl_
table_ ⚠free - nftnl_
table_ ⚠get - nftnl_
table_ ⚠get_ data - nftnl_
table_ ⚠get_ str - nftnl_
table_ ⚠get_ u8 - nftnl_
table_ ⚠get_ u32 - nftnl_
table_ ⚠is_ set - nftnl_
table_ ⚠list_ add - nftnl_
table_ ⚠list_ add_ tail - nftnl_
table_ ⚠list_ alloc - nftnl_
table_ ⚠list_ del - nftnl_
table_ ⚠list_ foreach - nftnl_
table_ ⚠list_ free - nftnl_
table_ ⚠list_ is_ empty - nftnl_
table_ ⚠list_ iter_ create - nftnl_
table_ ⚠list_ iter_ destroy - nftnl_
table_ ⚠list_ iter_ next - nftnl_
table_ ⚠nlmsg_ build_ payload - nftnl_
table_ ⚠nlmsg_ parse - nftnl_
table_ ⚠parse - nftnl_
table_ ⚠parse_ file - nftnl_
table_ ⚠set - nftnl_
table_ ⚠set_ data - nftnl_
table_ ⚠set_ str - nftnl_
table_ ⚠set_ u8 - nftnl_
table_ ⚠set_ u32 - nftnl_
table_ ⚠snprintf - nftnl_
table_ ⚠unset - nftnl_
trace_ ⚠alloc - nftnl_
trace_ ⚠free - nftnl_
trace_ ⚠get_ data - nftnl_
trace_ ⚠get_ str - nftnl_
trace_ ⚠get_ u16 - nftnl_
trace_ ⚠get_ u32 - nftnl_
trace_ ⚠get_ u64 - nftnl_
trace_ ⚠is_ set - nftnl_
trace_ ⚠nlmsg_ parse - nftnl_
udata_ ⚠buf_ alloc - nftnl_
udata_ ⚠buf_ data - nftnl_
udata_ ⚠buf_ free - nftnl_
udata_ ⚠buf_ len - nftnl_
udata_ ⚠buf_ put - nftnl_
udata_ ⚠end - nftnl_
udata_ ⚠get - nftnl_
udata_ ⚠len - nftnl_
udata_ ⚠next - nftnl_
udata_ ⚠parse - nftnl_
udata_ ⚠put - nftnl_
udata_ ⚠put_ strz - nftnl_
udata_ ⚠start - nftnl_
udata_ ⚠type