diff options
author | lafleur <lafleur@boum.org> | 2021-11-06 15:29:12 +0100 |
---|---|---|
committer | lafleur <lafleur@boum.org> | 2021-11-06 16:22:02 +0100 |
commit | 6bf99a03b8bd63f63f935d2a7bcd1ea0416e7b40 (patch) | |
tree | edc801e8fa1fa66a2a9634e9b1ab76f5a4323bf0 | |
parent | ef538ede9dd53c09ac6a29361ebe67eed7cc6ce5 (diff) |
automatically generate nf_tables rust headers
-rw-r--r-- | .gitlab-ci.yml | 12 | ||||
-rw-r--r-- | rustables/Cargo.toml | 6 | ||||
-rw-r--r-- | rustables/build.rs | 48 | ||||
-rw-r--r-- | rustables/src/tests/mod.rs | 6 | ||||
-rw-r--r-- | rustables/src/tests/sys.rs | 833 | ||||
-rw-r--r-- | rustables/wrapper.h | 1 |
6 files changed, 65 insertions, 841 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 63343a9..d675099 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,11 +2,11 @@ # https://hub.docker.com/r/library/rust/tags/ image: "rust:alpine" -# Optional: Install a C compiler, cmake and git into the container. -# You will often need this when you (or any of your dependencies) depends on C code. +# clang-libs are needed by bindgen. build-base contains various needed things, +# among which crti.o and pkg-config. before_script: - apk update - - apk add build-base pkgconf libmnl-dev libnftnl-dev + - apk add build-base libmnl-dev libnftnl-dev clang-libs cache: paths: @@ -16,9 +16,11 @@ cache: variables: # Set CARGO_HOME inside the CI directory, otherwise cargo won't use the cache. CARGO_HOME: $CI_PROJECT_DIR/cargo - # Let rust create dynamically linked builds under musl libc - see [this rust issue](https://github.com/rust-lang/compiler-team/issues/422) + # Let rust create dynamically linked builds under musl libc - see [this rust + # issue](https://github.com/rust-lang/compiler-team/issues/422) RUSTFLAGS: "-C target-feature=-crt-static" - # Same consideration for doc tests - see [this rust issue](https://github.com/rust-lang/cargo/issues/6650) + # Same consideration for doc tests - see [this rust + # issue](https://github.com/rust-lang/cargo/issues/6650) RUSTDOCFLAGS: "-C target-feature=-crt-static" test:cargo: diff --git a/rustables/Cargo.toml b/rustables/Cargo.toml index bf9ee2e..d948055 100644 --- a/rustables/Cargo.toml +++ b/rustables/Cargo.toml @@ -31,3 +31,9 @@ mnl = "0.2" [dev-dependencies] ipnetwork = "0.16" + +[build-dependencies] +bindgen = "0.53.1" +regex = "1.5.4" +lazy_static = "1.4.0" + diff --git a/rustables/build.rs b/rustables/build.rs new file mode 100644 index 0000000..fee34ff --- /dev/null +++ b/rustables/build.rs @@ -0,0 +1,48 @@ +use bindgen; + +use std::fs::File; +use std::io::Write; +use std::path::PathBuf; +use std::borrow::Cow; +use lazy_static::lazy_static; +use regex::{Captures, Regex}; + + +/// Recast nft_*_attributes from u32 to u16 in header file `before`. +fn reformat_units(before: &str) -> Cow<str> { + lazy_static! { + static ref RE: Regex = Regex::new(r"(pub type nft[a-zA-Z_]*_attributes) = u32;").unwrap(); + } + RE.replace_all(before, |captures: &Captures| { + format!("{} = u16;", &captures[1]) + }) +} + +fn main() { + // Tell cargo to invalidate the built crate whenever the headers change. + println!("cargo:rerun-if-changed=wrapper.h"); + + let bindings = bindgen::Builder::default() + .header("wrapper.h") + .generate_comments(false) + .prepend_enum_name(false) + // Tell cargo to invalidate the built crate whenever any of the + // included header files changed. + .parse_callbacks(Box::new(bindgen::CargoCallbacks)) + // Finish the builder and generate the bindings. + .generate() + // Unwrap the Result and panic on failure. + .expect("Unable to generate bindings"); + + // Add newlines because in alpine bindgen doesn't add them after statements. + let s = bindings.to_string().replace(" ; ", ";\n"); + let s = reformat_units(&s); + let h = String::from("#![allow(non_camel_case_types, dead_code)]\n\n") + &s; + + // Write the bindings to the rust header file. + let out_path = PathBuf::from("src/tests/bindings.rs"); + File::create(out_path) + .expect("Error: could not create rust header file.") + .write_all(&h.as_bytes()) + .expect("Error: could not write to the rust header file."); +} diff --git a/rustables/src/tests/mod.rs b/rustables/src/tests/mod.rs index 0c2c113..9a76606 100644 --- a/rustables/src/tests/mod.rs +++ b/rustables/src/tests/mod.rs @@ -5,15 +5,15 @@ use crate::expr::{ }; use crate::set::Set; use crate::{nft_nlmsg_maxsize, Chain, MsgType, NlMsg, ProtoFamily, Rule, Table}; -use rustables_sys::libc::{nlmsghdr, AF_UNIX, NFNETLINK_V0, NFNL_SUBSYS_NFTABLES, NFT_MSG_NEWRULE}; +use rustables_sys::libc::{nlmsghdr, AF_UNIX, NFNETLINK_V0, NFNL_SUBSYS_NFTABLES}; use std::ffi::{c_void, CStr}; use std::mem::size_of; use std::net::Ipv4Addr; use std::rc::Rc; use thiserror::Error; -mod sys; -use sys::*; +mod bindings; +use bindings::*; fn get_subsystem_from_nlmsghdr_type(x: u16) -> u8 { ((x & 0xff00) >> 8) as u8 diff --git a/rustables/src/tests/sys.rs b/rustables/src/tests/sys.rs deleted file mode 100644 index 2eb3cc2..0000000 --- a/rustables/src/tests/sys.rs +++ /dev/null @@ -1,833 +0,0 @@ -/* automatically generated by rust-bindgen 0.59.1 */ -// to regen, please run `bindgen /usr/include/linux/netfilter/nf_tables.h --no-doc-comments --no-prepend-enum-name` -// then replace the uint by u16 for convenience: in (neo)vim, run %s/\(pub type nft_[a-zA-Z_]*_attributes\) = ::std::os::raw::c_uint;/\1 = u16;/ -#![allow(non_camel_case_types, dead_code)] - -pub const NFT_NAME_MAXLEN: u32 = 256; -pub const NFT_TABLE_MAXNAMELEN: u32 = 256; -pub const NFT_CHAIN_MAXNAMELEN: u32 = 256; -pub const NFT_SET_MAXNAMELEN: u32 = 256; -pub const NFT_OBJ_MAXNAMELEN: u32 = 256; -pub const NFT_USERDATA_MAXLEN: u32 = 256; -pub const NFT_OSF_MAXGENRELEN: u32 = 16; -pub const NFT_REG_SIZE: u32 = 16; -pub const NFT_REG32_SIZE: u32 = 4; -pub const NFT_DATA_RESERVED_MASK: u32 = 4294967040; -pub const NFT_DATA_VALUE_MAXLEN: u32 = 64; -pub const NFT_QUEUE_FLAG_BYPASS: u32 = 1; -pub const NFT_QUEUE_FLAG_CPU_FANOUT: u32 = 2; -pub const NFT_QUEUE_FLAG_MASK: u32 = 3; -pub const NFT_SECMARK_CTX_MAXLEN: u32 = 256; -pub const NFT_OBJECT_UNSPEC: u32 = 0; -pub const NFT_OBJECT_COUNTER: u32 = 1; -pub const NFT_OBJECT_QUOTA: u32 = 2; -pub const NFT_OBJECT_CT_HELPER: u32 = 3; -pub const NFT_OBJECT_LIMIT: u32 = 4; -pub const NFT_OBJECT_CONNLIMIT: u32 = 5; -pub const NFT_OBJECT_TUNNEL: u32 = 6; -pub const NFT_OBJECT_CT_TIMEOUT: u32 = 7; -pub const NFT_OBJECT_SECMARK: u32 = 8; -pub const NFT_OBJECT_CT_EXPECT: u32 = 9; -pub const NFT_OBJECT_SYNPROXY: u32 = 10; -pub const __NFT_OBJECT_MAX: u32 = 11; -pub const NFT_OBJECT_MAX: u32 = 10; -pub const NFT_REG_VERDICT: nft_registers = 0; -pub const NFT_REG_1: nft_registers = 1; -pub const NFT_REG_2: nft_registers = 2; -pub const NFT_REG_3: nft_registers = 3; -pub const NFT_REG_4: nft_registers = 4; -pub const __NFT_REG_MAX: nft_registers = 5; -pub const NFT_REG32_00: nft_registers = 8; -pub const NFT_REG32_01: nft_registers = 9; -pub const NFT_REG32_02: nft_registers = 10; -pub const NFT_REG32_03: nft_registers = 11; -pub const NFT_REG32_04: nft_registers = 12; -pub const NFT_REG32_05: nft_registers = 13; -pub const NFT_REG32_06: nft_registers = 14; -pub const NFT_REG32_07: nft_registers = 15; -pub const NFT_REG32_08: nft_registers = 16; -pub const NFT_REG32_09: nft_registers = 17; -pub const NFT_REG32_10: nft_registers = 18; -pub const NFT_REG32_11: nft_registers = 19; -pub const NFT_REG32_12: nft_registers = 20; -pub const NFT_REG32_13: nft_registers = 21; -pub const NFT_REG32_14: nft_registers = 22; -pub const NFT_REG32_15: nft_registers = 23; -pub type nft_registers = ::std::os::raw::c_uint; -pub const NFT_CONTINUE: nft_verdicts = -1; -pub const NFT_BREAK: nft_verdicts = -2; -pub const NFT_JUMP: nft_verdicts = -3; -pub const NFT_GOTO: nft_verdicts = -4; -pub const NFT_RETURN: nft_verdicts = -5; -pub type nft_verdicts = ::std::os::raw::c_int; -pub const NFT_MSG_NEWTABLE: nf_tables_msg_types = 0; -pub const NFT_MSG_GETTABLE: nf_tables_msg_types = 1; -pub const NFT_MSG_DELTABLE: nf_tables_msg_types = 2; -pub const NFT_MSG_NEWCHAIN: nf_tables_msg_types = 3; -pub const NFT_MSG_GETCHAIN: nf_tables_msg_types = 4; -pub const NFT_MSG_DELCHAIN: nf_tables_msg_types = 5; -pub const NFT_MSG_NEWRULE: nf_tables_msg_types = 6; -pub const NFT_MSG_GETRULE: nf_tables_msg_types = 7; -pub const NFT_MSG_DELRULE: nf_tables_msg_types = 8; -pub const NFT_MSG_NEWSET: nf_tables_msg_types = 9; -pub const NFT_MSG_GETSET: nf_tables_msg_types = 10; -pub const NFT_MSG_DELSET: nf_tables_msg_types = 11; -pub const NFT_MSG_NEWSETELEM: nf_tables_msg_types = 12; -pub const NFT_MSG_GETSETELEM: nf_tables_msg_types = 13; -pub const NFT_MSG_DELSETELEM: nf_tables_msg_types = 14; -pub const NFT_MSG_NEWGEN: nf_tables_msg_types = 15; -pub const NFT_MSG_GETGEN: nf_tables_msg_types = 16; -pub const NFT_MSG_TRACE: nf_tables_msg_types = 17; -pub const NFT_MSG_NEWOBJ: nf_tables_msg_types = 18; -pub const NFT_MSG_GETOBJ: nf_tables_msg_types = 19; -pub const NFT_MSG_DELOBJ: nf_tables_msg_types = 20; -pub const NFT_MSG_GETOBJ_RESET: nf_tables_msg_types = 21; -pub const NFT_MSG_NEWFLOWTABLE: nf_tables_msg_types = 22; -pub const NFT_MSG_GETFLOWTABLE: nf_tables_msg_types = 23; -pub const NFT_MSG_DELFLOWTABLE: nf_tables_msg_types = 24; -pub const NFT_MSG_MAX: nf_tables_msg_types = 25; -pub type nf_tables_msg_types = ::std::os::raw::c_uint; -pub const NFTA_LIST_UNSPEC: nft_list_attributes = 0; -pub const NFTA_LIST_ELEM: nft_list_attributes = 1; -pub const __NFTA_LIST_MAX: nft_list_attributes = 2; -pub type nft_list_attributes = u16; -pub const NFTA_HOOK_UNSPEC: nft_hook_attributes = 0; -pub const NFTA_HOOK_HOOKNUM: nft_hook_attributes = 1; -pub const NFTA_HOOK_PRIORITY: nft_hook_attributes = 2; -pub const NFTA_HOOK_DEV: nft_hook_attributes = 3; -pub const NFTA_HOOK_DEVS: nft_hook_attributes = 4; -pub const __NFTA_HOOK_MAX: nft_hook_attributes = 5; -pub type nft_hook_attributes = u16; -pub const NFT_TABLE_F_DORMANT: nft_table_flags = 1; -pub const NFT_TABLE_F_OWNER: nft_table_flags = 2; -pub type nft_table_flags = ::std::os::raw::c_uint; -pub const NFTA_TABLE_UNSPEC: nft_table_attributes = 0; -pub const NFTA_TABLE_NAME: nft_table_attributes = 1; -pub const NFTA_TABLE_FLAGS: nft_table_attributes = 2; -pub const NFTA_TABLE_USE: nft_table_attributes = 3; -pub const NFTA_TABLE_HANDLE: nft_table_attributes = 4; -pub const NFTA_TABLE_PAD: nft_table_attributes = 5; -pub const NFTA_TABLE_USERDATA: nft_table_attributes = 6; -pub const NFTA_TABLE_OWNER: nft_table_attributes = 7; -pub const __NFTA_TABLE_MAX: nft_table_attributes = 8; -pub type nft_table_attributes = u16; -pub const NFT_CHAIN_BASE: nft_chain_flags = 1; -pub const NFT_CHAIN_HW_OFFLOAD: nft_chain_flags = 2; -pub const NFT_CHAIN_BINDING: nft_chain_flags = 4; -pub type nft_chain_flags = ::std::os::raw::c_uint; -pub const NFTA_CHAIN_UNSPEC: nft_chain_attributes = 0; -pub const NFTA_CHAIN_TABLE: nft_chain_attributes = 1; -pub const NFTA_CHAIN_HANDLE: nft_chain_attributes = 2; -pub const NFTA_CHAIN_NAME: nft_chain_attributes = 3; -pub const NFTA_CHAIN_HOOK: nft_chain_attributes = 4; -pub const NFTA_CHAIN_POLICY: nft_chain_attributes = 5; -pub const NFTA_CHAIN_USE: nft_chain_attributes = 6; -pub const NFTA_CHAIN_TYPE: nft_chain_attributes = 7; -pub const NFTA_CHAIN_COUNTERS: nft_chain_attributes = 8; -pub const NFTA_CHAIN_PAD: nft_chain_attributes = 9; -pub const NFTA_CHAIN_FLAGS: nft_chain_attributes = 10; -pub const NFTA_CHAIN_ID: nft_chain_attributes = 11; -pub const NFTA_CHAIN_USERDATA: nft_chain_attributes = 12; -pub const __NFTA_CHAIN_MAX: nft_chain_attributes = 13; -pub type nft_chain_attributes = u16; -pub const NFTA_RULE_UNSPEC: nft_rule_attributes = 0; -pub const NFTA_RULE_TABLE: nft_rule_attributes = 1; -pub const NFTA_RULE_CHAIN: nft_rule_attributes = 2; -pub const NFTA_RULE_HANDLE: nft_rule_attributes = 3; -pub const NFTA_RULE_EXPRESSIONS: nft_rule_attributes = 4; -pub const NFTA_RULE_COMPAT: nft_rule_attributes = 5; -pub const NFTA_RULE_POSITION: nft_rule_attributes = 6; -pub const NFTA_RULE_USERDATA: nft_rule_attributes = 7; -pub const NFTA_RULE_PAD: nft_rule_attributes = 8; -pub const NFTA_RULE_ID: nft_rule_attributes = 9; -pub const NFTA_RULE_POSITION_ID: nft_rule_attributes = 10; -pub const NFTA_RULE_CHAIN_ID: nft_rule_attributes = 11; -pub const __NFTA_RULE_MAX: nft_rule_attributes = 12; -pub type nft_rule_attributes = u16; -pub const NFT_RULE_COMPAT_F_INV: nft_rule_compat_flags = 2; -pub const NFT_RULE_COMPAT_F_MASK: nft_rule_compat_flags = 2; -pub type nft_rule_compat_flags = ::std::os::raw::c_uint; -pub const NFTA_RULE_COMPAT_UNSPEC: nft_rule_compat_attributes = 0; -pub const NFTA_RULE_COMPAT_PROTO: nft_rule_compat_attributes = 1; -pub const NFTA_RULE_COMPAT_FLAGS: nft_rule_compat_attributes = 2; -pub const __NFTA_RULE_COMPAT_MAX: nft_rule_compat_attributes = 3; -pub type nft_rule_compat_attributes = u16; -pub const NFT_SET_ANONYMOUS: nft_set_flags = 1; -pub const NFT_SET_CONSTANT: nft_set_flags = 2; -pub const NFT_SET_INTERVAL: nft_set_flags = 4; -pub const NFT_SET_MAP: nft_set_flags = 8; -pub const NFT_SET_TIMEOUT: nft_set_flags = 16; -pub const NFT_SET_EVAL: nft_set_flags = 32; -pub const NFT_SET_OBJECT: nft_set_flags = 64; -pub const NFT_SET_CONCAT: nft_set_flags = 128; -pub const NFT_SET_EXPR: nft_set_flags = 256; -pub type nft_set_flags = ::std::os::raw::c_uint; -pub const NFT_SET_POL_PERFORMANCE: nft_set_policies = 0; -pub const NFT_SET_POL_MEMORY: nft_set_policies = 1; -pub type nft_set_policies = ::std::os::raw::c_uint; -pub const NFTA_SET_DESC_UNSPEC: nft_set_desc_attributes = 0; -pub const NFTA_SET_DESC_SIZE: nft_set_desc_attributes = 1; -pub const NFTA_SET_DESC_CONCAT: nft_set_desc_attributes = 2; -pub const __NFTA_SET_DESC_MAX: nft_set_desc_attributes = 3; -pub type nft_set_desc_attributes = u16; -pub const NFTA_SET_FIELD_UNSPEC: nft_set_field_attributes = 0; -pub const NFTA_SET_FIELD_LEN: nft_set_field_attributes = 1; -pub const __NFTA_SET_FIELD_MAX: nft_set_field_attributes = 2; -pub type nft_set_field_attributes = u16; -pub const NFTA_SET_UNSPEC: nft_set_attributes = 0; -pub const NFTA_SET_TABLE: nft_set_attributes = 1; -pub const NFTA_SET_NAME: nft_set_attributes = 2; -pub const NFTA_SET_FLAGS: nft_set_attributes = 3; -pub const NFTA_SET_KEY_TYPE: nft_set_attributes = 4; -pub const NFTA_SET_KEY_LEN: nft_set_attributes = 5; -pub const NFTA_SET_DATA_TYPE: nft_set_attributes = 6; -pub const NFTA_SET_DATA_LEN: nft_set_attributes = 7; -pub const NFTA_SET_POLICY: nft_set_attributes = 8; -pub const NFTA_SET_DESC: nft_set_attributes = 9; -pub const NFTA_SET_ID: nft_set_attributes = 10; -pub const NFTA_SET_TIMEOUT: nft_set_attributes = 11; -pub const NFTA_SET_GC_INTERVAL: nft_set_attributes = 12; -pub const NFTA_SET_USERDATA: nft_set_attributes = 13; -pub const NFTA_SET_PAD: nft_set_attributes = 14; -pub const NFTA_SET_OBJ_TYPE: nft_set_attributes = 15; -pub const NFTA_SET_HANDLE: nft_set_attributes = 16; -pub const NFTA_SET_EXPR: nft_set_attributes = 17; -pub const NFTA_SET_EXPRESSIONS: nft_set_attributes = 18; -pub const __NFTA_SET_MAX: nft_set_attributes = 19; -pub type nft_set_attributes = u16; -pub const NFT_SET_ELEM_INTERVAL_END: nft_set_elem_flags = 1; -pub const NFT_SET_ELEM_CATCHALL: nft_set_elem_flags = 2; -pub type nft_set_elem_flags = ::std::os::raw::c_uint; -pub const NFTA_SET_ELEM_UNSPEC: nft_set_elem_attributes = 0; -pub const NFTA_SET_ELEM_KEY: nft_set_elem_attributes = 1; -pub const NFTA_SET_ELEM_DATA: nft_set_elem_attributes = 2; -pub const NFTA_SET_ELEM_FLAGS: nft_set_elem_attributes = 3; -pub const NFTA_SET_ELEM_TIMEOUT: nft_set_elem_attributes = 4; -pub const NFTA_SET_ELEM_EXPIRATION: nft_set_elem_attributes = 5; -pub const NFTA_SET_ELEM_USERDATA: nft_set_elem_attributes = 6; -pub const NFTA_SET_ELEM_EXPR: nft_set_elem_attributes = 7; -pub const NFTA_SET_ELEM_PAD: nft_set_elem_attributes = 8; -pub const NFTA_SET_ELEM_OBJREF: nft_set_elem_attributes = 9; -pub const NFTA_SET_ELEM_KEY_END: nft_set_elem_attributes = 10; -pub const NFTA_SET_ELEM_EXPRESSIONS: nft_set_elem_attributes = 11; -pub const __NFTA_SET_ELEM_MAX: nft_set_elem_attributes = 12; -pub type nft_set_elem_attributes = u16; -pub const NFTA_SET_ELEM_LIST_UNSPEC: nft_set_elem_list_attributes = 0; -pub const NFTA_SET_ELEM_LIST_TABLE: nft_set_elem_list_attributes = 1; -pub const NFTA_SET_ELEM_LIST_SET: nft_set_elem_list_attributes = 2; -pub const NFTA_SET_ELEM_LIST_ELEMENTS: nft_set_elem_list_attributes = 3; -pub const NFTA_SET_ELEM_LIST_SET_ID: nft_set_elem_list_attributes = 4; -pub const __NFTA_SET_ELEM_LIST_MAX: nft_set_elem_list_attributes = 5; -pub type nft_set_elem_list_attributes = u16; -pub const NFT_DATA_VALUE: nft_data_types = 0; -pub const NFT_DATA_VERDICT: nft_data_types = 4294967040; -pub type nft_data_types = ::std::os::raw::c_uint; -pub const NFTA_DATA_UNSPEC: nft_data_attributes = 0; -pub const NFTA_DATA_VALUE: nft_data_attributes = 1; -pub const NFTA_DATA_VERDICT: nft_data_attributes = 2; -pub const __NFTA_DATA_MAX: nft_data_attributes = 3; -pub type nft_data_attributes = u16; -pub const NFTA_VERDICT_UNSPEC: nft_verdict_attributes = 0; -pub const NFTA_VERDICT_CODE: nft_verdict_attributes = 1; -pub const NFTA_VERDICT_CHAIN: nft_verdict_attributes = 2; -pub const NFTA_VERDICT_CHAIN_ID: nft_verdict_attributes = 3; -pub const __NFTA_VERDICT_MAX: nft_verdict_attributes = 4; -pub type nft_verdict_attributes = u16; -pub const NFTA_EXPR_UNSPEC: nft_expr_attributes = 0; -pub const NFTA_EXPR_NAME: nft_expr_attributes = 1; -pub const NFTA_EXPR_DATA: nft_expr_attributes = 2; -pub const __NFTA_EXPR_MAX: nft_expr_attributes = 3; -pub type nft_expr_attributes = u16; -pub const NFTA_IMMEDIATE_UNSPEC: nft_immediate_attributes = 0; -pub const NFTA_IMMEDIATE_DREG: nft_immediate_attributes = 1; -pub const NFTA_IMMEDIATE_DATA: nft_immediate_attributes = 2; -pub const __NFTA_IMMEDIATE_MAX: nft_immediate_attributes = 3; -pub type nft_immediate_attributes = u16; -pub const NFT_BITWISE_BOOL: nft_bitwise_ops = 0; -pub const NFT_BITWISE_LSHIFT: nft_bitwise_ops = 1; -pub const NFT_BITWISE_RSHIFT: nft_bitwise_ops = 2; -pub type nft_bitwise_ops = ::std::os::raw::c_uint; -pub const NFTA_BITWISE_UNSPEC: nft_bitwise_attributes = 0; -pub const NFTA_BITWISE_SREG: nft_bitwise_attributes = 1; -pub const NFTA_BITWISE_DREG: nft_bitwise_attributes = 2; -pub const NFTA_BITWISE_LEN: nft_bitwise_attributes = 3; -pub const NFTA_BITWISE_MASK: nft_bitwise_attributes = 4; -pub const NFTA_BITWISE_XOR: nft_bitwise_attributes = 5; -pub const NFTA_BITWISE_OP: nft_bitwise_attributes = 6; -pub const NFTA_BITWISE_DATA: nft_bitwise_attributes = 7; -pub const __NFTA_BITWISE_MAX: nft_bitwise_attributes = 8; -pub type nft_bitwise_attributes = u16; -pub const NFT_BYTEORDER_NTOH: nft_byteorder_ops = 0; -pub const NFT_BYTEORDER_HTON: nft_byteorder_ops = 1; -pub type nft_byteorder_ops = ::std::os::raw::c_uint; -pub const NFTA_BYTEORDER_UNSPEC: nft_byteorder_attributes = 0; -pub const NFTA_BYTEORDER_SREG: nft_byteorder_attributes = 1; -pub const NFTA_BYTEORDER_DREG: nft_byteorder_attributes = 2; -pub const NFTA_BYTEORDER_OP: nft_byteorder_attributes = 3; -pub const NFTA_BYTEORDER_LEN: nft_byteorder_attributes = 4; -pub const NFTA_BYTEORDER_SIZE: nft_byteorder_attributes = 5; -pub const __NFTA_BYTEORDER_MAX: nft_byteorder_attributes = 6; -pub type nft_byteorder_attributes = u16; -pub const NFT_CMP_EQ: nft_cmp_ops = 0; -pub const NFT_CMP_NEQ: nft_cmp_ops = 1; -pub const NFT_CMP_LT: nft_cmp_ops = 2; -pub const NFT_CMP_LTE: nft_cmp_ops = 3; -pub const NFT_CMP_GT: nft_cmp_ops = 4; -pub const NFT_CMP_GTE: nft_cmp_ops = 5; -pub type nft_cmp_ops = ::std::os::raw::c_uint; -pub const NFTA_CMP_UNSPEC: nft_cmp_attributes = 0; -pub const NFTA_CMP_SREG: nft_cmp_attributes = 1; -pub const NFTA_CMP_OP: nft_cmp_attributes = 2; -pub const NFTA_CMP_DATA: nft_cmp_attributes = 3; -pub const __NFTA_CMP_MAX: nft_cmp_attributes = 4; -pub type nft_cmp_attributes = u16; -pub const NFT_RANGE_EQ: nft_range_ops = 0; -pub const NFT_RANGE_NEQ: nft_range_ops = 1; -pub type nft_range_ops = ::std::os::raw::c_uint; -pub const NFTA_RANGE_UNSPEC: nft_range_attributes = 0; -pub const NFTA_RANGE_SREG: nft_range_attributes = 1; -pub const NFTA_RANGE_OP: nft_range_attributes = 2; -pub const NFTA_RANGE_FROM_DATA: nft_range_attributes = 3; -pub const NFTA_RANGE_TO_DATA: nft_range_attributes = 4; -pub const __NFTA_RANGE_MAX: nft_range_attributes = 5; -pub type nft_range_attributes = u16; -pub const NFT_LOOKUP_F_INV: nft_lookup_flags = 1; -pub type nft_lookup_flags = ::std::os::raw::c_uint; -pub const NFTA_LOOKUP_UNSPEC: nft_lookup_attributes = 0; -pub const NFTA_LOOKUP_SET: nft_lookup_attributes = 1; -pub const NFTA_LOOKUP_SREG: nft_lookup_attributes = 2; -pub const NFTA_LOOKUP_DREG: nft_lookup_attributes = 3; -pub const NFTA_LOOKUP_SET_ID: nft_lookup_attributes = 4; -pub const NFTA_LOOKUP_FLAGS: nft_lookup_attributes = 5; -pub const __NFTA_LOOKUP_MAX: nft_lookup_attributes = 6; -pub type nft_lookup_attributes = u16; -pub const NFT_DYNSET_OP_ADD: nft_dynset_ops = 0; -pub const NFT_DYNSET_OP_UPDATE: nft_dynset_ops = 1; -pub const NFT_DYNSET_OP_DELETE: nft_dynset_ops = 2; -pub type nft_dynset_ops = ::std::os::raw::c_uint; -pub const NFT_DYNSET_F_INV: nft_dynset_flags = 1; -pub const NFT_DYNSET_F_EXPR: nft_dynset_flags = 2; -pub type nft_dynset_flags = ::std::os::raw::c_uint; -pub const NFTA_DYNSET_UNSPEC: nft_dynset_attributes = 0; -pub const NFTA_DYNSET_SET_NAME: nft_dynset_attributes = 1; -pub const NFTA_DYNSET_SET_ID: nft_dynset_attributes = 2; -pub const NFTA_DYNSET_OP: nft_dynset_attributes = 3; -pub const NFTA_DYNSET_SREG_KEY: nft_dynset_attributes = 4; -pub const NFTA_DYNSET_SREG_DATA: nft_dynset_attributes = 5; -pub const NFTA_DYNSET_TIMEOUT: nft_dynset_attributes = 6; -pub const NFTA_DYNSET_EXPR: nft_dynset_attributes = 7; -pub const NFTA_DYNSET_PAD: nft_dynset_attributes = 8; -pub const NFTA_DYNSET_FLAGS: nft_dynset_attributes = 9; -pub const NFTA_DYNSET_EXPRESSIONS: nft_dynset_attributes = 10; -pub const __NFTA_DYNSET_MAX: nft_dynset_attributes = 11; -pub type nft_dynset_attributes = u16; -pub const NFT_PAYLOAD_LL_HEADER: nft_payload_bases = 0; -pub const NFT_PAYLOAD_NETWORK_HEADER: nft_payload_bases = 1; -pub const NFT_PAYLOAD_TRANSPORT_HEADER: nft_payload_bases = 2; -pub type nft_payload_bases = ::std::os::raw::c_uint; -pub const NFT_PAYLOAD_CSUM_NONE: nft_payload_csum_types = 0; -pub const NFT_PAYLOAD_CSUM_INET: nft_payload_csum_types = 1; -pub const NFT_PAYLOAD_CSUM_SCTP: nft_payload_csum_types = 2; -pub type nft_payload_csum_types = ::std::os::raw::c_uint; -pub const NFT_PAYLOAD_L4CSUM_PSEUDOHDR: nft_payload_csum_flags = 1; -pub type nft_payload_csum_flags = ::std::os::raw::c_uint; -pub const NFTA_PAYLOAD_UNSPEC: nft_payload_attributes = 0; -pub const NFTA_PAYLOAD_DREG: nft_payload_attributes = 1; -pub const NFTA_PAYLOAD_BASE: nft_payload_attributes = 2; -pub const NFTA_PAYLOAD_OFFSET: nft_payload_attributes = 3; -pub const NFTA_PAYLOAD_LEN: nft_payload_attributes = 4; -pub const NFTA_PAYLOAD_SREG: nft_payload_attributes = 5; -pub const NFTA_PAYLOAD_CSUM_TYPE: nft_payload_attributes = 6; -pub const NFTA_PAYLOAD_CSUM_OFFSET: nft_payload_attributes = 7; -pub const NFTA_PAYLOAD_CSUM_FLAGS: nft_payload_attributes = 8; -pub const __NFTA_PAYLOAD_MAX: nft_payload_attributes = 9; -pub type nft_payload_attributes = u16; -pub const NFT_EXTHDR_F_PRESENT: nft_exthdr_flags = 1; -pub type nft_exthdr_flags = ::std::os::raw::c_uint; -pub const NFT_EXTHDR_OP_IPV6: nft_exthdr_op = 0; -pub const NFT_EXTHDR_OP_TCPOPT: nft_exthdr_op = 1; -pub const NFT_EXTHDR_OP_IPV4: nft_exthdr_op = 2; -pub const NFT_EXTHDR_OP_SCTP: nft_exthdr_op = 3; -pub const __NFT_EXTHDR_OP_MAX: nft_exthdr_op = 4; -pub type nft_exthdr_op = ::std::os::raw::c_uint; -pub const NFTA_EXTHDR_UNSPEC: nft_exthdr_attributes = 0; -pub const NFTA_EXTHDR_DREG: nft_exthdr_attributes = 1; -pub const NFTA_EXTHDR_TYPE: nft_exthdr_attributes = 2; -pub const NFTA_EXTHDR_OFFSET: nft_exthdr_attributes = 3; -pub const NFTA_EXTHDR_LEN: nft_exthdr_attributes = 4; -pub const NFTA_EXTHDR_FLAGS: nft_exthdr_attributes = 5; -pub const NFTA_EXTHDR_OP: nft_exthdr_attributes = 6; -pub const NFTA_EXTHDR_SREG: nft_exthdr_attributes = 7; -pub const __NFTA_EXTHDR_MAX: nft_exthdr_attributes = 8; -pub type nft_exthdr_attributes = u16; -pub const NFT_META_LEN: nft_meta_keys = 0; -pub const NFT_META_PROTOCOL: nft_meta_keys = 1; -pub const NFT_META_PRIORITY: nft_meta_keys = 2; -pub const NFT_META_MARK: nft_meta_keys = 3; -pub const NFT_META_IIF: nft_meta_keys = 4; -pub const NFT_META_OIF: nft_meta_keys = 5; -pub const NFT_META_IIFNAME: nft_meta_keys = 6; -pub const NFT_META_OIFNAME: nft_meta_keys = 7; -pub const NFT_META_IIFTYPE: nft_meta_keys = 8; -pub const NFT_META_OIFTYPE: nft_meta_keys = 9; -pub const NFT_META_SKUID: nft_meta_keys = 10; -pub const NFT_META_SKGID: nft_meta_keys = 11; -pub const NFT_META_NFTRACE: nft_meta_keys = 12; -pub const NFT_META_RTCLASSID: nft_meta_keys = 13; -pub const NFT_META_SECMARK: nft_meta_keys = 14; -pub const NFT_META_NFPROTO: nft_meta_keys = 15; -pub const NFT_META_L4PROTO: nft_meta_keys = 16; -pub const NFT_META_BRI_IIFNAME: nft_meta_keys = 17; -pub const NFT_META_BRI_OIFNAME: nft_meta_keys = 18; -pub const NFT_META_PKTTYPE: nft_meta_keys = 19; -pub const NFT_META_CPU: nft_meta_keys = 20; -pub const NFT_META_IIFGROUP: nft_meta_keys = 21; -pub const NFT_META_OIFGROUP: nft_meta_keys = 22; -pub const NFT_META_CGROUP: nft_meta_keys = 23; -pub const NFT_META_PRANDOM: nft_meta_keys = 24; -pub const NFT_META_SECPATH: nft_meta_keys = 25; -pub const NFT_META_IIFKIND: nft_meta_keys = 26; -pub const NFT_META_OIFKIND: nft_meta_keys = 27; -pub const NFT_META_BRI_IIFPVID: nft_meta_keys = 28; -pub const NFT_META_BRI_IIFVPROTO: nft_meta_keys = 29; -pub const NFT_META_TIME_NS: nft_meta_keys = 30; -pub const NFT_META_TIME_DAY: nft_meta_keys = 31; -pub const NFT_META_TIME_HOUR: nft_meta_keys = 32; -pub const NFT_META_SDIF: nft_meta_keys = 33; -pub const NFT_META_SDIFNAME: nft_meta_keys = 34; -pub type nft_meta_keys = ::std::os::raw::c_uint; -pub const NFT_RT_CLASSID: nft_rt_keys = 0; -pub const NFT_RT_NEXTHOP4: nft_rt_keys = 1; -pub const NFT_RT_NEXTHOP6: nft_rt_keys = 2; -pub const NFT_RT_TCPMSS: nft_rt_keys = 3; -pub const NFT_RT_XFRM: nft_rt_keys = 4; -pub const __NFT_RT_MAX: nft_rt_keys = 5; -pub type nft_rt_keys = ::std::os::raw::c_uint; -pub const NFT_HASH_JENKINS: nft_hash_types = 0; -pub const NFT_HASH_SYM: nft_hash_types = 1; -pub type nft_hash_types = ::std::os::raw::c_uint; -pub const NFTA_HASH_UNSPEC: nft_hash_attributes = 0; -pub const NFTA_HASH_SREG: nft_hash_attributes = 1; -pub const NFTA_HASH_DREG: nft_hash_attributes = 2; -pub const NFTA_HASH_LEN: nft_hash_attributes = 3; -pub const NFTA_HASH_MODULUS: nft_hash_attributes = 4; -pub const NFTA_HASH_SEED: nft_hash_attributes = 5; -pub const NFTA_HASH_OFFSET: nft_hash_attributes = 6; -pub const NFTA_HASH_TYPE: nft_hash_attributes = 7; -pub const NFTA_HASH_SET_NAME: nft_hash_attributes = 8; -pub const NFTA_HASH_SET_ID: nft_hash_attributes = 9; -pub const __NFTA_HASH_MAX: nft_hash_attributes = 10; -pub type nft_hash_attributes = u16; -pub const NFTA_META_UNSPEC: nft_meta_attributes = 0; -pub const NFTA_META_DREG: nft_meta_attributes = 1; -pub const NFTA_META_KEY: nft_meta_attributes = 2; -pub const NFTA_META_SREG: nft_meta_attributes = 3; -pub const __NFTA_META_MAX: nft_meta_attributes = 4; -pub type nft_meta_attributes = u16; -pub const NFTA_RT_UNSPEC: nft_rt_attributes = 0; -pub const NFTA_RT_DREG: nft_rt_attributes = 1; -pub const NFTA_RT_KEY: nft_rt_attributes = 2; -pub const __NFTA_RT_MAX: nft_rt_attributes = 3; -pub type nft_rt_attributes = u16; -pub const NFTA_SOCKET_UNSPEC: nft_socket_attributes = 0; -pub const NFTA_SOCKET_KEY: nft_socket_attributes = 1; -pub const NFTA_SOCKET_DREG: nft_socket_attributes = 2; -pub const NFTA_SOCKET_LEVEL: nft_socket_attributes = 3; -pub const __NFTA_SOCKET_MAX: nft_socket_attributes = 4; -pub type nft_socket_attributes = u16; -pub const NFT_SOCKET_TRANSPARENT: nft_socket_keys = 0; -pub const NFT_SOCKET_MARK: nft_socket_keys = 1; -pub const NFT_SOCKET_WILDCARD: nft_socket_keys = 2; -pub const NFT_SOCKET_CGROUPV2: nft_socket_keys = 3; -pub const __NFT_SOCKET_MAX: nft_socket_keys = 4; -pub type nft_socket_keys = ::std::os::raw::c_uint; -pub const NFT_CT_STATE: nft_ct_keys = 0; -pub const NFT_CT_DIRECTION: nft_ct_keys = 1; -pub const NFT_CT_STATUS: nft_ct_keys = 2; -pub const NFT_CT_MARK: nft_ct_keys = 3; -pub const NFT_CT_SECMARK: nft_ct_keys = 4; -pub const NFT_CT_EXPIRATION: nft_ct_keys = 5; -pub const NFT_CT_HELPER: nft_ct_keys = 6; -pub const NFT_CT_L3PROTOCOL: nft_ct_keys = 7; -pub const NFT_CT_SRC: nft_ct_keys = 8; -pub const NFT_CT_DST: nft_ct_keys = 9; -pub const NFT_CT_PROTOCOL: nft_ct_keys = 10; -pub const NFT_CT_PROTO_SRC: nft_ct_keys = 11; -pub const NFT_CT_PROTO_DST: nft_ct_keys = 12; -pub const NFT_CT_LABELS: nft_ct_keys = 13; -pub const NFT_CT_PKTS: nft_ct_keys = 14; -pub const NFT_CT_BYTES: nft_ct_keys = 15; -pub const NFT_CT_AVGPKT: nft_ct_keys = 16; -pub const NFT_CT_ZONE: nft_ct_keys = 17; -pub const NFT_CT_EVENTMASK: nft_ct_keys = 18; -pub const NFT_CT_SRC_IP: nft_ct_keys = 19; -pub const NFT_CT_DST_IP: nft_ct_keys = 20; -pub const NFT_CT_SRC_IP6: nft_ct_keys = 21; -pub const NFT_CT_DST_IP6: nft_ct_keys = 22; -pub const NFT_CT_ID: nft_ct_keys = 23; -pub const __NFT_CT_MAX: nft_ct_keys = 24; -pub type nft_ct_keys = ::std::os::raw::c_uint; -pub const NFTA_CT_UNSPEC: nft_ct_attributes = 0; -pub const NFTA_CT_DREG: nft_ct_attributes = 1; -pub const NFTA_CT_KEY: nft_ct_attributes = 2; -pub const NFTA_CT_DIRECTION: nft_ct_attributes = 3; -pub const NFTA_CT_SREG: nft_ct_attributes = 4; -pub const __NFTA_CT_MAX: nft_ct_attributes = 5; -pub type nft_ct_attributes = u16; -pub const NFTA_FLOW_UNSPEC: nft_offload_attributes = 0; -pub const NFTA_FLOW_TABLE_NAME: nft_offload_attributes = 1; -pub const __NFTA_FLOW_MAX: nft_offload_attributes = 2; -pub type nft_offload_attributes = u16; -pub const NFT_LIMIT_PKTS: nft_limit_type = 0; -pub const NFT_LIMIT_PKT_BYTES: nft_limit_type = 1; -pub type nft_limit_type = ::std::os::raw::c_uint; -pub const NFT_LIMIT_F_INV: nft_limit_flags = 1; -pub type nft_limit_flags = ::std::os::raw::c_uint; -pub const NFTA_LIMIT_UNSPEC: nft_limit_attributes = 0; -pub const NFTA_LIMIT_RATE: nft_limit_attributes = 1; -pub const NFTA_LIMIT_UNIT: nft_limit_attributes = 2; -pub const NFTA_LIMIT_BURST: nft_limit_attributes = 3; -pub const NFTA_LIMIT_TYPE: nft_limit_attributes = 4; -pub const NFTA_LIMIT_FLAGS: nft_limit_attributes = 5; -pub const NFTA_LIMIT_PAD: nft_limit_attributes = 6; -pub const __NFTA_LIMIT_MAX: nft_limit_attributes = 7; -pub type nft_limit_attributes = u16; -pub const NFT_CONNLIMIT_F_INV: nft_connlimit_flags = 1; -pub type nft_connlimit_flags = ::std::os::raw::c_uint; -pub const NFTA_CONNLIMIT_UNSPEC: nft_connlimit_attributes = 0; -pub const NFTA_CONNLIMIT_COUNT: nft_connlimit_attributes = 1; -pub const NFTA_CONNLIMIT_FLAGS: nft_connlimit_attributes = 2; -pub const __NFTA_CONNLIMIT_MAX: nft_connlimit_attributes = 3; -pub type nft_connlimit_attributes = u16; -pub const NFTA_COUNTER_UNSPEC: nft_counter_attributes = 0; -pub const NFTA_COUNTER_BYTES: nft_counter_attributes = 1; -pub const NFTA_COUNTER_PACKETS: nft_counter_attributes = 2; -pub const NFTA_COUNTER_PAD: nft_counter_attributes = 3; -pub const __NFTA_COUNTER_MAX: nft_counter_attributes = 4; -pub type nft_counter_attributes = u16; -pub const NFTA_LAST_UNSPEC: nft_last_attributes = 0; -pub const NFTA_LAST_SET: nft_last_attributes = 1; -pub const NFTA_LAST_MSECS: nft_last_attributes = 2; -pub const NFTA_LAST_PAD: nft_last_attributes = 3; -pub const __NFTA_LAST_MAX: nft_last_attributes = 4; -pub type nft_last_attributes = u16; -pub const NFTA_LOG_UNSPEC: nft_log_attributes = 0; -pub const NFTA_LOG_GROUP: nft_log_attributes = 1; -pub const NFTA_LOG_PREFIX: nft_log_attributes = 2; -pub const NFTA_LOG_SNAPLEN: nft_log_attributes = 3; -pub const NFTA_LOG_QTHRESHOLD: nft_log_attributes = 4; -pub const NFTA_LOG_LEVEL: nft_log_attributes = 5; -pub const NFTA_LOG_FLAGS: nft_log_attributes = 6; -pub const __NFTA_LOG_MAX: nft_log_attributes = 7; -pub type nft_log_attributes = u16; -pub const NFT_LOGLEVEL_EMERG: nft_log_level = 0; -pub const NFT_LOGLEVEL_ALERT: nft_log_level = 1; -pub const NFT_LOGLEVEL_CRIT: nft_log_level = 2; -pub const NFT_LOGLEVEL_ERR: nft_log_level = 3; -pub const NFT_LOGLEVEL_WARNING: nft_log_level = 4; -pub const NFT_LOGLEVEL_NOTICE: nft_log_level = 5; -pub const NFT_LOGLEVEL_INFO: nft_log_level = 6; -pub const NFT_LOGLEVEL_DEBUG: nft_log_level = 7; -pub const NFT_LOGLEVEL_AUDIT: nft_log_level = 8; -pub const __NFT_LOGLEVEL_MAX: nft_log_level = 9; -pub type nft_log_level = ::std::os::raw::c_uint; -pub const NFTA_QUEUE_UNSPEC: nft_queue_attributes = 0; -pub const NFTA_QUEUE_NUM: nft_queue_attributes = 1; -pub const NFTA_QUEUE_TOTAL: nft_queue_attributes = 2; -pub const NFTA_QUEUE_FLAGS: nft_queue_attributes = 3; -pub const NFTA_QUEUE_SREG_QNUM: nft_queue_attributes = 4; -pub const __NFTA_QUEUE_MAX: nft_queue_attributes = 5; -pub type nft_queue_attributes = u16; -pub const NFT_QUOTA_F_INV: nft_quota_flags = 1; -pub const NFT_QUOTA_F_DEPLETED: nft_quota_flags = 2; -pub type nft_quota_flags = ::std::os::raw::c_uint; -pub const NFTA_QUOTA_UNSPEC: nft_quota_attributes = 0; -pub const NFTA_QUOTA_BYTES: nft_quota_attributes = 1; -pub const NFTA_QUOTA_FLAGS: nft_quota_attributes = 2; -pub const NFTA_QUOTA_PAD: nft_quota_attributes = 3; -pub const NFTA_QUOTA_CONSUMED: nft_quota_attributes = 4; -pub const __NFTA_QUOTA_MAX: nft_quota_attributes = 5; -pub type nft_quota_attributes = u16; -pub const NFTA_SECMARK_UNSPEC: nft_secmark_attributes = 0; -pub const NFTA_SECMARK_CTX: nft_secmark_attributes = 1; -pub const __NFTA_SECMARK_MAX: nft_secmark_attributes = 2; -pub type nft_secmark_attributes = u16; -pub const NFT_REJECT_ICMP_UNREACH: nft_reject_types = 0; -pub const NFT_REJECT_TCP_RST: nft_reject_types = 1; -pub const NFT_REJECT_ICMPX_UNREACH: nft_reject_types = 2; -pub type nft_reject_types = ::std::os::raw::c_uint; -pub const NFT_REJECT_ICMPX_NO_ROUTE: nft_reject_inet_code = 0; -pub const NFT_REJECT_ICMPX_PORT_UNREACH: nft_reject_inet_code = 1; -pub const NFT_REJECT_ICMPX_HOST_UNREACH: nft_reject_inet_code = 2; -pub const NFT_REJECT_ICMPX_ADMIN_PROHIBITED: nft_reject_inet_code = 3; -pub const __NFT_REJECT_ICMPX_MAX: nft_reject_inet_code = 4; -pub type nft_reject_inet_code = ::std::os::raw::c_uint; -pub const NFTA_REJECT_UNSPEC: nft_reject_attributes = 0; -pub const NFTA_REJECT_TYPE: nft_reject_attributes = 1; -pub const NFTA_REJECT_ICMP_CODE: nft_reject_attributes = 2; -pub const __NFTA_REJECT_MAX: nft_reject_attributes = 3; -pub type nft_reject_attributes = u16; -pub const NFT_NAT_SNAT: nft_nat_types = 0; -pub const NFT_NAT_DNAT: nft_nat_types = 1; -pub type nft_nat_types = ::std::os::raw::c_uint; -pub const NFTA_NAT_UNSPEC: nft_nat_attributes = 0; -pub const NFTA_NAT_TYPE: nft_nat_attributes = 1; -pub const NFTA_NAT_FAMILY: nft_nat_attributes = 2; -pub const NFTA_NAT_REG_ADDR_MIN: nft_nat_attributes = 3; -pub const NFTA_NAT_REG_ADDR_MAX: nft_nat_attributes = 4; -pub const NFTA_NAT_REG_PROTO_MIN: nft_nat_attributes = 5; -pub const NFTA_NAT_REG_PROTO_MAX: nft_nat_attributes = 6; -pub const NFTA_NAT_FLAGS: nft_nat_attributes = 7; -pub const __NFTA_NAT_MAX: nft_nat_attributes = 8; -pub type nft_nat_attributes = u16; -pub const NFTA_TPROXY_UNSPEC: nft_tproxy_attributes = 0; -pub const NFTA_TPROXY_FAMILY: nft_tproxy_attributes = 1; -pub const NFTA_TPROXY_REG_ADDR: nft_tproxy_attributes = 2; -pub const NFTA_TPROXY_REG_PORT: nft_tproxy_attributes = 3; -pub const __NFTA_TPROXY_MAX: nft_tproxy_attributes = 4; -pub type nft_tproxy_attributes = u16; -pub const NFTA_MASQ_UNSPEC: nft_masq_attributes = 0; -pub const NFTA_MASQ_FLAGS: nft_masq_attributes = 1; -pub const NFTA_MASQ_REG_PROTO_MIN: nft_masq_attributes = 2; -pub const NFTA_MASQ_REG_PROTO_MAX: nft_masq_attributes = 3; -pub const __NFTA_MASQ_MAX: nft_masq_attributes = 4; -pub type nft_masq_attributes = u16; -pub const NFTA_REDIR_UNSPEC: nft_redir_attributes = 0; -pub const NFTA_REDIR_REG_PROTO_MIN: nft_redir_attributes = 1; -pub const NFTA_REDIR_REG_PROTO_MAX: nft_redir_attributes = 2; -pub const NFTA_REDIR_FLAGS: nft_redir_attributes = 3; -pub const __NFTA_REDIR_MAX: nft_redir_attributes = 4; -pub type nft_redir_attributes = u16; -pub const NFTA_DUP_UNSPEC: nft_dup_attributes = 0; -pub const NFTA_DUP_SREG_ADDR: nft_dup_attributes = 1; -pub const NFTA_DUP_SREG_DEV: nft_dup_attributes = 2; -pub const __NFTA_DUP_MAX: nft_dup_attributes = 3; -pub type nft_dup_attributes = u16; -pub const NFTA_FWD_UNSPEC: nft_fwd_attributes = 0; -pub const NFTA_FWD_SREG_DEV: nft_fwd_attributes = 1; -pub const NFTA_FWD_SREG_ADDR: nft_fwd_attributes = 2; -pub const NFTA_FWD_NFPROTO: nft_fwd_attributes = 3; -pub const __NFTA_FWD_MAX: nft_fwd_attributes = 4; -pub type nft_fwd_attributes = u16; -pub const NFTA_OBJREF_UNSPEC: nft_objref_attributes = 0; -pub const NFTA_OBJREF_IMM_TYPE: nft_objref_attributes = 1; -pub const NFTA_OBJREF_IMM_NAME: nft_objref_attributes = 2; -pub const NFTA_OBJREF_SET_SREG: nft_objref_attributes = 3; -pub const NFTA_OBJREF_SET_NAME: nft_objref_attributes = 4; -pub const NFTA_OBJREF_SET_ID: nft_objref_attributes = 5; -pub const __NFTA_OBJREF_MAX: nft_objref_attributes = 6; -pub type nft_objref_attributes = u16; -pub const NFTA_GEN_UNSPEC: nft_gen_attributes = 0; -pub const NFTA_GEN_ID: nft_gen_attributes = 1; -pub const NFTA_GEN_PROC_PID: nft_gen_attributes = 2; -pub const NFTA_GEN_PROC_NAME: nft_gen_attributes = 3; -pub const __NFTA_GEN_MAX: nft_gen_attributes = 4; -pub type nft_gen_attributes = u16; -pub const NFTA_FIB_UNSPEC: nft_fib_attributes = 0; -pub const NFTA_FIB_DREG: nft_fib_attributes = 1; -pub const NFTA_FIB_RESULT: nft_fib_attributes = 2; -pub const NFTA_FIB_FLAGS: nft_fib_attributes = 3; -pub const __NFTA_FIB_MAX: nft_fib_attributes = 4; -pub type nft_fib_attributes = u16; -pub const NFT_FIB_RESULT_UNSPEC: nft_fib_result = 0; -pub const NFT_FIB_RESULT_OIF: nft_fib_result = 1; -pub const NFT_FIB_RESULT_OIFNAME: nft_fib_result = 2; -pub const NFT_FIB_RESULT_ADDRTYPE: nft_fib_result = 3; -pub const __NFT_FIB_RESULT_MAX: nft_fib_result = 4; -pub type nft_fib_result = ::std::os::raw::c_uint; -pub const NFTA_FIB_F_SADDR: nft_fib_flags = 1; -pub const NFTA_FIB_F_DADDR: nft_fib_flags = 2; -pub const NFTA_FIB_F_MARK: nft_fib_flags = 4; -pub const NFTA_FIB_F_IIF: nft_fib_flags = 8; -pub const NFTA_FIB_F_OIF: nft_fib_flags = 16; -pub const NFTA_FIB_F_PRESENT: nft_fib_flags = 32; -pub type nft_fib_flags = ::std::os::raw::c_uint; -pub const NFTA_CT_HELPER_UNSPEC: nft_ct_helper_attributes = 0; -pub const NFTA_CT_HELPER_NAME: nft_ct_helper_attributes = 1; -pub const NFTA_CT_HELPER_L3PROTO: nft_ct_helper_attributes = 2; -pub const NFTA_CT_HELPER_L4PROTO: nft_ct_helper_attributes = 3; -pub const __NFTA_CT_HELPER_MAX: nft_ct_helper_attributes = 4; -pub type nft_ct_helper_attributes = u16; -pub const NFTA_CT_TIMEOUT_UNSPEC: nft_ct_timeout_timeout_attributes = 0; -pub const NFTA_CT_TIMEOUT_L3PROTO: nft_ct_timeout_timeout_attributes = 1; -pub const NFTA_CT_TIMEOUT_L4PROTO: nft_ct_timeout_timeout_attributes = 2; -pub const NFTA_CT_TIMEOUT_DATA: nft_ct_timeout_timeout_attributes = 3; -pub const __NFTA_CT_TIMEOUT_MAX: nft_ct_timeout_timeout_attributes = 4; -pub type nft_ct_timeout_timeout_attributes = u16; -pub const NFTA_CT_EXPECT_UNSPEC: nft_ct_expectation_attributes = 0; -pub const NFTA_CT_EXPECT_L3PROTO: nft_ct_expectation_attributes = 1; -pub const NFTA_CT_EXPECT_L4PROTO: nft_ct_expectation_attributes = 2; -pub const NFTA_CT_EXPECT_DPORT: nft_ct_expectation_attributes = 3; -pub const NFTA_CT_EXPECT_TIMEOUT: nft_ct_expectation_attributes = 4; -pub const NFTA_CT_EXPECT_SIZE: nft_ct_expectation_attributes = 5; -pub const __NFTA_CT_EXPECT_MAX: nft_ct_expectation_attributes = 6; -pub type nft_ct_expectation_attributes = u16; -pub const NFTA_OBJ_UNSPEC: nft_object_attributes = 0; -pub const NFTA_OBJ_TABLE: nft_object_attributes = 1; -pub const NFTA_OBJ_NAME: nft_object_attributes = 2; -pub const NFTA_OBJ_TYPE: nft_object_attributes = 3; -pub const NFTA_OBJ_DATA: nft_object_attributes = 4; -pub const NFTA_OBJ_USE: nft_object_attributes = 5; -pub const NFTA_OBJ_HANDLE: nft_object_attributes = 6; -pub const NFTA_OBJ_PAD: nft_object_attributes = 7; -pub const NFTA_OBJ_USERDATA: nft_object_attributes = 8; -pub const __NFTA_OBJ_MAX: nft_object_attributes = 9; -pub type nft_object_attributes = u16; -pub const NFT_FLOWTABLE_HW_OFFLOAD: nft_flowtable_flags = 1; -pub const NFT_FLOWTABLE_COUNTER: nft_flowtable_flags = 2; -pub const NFT_FLOWTABLE_MASK: nft_flowtable_flags = 3; -pub type nft_flowtable_flags = ::std::os::raw::c_uint; -pub const NFTA_FLOWTABLE_UNSPEC: nft_flowtable_attributes = 0; -pub const NFTA_FLOWTABLE_TABLE: nft_flowtable_attributes = 1; -pub const NFTA_FLOWTABLE_NAME: nft_flowtable_attributes = 2; -pub const NFTA_FLOWTABLE_HOOK: nft_flowtable_attributes = 3; -pub const NFTA_FLOWTABLE_USE: nft_flowtable_attributes = 4; -pub const NFTA_FLOWTABLE_HANDLE: nft_flowtable_attributes = 5; -pub const NFTA_FLOWTABLE_PAD: nft_flowtable_attributes = 6; -pub const NFTA_FLOWTABLE_FLAGS: nft_flowtable_attributes = 7; -pub const __NFTA_FLOWTABLE_MAX: nft_flowtable_attributes = 8; -pub type nft_flowtable_attributes = u16; -pub const NFTA_FLOWTABLE_HOOK_UNSPEC: nft_flowtable_hook_attributes = 0; -pub const NFTA_FLOWTABLE_HOOK_NUM: nft_flowtable_hook_attributes = 1; -pub const NFTA_FLOWTABLE_HOOK_PRIORITY: nft_flowtable_hook_attributes = 2; -pub const NFTA_FLOWTABLE_HOOK_DEVS: nft_flowtable_hook_attributes = 3; -pub const __NFTA_FLOWTABLE_HOOK_MAX: nft_flowtable_hook_attributes = 4; -pub type nft_flowtable_hook_attributes = u16; -pub const NFTA_OSF_UNSPEC: nft_osf_attributes = 0; -pub const NFTA_OSF_DREG: nft_osf_attributes = 1; -pub const NFTA_OSF_TTL: nft_osf_attributes = 2; -pub const NFTA_OSF_FLAGS: nft_osf_attributes = 3; -pub const __NFTA_OSF_MAX: nft_osf_attributes = 4; -pub type nft_osf_attributes = u16; -pub const NFT_OSF_F_VERSION: nft_osf_flags = 1; -pub type nft_osf_flags = ::std::os::raw::c_uint; -pub const NFTA_SYNPROXY_UNSPEC: nft_synproxy_attributes = 0; -pub const NFTA_SYNPROXY_MSS: nft_synproxy_attributes = 1; -pub const NFTA_SYNPROXY_WSCALE: nft_synproxy_attributes = 2; -pub const NFTA_SYNPROXY_FLAGS: nft_synproxy_attributes = 3; -pub const __NFTA_SYNPROXY_MAX: nft_synproxy_attributes = 4; -pub type nft_synproxy_attributes = u16; -pub const NFTA_DEVICE_UNSPEC: nft_devices_attributes = 0; -pub const NFTA_DEVICE_NAME: nft_devices_attributes = 1; -pub const __NFTA_DEVICE_MAX: nft_devices_attributes = 2; -pub type nft_devices_attributes = u16; -pub const NFTA_XFRM_UNSPEC: nft_xfrm_attributes = 0; -pub const NFTA_XFRM_DREG: nft_xfrm_attributes = 1; -pub const NFTA_XFRM_KEY: nft_xfrm_attributes = 2; -pub const NFTA_XFRM_DIR: nft_xfrm_attributes = 3; -pub const NFTA_XFRM_SPNUM: nft_xfrm_attributes = 4; -pub const __NFTA_XFRM_MAX: nft_xfrm_attributes = 5; -pub type nft_xfrm_attributes = u16; -pub const NFT_XFRM_KEY_UNSPEC: nft_xfrm_keys = 0; -pub const NFT_XFRM_KEY_DADDR_IP4: nft_xfrm_keys = 1; -pub const NFT_XFRM_KEY_DADDR_IP6: nft_xfrm_keys = 2; -pub const NFT_XFRM_KEY_SADDR_IP4: nft_xfrm_keys = 3; -pub const NFT_XFRM_KEY_SADDR_IP6: nft_xfrm_keys = 4; -pub const NFT_XFRM_KEY_REQID: nft_xfrm_keys = 5; -pub const NFT_XFRM_KEY_SPI: nft_xfrm_keys = 6; -pub const __NFT_XFRM_KEY_MAX: nft_xfrm_keys = 7; -pub type nft_xfrm_keys = ::std::os::raw::c_uint; -pub const NFTA_TRACE_UNSPEC: nft_trace_attributes = 0; -pub const NFTA_TRACE_TABLE: nft_trace_attributes = 1; -pub const NFTA_TRACE_CHAIN: nft_trace_attributes = 2; -pub const NFTA_TRACE_RULE_HANDLE: nft_trace_attributes = 3; -pub const NFTA_TRACE_TYPE: nft_trace_attributes = 4; -pub const NFTA_TRACE_VERDICT: nft_trace_attributes = 5; -pub const NFTA_TRACE_ID: nft_trace_attributes = 6; -pub const NFTA_TRACE_LL_HEADER: nft_trace_attributes = 7; -pub const NFTA_TRACE_NETWORK_HEADER: nft_trace_attributes = 8; -pub const NFTA_TRACE_TRANSPORT_HEADER: nft_trace_attributes = 9; -pub const NFTA_TRACE_IIF: nft_trace_attributes = 10; -pub const NFTA_TRACE_IIFTYPE: nft_trace_attributes = 11; -pub const NFTA_TRACE_OIF: nft_trace_attributes = 12; -pub const NFTA_TRACE_OIFTYPE: nft_trace_attributes = 13; -pub const NFTA_TRACE_MARK: nft_trace_attributes = 14; -pub const NFTA_TRACE_NFPROTO: nft_trace_attributes = 15; -pub const NFTA_TRACE_POLICY: nft_trace_attributes = 16; -pub const NFTA_TRACE_PAD: nft_trace_attributes = 17; -pub const __NFTA_TRACE_MAX: nft_trace_attributes = 18; -pub type nft_trace_attributes = u16; -pub const NFT_TRACETYPE_UNSPEC: nft_trace_types = 0; -pub const NFT_TRACETYPE_POLICY: nft_trace_types = 1; -pub const NFT_TRACETYPE_RETURN: nft_trace_types = 2; -pub const NFT_TRACETYPE_RULE: nft_trace_types = 3; -pub const __NFT_TRACETYPE_MAX: nft_trace_types = 4; -pub type nft_trace_types = ::std::os::raw::c_uint; -pub const NFTA_NG_UNSPEC: nft_ng_attributes = 0; -pub const NFTA_NG_DREG: nft_ng_attributes = 1; -pub const NFTA_NG_MODULUS: nft_ng_attributes = 2; -pub const NFTA_NG_TYPE: nft_ng_attributes = 3; -pub const NFTA_NG_OFFSET: nft_ng_attributes = 4; -pub const NFTA_NG_SET_NAME: nft_ng_attributes = 5; -pub const NFTA_NG_SET_ID: nft_ng_attributes = 6; -pub const __NFTA_NG_MAX: nft_ng_attributes = 7; -pub type nft_ng_attributes = u16; -pub const NFT_NG_INCREMENTAL: nft_ng_types = 0; -pub const NFT_NG_RANDOM: nft_ng_types = 1; -pub const __NFT_NG_MAX: nft_ng_types = 2; -pub type nft_ng_types = ::std::os::raw::c_uint; -pub const NFTA_TUNNEL_KEY_IP_UNSPEC: nft_tunnel_key_ip_attributes = 0; -pub const NFTA_TUNNEL_KEY_IP_SRC: nft_tunnel_key_ip_attributes = 1; -pub const NFTA_TUNNEL_KEY_IP_DST: nft_tunnel_key_ip_attributes = 2; -pub const __NFTA_TUNNEL_KEY_IP_MAX: nft_tunnel_key_ip_attributes = 3; -pub type nft_tunnel_key_ip_attributes = u16; -pub const NFTA_TUNNEL_KEY_IP6_UNSPEC: nft_tunnel_ip6_attributes = 0; -pub const NFTA_TUNNEL_KEY_IP6_SRC: nft_tunnel_ip6_attributes = 1; -pub const NFTA_TUNNEL_KEY_IP6_DST: nft_tunnel_ip6_attributes = 2; -pub const NFTA_TUNNEL_KEY_IP6_FLOWLABEL: nft_tunnel_ip6_attributes = 3; -pub const __NFTA_TUNNEL_KEY_IP6_MAX: nft_tunnel_ip6_attributes = 4; -pub type nft_tunnel_ip6_attributes = ::std::os::raw::c_uint; -pub const NFTA_TUNNEL_KEY_OPTS_UNSPEC: nft_tunnel_opts_attributes = 0; -pub const NFTA_TUNNEL_KEY_OPTS_VXLAN: nft_tunnel_opts_attributes = 1; -pub const NFTA_TUNNEL_KEY_OPTS_ERSPAN: nft_tunnel_opts_attributes = 2; -pub const NFTA_TUNNEL_KEY_OPTS_GENEVE: nft_tunnel_opts_attributes = 3; -pub const __NFTA_TUNNEL_KEY_OPTS_MAX: nft_tunnel_opts_attributes = 4; -pub type nft_tunnel_opts_attributes = u16; -pub const NFTA_TUNNEL_KEY_VXLAN_UNSPEC: nft_tunnel_opts_vxlan_attributes = 0; -pub const NFTA_TUNNEL_KEY_VXLAN_GBP: nft_tunnel_opts_vxlan_attributes = 1; -pub const __NFTA_TUNNEL_KEY_VXLAN_MAX: nft_tunnel_opts_vxlan_attributes = 2; -pub type nft_tunnel_opts_vxlan_attributes = u16; -pub const NFTA_TUNNEL_KEY_ERSPAN_UNSPEC: nft_tunnel_opts_erspan_attributes = 0; -pub const NFTA_TUNNEL_KEY_ERSPAN_VERSION: nft_tunnel_opts_erspan_attributes = 1; -pub const NFTA_TUNNEL_KEY_ERSPAN_V1_INDEX: nft_tunnel_opts_erspan_attributes = 2; -pub const NFTA_TUNNEL_KEY_ERSPAN_V2_HWID: nft_tunnel_opts_erspan_attributes = 3; -pub const NFTA_TUNNEL_KEY_ERSPAN_V2_DIR: nft_tunnel_opts_erspan_attributes = 4; -pub const __NFTA_TUNNEL_KEY_ERSPAN_MAX: nft_tunnel_opts_erspan_attributes = 5; -pub type nft_tunnel_opts_erspan_attributes = u16; -pub const NFTA_TUNNEL_KEY_GENEVE_UNSPEC: nft_tunnel_opts_geneve_attributes = 0; -pub const NFTA_TUNNEL_KEY_GENEVE_CLASS: nft_tunnel_opts_geneve_attributes = 1; -pub const NFTA_TUNNEL_KEY_GENEVE_TYPE: nft_tunnel_opts_geneve_attributes = 2; -pub const NFTA_TUNNEL_KEY_GENEVE_DATA: nft_tunnel_opts_geneve_attributes = 3; -pub const __NFTA_TUNNEL_KEY_GENEVE_MAX: nft_tunnel_opts_geneve_attributes = 4; -pub type nft_tunnel_opts_geneve_attributes = u16; -pub const NFT_TUNNEL_F_ZERO_CSUM_TX: nft_tunnel_flags = 1; -pub const NFT_TUNNEL_F_DONT_FRAGMENT: nft_tunnel_flags = 2; -pub const NFT_TUNNEL_F_SEQ_NUMBER: nft_tunnel_flags = 4; -pub type nft_tunnel_flags = ::std::os::raw::c_uint; -pub const NFTA_TUNNEL_KEY_UNSPEC: nft_tunnel_key_attributes = 0; -pub const NFTA_TUNNEL_KEY_ID: nft_tunnel_key_attributes = 1; -pub const NFTA_TUNNEL_KEY_IP: nft_tunnel_key_attributes = 2; -pub const NFTA_TUNNEL_KEY_IP6: nft_tunnel_key_attributes = 3; -pub const NFTA_TUNNEL_KEY_FLAGS: nft_tunnel_key_attributes = 4; -pub const NFTA_TUNNEL_KEY_TOS: nft_tunnel_key_attributes = 5; -pub const NFTA_TUNNEL_KEY_TTL: nft_tunnel_key_attributes = 6; -pub const NFTA_TUNNEL_KEY_SPORT: nft_tunnel_key_attributes = 7; -pub const NFTA_TUNNEL_KEY_DPORT: nft_tunnel_key_attributes = 8; -pub const NFTA_TUNNEL_KEY_OPTS: nft_tunnel_key_attributes = 9; -pub const __NFTA_TUNNEL_KEY_MAX: nft_tunnel_key_attributes = 10; -pub type nft_tunnel_key_attributes = u16; -pub const NFT_TUNNEL_PATH: nft_tunnel_keys = 0; -pub const NFT_TUNNEL_ID: nft_tunnel_keys = 1; -pub const __NFT_TUNNEL_MAX: nft_tunnel_keys = 2; -pub type nft_tunnel_keys = ::std::os::raw::c_uint; -pub const NFT_TUNNEL_MODE_NONE: nft_tunnel_mode = 0; -pub const NFT_TUNNEL_MODE_RX: nft_tunnel_mode = 1; -pub const NFT_TUNNEL_MODE_TX: nft_tunnel_mode = 2; -pub const __NFT_TUNNEL_MODE_MAX: nft_tunnel_mode = 3; -pub type nft_tunnel_mode = ::std::os::raw::c_uint; -pub const NFTA_TUNNEL_UNSPEC: nft_tunnel_attributes = 0; -pub const NFTA_TUNNEL_KEY: nft_tunnel_attributes = 1; -pub const NFTA_TUNNEL_DREG: nft_tunnel_attributes = 2; -pub const NFTA_TUNNEL_MODE: nft_tunnel_attributes = 3; -pub const __NFTA_TUNNEL_MAX: nft_tunnel_attributes = 4; -pub type nft_tunnel_attributes = u16; diff --git a/rustables/wrapper.h b/rustables/wrapper.h new file mode 100644 index 0000000..4e72034 --- /dev/null +++ b/rustables/wrapper.h @@ -0,0 +1 @@ +#include "/usr/include/linux/netfilter/nf_tables.h" |