From da881c08a64a3d2ead79a334fbe1280459f3a12c Mon Sep 17 00:00:00 2001 From: Alvin Peters Date: Sat, 8 Jun 2024 16:12:13 +1000 Subject: [PATCH 01/17] Switch from ioctl_sys to nix's ioctl Allows to be built on other platforms like FreeBSD. Needs to stick to nix 0.26 because nix >= 0.27 requires Rust >= 1.65. --- Cargo.lock | 118 ++++++++++++++++++++++++++++++++----------------- Cargo.toml | 2 +- src/ffi/mod.rs | 34 +++++++------- src/macros.rs | 12 ++--- 4 files changed, 99 insertions(+), 67 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ca09fe1..4887c85 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "assert_matches" -version = "1.1.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e772942dccdf11b368c31e044e4fca9189f80a773d2f0808379de65894cbf57" +checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" [[package]] name = "backtrace" @@ -15,7 +15,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebbbf59b1c43eefa8c3ede390fcc36820b4999f7914104015be25025e0d62af2" dependencies = [ "backtrace-sys", - "cfg-if 0.1.0", + "cfg-if 0.1.10", "libc", "rustc-demangle", "winapi", @@ -30,11 +30,17 @@ dependencies = [ "libc", ] +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + [[package]] name = "cfg-if" -version = "0.1.0" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de1e760d7b6535af4241fca8bd8adf68e2e7edacc6b29f5d399050c5e48cf88c" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" [[package]] name = "cfg-if" @@ -63,7 +69,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn", + "syn 1.0.109", ] [[package]] @@ -74,7 +80,7 @@ checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" dependencies = [ "darling_core", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -87,7 +93,7 @@ dependencies = [ "derive_builder_core", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -99,7 +105,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -114,9 +120,9 @@ dependencies = [ [[package]] name = "fnv" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "getrandom" @@ -131,15 +137,9 @@ dependencies = [ [[package]] name = "ident_case" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c9826188e666f2ed92071d2dadef6edc430b11b158b5b2b3f4babbcc891eaaa" - -[[package]] -name = "ioctl-sys" -version = "0.8.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bd11f3a29434026f5ff98c730b668ba74b1033637b8817940b54d040696133c" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "ipnetwork" @@ -156,6 +156,17 @@ version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +[[package]] +name = "nix" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +dependencies = [ + "bitflags", + "cfg-if 1.0.0", + "libc", +] + [[package]] name = "pfctl" version = "0.4.6" @@ -163,71 +174,96 @@ dependencies = [ "assert_matches", "derive_builder", "error-chain", - "ioctl-sys", "ipnetwork", "libc", + "nix", "scopeguard", "uuid", ] [[package]] name = "proc-macro2" -version = "1.0.0" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19f287c234c9b2d0308d692dee5c449c1a171167a6f8150f7cf2a49d8fd96967" +checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] name = "quote" -version = "1.0.0" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab938ebe6f1c82426b5fb82eaf10c3e3028c53deaa3fbe38f5904b37cf4d767" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] [[package]] name = "rustc-demangle" -version = "0.1.4" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3058a43ada2c2d0b92b3ae38007a2d0fa5e9db971be260e0171408a4ff471c95" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "scopeguard" -version = "1.0.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.0" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "369633cfe0f0bde1dfc037fb6c5a329d46586a31f981bed14d87487a3439ae37" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.203" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] [[package]] name = "strsim" -version = "0.9.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7be23478587f30ca7b4b423b6bee7baf5b6986c1e511bf1904a984cb6105621" +checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" [[package]] name = "syn" -version = "1.0.1" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "863ecbce06044c8380458360b4146d7372edadfedd77f120ba8c193da427b708" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] -name = "unicode-xid" -version = "0.2.0" +name = "unicode-ident" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "uuid" @@ -252,9 +288,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "winapi" -version = "0.3.6" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ "winapi-i686-pc-windows-gnu", "winapi-x86_64-pc-windows-gnu", diff --git a/Cargo.toml b/Cargo.toml index 4c2ac34..d5c8d0e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ travis-ci = { repository = "mullvad/pfctl-rs" } [dependencies] error-chain = "0.12.4" -ioctl-sys = "0.8.0" +nix = { version = "0.26.4", features = ["ioctl"], default-features = false } libc = "0.2.29" derive_builder = "0.9" ipnetwork = "0.20.0" diff --git a/src/ffi/mod.rs b/src/ffi/mod.rs index 70a6759..99c80c6 100644 --- a/src/ffi/mod.rs +++ b/src/ffi/mod.rs @@ -6,7 +6,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use ioctl_sys::ioctl; +use nix::{ioctl_none, ioctl_readwrite}; #[allow(non_camel_case_types)] #[allow(non_upper_case_globals)] @@ -32,34 +32,34 @@ pub mod tcp { // The documentation describing the order of calls and accepted parameters can be found at: // http://man.openbsd.org/pf.4 // DIOCSTART -ioctl!(none pf_start with b'D', 1); +ioctl_none!(pf_start, b'D', 1); // DIOCSTOP -ioctl!(none pf_stop with b'D', 2); +ioctl_none!(pf_stop, b'D', 2); // DIOCADDRULE -ioctl!(readwrite pf_add_rule with b'D', 4; pfvar::pfioc_rule); +ioctl_readwrite!(pf_add_rule, b'D', 4, pfvar::pfioc_rule); // DIOCGETRULES -ioctl!(readwrite pf_get_rules with b'D', 6; pfvar::pfioc_rule); +ioctl_readwrite!(pf_get_rules, b'D', 6, pfvar::pfioc_rule); // DIOCGETRULE -ioctl!(readwrite pf_get_rule with b'D', 7; pfvar::pfioc_rule); +ioctl_readwrite!(pf_get_rule, b'D', 7, pfvar::pfioc_rule); // DIOCCLRSTATES -ioctl!(readwrite pf_clear_states with b'D', 18; pfvar::pfioc_state_kill); +ioctl_readwrite!(pf_clear_states, b'D', 18, pfvar::pfioc_state_kill); // DIOCGETSTATUS -ioctl!(readwrite pf_get_status with b'D', 21; pfvar::pf_status); +ioctl_readwrite!(pf_get_status, b'D', 21, pfvar::pf_status); // DIOCGETSTATES -ioctl!(readwrite pf_get_states with b'D', 25; pfvar::pfioc_states); +ioctl_readwrite!(pf_get_states, b'D', 25, pfvar::pfioc_states); // DIOCCHANGERULE -ioctl!(readwrite pf_change_rule with b'D', 26; pfvar::pfioc_rule); +ioctl_readwrite!(pf_change_rule, b'D', 26, pfvar::pfioc_rule); // DIOCINSERTRULE -ioctl!(readwrite pf_insert_rule with b'D', 27; pfvar::pfioc_rule); +ioctl_readwrite!(pf_insert_rule, b'D', 27, pfvar::pfioc_rule); // DIOCDELETERULE -ioctl!(readwrite pf_delete_rule with b'D', 28; pfvar::pfioc_rule); +ioctl_readwrite!(pf_delete_rule, b'D', 28, pfvar::pfioc_rule); // DIOCKILLSTATES -ioctl!(readwrite pf_kill_states with b'D', 41; pfvar::pfioc_state_kill); +ioctl_readwrite!(pf_kill_states, b'D', 41, pfvar::pfioc_state_kill); // DIOCBEGINADDRS -ioctl!(readwrite pf_begin_addrs with b'D', 51; pfvar::pfioc_pooladdr); +ioctl_readwrite!(pf_begin_addrs, b'D', 51, pfvar::pfioc_pooladdr); // DIOCADDADDR -ioctl!(readwrite pf_add_addr with b'D', 52; pfvar::pfioc_pooladdr); +ioctl_readwrite!(pf_add_addr, b'D', 52, pfvar::pfioc_pooladdr); // DIOCXBEGIN -ioctl!(readwrite pf_begin_trans with b'D', 81; pfvar::pfioc_trans); +ioctl_readwrite!(pf_begin_trans, b'D', 81, pfvar::pfioc_trans); // DIOCXCOMMIT -ioctl!(readwrite pf_commit_trans with b'D', 82; pfvar::pfioc_trans); +ioctl_readwrite!(pf_commit_trans, b'D', 82, pfvar::pfioc_trans); diff --git a/src/macros.rs b/src/macros.rs index aa38f5f..f91407c 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -6,20 +6,16 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub const IOCTL_ERROR: i32 = -1; - /// Macro for taking an expression with an ioctl call, perform it and return a Rust ´Result´. macro_rules! ioctl_guard { ($func:expr) => { ioctl_guard!($func, libc::EEXIST) }; ($func:expr, $already_active:expr) => { - if unsafe { $func } == $crate::macros::IOCTL_ERROR { - let io_error = ::std::io::Error::last_os_error(); - let error_code = io_error - .raw_os_error() - .expect("Errors created with last_os_error should have errno"); - let mut err = Err($crate::ErrorKind::IoctlError(io_error).into()); + // nix::ioctl calls return error numbers out of box. + if let nix::Result::Err(errno) = unsafe { $func } { + let error_code = errno as i32; + let mut err = Err($crate::ErrorKind::IoctlError(std::io::Error::from_raw_os_error(error_code)).into()); if error_code == $already_active { err = err.chain_err(|| $crate::ErrorKind::StateAlreadyActive); } From 4fe692035ac449af8ead26f9860ef40cfdd145fb Mon Sep 17 00:00:00 2001 From: Alvin Peters Date: Tue, 11 Jun 2024 11:25:03 +1000 Subject: [PATCH 02/17] Add FreeBSD and OpenBSD test jobs --- .github/workflows/build-and-test.yml | 34 +++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index ff6b555..4e2ea2a 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -14,7 +14,8 @@ env: RUSTFLAGS: --deny warnings jobs: - build-and-test: + build-and-test-macos: + name: Build and test on macOS strategy: matrix: # Keep MSRV in sync with rust-version in Cargo.toml as much as possible. @@ -36,11 +37,38 @@ jobs: # Since the tests modify global state (the system firewall) they cannot run in parallel. # The integration tests must run as root since they write firewall state (/dev/pf) run: sudo cargo test -- --test-threads=1 - + build-and-test-openbsd: + name: Build and test on OpenBSD + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run tests inside an OpenBSD VM + uses: vmactions/openbsd-vm@v1 + with: + usesh: true + copyback: false + prepare: | + pkg_add rust + run: | + cargo test -- --test-threads=1 + build-and-test-freebsd: + name: Build and test on FreeBSD + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run tests inside a FreeBSD VM + uses: vmactions/freebsd-vm@v1 + with: + usesh: true + copyback: false + prepare: | + pkg install -y rust + run: | + cargo test -- --test-threads=1 # Make sure the library builds with all dependencies downgraded to their # oldest versions allowed by the semver spec. This ensures we have not # under-specified any dependency - minimal-versions: + minimal-versions-macos: runs-on: macos-latest steps: - uses: actions/checkout@v4 From e3b06e2d045de4bff9624ce37a6f4b3784537c8f Mon Sep 17 00:00:00 2001 From: Alvin Peters Date: Tue, 11 Jun 2024 12:40:56 +1000 Subject: [PATCH 03/17] Add pfvar.h binding from FreeBSD --- src/ffi/mod.rs | 10 + src/ffi/{pfvar.rs => pfvar/freebsd.rs} | 3862 +++++++++++---------- src/ffi/pfvar/macos.rs | 4326 ++++++++++++++++++++++++ 3 files changed, 6225 insertions(+), 1973 deletions(-) rename src/ffi/{pfvar.rs => pfvar/freebsd.rs} (79%) create mode 100644 src/ffi/pfvar/macos.rs diff --git a/src/ffi/mod.rs b/src/ffi/mod.rs index 99c80c6..67595b7 100644 --- a/src/ffi/mod.rs +++ b/src/ffi/mod.rs @@ -8,10 +8,20 @@ use nix::{ioctl_none, ioctl_readwrite}; +#[cfg(target_os = "macos")] #[allow(non_camel_case_types)] #[allow(non_upper_case_globals)] #[allow(non_snake_case)] #[allow(dead_code)] +#[path = "pfvar/macos.rs"] +pub mod pfvar; + +#[cfg(target_os = "freebsd")] +#[allow(non_camel_case_types)] +#[allow(non_upper_case_globals)] +#[allow(non_snake_case)] +#[allow(dead_code)] +#[path = "pfvar/freebsd.rs"] pub mod pfvar; pub mod tcp { diff --git a/src/ffi/pfvar.rs b/src/ffi/pfvar/freebsd.rs similarity index 79% rename from src/ffi/pfvar.rs rename to src/ffi/pfvar/freebsd.rs index f7737bc..67c23ba 100644 --- a/src/ffi/pfvar.rs +++ b/src/ffi/pfvar/freebsd.rs @@ -1,13 +1,11 @@ /* automatically generated by rust-bindgen 0.69.4 */ pub const PF_UNSPEC: u32 = 0; -pub const PF_LOCAL: u32 = 1; -pub const PF_UNIX: u32 = 1; pub const PF_INET: u32 = 2; pub const PF_IMPLINK: u32 = 3; pub const PF_PUP: u32 = 4; pub const PF_CHAOS: u32 = 5; -pub const PF_NS: u32 = 6; +pub const PF_NETBIOS: u32 = 6; pub const PF_ISO: u32 = 7; pub const PF_OSI: u32 = 7; pub const PF_ECMA: u32 = 8; @@ -28,20 +26,23 @@ pub const PF_SIP: u32 = 24; pub const PF_IPX: u32 = 23; pub const PF_RTIP: u32 = 22; pub const PF_PIP: u32 = 25; -pub const PF_NDRV: u32 = 27; -pub const PF_ISDN: u32 = 28; -pub const PF_KEY: u32 = 29; -pub const PF_INET6: u32 = 30; -pub const PF_NATM: u32 = 31; -pub const PF_SYSTEM: u32 = 32; -pub const PF_NETBIOS: u32 = 33; -pub const PF_PPP: u32 = 34; -pub const PF_RESERVED_36: u32 = 36; -pub const PF_UTUN: u32 = 38; -pub const PF_VSOCK: u32 = 40; -pub const PF_MAX: u32 = 41; +pub const PF_ISDN: u32 = 26; +pub const PF_KEY: u32 = 27; +pub const PF_INET6: u32 = 28; +pub const PF_NATM: u32 = 29; +pub const PF_ATM: u32 = 30; +pub const PF_NETGRAPH: u32 = 32; +pub const PF_SLOW: u32 = 33; +pub const PF_SCLUSTER: u32 = 34; +pub const PF_ARP: u32 = 35; +pub const PF_BLUETOOTH: u32 = 36; +pub const PF_IEEE80211: u32 = 37; +pub const PF_NETLINK: u32 = 38; +pub const PF_INET_SDP: u32 = 40; +pub const PF_INET6_SDP: u32 = 42; +pub const PF_DIVERT: u32 = 44; +pub const PF_MAX: u32 = 44; pub const PF_MD5_DIGEST_LENGTH: u32 = 16; -pub const PF_GRE_PPTP_VARIANT: u32 = 1; pub const PF_POOL_IDMASK: u32 = 15; pub const PF_POOL_TYPEMASK: u32 = 15; pub const PF_POOL_STICKYADDR: u32 = 32; @@ -50,7 +51,11 @@ pub const PF_WSCALE_MASK: u32 = 15; pub const PF_LOG: u32 = 1; pub const PF_LOG_ALL: u32 = 2; pub const PF_LOG_SOCKET_LOOKUP: u32 = 4; +pub const PF_LOG_FORCE: u32 = 8; pub const PF_TABLE_NAME_SIZE: u32 = 32; +pub const PF_QNAME_SIZE: u32 = 64; +pub const PF_REASS_ENABLED: u32 = 1; +pub const PF_REASS_NODF: u32 = 2; pub const PF_OSFP_EXPANDED: u32 = 1; pub const PF_OSFP_GENERIC: u32 = 2; pub const PF_OSFP_NODETAIL: u32 = 4; @@ -88,14 +93,15 @@ pub const PF_SKIP_DST_ADDR: u32 = 6; pub const PF_SKIP_DST_PORT: u32 = 7; pub const PF_SKIP_COUNT: u32 = 8; pub const PF_RULE_LABEL_SIZE: u32 = 64; -pub const PF_QNAME_SIZE: u32 = 64; +pub const PF_RULE_MAX_LABEL_COUNT: u32 = 5; pub const PF_TAG_NAME_SIZE: u32 = 64; -pub const PF_OWNER_NAME_SIZE: u32 = 64; pub const PF_STATE_NORMAL: u32 = 1; pub const PF_STATE_MODULATE: u32 = 2; pub const PF_STATE_SYNPROXY: u32 = 3; pub const PF_FLUSH: u32 = 1; pub const PF_FLUSH_GLOBAL: u32 = 2; +pub const PF_PRIO_ZERO: u32 = 255; +pub const PF_PRIO_MAX: u32 = 7; pub const PFRULE_DROP: u32 = 0; pub const PFRULE_RETURNRST: u32 = 1; pub const PFRULE_FRAGMENT: u32 = 2; @@ -105,41 +111,50 @@ pub const PFRULE_NOSYNC: u32 = 16; pub const PFRULE_SRCTRACK: u32 = 32; pub const PFRULE_RULESRCTRACK: u32 = 64; pub const PFRULE_NODF: u32 = 256; -pub const PFRULE_FRAGCROP: u32 = 512; -pub const PFRULE_FRAGDROP: u32 = 1024; +pub const PFRULE_FRAGMENT_NOREASS: u32 = 512; pub const PFRULE_RANDOMID: u32 = 2048; pub const PFRULE_REASSEMBLE_TCP: u32 = 4096; -pub const PFRULE_TOS: u32 = 8192; -pub const PFRULE_DSCP: u32 = 16384; -pub const PFRULE_SC: u32 = 32768; +pub const PFRULE_SET_TOS: u32 = 8192; pub const PFRULE_IFBOUND: u32 = 65536; -pub const PFRULE_PFM: u32 = 131072; -pub const PF_TAG_NAME_SYSTEM_SERVICE: &[u8; 32] = b"com.apple.pf.system_service_tag\0"; -pub const PF_TAG_NAME_STACK_DROP: &[u8; 28] = b"com.apple.pf.stack_drop_tag\0"; +pub const PFRULE_STATESLOPPY: u32 = 131072; +pub const PFRULE_DN_IS_PIPE: u32 = 64; +pub const PFRULE_DN_IS_QUEUE: u32 = 128; pub const PF_THRESHOLD_MULT: u32 = 1000; pub const PF_THRESHOLD_MAX: u32 = 4294967; +pub const PF_ALTQ_VERSION: u32 = 1; +pub const PF_SCRUB_FLAG_VALID: u32 = 1; +pub const PF_STATE_VERSION: u32 = 20230404; pub const PF_RESERVED_ANCHOR: &[u8; 4] = b"_pf\0"; pub const PF_DPORT_RANGE: u32 = 1; pub const PF_RPORT_RANGE: u32 = 2; -pub const PF_ALTQ_BW_ABSOLUTE: u32 = 1; -pub const PF_ALTQ_BW_PERCENT: u32 = 2; -pub const PF_ALTQF_TBR: u32 = 1; -pub const PF_ALTQ_QRF_WEIGHT: u32 = 1; +pub const PF_SYNCOOKIES_HIWATPCT: u32 = 25; +pub const PF_SYNCOOKIES_LOWATPCT: u32 = 12; +pub const PF_FRAG_ENTRY_POINTS: u32 = 16; +pub const PF_FRAG_ENTRY_LIMIT: u32 = 64; +pub const PF_IFSPEED_VERSION: u32 = 1; pub type __uint8_t = ::std::os::raw::c_uchar; pub type __uint16_t = ::std::os::raw::c_ushort; pub type __int32_t = ::std::os::raw::c_int; pub type __uint32_t = ::std::os::raw::c_uint; -pub type __darwin_pid_t = __int32_t; -pub type __darwin_uid_t = __uint32_t; -pub type u_int8_t = ::std::os::raw::c_uchar; -pub type u_int16_t = ::std::os::raw::c_ushort; -pub type u_int32_t = ::std::os::raw::c_uint; -pub type u_int64_t = ::std::os::raw::c_ulonglong; -pub type caddr_t = *mut ::std::os::raw::c_char; +pub type __uint64_t = ::std::os::raw::c_ulong; +pub type __pid_t = __int32_t; +pub type __sa_family_t = __uint8_t; +pub type __uid_t = __uint32_t; +pub type u_int = ::std::os::raw::c_uint; +pub type u_int8_t = __uint8_t; +pub type u_int16_t = __uint16_t; +pub type u_int32_t = __uint32_t; +pub type u_int64_t = __uint64_t; pub type in_addr_t = __uint32_t; -pub type pid_t = __darwin_pid_t; -pub type uid_t = __darwin_uid_t; -pub type sa_family_t = __uint8_t; +pub type pid_t = __pid_t; +pub type uid_t = __uid_t; +pub type counter_u64_t = *mut u64; +pub type sa_family_t = __sa_family_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ifnet { + _unused: [u8; 0], +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct in_addr { @@ -178,9 +193,9 @@ pub struct in6_addr { #[repr(C)] #[derive(Copy, Clone)] pub union in6_addr__bindgen_ty_1 { - pub __u6_addr8: [__uint8_t; 16usize], - pub __u6_addr16: [__uint16_t; 8usize], - pub __u6_addr32: [__uint32_t; 4usize], + pub __u6_addr8: [u8; 16usize], + pub __u6_addr16: [u16; 8usize], + pub __u6_addr32: [u32; 4usize], } #[test] fn bindgen_test_layout_in6_addr__bindgen_ty_1() { @@ -253,34 +268,32 @@ fn bindgen_test_layout_in6_addr() { ) ); } -pub const PF_INOUT: _bindgen_ty_6 = _bindgen_ty_6::PF_INOUT; -pub const PF_IN: _bindgen_ty_6 = _bindgen_ty_6::PF_IN; -pub const PF_OUT: _bindgen_ty_6 = _bindgen_ty_6::PF_OUT; +pub const PF_INOUT: _bindgen_ty_1 = _bindgen_ty_1::PF_INOUT; +pub const PF_IN: _bindgen_ty_1 = _bindgen_ty_1::PF_IN; +pub const PF_OUT: _bindgen_ty_1 = _bindgen_ty_1::PF_OUT; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum _bindgen_ty_6 { +pub enum _bindgen_ty_1 { PF_INOUT = 0, PF_IN = 1, PF_OUT = 2, } -pub const PF_PASS: _bindgen_ty_7 = _bindgen_ty_7::PF_PASS; -pub const PF_DROP: _bindgen_ty_7 = _bindgen_ty_7::PF_DROP; -pub const PF_SCRUB: _bindgen_ty_7 = _bindgen_ty_7::PF_SCRUB; -pub const PF_NOSCRUB: _bindgen_ty_7 = _bindgen_ty_7::PF_NOSCRUB; -pub const PF_NAT: _bindgen_ty_7 = _bindgen_ty_7::PF_NAT; -pub const PF_NONAT: _bindgen_ty_7 = _bindgen_ty_7::PF_NONAT; -pub const PF_BINAT: _bindgen_ty_7 = _bindgen_ty_7::PF_BINAT; -pub const PF_NOBINAT: _bindgen_ty_7 = _bindgen_ty_7::PF_NOBINAT; -pub const PF_RDR: _bindgen_ty_7 = _bindgen_ty_7::PF_RDR; -pub const PF_NORDR: _bindgen_ty_7 = _bindgen_ty_7::PF_NORDR; -pub const PF_SYNPROXY_DROP: _bindgen_ty_7 = _bindgen_ty_7::PF_SYNPROXY_DROP; -pub const PF_DUMMYNET: _bindgen_ty_7 = _bindgen_ty_7::PF_DUMMYNET; -pub const PF_NODUMMYNET: _bindgen_ty_7 = _bindgen_ty_7::PF_NODUMMYNET; -pub const PF_NAT64: _bindgen_ty_7 = _bindgen_ty_7::PF_NAT64; -pub const PF_NONAT64: _bindgen_ty_7 = _bindgen_ty_7::PF_NONAT64; +pub const PF_PASS: _bindgen_ty_2 = _bindgen_ty_2::PF_PASS; +pub const PF_DROP: _bindgen_ty_2 = _bindgen_ty_2::PF_DROP; +pub const PF_SCRUB: _bindgen_ty_2 = _bindgen_ty_2::PF_SCRUB; +pub const PF_NOSCRUB: _bindgen_ty_2 = _bindgen_ty_2::PF_NOSCRUB; +pub const PF_NAT: _bindgen_ty_2 = _bindgen_ty_2::PF_NAT; +pub const PF_NONAT: _bindgen_ty_2 = _bindgen_ty_2::PF_NONAT; +pub const PF_BINAT: _bindgen_ty_2 = _bindgen_ty_2::PF_BINAT; +pub const PF_NOBINAT: _bindgen_ty_2 = _bindgen_ty_2::PF_NOBINAT; +pub const PF_RDR: _bindgen_ty_2 = _bindgen_ty_2::PF_RDR; +pub const PF_NORDR: _bindgen_ty_2 = _bindgen_ty_2::PF_NORDR; +pub const PF_SYNPROXY_DROP: _bindgen_ty_2 = _bindgen_ty_2::PF_SYNPROXY_DROP; +pub const PF_DEFER: _bindgen_ty_2 = _bindgen_ty_2::PF_DEFER; +pub const PF_MATCH: _bindgen_ty_2 = _bindgen_ty_2::PF_MATCH; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum _bindgen_ty_7 { +pub enum _bindgen_ty_2 { PF_PASS = 0, PF_DROP = 1, PF_SCRUB = 2, @@ -292,42 +305,38 @@ pub enum _bindgen_ty_7 { PF_RDR = 8, PF_NORDR = 9, PF_SYNPROXY_DROP = 10, - PF_DUMMYNET = 11, - PF_NODUMMYNET = 12, - PF_NAT64 = 13, - PF_NONAT64 = 14, + PF_DEFER = 11, + PF_MATCH = 12, } -pub const PF_RULESET_SCRUB: _bindgen_ty_8 = _bindgen_ty_8::PF_RULESET_SCRUB; -pub const PF_RULESET_FILTER: _bindgen_ty_8 = _bindgen_ty_8::PF_RULESET_FILTER; -pub const PF_RULESET_NAT: _bindgen_ty_8 = _bindgen_ty_8::PF_RULESET_NAT; -pub const PF_RULESET_BINAT: _bindgen_ty_8 = _bindgen_ty_8::PF_RULESET_BINAT; -pub const PF_RULESET_RDR: _bindgen_ty_8 = _bindgen_ty_8::PF_RULESET_RDR; -pub const PF_RULESET_DUMMYNET: _bindgen_ty_8 = _bindgen_ty_8::PF_RULESET_DUMMYNET; -pub const PF_RULESET_MAX: _bindgen_ty_8 = _bindgen_ty_8::PF_RULESET_MAX; +pub const PF_RULESET_SCRUB: _bindgen_ty_3 = _bindgen_ty_3::PF_RULESET_SCRUB; +pub const PF_RULESET_FILTER: _bindgen_ty_3 = _bindgen_ty_3::PF_RULESET_FILTER; +pub const PF_RULESET_NAT: _bindgen_ty_3 = _bindgen_ty_3::PF_RULESET_NAT; +pub const PF_RULESET_BINAT: _bindgen_ty_3 = _bindgen_ty_3::PF_RULESET_BINAT; +pub const PF_RULESET_RDR: _bindgen_ty_3 = _bindgen_ty_3::PF_RULESET_RDR; +pub const PF_RULESET_MAX: _bindgen_ty_3 = _bindgen_ty_3::PF_RULESET_MAX; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum _bindgen_ty_8 { +pub enum _bindgen_ty_3 { PF_RULESET_SCRUB = 0, PF_RULESET_FILTER = 1, PF_RULESET_NAT = 2, PF_RULESET_BINAT = 3, PF_RULESET_RDR = 4, - PF_RULESET_DUMMYNET = 5, - PF_RULESET_MAX = 6, + PF_RULESET_MAX = 5, } -pub const PF_OP_NONE: _bindgen_ty_9 = _bindgen_ty_9::PF_OP_NONE; -pub const PF_OP_IRG: _bindgen_ty_9 = _bindgen_ty_9::PF_OP_IRG; -pub const PF_OP_EQ: _bindgen_ty_9 = _bindgen_ty_9::PF_OP_EQ; -pub const PF_OP_NE: _bindgen_ty_9 = _bindgen_ty_9::PF_OP_NE; -pub const PF_OP_LT: _bindgen_ty_9 = _bindgen_ty_9::PF_OP_LT; -pub const PF_OP_LE: _bindgen_ty_9 = _bindgen_ty_9::PF_OP_LE; -pub const PF_OP_GT: _bindgen_ty_9 = _bindgen_ty_9::PF_OP_GT; -pub const PF_OP_GE: _bindgen_ty_9 = _bindgen_ty_9::PF_OP_GE; -pub const PF_OP_XRG: _bindgen_ty_9 = _bindgen_ty_9::PF_OP_XRG; -pub const PF_OP_RRG: _bindgen_ty_9 = _bindgen_ty_9::PF_OP_RRG; +pub const PF_OP_NONE: _bindgen_ty_4 = _bindgen_ty_4::PF_OP_NONE; +pub const PF_OP_IRG: _bindgen_ty_4 = _bindgen_ty_4::PF_OP_IRG; +pub const PF_OP_EQ: _bindgen_ty_4 = _bindgen_ty_4::PF_OP_EQ; +pub const PF_OP_NE: _bindgen_ty_4 = _bindgen_ty_4::PF_OP_NE; +pub const PF_OP_LT: _bindgen_ty_4 = _bindgen_ty_4::PF_OP_LT; +pub const PF_OP_LE: _bindgen_ty_4 = _bindgen_ty_4::PF_OP_LE; +pub const PF_OP_GT: _bindgen_ty_4 = _bindgen_ty_4::PF_OP_GT; +pub const PF_OP_GE: _bindgen_ty_4 = _bindgen_ty_4::PF_OP_GE; +pub const PF_OP_XRG: _bindgen_ty_4 = _bindgen_ty_4::PF_OP_XRG; +pub const PF_OP_RRG: _bindgen_ty_4 = _bindgen_ty_4::PF_OP_RRG; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum _bindgen_ty_9 { +pub enum _bindgen_ty_4 { PF_OP_NONE = 0, PF_OP_IRG = 1, PF_OP_EQ = 2, @@ -339,28 +348,28 @@ pub enum _bindgen_ty_9 { PF_OP_XRG = 8, PF_OP_RRG = 9, } -pub const PF_DEBUG_NONE: _bindgen_ty_10 = _bindgen_ty_10::PF_DEBUG_NONE; -pub const PF_DEBUG_URGENT: _bindgen_ty_10 = _bindgen_ty_10::PF_DEBUG_URGENT; -pub const PF_DEBUG_MISC: _bindgen_ty_10 = _bindgen_ty_10::PF_DEBUG_MISC; -pub const PF_DEBUG_NOISY: _bindgen_ty_10 = _bindgen_ty_10::PF_DEBUG_NOISY; +pub const PF_DEBUG_NONE: _bindgen_ty_5 = _bindgen_ty_5::PF_DEBUG_NONE; +pub const PF_DEBUG_URGENT: _bindgen_ty_5 = _bindgen_ty_5::PF_DEBUG_URGENT; +pub const PF_DEBUG_MISC: _bindgen_ty_5 = _bindgen_ty_5::PF_DEBUG_MISC; +pub const PF_DEBUG_NOISY: _bindgen_ty_5 = _bindgen_ty_5::PF_DEBUG_NOISY; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum _bindgen_ty_10 { +pub enum _bindgen_ty_5 { PF_DEBUG_NONE = 0, PF_DEBUG_URGENT = 1, PF_DEBUG_MISC = 2, PF_DEBUG_NOISY = 3, } -pub const PF_CHANGE_NONE: _bindgen_ty_11 = _bindgen_ty_11::PF_CHANGE_NONE; -pub const PF_CHANGE_ADD_HEAD: _bindgen_ty_11 = _bindgen_ty_11::PF_CHANGE_ADD_HEAD; -pub const PF_CHANGE_ADD_TAIL: _bindgen_ty_11 = _bindgen_ty_11::PF_CHANGE_ADD_TAIL; -pub const PF_CHANGE_ADD_BEFORE: _bindgen_ty_11 = _bindgen_ty_11::PF_CHANGE_ADD_BEFORE; -pub const PF_CHANGE_ADD_AFTER: _bindgen_ty_11 = _bindgen_ty_11::PF_CHANGE_ADD_AFTER; -pub const PF_CHANGE_REMOVE: _bindgen_ty_11 = _bindgen_ty_11::PF_CHANGE_REMOVE; -pub const PF_CHANGE_GET_TICKET: _bindgen_ty_11 = _bindgen_ty_11::PF_CHANGE_GET_TICKET; +pub const PF_CHANGE_NONE: _bindgen_ty_6 = _bindgen_ty_6::PF_CHANGE_NONE; +pub const PF_CHANGE_ADD_HEAD: _bindgen_ty_6 = _bindgen_ty_6::PF_CHANGE_ADD_HEAD; +pub const PF_CHANGE_ADD_TAIL: _bindgen_ty_6 = _bindgen_ty_6::PF_CHANGE_ADD_TAIL; +pub const PF_CHANGE_ADD_BEFORE: _bindgen_ty_6 = _bindgen_ty_6::PF_CHANGE_ADD_BEFORE; +pub const PF_CHANGE_ADD_AFTER: _bindgen_ty_6 = _bindgen_ty_6::PF_CHANGE_ADD_AFTER; +pub const PF_CHANGE_REMOVE: _bindgen_ty_6 = _bindgen_ty_6::PF_CHANGE_REMOVE; +pub const PF_CHANGE_GET_TICKET: _bindgen_ty_6 = _bindgen_ty_6::PF_CHANGE_GET_TICKET; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum _bindgen_ty_11 { +pub enum _bindgen_ty_6 { PF_CHANGE_NONE = 0, PF_CHANGE_ADD_HEAD = 1, PF_CHANGE_ADD_TAIL = 2, @@ -369,1030 +378,868 @@ pub enum _bindgen_ty_11 { PF_CHANGE_REMOVE = 5, PF_CHANGE_GET_TICKET = 6, } -pub const PF_GET_NONE: _bindgen_ty_12 = _bindgen_ty_12::PF_GET_NONE; -pub const PF_GET_CLR_CNTR: _bindgen_ty_12 = _bindgen_ty_12::PF_GET_CLR_CNTR; +pub const PF_GET_NONE: _bindgen_ty_7 = _bindgen_ty_7::PF_GET_NONE; +pub const PF_GET_CLR_CNTR: _bindgen_ty_7 = _bindgen_ty_7::PF_GET_CLR_CNTR; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum _bindgen_ty_12 { +pub enum _bindgen_ty_7 { PF_GET_NONE = 0, PF_GET_CLR_CNTR = 1, } -pub const PF_NOPFROUTE: _bindgen_ty_14 = _bindgen_ty_14::PF_NOPFROUTE; -pub const PF_FASTROUTE: _bindgen_ty_14 = _bindgen_ty_14::PF_FASTROUTE; -pub const PF_ROUTETO: _bindgen_ty_14 = _bindgen_ty_14::PF_ROUTETO; -pub const PF_DUPTO: _bindgen_ty_14 = _bindgen_ty_14::PF_DUPTO; -pub const PF_REPLYTO: _bindgen_ty_14 = _bindgen_ty_14::PF_REPLYTO; +pub const PF_SK_WIRE: _bindgen_ty_8 = _bindgen_ty_8::PF_SK_WIRE; +pub const PF_SK_STACK: _bindgen_ty_8 = _bindgen_ty_8::PF_SK_STACK; +pub const PF_SK_BOTH: _bindgen_ty_8 = _bindgen_ty_8::PF_SK_BOTH; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum _bindgen_ty_14 { +pub enum _bindgen_ty_8 { + PF_SK_WIRE = 0, + PF_SK_STACK = 1, + PF_SK_BOTH = 2, +} +pub const PF_PEER_SRC: _bindgen_ty_9 = _bindgen_ty_9::PF_PEER_SRC; +pub const PF_PEER_DST: _bindgen_ty_9 = _bindgen_ty_9::PF_PEER_DST; +pub const PF_PEER_BOTH: _bindgen_ty_9 = _bindgen_ty_9::PF_PEER_BOTH; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_9 { + PF_PEER_SRC = 0, + PF_PEER_DST = 1, + PF_PEER_BOTH = 2, +} +pub const PF_NOPFROUTE: _bindgen_ty_11 = _bindgen_ty_11::PF_NOPFROUTE; +pub const PF_FASTROUTE: _bindgen_ty_11 = _bindgen_ty_11::PF_FASTROUTE; +pub const PF_ROUTETO: _bindgen_ty_11 = _bindgen_ty_11::PF_ROUTETO; +pub const PF_DUPTO: _bindgen_ty_11 = _bindgen_ty_11::PF_DUPTO; +pub const PF_REPLYTO: _bindgen_ty_11 = _bindgen_ty_11::PF_REPLYTO; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_11 { PF_NOPFROUTE = 0, PF_FASTROUTE = 1, PF_ROUTETO = 2, PF_DUPTO = 3, PF_REPLYTO = 4, } -pub const PF_LIMIT_STATES: _bindgen_ty_15 = _bindgen_ty_15::PF_LIMIT_STATES; -pub const PF_LIMIT_APP_STATES: _bindgen_ty_15 = _bindgen_ty_15::PF_LIMIT_APP_STATES; -pub const PF_LIMIT_SRC_NODES: _bindgen_ty_15 = _bindgen_ty_15::PF_LIMIT_SRC_NODES; -pub const PF_LIMIT_FRAGS: _bindgen_ty_15 = _bindgen_ty_15::PF_LIMIT_FRAGS; -pub const PF_LIMIT_TABLES: _bindgen_ty_15 = _bindgen_ty_15::PF_LIMIT_TABLES; -pub const PF_LIMIT_TABLE_ENTRIES: _bindgen_ty_15 = _bindgen_ty_15::PF_LIMIT_TABLE_ENTRIES; -pub const PF_LIMIT_MAX: _bindgen_ty_15 = _bindgen_ty_15::PF_LIMIT_MAX; +pub const PF_LIMIT_STATES: _bindgen_ty_12 = _bindgen_ty_12::PF_LIMIT_STATES; +pub const PF_LIMIT_SRC_NODES: _bindgen_ty_12 = _bindgen_ty_12::PF_LIMIT_SRC_NODES; +pub const PF_LIMIT_FRAGS: _bindgen_ty_12 = _bindgen_ty_12::PF_LIMIT_FRAGS; +pub const PF_LIMIT_TABLE_ENTRIES: _bindgen_ty_12 = _bindgen_ty_12::PF_LIMIT_TABLE_ENTRIES; +pub const PF_LIMIT_MAX: _bindgen_ty_12 = _bindgen_ty_12::PF_LIMIT_MAX; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum _bindgen_ty_15 { +pub enum _bindgen_ty_12 { PF_LIMIT_STATES = 0, - PF_LIMIT_APP_STATES = 1, - PF_LIMIT_SRC_NODES = 2, - PF_LIMIT_FRAGS = 3, - PF_LIMIT_TABLES = 4, - PF_LIMIT_TABLE_ENTRIES = 5, - PF_LIMIT_MAX = 6, + PF_LIMIT_SRC_NODES = 1, + PF_LIMIT_FRAGS = 2, + PF_LIMIT_TABLE_ENTRIES = 3, + PF_LIMIT_MAX = 4, } -pub const PF_POOL_NONE: _bindgen_ty_16 = _bindgen_ty_16::PF_POOL_NONE; -pub const PF_POOL_BITMASK: _bindgen_ty_16 = _bindgen_ty_16::PF_POOL_BITMASK; -pub const PF_POOL_RANDOM: _bindgen_ty_16 = _bindgen_ty_16::PF_POOL_RANDOM; -pub const PF_POOL_SRCHASH: _bindgen_ty_16 = _bindgen_ty_16::PF_POOL_SRCHASH; -pub const PF_POOL_ROUNDROBIN: _bindgen_ty_16 = _bindgen_ty_16::PF_POOL_ROUNDROBIN; +pub const PF_POOL_NONE: _bindgen_ty_13 = _bindgen_ty_13::PF_POOL_NONE; +pub const PF_POOL_BITMASK: _bindgen_ty_13 = _bindgen_ty_13::PF_POOL_BITMASK; +pub const PF_POOL_RANDOM: _bindgen_ty_13 = _bindgen_ty_13::PF_POOL_RANDOM; +pub const PF_POOL_SRCHASH: _bindgen_ty_13 = _bindgen_ty_13::PF_POOL_SRCHASH; +pub const PF_POOL_ROUNDROBIN: _bindgen_ty_13 = _bindgen_ty_13::PF_POOL_ROUNDROBIN; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum _bindgen_ty_16 { +pub enum _bindgen_ty_13 { PF_POOL_NONE = 0, PF_POOL_BITMASK = 1, PF_POOL_RANDOM = 2, PF_POOL_SRCHASH = 3, PF_POOL_ROUNDROBIN = 4, } -pub const PF_ADDR_ADDRMASK: _bindgen_ty_17 = _bindgen_ty_17::PF_ADDR_ADDRMASK; -pub const PF_ADDR_NOROUTE: _bindgen_ty_17 = _bindgen_ty_17::PF_ADDR_NOROUTE; -pub const PF_ADDR_DYNIFTL: _bindgen_ty_17 = _bindgen_ty_17::PF_ADDR_DYNIFTL; -pub const PF_ADDR_TABLE: _bindgen_ty_17 = _bindgen_ty_17::PF_ADDR_TABLE; -pub const PF_ADDR_RTLABEL: _bindgen_ty_17 = _bindgen_ty_17::PF_ADDR_RTLABEL; -pub const PF_ADDR_URPFFAILED: _bindgen_ty_17 = _bindgen_ty_17::PF_ADDR_URPFFAILED; -pub const PF_ADDR_RANGE: _bindgen_ty_17 = _bindgen_ty_17::PF_ADDR_RANGE; +pub const PF_ADDR_ADDRMASK: _bindgen_ty_14 = _bindgen_ty_14::PF_ADDR_ADDRMASK; +pub const PF_ADDR_NOROUTE: _bindgen_ty_14 = _bindgen_ty_14::PF_ADDR_NOROUTE; +pub const PF_ADDR_DYNIFTL: _bindgen_ty_14 = _bindgen_ty_14::PF_ADDR_DYNIFTL; +pub const PF_ADDR_TABLE: _bindgen_ty_14 = _bindgen_ty_14::PF_ADDR_TABLE; +pub const PF_ADDR_URPFFAILED: _bindgen_ty_14 = _bindgen_ty_14::PF_ADDR_URPFFAILED; +pub const PF_ADDR_RANGE: _bindgen_ty_14 = _bindgen_ty_14::PF_ADDR_RANGE; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum _bindgen_ty_17 { +pub enum _bindgen_ty_14 { PF_ADDR_ADDRMASK = 0, PF_ADDR_NOROUTE = 1, PF_ADDR_DYNIFTL = 2, PF_ADDR_TABLE = 3, - PF_ADDR_RTLABEL = 4, - PF_ADDR_URPFFAILED = 5, - PF_ADDR_RANGE = 6, + PF_ADDR_URPFFAILED = 4, + PF_ADDR_RANGE = 5, } #[repr(C)] #[derive(Copy, Clone)] -pub struct pf_addr { - pub pfa: pf_addr__bindgen_ty_1, +pub struct pfi_kif { + pub pfik_name: [::std::os::raw::c_char; 16usize], + pub __bindgen_anon_1: pfi_kif__bindgen_ty_1, + pub pfik_packets: [[[u_int64_t; 2usize]; 2usize]; 2usize], + pub pfik_bytes: [[[u_int64_t; 2usize]; 2usize]; 2usize], + pub pfik_tzero: u_int32_t, + pub pfik_flags: u_int, + pub pfik_ifp: *mut ifnet, + pub pfik_group: *mut ifg_group, + pub pfik_rulerefs: u_int, + pub pfik_dynaddrs: pfi_kif__bindgen_ty_2, } #[repr(C)] #[derive(Copy, Clone)] -pub union pf_addr__bindgen_ty_1 { - pub _v4addr: in_addr, - pub _v6addr: in6_addr, - pub _addr8: [u_int8_t; 16usize], - pub _addr16: [u_int16_t; 8usize], - pub _addr32: [u_int32_t; 4usize], +pub union pfi_kif__bindgen_ty_1 { + pub pfik_tree: pfi_kif__bindgen_ty_1__bindgen_ty_1, + pub pfik_list: pfi_kif__bindgen_ty_1__bindgen_ty_2, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfi_kif__bindgen_ty_1__bindgen_ty_1 { + pub rbe_link: [*mut pfi_kif; 3usize], } #[test] -fn bindgen_test_layout_pf_addr__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_pfi_kif__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(pf_addr__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pf_addr__bindgen_ty_1)) + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(pfi_kif__bindgen_ty_1__bindgen_ty_1)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._v4addr) as usize - ptr as usize }, - 0usize, + ::std::mem::align_of::(), + 8usize, concat!( - "Offset of field: ", - stringify!(pf_addr__bindgen_ty_1), - "::", - stringify!(_v4addr) + "Alignment of ", + stringify!(pfi_kif__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._v6addr) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rbe_link) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pf_addr__bindgen_ty_1), + stringify!(pfi_kif__bindgen_ty_1__bindgen_ty_1), "::", - stringify!(_v6addr) + stringify!(rbe_link) ) ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfi_kif__bindgen_ty_1__bindgen_ty_2 { + pub le_next: *mut pfi_kif, + pub le_prev: *mut *mut pfi_kif, +} +#[test] +fn bindgen_test_layout_pfi_kif__bindgen_ty_1__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pfi_kif__bindgen_ty_1__bindgen_ty_2)) + ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._addr8) as usize - ptr as usize }, - 0usize, + ::std::mem::align_of::(), + 8usize, concat!( - "Offset of field: ", - stringify!(pf_addr__bindgen_ty_1), - "::", - stringify!(_addr8) + "Alignment of ", + stringify!(pfi_kif__bindgen_ty_1__bindgen_ty_2) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._addr16) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).le_next) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pf_addr__bindgen_ty_1), + stringify!(pfi_kif__bindgen_ty_1__bindgen_ty_2), "::", - stringify!(_addr16) + stringify!(le_next) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._addr32) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).le_prev) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(pf_addr__bindgen_ty_1), + stringify!(pfi_kif__bindgen_ty_1__bindgen_ty_2), "::", - stringify!(_addr32) + stringify!(le_prev) ) ); } #[test] -fn bindgen_test_layout_pf_addr() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_pfi_kif__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(pf_addr)) + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(pfi_kif__bindgen_ty_1)) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pf_addr)) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfi_kif__bindgen_ty_1)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pfa) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pfik_tree) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pf_addr), + stringify!(pfi_kif__bindgen_ty_1), "::", - stringify!(pfa) + stringify!(pfik_tree) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfik_list) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif__bindgen_ty_1), + "::", + stringify!(pfik_list) ) ); } #[repr(C)] -#[derive(Copy, Clone)] -pub struct pf_addr_wrap { - pub v: pf_addr_wrap__bindgen_ty_1, - pub p: pf_addr_wrap__bindgen_ty_2, - pub type_: u_int8_t, - pub iflags: u_int8_t, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union pf_addr_wrap__bindgen_ty_1 { - pub a: pf_addr_wrap__bindgen_ty_1__bindgen_ty_1, - pub ifname: [::std::os::raw::c_char; 16usize], - pub tblname: [::std::os::raw::c_char; 32usize], - pub rtlabelname: [::std::os::raw::c_char; 32usize], - pub rtlabel: u_int32_t, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct pf_addr_wrap__bindgen_ty_1__bindgen_ty_1 { - pub addr: pf_addr, - pub mask: pf_addr, +#[derive(Debug, Copy, Clone)] +pub struct pfi_kif__bindgen_ty_2 { + pub tqh_first: *mut pfi_dynaddr, + pub tqh_last: *mut *mut pfi_dynaddr, } #[test] -fn bindgen_test_layout_pf_addr_wrap__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_pfi_kif__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!( - "Size of: ", - stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1) - ) + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pfi_kif__bindgen_ty_2)) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1) - ) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfi_kif__bindgen_ty_2)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tqh_first) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1), + stringify!(pfi_kif__bindgen_ty_2), "::", - stringify!(addr) + stringify!(tqh_first) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mask) as usize - ptr as usize }, - 16usize, + unsafe { ::std::ptr::addr_of!((*ptr).tqh_last) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1), + stringify!(pfi_kif__bindgen_ty_2), "::", - stringify!(mask) + stringify!(tqh_last) ) ); } #[test] -fn bindgen_test_layout_pf_addr_wrap__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_pfi_kif() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(pf_addr_wrap__bindgen_ty_1)) + ::std::mem::size_of::(), + 216usize, + concat!("Size of: ", stringify!(pfi_kif)) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pf_addr_wrap__bindgen_ty_1)) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfi_kif)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pfik_name) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pf_addr_wrap__bindgen_ty_1), + stringify!(pfi_kif), "::", - stringify!(a) + stringify!(pfik_name) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).pfik_packets) as usize - ptr as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(pf_addr_wrap__bindgen_ty_1), + stringify!(pfi_kif), "::", - stringify!(ifname) + stringify!(pfik_packets) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tblname) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).pfik_bytes) as usize - ptr as usize }, + 104usize, concat!( "Offset of field: ", - stringify!(pf_addr_wrap__bindgen_ty_1), + stringify!(pfi_kif), "::", - stringify!(tblname) + stringify!(pfik_bytes) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rtlabelname) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).pfik_tzero) as usize - ptr as usize }, + 168usize, concat!( "Offset of field: ", - stringify!(pf_addr_wrap__bindgen_ty_1), + stringify!(pfi_kif), "::", - stringify!(rtlabelname) + stringify!(pfik_tzero) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rtlabel) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).pfik_flags) as usize - ptr as usize }, + 172usize, concat!( "Offset of field: ", - stringify!(pf_addr_wrap__bindgen_ty_1), + stringify!(pfi_kif), "::", - stringify!(rtlabel) + stringify!(pfik_flags) ) ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union pf_addr_wrap__bindgen_ty_2 { - pub dyn_: *mut ::std::os::raw::c_void, - pub tbl: *mut ::std::os::raw::c_void, - pub dyncnt: ::std::os::raw::c_int, - pub tblcnt: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_pf_addr_wrap__bindgen_ty_2() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(pf_addr_wrap__bindgen_ty_2)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pf_addr_wrap__bindgen_ty_2)) - ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dyn_) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).pfik_ifp) as usize - ptr as usize }, + 176usize, concat!( "Offset of field: ", - stringify!(pf_addr_wrap__bindgen_ty_2), + stringify!(pfi_kif), "::", - stringify!(dyn_) + stringify!(pfik_ifp) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tbl) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).pfik_group) as usize - ptr as usize }, + 184usize, concat!( "Offset of field: ", - stringify!(pf_addr_wrap__bindgen_ty_2), + stringify!(pfi_kif), "::", - stringify!(tbl) + stringify!(pfik_group) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dyncnt) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).pfik_rulerefs) as usize - ptr as usize }, + 192usize, concat!( "Offset of field: ", - stringify!(pf_addr_wrap__bindgen_ty_2), + stringify!(pfi_kif), "::", - stringify!(dyncnt) + stringify!(pfik_rulerefs) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tblcnt) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).pfik_dynaddrs) as usize - ptr as usize }, + 200usize, concat!( "Offset of field: ", - stringify!(pf_addr_wrap__bindgen_ty_2), + stringify!(pfi_kif), "::", - stringify!(tblcnt) + stringify!(pfik_dynaddrs) ) ); } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_status { + pub counters: [u64; 16usize], + pub lcounters: [u64; 7usize], + pub fcounters: [u64; 3usize], + pub scounters: [u64; 3usize], + pub pcounters: [[[u64; 3usize]; 2usize]; 2usize], + pub bcounters: [[u64; 2usize]; 2usize], + pub running: u32, + pub states: u32, + pub src_nodes: u32, + pub since: u32, + pub debug: u32, + pub hostid: u32, + pub ifname: [::std::os::raw::c_char; 16usize], + pub pf_chksum: [u8; 16usize], +} #[test] -fn bindgen_test_layout_pf_addr_wrap() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_pf_status() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(pf_addr_wrap)) + ::std::mem::size_of::(), + 416usize, + concat!("Size of: ", stringify!(pf_status)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(pf_addr_wrap)) + concat!("Alignment of ", stringify!(pf_status)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).v) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).counters) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pf_addr_wrap), + stringify!(pf_status), "::", - stringify!(v) + stringify!(counters) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).p) as usize - ptr as usize }, - 32usize, + unsafe { ::std::ptr::addr_of!((*ptr).lcounters) as usize - ptr as usize }, + 128usize, concat!( "Offset of field: ", - stringify!(pf_addr_wrap), + stringify!(pf_status), "::", - stringify!(p) + stringify!(lcounters) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 40usize, + unsafe { ::std::ptr::addr_of!((*ptr).fcounters) as usize - ptr as usize }, + 184usize, concat!( "Offset of field: ", - stringify!(pf_addr_wrap), + stringify!(pf_status), "::", - stringify!(type_) + stringify!(fcounters) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iflags) as usize - ptr as usize }, - 41usize, + unsafe { ::std::ptr::addr_of!((*ptr).scounters) as usize - ptr as usize }, + 208usize, concat!( "Offset of field: ", - stringify!(pf_addr_wrap), + stringify!(pf_status), "::", - stringify!(iflags) + stringify!(scounters) ) ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pf_port_range { - pub port: [u_int16_t; 2usize], - pub op: u_int8_t, -} -#[test] -fn bindgen_test_layout_pf_port_range() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 6usize, - concat!("Size of: ", stringify!(pf_port_range)) - ); - assert_eq!( - ::std::mem::align_of::(), - 2usize, - concat!("Alignment of ", stringify!(pf_port_range)) - ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).port) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).pcounters) as usize - ptr as usize }, + 232usize, concat!( "Offset of field: ", - stringify!(pf_port_range), + stringify!(pf_status), "::", - stringify!(port) + stringify!(pcounters) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).op) as usize - ptr as usize }, - 4usize, + unsafe { ::std::ptr::addr_of!((*ptr).bcounters) as usize - ptr as usize }, + 328usize, concat!( "Offset of field: ", - stringify!(pf_port_range), + stringify!(pf_status), "::", - stringify!(op) + stringify!(bcounters) ) ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union pf_rule_xport { - pub range: pf_port_range, - pub call_id: u_int16_t, - pub spi: u_int32_t, -} -#[test] -fn bindgen_test_layout_pf_rule_xport() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(pf_rule_xport)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pf_rule_xport)) - ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).range) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).running) as usize - ptr as usize }, + 360usize, concat!( "Offset of field: ", - stringify!(pf_rule_xport), + stringify!(pf_status), "::", - stringify!(range) + stringify!(running) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).call_id) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).states) as usize - ptr as usize }, + 364usize, concat!( "Offset of field: ", - stringify!(pf_rule_xport), + stringify!(pf_status), "::", - stringify!(call_id) + stringify!(states) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).spi) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).src_nodes) as usize - ptr as usize }, + 368usize, concat!( "Offset of field: ", - stringify!(pf_rule_xport), + stringify!(pf_status), "::", - stringify!(spi) + stringify!(src_nodes) ) ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pf_rule_uid { - pub uid: [uid_t; 2usize], - pub op: u_int8_t, - pub _pad: [u_int8_t; 3usize], -} -#[test] -fn bindgen_test_layout_pf_rule_uid() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(pf_rule_uid)) + unsafe { ::std::ptr::addr_of!((*ptr).since) as usize - ptr as usize }, + 372usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(since) + ) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pf_rule_uid)) + unsafe { ::std::ptr::addr_of!((*ptr).debug) as usize - ptr as usize }, + 376usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(debug) + ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uid) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).hostid) as usize - ptr as usize }, + 380usize, concat!( "Offset of field: ", - stringify!(pf_rule_uid), + stringify!(pf_status), "::", - stringify!(uid) + stringify!(hostid) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).op) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, + 384usize, concat!( "Offset of field: ", - stringify!(pf_rule_uid), + stringify!(pf_status), "::", - stringify!(op) + stringify!(ifname) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pad) as usize - ptr as usize }, - 9usize, + unsafe { ::std::ptr::addr_of!((*ptr).pf_chksum) as usize - ptr as usize }, + 400usize, concat!( "Offset of field: ", - stringify!(pf_rule_uid), + stringify!(pf_status), "::", - stringify!(_pad) + stringify!(pf_chksum) ) ); } #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pf_rule_gid { - pub gid: [uid_t; 2usize], - pub op: u_int8_t, - pub _pad: [u_int8_t; 3usize], +#[derive(Copy, Clone)] +pub struct pf_addr { + pub __bindgen_anon_1: pf_addr__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pf_addr__bindgen_ty_1 { + pub v4: in_addr, + pub v6: in6_addr, + pub addr8: [u_int8_t; 16usize], + pub addr16: [u_int16_t; 8usize], + pub addr32: [u_int32_t; 4usize], } #[test] -fn bindgen_test_layout_pf_rule_gid() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_pf_addr__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(pf_rule_gid)) + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_addr__bindgen_ty_1)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(pf_rule_gid)) + concat!("Alignment of ", stringify!(pf_addr__bindgen_ty_1)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gid) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).v4) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pf_rule_gid), + stringify!(pf_addr__bindgen_ty_1), "::", - stringify!(gid) + stringify!(v4) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).op) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).v6) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(pf_rule_gid), + stringify!(pf_addr__bindgen_ty_1), "::", - stringify!(op) + stringify!(v6) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pad) as usize - ptr as usize }, - 9usize, + unsafe { ::std::ptr::addr_of!((*ptr).addr8) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(pf_rule_gid), + stringify!(pf_addr__bindgen_ty_1), "::", - stringify!(_pad) + stringify!(addr8) ) ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct pf_rule_addr { - pub addr: pf_addr_wrap, - pub xport: pf_rule_xport, - pub neg: u_int8_t, -} -#[test] -fn bindgen_test_layout_pf_rule_addr() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(pf_rule_addr)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pf_rule_addr)) - ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).addr16) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pf_rule_addr), + stringify!(pf_addr__bindgen_ty_1), "::", - stringify!(addr) + stringify!(addr16) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xport) as usize - ptr as usize }, - 48usize, + unsafe { ::std::ptr::addr_of!((*ptr).addr32) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(pf_rule_addr), + stringify!(pf_addr__bindgen_ty_1), "::", - stringify!(xport) + stringify!(addr32) ) ); +} +#[test] +fn bindgen_test_layout_pf_addr() { assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).neg) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(pf_rule_addr), - "::", - stringify!(neg) - ) + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_addr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_addr)) ); } #[repr(C)] #[derive(Copy, Clone)] -pub struct pf_pooladdr { - pub addr: pf_addr_wrap, - pub entries: pf_pooladdr__bindgen_ty_1, +pub struct pf_addr_wrap { + pub v: pf_addr_wrap__bindgen_ty_1, + pub p: pf_addr_wrap__bindgen_ty_2, + pub type_: u_int8_t, + pub iflags: u_int8_t, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pf_addr_wrap__bindgen_ty_1 { + pub a: pf_addr_wrap__bindgen_ty_1__bindgen_ty_1, pub ifname: [::std::os::raw::c_char; 16usize], - pub kif: *mut ::std::os::raw::c_void, + pub tblname: [::std::os::raw::c_char; 32usize], } #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pf_pooladdr__bindgen_ty_1 { - pub tqe_next: *mut pf_pooladdr, - pub tqe_prev: *mut *mut pf_pooladdr, +#[derive(Copy, Clone)] +pub struct pf_addr_wrap__bindgen_ty_1__bindgen_ty_1 { + pub addr: pf_addr, + pub mask: pf_addr, } #[test] -fn bindgen_test_layout_pf_pooladdr__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_pf_addr_wrap__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(pf_pooladdr__bindgen_ty_1)) + ::std::mem::size_of::(), + 32usize, + concat!( + "Size of: ", + stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1) + ) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pf_pooladdr__bindgen_ty_1)) + ::std::mem::align_of::(), + 4usize, + concat!( + "Alignment of ", + stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1) + ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqe_next) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pf_pooladdr__bindgen_ty_1), + stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1), "::", - stringify!(tqe_next) + stringify!(addr) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqe_prev) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).mask) as usize - ptr as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(pf_pooladdr__bindgen_ty_1), + stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1), "::", - stringify!(tqe_prev) + stringify!(mask) ) ); } #[test] -fn bindgen_test_layout_pf_pooladdr() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_pf_addr_wrap__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 88usize, - concat!("Size of: ", stringify!(pf_pooladdr)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pf_pooladdr)) + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(pf_addr_wrap__bindgen_ty_1)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pf_pooladdr), - "::", - stringify!(addr) - ) + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_addr_wrap__bindgen_ty_1)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).entries) as usize - ptr as usize }, - 48usize, + unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(pf_pooladdr), + stringify!(pf_addr_wrap__bindgen_ty_1), "::", - stringify!(entries) + stringify!(a) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, - 64usize, + 0usize, concat!( "Offset of field: ", - stringify!(pf_pooladdr), + stringify!(pf_addr_wrap__bindgen_ty_1), "::", stringify!(ifname) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kif) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(pf_pooladdr), - "::", - stringify!(kif) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pf_palist { - pub tqh_first: *mut pf_pooladdr, - pub tqh_last: *mut *mut pf_pooladdr, -} -#[test] -fn bindgen_test_layout_pf_palist() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(pf_palist)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pf_palist)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqh_first) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tblname) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pf_palist), - "::", - stringify!(tqh_first) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqh_last) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(pf_palist), + stringify!(pf_addr_wrap__bindgen_ty_1), "::", - stringify!(tqh_last) + stringify!(tblname) ) ); } #[repr(C)] #[derive(Copy, Clone)] -pub struct pf_poolhashkey { - pub pfk: pf_poolhashkey__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union pf_poolhashkey__bindgen_ty_1 { - pub key8: [u_int8_t; 16usize], - pub key16: [u_int16_t; 8usize], - pub key32: [u_int32_t; 4usize], +pub union pf_addr_wrap__bindgen_ty_2 { + pub dyn_: *mut pfi_dynaddr, + pub tbl: *mut pfr_ktable, + pub dyncnt: ::std::os::raw::c_int, + pub tblcnt: ::std::os::raw::c_int, } #[test] -fn bindgen_test_layout_pf_poolhashkey__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_pf_addr_wrap__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(pf_poolhashkey__bindgen_ty_1)) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(pf_addr_wrap__bindgen_ty_2)) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pf_poolhashkey__bindgen_ty_1)) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_addr_wrap__bindgen_ty_2)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).key8) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).dyn_) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pf_poolhashkey__bindgen_ty_1), + stringify!(pf_addr_wrap__bindgen_ty_2), "::", - stringify!(key8) + stringify!(dyn_) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).key16) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tbl) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pf_poolhashkey__bindgen_ty_1), + stringify!(pf_addr_wrap__bindgen_ty_2), "::", - stringify!(key16) + stringify!(tbl) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).key32) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).dyncnt) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pf_poolhashkey__bindgen_ty_1), + stringify!(pf_addr_wrap__bindgen_ty_2), "::", - stringify!(key32) + stringify!(dyncnt) ) ); -} -#[test] -fn bindgen_test_layout_pf_poolhashkey() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(pf_poolhashkey)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pf_poolhashkey)) - ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pfk) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tblcnt) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pf_poolhashkey), + stringify!(pf_addr_wrap__bindgen_ty_2), "::", - stringify!(pfk) + stringify!(tblcnt) ) ); } -#[repr(C)] -#[derive(Copy, Clone)] -pub struct pf_pool { - pub list: pf_palist, - pub cur: *mut ::std::os::raw::c_void, - pub key: pf_poolhashkey, - pub counter: pf_addr, - pub tblidx: ::std::os::raw::c_int, - pub proxy_port: [u_int16_t; 2usize], - pub port_op: u_int8_t, - pub opts: u_int8_t, - pub af: sa_family_t, -} #[test] -fn bindgen_test_layout_pf_pool() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_pf_addr_wrap() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 72usize, - concat!("Size of: ", stringify!(pf_pool)) + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(pf_addr_wrap)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(pf_pool)) + concat!("Alignment of ", stringify!(pf_addr_wrap)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).list) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).v) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pf_pool), - "::", - stringify!(list) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cur) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(pf_pool), + stringify!(pf_addr_wrap), "::", - stringify!(cur) + stringify!(v) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).key) as usize - ptr as usize }, - 24usize, + unsafe { ::std::ptr::addr_of!((*ptr).p) as usize - ptr as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(pf_pool), + stringify!(pf_addr_wrap), "::", - stringify!(key) + stringify!(p) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).counter) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", - stringify!(pf_pool), - "::", - stringify!(counter) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tblidx) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(pf_pool), - "::", - stringify!(tblidx) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).proxy_port) as usize - ptr as usize }, - 60usize, - concat!( - "Offset of field: ", - stringify!(pf_pool), - "::", - stringify!(proxy_port) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).port_op) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(pf_pool), - "::", - stringify!(port_op) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).opts) as usize - ptr as usize }, - 65usize, - concat!( - "Offset of field: ", - stringify!(pf_pool), + stringify!(pf_addr_wrap), "::", - stringify!(opts) + stringify!(type_) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).af) as usize - ptr as usize }, - 66usize, + unsafe { ::std::ptr::addr_of!((*ptr).iflags) as usize - ptr as usize }, + 41usize, concat!( "Offset of field: ", - stringify!(pf_pool), + stringify!(pf_addr_wrap), "::", - stringify!(af) + stringify!(iflags) ) ); } -pub type pf_osfp_t = u_int32_t; #[repr(C)] #[derive(Copy, Clone)] pub union pf_rule_ptr { @@ -1435,2319 +1282,2447 @@ fn bindgen_test_layout_pf_rule_ptr() { ); } #[repr(C)] -#[derive(Copy, Clone)] -pub struct pf_rule { - pub src: pf_rule_addr, - pub dst: pf_rule_addr, - pub skip: [pf_rule_ptr; 8usize], - pub label: [::std::os::raw::c_char; 64usize], - pub ifname: [::std::os::raw::c_char; 16usize], - pub qname: [::std::os::raw::c_char; 64usize], - pub pqname: [::std::os::raw::c_char; 64usize], - pub tagname: [::std::os::raw::c_char; 64usize], - pub match_tagname: [::std::os::raw::c_char; 64usize], - pub overload_tblname: [::std::os::raw::c_char; 32usize], - pub entries: pf_rule__bindgen_ty_1, - pub rpool: pf_pool, - pub evaluations: u_int64_t, - pub packets: [u_int64_t; 2usize], - pub bytes: [u_int64_t; 2usize], - pub ticket: u_int64_t, - pub owner: [::std::os::raw::c_char; 64usize], - pub priority: u_int32_t, - pub kif: *mut ::std::os::raw::c_void, - pub anchor: *mut pf_anchor, - pub overload_tbl: *mut ::std::os::raw::c_void, - pub os_fingerprint: pf_osfp_t, - pub rtableid: ::std::os::raw::c_uint, - pub timeout: [u_int32_t; 26usize], - pub states: u_int32_t, - pub max_states: u_int32_t, - pub src_nodes: u_int32_t, - pub max_src_nodes: u_int32_t, - pub max_src_states: u_int32_t, - pub max_src_conn: u_int32_t, - pub max_src_conn_rate: pf_rule__bindgen_ty_2, - pub qid: u_int32_t, - pub pqid: u_int32_t, - pub rt_listid: u_int32_t, - pub nr: u_int32_t, - pub prob: u_int32_t, - pub cuid: uid_t, - pub cpid: pid_t, - pub return_icmp: u_int16_t, - pub return_icmp6: u_int16_t, - pub max_mss: u_int16_t, - pub tag: u_int16_t, - pub match_tag: u_int16_t, - pub uid: pf_rule_uid, - pub gid: pf_rule_gid, - pub rule_flag: u_int32_t, - pub action: u_int8_t, - pub direction: u_int8_t, - pub log: u_int8_t, - pub logif: u_int8_t, - pub quick: u_int8_t, - pub ifnot: u_int8_t, - pub match_tag_not: u_int8_t, - pub natpass: u_int8_t, - pub keep_state: u_int8_t, - pub af: sa_family_t, - pub proto: u_int8_t, - pub type_: u_int8_t, - pub code: u_int8_t, - pub flags: u_int8_t, - pub flagset: u_int8_t, - pub min_ttl: u_int8_t, - pub allow_opts: u_int8_t, - pub rt: u_int8_t, - pub return_ttl: u_int8_t, - pub tos: u_int8_t, - pub anchor_relative: u_int8_t, - pub anchor_wildcard: u_int8_t, - pub flush: u_int8_t, - pub proto_variant: u_int8_t, - pub extfilter: u_int8_t, - pub extmap: u_int8_t, - pub dnpipe: u_int32_t, - pub dntype: u_int32_t, -} -#[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct pf_rule__bindgen_ty_1 { - pub tqe_next: *mut pf_rule, - pub tqe_prev: *mut *mut pf_rule, +pub struct pf_rule_uid { + pub uid: [uid_t; 2usize], + pub op: u_int8_t, } #[test] -fn bindgen_test_layout_pf_rule__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_pf_rule_uid() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(pf_rule__bindgen_ty_1)) + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(pf_rule_uid)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pf_rule__bindgen_ty_1)) + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_rule_uid)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqe_next) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).uid) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pf_rule__bindgen_ty_1), + stringify!(pf_rule_uid), "::", - stringify!(tqe_next) + stringify!(uid) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqe_prev) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).op) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(pf_rule__bindgen_ty_1), + stringify!(pf_rule_uid), "::", - stringify!(tqe_prev) + stringify!(op) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct pf_rule__bindgen_ty_2 { - pub limit: u_int32_t, - pub seconds: u_int32_t, +pub struct pf_rule_gid { + pub gid: [uid_t; 2usize], + pub op: u_int8_t, } #[test] -fn bindgen_test_layout_pf_rule__bindgen_ty_2() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_pf_rule_gid() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(pf_rule__bindgen_ty_2)) + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(pf_rule_gid)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(pf_rule__bindgen_ty_2)) + concat!("Alignment of ", stringify!(pf_rule_gid)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).limit) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).gid) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pf_rule__bindgen_ty_2), + stringify!(pf_rule_gid), "::", - stringify!(limit) + stringify!(gid) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).seconds) as usize - ptr as usize }, - 4usize, + unsafe { ::std::ptr::addr_of!((*ptr).op) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(pf_rule__bindgen_ty_2), + stringify!(pf_rule_gid), "::", - stringify!(seconds) + stringify!(op) ) ); } +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_rule_addr { + pub addr: pf_addr_wrap, + pub port: [u_int16_t; 2usize], + pub neg: u_int8_t, + pub port_op: u_int8_t, +} #[test] -fn bindgen_test_layout_pf_rule() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_pf_rule_addr() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 1040usize, - concat!("Size of: ", stringify!(pf_rule)) + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(pf_rule_addr)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(pf_rule)) + concat!("Alignment of ", stringify!(pf_rule_addr)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).src) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pf_rule), + stringify!(pf_rule_addr), "::", - stringify!(src) + stringify!(addr) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dst) as usize - ptr as usize }, - 64usize, + unsafe { ::std::ptr::addr_of!((*ptr).port) as usize - ptr as usize }, + 48usize, concat!( "Offset of field: ", - stringify!(pf_rule), + stringify!(pf_rule_addr), "::", - stringify!(dst) + stringify!(port) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).skip) as usize - ptr as usize }, - 128usize, + unsafe { ::std::ptr::addr_of!((*ptr).neg) as usize - ptr as usize }, + 52usize, concat!( "Offset of field: ", - stringify!(pf_rule), + stringify!(pf_rule_addr), "::", - stringify!(skip) + stringify!(neg) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, - 192usize, + unsafe { ::std::ptr::addr_of!((*ptr).port_op) as usize - ptr as usize }, + 53usize, concat!( "Offset of field: ", - stringify!(pf_rule), + stringify!(pf_rule_addr), "::", - stringify!(label) + stringify!(port_op) ) ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_pooladdr { + pub addr: pf_addr_wrap, + pub entries: pf_pooladdr__bindgen_ty_1, + pub ifname: [::std::os::raw::c_char; 16usize], + pub kif: *mut pfi_kif, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_pooladdr__bindgen_ty_1 { + pub tqe_next: *mut pf_pooladdr, + pub tqe_prev: *mut *mut pf_pooladdr, +} +#[test] +fn bindgen_test_layout_pf_pooladdr__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, - 256usize, - concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(ifname) - ) + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_pooladdr__bindgen_ty_1)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).qname) as usize - ptr as usize }, - 272usize, - concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(qname) - ) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_pooladdr__bindgen_ty_1)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pqname) as usize - ptr as usize }, - 336usize, + unsafe { ::std::ptr::addr_of!((*ptr).tqe_next) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(pf_rule), + stringify!(pf_pooladdr__bindgen_ty_1), "::", - stringify!(pqname) + stringify!(tqe_next) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tagname) as usize - ptr as usize }, - 400usize, + unsafe { ::std::ptr::addr_of!((*ptr).tqe_prev) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(pf_rule), + stringify!(pf_pooladdr__bindgen_ty_1), "::", - stringify!(tagname) + stringify!(tqe_prev) ) ); +} +#[test] +fn bindgen_test_layout_pf_pooladdr() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 88usize, + concat!("Size of: ", stringify!(pf_pooladdr)) + ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).match_tagname) as usize - ptr as usize }, - 464usize, - concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(match_tagname) - ) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_pooladdr)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).overload_tblname) as usize - ptr as usize }, - 528usize, + unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(pf_rule), + stringify!(pf_pooladdr), "::", - stringify!(overload_tblname) + stringify!(addr) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).entries) as usize - ptr as usize }, - 560usize, + 48usize, concat!( "Offset of field: ", - stringify!(pf_rule), + stringify!(pf_pooladdr), "::", stringify!(entries) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rpool) as usize - ptr as usize }, - 576usize, + unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, + 64usize, concat!( "Offset of field: ", - stringify!(pf_rule), + stringify!(pf_pooladdr), "::", - stringify!(rpool) + stringify!(ifname) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).evaluations) as usize - ptr as usize }, - 648usize, + unsafe { ::std::ptr::addr_of!((*ptr).kif) as usize - ptr as usize }, + 80usize, concat!( "Offset of field: ", - stringify!(pf_rule), + stringify!(pf_pooladdr), "::", - stringify!(evaluations) + stringify!(kif) ) ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_palist { + pub tqh_first: *mut pf_pooladdr, + pub tqh_last: *mut *mut pf_pooladdr, +} +#[test] +fn bindgen_test_layout_pf_palist() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_palist)) + ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).packets) as usize - ptr as usize }, - 656usize, + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_palist)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tqh_first) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(pf_rule), + stringify!(pf_palist), "::", - stringify!(packets) + stringify!(tqh_first) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bytes) as usize - ptr as usize }, - 672usize, + unsafe { ::std::ptr::addr_of!((*ptr).tqh_last) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(pf_rule), + stringify!(pf_palist), "::", - stringify!(bytes) + stringify!(tqh_last) ) ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_poolhashkey { + pub __bindgen_anon_1: pf_poolhashkey__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pf_poolhashkey__bindgen_ty_1 { + pub key8: [u_int8_t; 16usize], + pub key16: [u_int16_t; 8usize], + pub key32: [u_int32_t; 4usize], +} +#[test] +fn bindgen_test_layout_pf_poolhashkey__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ticket) as usize - ptr as usize }, - 688usize, + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_poolhashkey__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_poolhashkey__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).key8) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(pf_rule), + stringify!(pf_poolhashkey__bindgen_ty_1), "::", - stringify!(ticket) + stringify!(key8) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).owner) as usize - ptr as usize }, - 696usize, + unsafe { ::std::ptr::addr_of!((*ptr).key16) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(pf_rule), + stringify!(pf_poolhashkey__bindgen_ty_1), "::", - stringify!(owner) + stringify!(key16) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).priority) as usize - ptr as usize }, - 760usize, + unsafe { ::std::ptr::addr_of!((*ptr).key32) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(pf_rule), + stringify!(pf_poolhashkey__bindgen_ty_1), + "::", + stringify!(key32) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_poolhashkey() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_poolhashkey)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_poolhashkey)) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_pool { + pub list: pf_palist, + pub cur: *mut pf_pooladdr, + pub key: pf_poolhashkey, + pub counter: pf_addr, + pub tblidx: ::std::os::raw::c_int, + pub proxy_port: [u_int16_t; 2usize], + pub opts: u_int8_t, +} +#[test] +fn bindgen_test_layout_pf_pool() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 72usize, + concat!("Size of: ", stringify!(pf_pool)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_pool)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).list) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(list) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cur) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(cur) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).key) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(key) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).counter) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), "::", - stringify!(priority) + stringify!(counter) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kif) as usize - ptr as usize }, - 768usize, + unsafe { ::std::ptr::addr_of!((*ptr).tblidx) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(tblidx) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).proxy_port) as usize - ptr as usize }, + 60usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(proxy_port) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).opts) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(opts) + ) + ); +} +pub type pf_osfp_t = u_int32_t; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_rule { + pub src: pf_rule_addr, + pub dst: pf_rule_addr, + pub skip: [pf_rule_ptr; 8usize], + pub label: [::std::os::raw::c_char; 64usize], + pub ifname: [::std::os::raw::c_char; 16usize], + pub qname: [::std::os::raw::c_char; 64usize], + pub pqname: [::std::os::raw::c_char; 64usize], + pub tagname: [::std::os::raw::c_char; 64usize], + pub match_tagname: [::std::os::raw::c_char; 64usize], + pub overload_tblname: [::std::os::raw::c_char; 32usize], + pub entries: pf_rule__bindgen_ty_1, + pub rpool: pf_pool, + pub evaluations: u_int64_t, + pub packets: [u_int64_t; 2usize], + pub bytes: [u_int64_t; 2usize], + pub kif: *mut pfi_kif, + pub anchor: *mut pf_anchor, + pub overload_tbl: *mut pfr_ktable, + pub os_fingerprint: pf_osfp_t, + pub rtableid: ::std::os::raw::c_int, + pub timeout: [u_int32_t; 20usize], + pub max_states: u_int32_t, + pub max_src_nodes: u_int32_t, + pub max_src_states: u_int32_t, + pub max_src_conn: u_int32_t, + pub max_src_conn_rate: pf_rule__bindgen_ty_2, + pub qid: u_int32_t, + pub pqid: u_int32_t, + pub rt_listid: u_int32_t, + pub nr: u_int32_t, + pub prob: u_int32_t, + pub cuid: uid_t, + pub cpid: pid_t, + pub states_cur: counter_u64_t, + pub states_tot: counter_u64_t, + pub src_nodes: counter_u64_t, + pub return_icmp: u_int16_t, + pub return_icmp6: u_int16_t, + pub max_mss: u_int16_t, + pub tag: u_int16_t, + pub match_tag: u_int16_t, + pub scrub_flags: u_int16_t, + pub uid: pf_rule_uid, + pub gid: pf_rule_gid, + pub rule_flag: u_int32_t, + pub action: u_int8_t, + pub direction: u_int8_t, + pub log: u_int8_t, + pub logif: u_int8_t, + pub quick: u_int8_t, + pub ifnot: u_int8_t, + pub match_tag_not: u_int8_t, + pub natpass: u_int8_t, + pub keep_state: u_int8_t, + pub af: sa_family_t, + pub proto: u_int8_t, + pub type_: u_int8_t, + pub code: u_int8_t, + pub flags: u_int8_t, + pub flagset: u_int8_t, + pub min_ttl: u_int8_t, + pub allow_opts: u_int8_t, + pub rt: u_int8_t, + pub return_ttl: u_int8_t, + pub tos: u_int8_t, + pub set_tos: u_int8_t, + pub anchor_relative: u_int8_t, + pub anchor_wildcard: u_int8_t, + pub flush: u_int8_t, + pub prio: u_int8_t, + pub set_prio: [u_int8_t; 2usize], + pub divert: pf_rule__bindgen_ty_3, + pub u_states_cur: u64, + pub u_states_tot: u64, + pub u_src_nodes: u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_rule__bindgen_ty_1 { + pub tqe_next: *mut pf_rule, + pub tqe_prev: *mut *mut pf_rule, +} +#[test] +fn bindgen_test_layout_pf_rule__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_rule__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_rule__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tqe_next) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(pf_rule), + stringify!(pf_rule__bindgen_ty_1), "::", - stringify!(kif) + stringify!(tqe_next) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).anchor) as usize - ptr as usize }, - 776usize, + unsafe { ::std::ptr::addr_of!((*ptr).tqe_prev) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(pf_rule), + stringify!(pf_rule__bindgen_ty_1), "::", - stringify!(anchor) + stringify!(tqe_prev) ) ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_rule__bindgen_ty_2 { + pub limit: u_int32_t, + pub seconds: u_int32_t, +} +#[test] +fn bindgen_test_layout_pf_rule__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).overload_tbl) as usize - ptr as usize }, - 784usize, - concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(overload_tbl) - ) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(pf_rule__bindgen_ty_2)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).os_fingerprint) as usize - ptr as usize }, - 792usize, - concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(os_fingerprint) - ) + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_rule__bindgen_ty_2)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rtableid) as usize - ptr as usize }, - 796usize, + unsafe { ::std::ptr::addr_of!((*ptr).limit) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(pf_rule), + stringify!(pf_rule__bindgen_ty_2), "::", - stringify!(rtableid) + stringify!(limit) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).timeout) as usize - ptr as usize }, - 800usize, + unsafe { ::std::ptr::addr_of!((*ptr).seconds) as usize - ptr as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(pf_rule), + stringify!(pf_rule__bindgen_ty_2), "::", - stringify!(timeout) + stringify!(seconds) ) ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_rule__bindgen_ty_3 { + pub addr: pf_addr, + pub port: u_int16_t, +} +#[test] +fn bindgen_test_layout_pf_rule__bindgen_ty_3() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).states) as usize - ptr as usize }, - 904usize, - concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(states) - ) + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(pf_rule__bindgen_ty_3)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).max_states) as usize - ptr as usize }, - 908usize, - concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(max_states) - ) + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_rule__bindgen_ty_3)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).src_nodes) as usize - ptr as usize }, - 912usize, + unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(pf_rule), + stringify!(pf_rule__bindgen_ty_3), "::", - stringify!(src_nodes) + stringify!(addr) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).max_src_nodes) as usize - ptr as usize }, - 916usize, + unsafe { ::std::ptr::addr_of!((*ptr).port) as usize - ptr as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(pf_rule), + stringify!(pf_rule__bindgen_ty_3), "::", - stringify!(max_src_nodes) + stringify!(port) ) ); +} +#[test] +fn bindgen_test_layout_pf_rule() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).max_src_states) as usize - ptr as usize }, - 920usize, - concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(max_src_states) - ) + ::std::mem::size_of::(), + 976usize, + concat!("Size of: ", stringify!(pf_rule)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).max_src_conn) as usize - ptr as usize }, - 924usize, - concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(max_src_conn) - ) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_rule)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).max_src_conn_rate) as usize - ptr as usize }, - 928usize, + unsafe { ::std::ptr::addr_of!((*ptr).src) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(max_src_conn_rate) + stringify!(src) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).qid) as usize - ptr as usize }, - 936usize, + unsafe { ::std::ptr::addr_of!((*ptr).dst) as usize - ptr as usize }, + 56usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(qid) + stringify!(dst) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pqid) as usize - ptr as usize }, - 940usize, + unsafe { ::std::ptr::addr_of!((*ptr).skip) as usize - ptr as usize }, + 112usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(pqid) + stringify!(skip) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rt_listid) as usize - ptr as usize }, - 944usize, + unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, + 176usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(rt_listid) + stringify!(label) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nr) as usize - ptr as usize }, - 948usize, + unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, + 240usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(nr) + stringify!(ifname) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, - 952usize, + unsafe { ::std::ptr::addr_of!((*ptr).qname) as usize - ptr as usize }, + 256usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(prob) + stringify!(qname) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cuid) as usize - ptr as usize }, - 956usize, + unsafe { ::std::ptr::addr_of!((*ptr).pqname) as usize - ptr as usize }, + 320usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(cuid) + stringify!(pqname) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpid) as usize - ptr as usize }, - 960usize, + unsafe { ::std::ptr::addr_of!((*ptr).tagname) as usize - ptr as usize }, + 384usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(cpid) + stringify!(tagname) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).return_icmp) as usize - ptr as usize }, - 964usize, + unsafe { ::std::ptr::addr_of!((*ptr).match_tagname) as usize - ptr as usize }, + 448usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(return_icmp) + stringify!(match_tagname) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).return_icmp6) as usize - ptr as usize }, - 966usize, + unsafe { ::std::ptr::addr_of!((*ptr).overload_tblname) as usize - ptr as usize }, + 512usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(return_icmp6) + stringify!(overload_tblname) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).max_mss) as usize - ptr as usize }, - 968usize, + unsafe { ::std::ptr::addr_of!((*ptr).entries) as usize - ptr as usize }, + 544usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(max_mss) + stringify!(entries) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, - 970usize, + unsafe { ::std::ptr::addr_of!((*ptr).rpool) as usize - ptr as usize }, + 560usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(tag) + stringify!(rpool) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).match_tag) as usize - ptr as usize }, - 972usize, + unsafe { ::std::ptr::addr_of!((*ptr).evaluations) as usize - ptr as usize }, + 632usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(match_tag) + stringify!(evaluations) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uid) as usize - ptr as usize }, - 976usize, + unsafe { ::std::ptr::addr_of!((*ptr).packets) as usize - ptr as usize }, + 640usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(uid) + stringify!(packets) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gid) as usize - ptr as usize }, - 988usize, + unsafe { ::std::ptr::addr_of!((*ptr).bytes) as usize - ptr as usize }, + 656usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(gid) + stringify!(bytes) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rule_flag) as usize - ptr as usize }, - 1000usize, + unsafe { ::std::ptr::addr_of!((*ptr).kif) as usize - ptr as usize }, + 672usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(rule_flag) + stringify!(kif) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, - 1004usize, + unsafe { ::std::ptr::addr_of!((*ptr).anchor) as usize - ptr as usize }, + 680usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(action) + stringify!(anchor) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).direction) as usize - ptr as usize }, - 1005usize, + unsafe { ::std::ptr::addr_of!((*ptr).overload_tbl) as usize - ptr as usize }, + 688usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(direction) + stringify!(overload_tbl) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).log) as usize - ptr as usize }, - 1006usize, + unsafe { ::std::ptr::addr_of!((*ptr).os_fingerprint) as usize - ptr as usize }, + 696usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(log) + stringify!(os_fingerprint) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).logif) as usize - ptr as usize }, - 1007usize, + unsafe { ::std::ptr::addr_of!((*ptr).rtableid) as usize - ptr as usize }, + 700usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(logif) + stringify!(rtableid) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).quick) as usize - ptr as usize }, - 1008usize, + unsafe { ::std::ptr::addr_of!((*ptr).timeout) as usize - ptr as usize }, + 704usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(quick) + stringify!(timeout) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ifnot) as usize - ptr as usize }, - 1009usize, + unsafe { ::std::ptr::addr_of!((*ptr).max_states) as usize - ptr as usize }, + 784usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(ifnot) + stringify!(max_states) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).match_tag_not) as usize - ptr as usize }, - 1010usize, + unsafe { ::std::ptr::addr_of!((*ptr).max_src_nodes) as usize - ptr as usize }, + 788usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(match_tag_not) + stringify!(max_src_nodes) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).natpass) as usize - ptr as usize }, - 1011usize, + unsafe { ::std::ptr::addr_of!((*ptr).max_src_states) as usize - ptr as usize }, + 792usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(natpass) + stringify!(max_src_states) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keep_state) as usize - ptr as usize }, - 1012usize, + unsafe { ::std::ptr::addr_of!((*ptr).max_src_conn) as usize - ptr as usize }, + 796usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(keep_state) + stringify!(max_src_conn) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).af) as usize - ptr as usize }, - 1013usize, + unsafe { ::std::ptr::addr_of!((*ptr).max_src_conn_rate) as usize - ptr as usize }, + 800usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(af) + stringify!(max_src_conn_rate) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).proto) as usize - ptr as usize }, - 1014usize, + unsafe { ::std::ptr::addr_of!((*ptr).qid) as usize - ptr as usize }, + 808usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(proto) + stringify!(qid) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 1015usize, + unsafe { ::std::ptr::addr_of!((*ptr).pqid) as usize - ptr as usize }, + 812usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(type_) + stringify!(pqid) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).code) as usize - ptr as usize }, - 1016usize, + unsafe { ::std::ptr::addr_of!((*ptr).rt_listid) as usize - ptr as usize }, + 816usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(code) + stringify!(rt_listid) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 1017usize, + unsafe { ::std::ptr::addr_of!((*ptr).nr) as usize - ptr as usize }, + 820usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(flags) + stringify!(nr) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flagset) as usize - ptr as usize }, - 1018usize, + unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, + 824usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(flagset) + stringify!(prob) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).min_ttl) as usize - ptr as usize }, - 1019usize, + unsafe { ::std::ptr::addr_of!((*ptr).cuid) as usize - ptr as usize }, + 828usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(min_ttl) + stringify!(cuid) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).allow_opts) as usize - ptr as usize }, - 1020usize, + unsafe { ::std::ptr::addr_of!((*ptr).cpid) as usize - ptr as usize }, + 832usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(allow_opts) + stringify!(cpid) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rt) as usize - ptr as usize }, - 1021usize, + unsafe { ::std::ptr::addr_of!((*ptr).states_cur) as usize - ptr as usize }, + 840usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(rt) + stringify!(states_cur) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).return_ttl) as usize - ptr as usize }, - 1022usize, + unsafe { ::std::ptr::addr_of!((*ptr).states_tot) as usize - ptr as usize }, + 848usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(return_ttl) + stringify!(states_tot) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tos) as usize - ptr as usize }, - 1023usize, + unsafe { ::std::ptr::addr_of!((*ptr).src_nodes) as usize - ptr as usize }, + 856usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(tos) + stringify!(src_nodes) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).anchor_relative) as usize - ptr as usize }, - 1024usize, + unsafe { ::std::ptr::addr_of!((*ptr).return_icmp) as usize - ptr as usize }, + 864usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(anchor_relative) + stringify!(return_icmp) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).anchor_wildcard) as usize - ptr as usize }, - 1025usize, + unsafe { ::std::ptr::addr_of!((*ptr).return_icmp6) as usize - ptr as usize }, + 866usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(anchor_wildcard) + stringify!(return_icmp6) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flush) as usize - ptr as usize }, - 1026usize, + unsafe { ::std::ptr::addr_of!((*ptr).max_mss) as usize - ptr as usize }, + 868usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(flush) + stringify!(max_mss) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).proto_variant) as usize - ptr as usize }, - 1027usize, + unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, + 870usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(proto_variant) + stringify!(tag) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).extfilter) as usize - ptr as usize }, - 1028usize, + unsafe { ::std::ptr::addr_of!((*ptr).match_tag) as usize - ptr as usize }, + 872usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(extfilter) + stringify!(match_tag) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).extmap) as usize - ptr as usize }, - 1029usize, + unsafe { ::std::ptr::addr_of!((*ptr).scrub_flags) as usize - ptr as usize }, + 874usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(extmap) + stringify!(scrub_flags) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dnpipe) as usize - ptr as usize }, - 1032usize, + unsafe { ::std::ptr::addr_of!((*ptr).uid) as usize - ptr as usize }, + 876usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(dnpipe) + stringify!(uid) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dntype) as usize - ptr as usize }, - 1036usize, + unsafe { ::std::ptr::addr_of!((*ptr).gid) as usize - ptr as usize }, + 888usize, concat!( "Offset of field: ", stringify!(pf_rule), "::", - stringify!(dntype) + stringify!(gid) ) ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union pf_state_xport { - pub port: u_int16_t, - pub call_id: u_int16_t, - pub spi: u_int32_t, -} -#[test] -fn bindgen_test_layout_pf_state_xport() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(pf_state_xport)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pf_state_xport)) - ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).port) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).rule_flag) as usize - ptr as usize }, + 900usize, concat!( "Offset of field: ", - stringify!(pf_state_xport), + stringify!(pf_rule), "::", - stringify!(port) + stringify!(rule_flag) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).call_id) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, + 904usize, concat!( "Offset of field: ", - stringify!(pf_state_xport), + stringify!(pf_rule), "::", - stringify!(call_id) + stringify!(action) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).spi) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).direction) as usize - ptr as usize }, + 905usize, concat!( "Offset of field: ", - stringify!(pf_state_xport), + stringify!(pf_rule), "::", - stringify!(spi) + stringify!(direction) ) ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct hook_desc { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct hook_desc_head { - pub tqh_first: *mut hook_desc, - pub tqh_last: *mut *mut hook_desc, -} -#[test] -fn bindgen_test_layout_hook_desc_head() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(hook_desc_head)) - ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(hook_desc_head)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqh_first) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).log) as usize - ptr as usize }, + 906usize, concat!( "Offset of field: ", - stringify!(hook_desc_head), + stringify!(pf_rule), "::", - stringify!(tqh_first) + stringify!(log) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqh_last) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).logif) as usize - ptr as usize }, + 907usize, concat!( "Offset of field: ", - stringify!(hook_desc_head), + stringify!(pf_rule), "::", - stringify!(tqh_last) + stringify!(logif) ) ); -} -#[repr(C, packed)] -#[derive(Debug, Copy, Clone)] -pub struct pfsync_state_scrub { - pub pfss_flags: u_int16_t, - pub pfss_ttl: u_int8_t, - pub scrub_flag: u_int8_t, - pub pfss_ts_mod: u_int32_t, -} -#[test] -fn bindgen_test_layout_pfsync_state_scrub() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(pfsync_state_scrub)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(pfsync_state_scrub)) - ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pfss_flags) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).quick) as usize - ptr as usize }, + 908usize, concat!( "Offset of field: ", - stringify!(pfsync_state_scrub), + stringify!(pf_rule), "::", - stringify!(pfss_flags) + stringify!(quick) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pfss_ttl) as usize - ptr as usize }, - 2usize, + unsafe { ::std::ptr::addr_of!((*ptr).ifnot) as usize - ptr as usize }, + 909usize, concat!( "Offset of field: ", - stringify!(pfsync_state_scrub), + stringify!(pf_rule), "::", - stringify!(pfss_ttl) + stringify!(ifnot) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).scrub_flag) as usize - ptr as usize }, - 3usize, + unsafe { ::std::ptr::addr_of!((*ptr).match_tag_not) as usize - ptr as usize }, + 910usize, concat!( "Offset of field: ", - stringify!(pfsync_state_scrub), + stringify!(pf_rule), "::", - stringify!(scrub_flag) + stringify!(match_tag_not) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pfss_ts_mod) as usize - ptr as usize }, - 4usize, + unsafe { ::std::ptr::addr_of!((*ptr).natpass) as usize - ptr as usize }, + 911usize, concat!( "Offset of field: ", - stringify!(pfsync_state_scrub), + stringify!(pf_rule), "::", - stringify!(pfss_ts_mod) + stringify!(natpass) ) ); -} -#[repr(C, packed)] -#[derive(Copy, Clone)] -pub struct pfsync_state_host { - pub addr: pf_addr, - pub xport: pf_state_xport, - pub pad: [u_int16_t; 2usize], -} -#[test] -fn bindgen_test_layout_pfsync_state_host() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(pfsync_state_host)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(pfsync_state_host)) - ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).keep_state) as usize - ptr as usize }, + 912usize, concat!( "Offset of field: ", - stringify!(pfsync_state_host), + stringify!(pf_rule), "::", - stringify!(addr) + stringify!(keep_state) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xport) as usize - ptr as usize }, - 16usize, + unsafe { ::std::ptr::addr_of!((*ptr).af) as usize - ptr as usize }, + 913usize, concat!( "Offset of field: ", - stringify!(pfsync_state_host), + stringify!(pf_rule), "::", - stringify!(xport) + stringify!(af) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, - 20usize, + unsafe { ::std::ptr::addr_of!((*ptr).proto) as usize - ptr as usize }, + 914usize, concat!( "Offset of field: ", - stringify!(pfsync_state_host), + stringify!(pf_rule), "::", - stringify!(pad) + stringify!(proto) ) ); -} -#[repr(C, packed)] -#[derive(Debug, Copy, Clone)] -pub struct pfsync_state_peer { - pub scrub: pfsync_state_scrub, - pub seqlo: u_int32_t, - pub seqhi: u_int32_t, - pub seqdiff: u_int32_t, - pub max_win: u_int16_t, - pub mss: u_int16_t, - pub state: u_int8_t, - pub wscale: u_int8_t, - pub pad: [u_int8_t; 6usize], -} -#[test] -fn bindgen_test_layout_pfsync_state_peer() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(pfsync_state_peer)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(pfsync_state_peer)) - ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).scrub) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + 915usize, concat!( "Offset of field: ", - stringify!(pfsync_state_peer), + stringify!(pf_rule), "::", - stringify!(scrub) + stringify!(type_) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).seqlo) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).code) as usize - ptr as usize }, + 916usize, concat!( "Offset of field: ", - stringify!(pfsync_state_peer), + stringify!(pf_rule), "::", - stringify!(seqlo) + stringify!(code) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).seqhi) as usize - ptr as usize }, - 12usize, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 917usize, concat!( "Offset of field: ", - stringify!(pfsync_state_peer), + stringify!(pf_rule), "::", - stringify!(seqhi) + stringify!(flags) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).seqdiff) as usize - ptr as usize }, - 16usize, + unsafe { ::std::ptr::addr_of!((*ptr).flagset) as usize - ptr as usize }, + 918usize, concat!( "Offset of field: ", - stringify!(pfsync_state_peer), + stringify!(pf_rule), "::", - stringify!(seqdiff) + stringify!(flagset) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).max_win) as usize - ptr as usize }, - 20usize, + unsafe { ::std::ptr::addr_of!((*ptr).min_ttl) as usize - ptr as usize }, + 919usize, concat!( "Offset of field: ", - stringify!(pfsync_state_peer), + stringify!(pf_rule), "::", - stringify!(max_win) + stringify!(min_ttl) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mss) as usize - ptr as usize }, - 22usize, + unsafe { ::std::ptr::addr_of!((*ptr).allow_opts) as usize - ptr as usize }, + 920usize, concat!( "Offset of field: ", - stringify!(pfsync_state_peer), + stringify!(pf_rule), "::", - stringify!(mss) + stringify!(allow_opts) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, - 24usize, + unsafe { ::std::ptr::addr_of!((*ptr).rt) as usize - ptr as usize }, + 921usize, concat!( "Offset of field: ", - stringify!(pfsync_state_peer), + stringify!(pf_rule), "::", - stringify!(state) + stringify!(rt) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).wscale) as usize - ptr as usize }, - 25usize, + unsafe { ::std::ptr::addr_of!((*ptr).return_ttl) as usize - ptr as usize }, + 922usize, concat!( "Offset of field: ", - stringify!(pfsync_state_peer), + stringify!(pf_rule), "::", - stringify!(wscale) + stringify!(return_ttl) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, - 26usize, + unsafe { ::std::ptr::addr_of!((*ptr).tos) as usize - ptr as usize }, + 923usize, concat!( "Offset of field: ", - stringify!(pfsync_state_peer), + stringify!(pf_rule), "::", - stringify!(pad) + stringify!(tos) ) ); -} -#[repr(C, packed)] -#[derive(Copy, Clone)] -pub struct pfsync_state { - pub id: [u_int32_t; 2usize], - pub ifname: [::std::os::raw::c_char; 16usize], - pub lan: pfsync_state_host, - pub gwy: pfsync_state_host, - pub ext_lan: pfsync_state_host, - pub ext_gwy: pfsync_state_host, - pub src: pfsync_state_peer, - pub dst: pfsync_state_peer, - pub rt_addr: pf_addr, - pub unlink_hooks: hook_desc_head, - pub rule: u_int32_t, - pub anchor: u_int32_t, - pub nat_rule: u_int32_t, - pub creation: u_int64_t, - pub expire: u_int64_t, - pub packets: [[u_int32_t; 2usize]; 2usize], - pub bytes: [[u_int32_t; 2usize]; 2usize], - pub creatorid: u_int32_t, - pub tag: u_int16_t, - pub af_lan: sa_family_t, - pub af_gwy: sa_family_t, - pub proto: u_int8_t, - pub direction: u_int8_t, - pub log: u_int8_t, - pub allow_opts: u_int8_t, - pub timeout: u_int8_t, - pub sync_flags: u_int8_t, - pub updates: u_int8_t, - pub proto_variant: u_int8_t, - pub __pad: u_int8_t, - pub flowhash: u_int32_t, -} -#[test] -fn bindgen_test_layout_pfsync_state() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 297usize, - concat!("Size of: ", stringify!(pfsync_state)) - ); assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(pfsync_state)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).set_tos) as usize - ptr as usize }, + 924usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_rule), "::", - stringify!(id) + stringify!(set_tos) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).anchor_relative) as usize - ptr as usize }, + 925usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_rule), "::", - stringify!(ifname) + stringify!(anchor_relative) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lan) as usize - ptr as usize }, - 24usize, + unsafe { ::std::ptr::addr_of!((*ptr).anchor_wildcard) as usize - ptr as usize }, + 926usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_rule), "::", - stringify!(lan) + stringify!(anchor_wildcard) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gwy) as usize - ptr as usize }, - 48usize, + unsafe { ::std::ptr::addr_of!((*ptr).flush) as usize - ptr as usize }, + 927usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_rule), "::", - stringify!(gwy) + stringify!(flush) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ext_lan) as usize - ptr as usize }, - 72usize, + unsafe { ::std::ptr::addr_of!((*ptr).prio) as usize - ptr as usize }, + 928usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_rule), "::", - stringify!(ext_lan) + stringify!(prio) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ext_gwy) as usize - ptr as usize }, - 96usize, + unsafe { ::std::ptr::addr_of!((*ptr).set_prio) as usize - ptr as usize }, + 929usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_rule), "::", - stringify!(ext_gwy) + stringify!(set_prio) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).src) as usize - ptr as usize }, - 120usize, + unsafe { ::std::ptr::addr_of!((*ptr).divert) as usize - ptr as usize }, + 932usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_rule), "::", - stringify!(src) + stringify!(divert) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dst) as usize - ptr as usize }, - 152usize, + unsafe { ::std::ptr::addr_of!((*ptr).u_states_cur) as usize - ptr as usize }, + 952usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_rule), "::", - stringify!(dst) + stringify!(u_states_cur) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rt_addr) as usize - ptr as usize }, - 184usize, + unsafe { ::std::ptr::addr_of!((*ptr).u_states_tot) as usize - ptr as usize }, + 960usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_rule), "::", - stringify!(rt_addr) + stringify!(u_states_tot) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).unlink_hooks) as usize - ptr as usize }, - 200usize, + unsafe { ::std::ptr::addr_of!((*ptr).u_src_nodes) as usize - ptr as usize }, + 968usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_rule), "::", - stringify!(unlink_hooks) + stringify!(u_src_nodes) ) ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_rulequeue { + pub tqh_first: *mut pf_rule, + pub tqh_last: *mut *mut pf_rule, +} +#[test] +fn bindgen_test_layout_pf_rulequeue() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_rulequeue)) + ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rule) as usize - ptr as usize }, - 216usize, + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_rulequeue)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tqh_first) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_rulequeue), "::", - stringify!(rule) + stringify!(tqh_first) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).anchor) as usize - ptr as usize }, - 220usize, + unsafe { ::std::ptr::addr_of!((*ptr).tqh_last) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_rulequeue), "::", - stringify!(anchor) + stringify!(tqh_last) ) ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_ruleset { + pub rules: [pf_ruleset__bindgen_ty_1; 5usize], + pub anchor: *mut pf_anchor, + pub tticket: u_int32_t, + pub tables: ::std::os::raw::c_int, + pub topen: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_ruleset__bindgen_ty_1 { + pub queues: [pf_rulequeue; 2usize], + pub active: pf_ruleset__bindgen_ty_1__bindgen_ty_1, + pub inactive: pf_ruleset__bindgen_ty_1__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_ruleset__bindgen_ty_1__bindgen_ty_1 { + pub ptr: *mut pf_rulequeue, + pub ptr_array: *mut *mut pf_rule, + pub rcount: u_int32_t, + pub ticket: u_int32_t, + pub open: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_pf_ruleset__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nat_rule) as usize - ptr as usize }, - 224usize, + ::std::mem::size_of::(), + 32usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(nat_rule) + "Size of: ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).creation) as usize - ptr as usize }, - 228usize, + ::std::mem::align_of::(), + 8usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(creation) + "Alignment of ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).expire) as usize - ptr as usize }, - 236usize, + unsafe { ::std::ptr::addr_of!((*ptr).ptr) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), "::", - stringify!(expire) + stringify!(ptr) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).packets) as usize - ptr as usize }, - 244usize, + unsafe { ::std::ptr::addr_of!((*ptr).ptr_array) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), "::", - stringify!(packets) + stringify!(ptr_array) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bytes) as usize - ptr as usize }, - 260usize, + unsafe { ::std::ptr::addr_of!((*ptr).rcount) as usize - ptr as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), "::", - stringify!(bytes) + stringify!(rcount) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).creatorid) as usize - ptr as usize }, - 276usize, + unsafe { ::std::ptr::addr_of!((*ptr).ticket) as usize - ptr as usize }, + 20usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), "::", - stringify!(creatorid) + stringify!(ticket) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, - 280usize, + unsafe { ::std::ptr::addr_of!((*ptr).open) as usize - ptr as usize }, + 24usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), "::", - stringify!(tag) + stringify!(open) ) ); +} +#[test] +fn bindgen_test_layout_pf_ruleset__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 96usize, + concat!("Size of: ", stringify!(pf_ruleset__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_ruleset__bindgen_ty_1)) + ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).af_lan) as usize - ptr as usize }, - 282usize, + unsafe { ::std::ptr::addr_of!((*ptr).queues) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_ruleset__bindgen_ty_1), "::", - stringify!(af_lan) + stringify!(queues) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).af_gwy) as usize - ptr as usize }, - 283usize, + unsafe { ::std::ptr::addr_of!((*ptr).active) as usize - ptr as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_ruleset__bindgen_ty_1), "::", - stringify!(af_gwy) + stringify!(active) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).proto) as usize - ptr as usize }, - 284usize, + unsafe { ::std::ptr::addr_of!((*ptr).inactive) as usize - ptr as usize }, + 64usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_ruleset__bindgen_ty_1), "::", - stringify!(proto) + stringify!(inactive) ) ); +} +#[test] +fn bindgen_test_layout_pf_ruleset() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 504usize, + concat!("Size of: ", stringify!(pf_ruleset)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_ruleset)) + ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).direction) as usize - ptr as usize }, - 285usize, + unsafe { ::std::ptr::addr_of!((*ptr).rules) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_ruleset), "::", - stringify!(direction) + stringify!(rules) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).log) as usize - ptr as usize }, - 286usize, + unsafe { ::std::ptr::addr_of!((*ptr).anchor) as usize - ptr as usize }, + 480usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_ruleset), "::", - stringify!(log) + stringify!(anchor) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).allow_opts) as usize - ptr as usize }, - 287usize, + unsafe { ::std::ptr::addr_of!((*ptr).tticket) as usize - ptr as usize }, + 488usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_ruleset), "::", - stringify!(allow_opts) + stringify!(tticket) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).timeout) as usize - ptr as usize }, - 288usize, + unsafe { ::std::ptr::addr_of!((*ptr).tables) as usize - ptr as usize }, + 492usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_ruleset), "::", - stringify!(timeout) + stringify!(tables) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sync_flags) as usize - ptr as usize }, - 289usize, + unsafe { ::std::ptr::addr_of!((*ptr).topen) as usize - ptr as usize }, + 496usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_ruleset), "::", - stringify!(sync_flags) + stringify!(topen) ) ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_anchor_node { + pub rbh_root: *mut pf_anchor, +} +#[test] +fn bindgen_test_layout_pf_anchor_node() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).updates) as usize - ptr as usize }, - 290usize, - concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(updates) - ) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(pf_anchor_node)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).proto_variant) as usize - ptr as usize }, - 291usize, - concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(proto_variant) - ) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_anchor_node)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pad) as usize - ptr as usize }, - 292usize, + unsafe { ::std::ptr::addr_of!((*ptr).rbh_root) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_anchor_node), "::", - stringify!(__pad) + stringify!(rbh_root) ) ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_anchor { + pub entry_global: pf_anchor__bindgen_ty_1, + pub entry_node: pf_anchor__bindgen_ty_2, + pub parent: *mut pf_anchor, + pub children: pf_anchor_node, + pub name: [::std::os::raw::c_char; 64usize], + pub path: [::std::os::raw::c_char; 1024usize], + pub ruleset: pf_ruleset, + pub refcnt: ::std::os::raw::c_int, + pub match_: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_anchor__bindgen_ty_1 { + pub rbe_link: [*mut pf_anchor; 3usize], +} +#[test] +fn bindgen_test_layout_pf_anchor__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(pf_anchor__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_anchor__bindgen_ty_1)) + ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flowhash) as usize - ptr as usize }, - 293usize, + unsafe { ::std::ptr::addr_of!((*ptr).rbe_link) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(pfsync_state), + stringify!(pf_anchor__bindgen_ty_1), "::", - stringify!(flowhash) + stringify!(rbe_link) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct pf_rulequeue { - pub tqh_first: *mut pf_rule, - pub tqh_last: *mut *mut pf_rule, +pub struct pf_anchor__bindgen_ty_2 { + pub rbe_link: [*mut pf_anchor; 3usize], } #[test] -fn bindgen_test_layout_pf_rulequeue() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_pf_anchor__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(pf_rulequeue)) + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(pf_anchor__bindgen_ty_2)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(pf_rulequeue)) + concat!("Alignment of ", stringify!(pf_anchor__bindgen_ty_2)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqh_first) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rbe_link) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pf_rulequeue), + stringify!(pf_anchor__bindgen_ty_2), "::", - stringify!(tqh_first) + stringify!(rbe_link) ) ); +} +#[test] +fn bindgen_test_layout_pf_anchor() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 1664usize, + concat!("Size of: ", stringify!(pf_anchor)) + ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqh_last) as usize - ptr as usize }, + ::std::mem::align_of::(), 8usize, + concat!("Alignment of ", stringify!(pf_anchor)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).entry_global) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(pf_rulequeue), + stringify!(pf_anchor), "::", - stringify!(tqh_last) + stringify!(entry_global) ) ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pf_ruleset { - pub rules: [pf_ruleset__bindgen_ty_1; 6usize], - pub anchor: *mut pf_anchor, - pub tticket: u_int32_t, - pub tables: ::std::os::raw::c_int, - pub topen: ::std::os::raw::c_int, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pf_ruleset__bindgen_ty_1 { - pub queues: [pf_rulequeue; 2usize], - pub active: pf_ruleset__bindgen_ty_1__bindgen_ty_1, - pub inactive: pf_ruleset__bindgen_ty_1__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pf_ruleset__bindgen_ty_1__bindgen_ty_1 { - pub ptr: *mut pf_rulequeue, - pub ptr_array: *mut *mut pf_rule, - pub rcount: u_int32_t, - pub rsize: u_int32_t, - pub ticket: u_int32_t, - pub open: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_pf_ruleset__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 32usize, + unsafe { ::std::ptr::addr_of!((*ptr).entry_node) as usize - ptr as usize }, + 24usize, concat!( - "Size of: ", - stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1) + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(entry_node) ) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).parent) as usize - ptr as usize }, + 48usize, concat!( - "Alignment of ", - stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1) + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(parent) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ptr) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).children) as usize - ptr as usize }, + 56usize, concat!( "Offset of field: ", - stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), + stringify!(pf_anchor), "::", - stringify!(ptr) + stringify!(children) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ptr_array) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, + 64usize, concat!( "Offset of field: ", - stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), + stringify!(pf_anchor), "::", - stringify!(ptr_array) + stringify!(name) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rcount) as usize - ptr as usize }, - 16usize, + unsafe { ::std::ptr::addr_of!((*ptr).path) as usize - ptr as usize }, + 128usize, concat!( "Offset of field: ", - stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), + stringify!(pf_anchor), "::", - stringify!(rcount) + stringify!(path) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rsize) as usize - ptr as usize }, - 20usize, + unsafe { ::std::ptr::addr_of!((*ptr).ruleset) as usize - ptr as usize }, + 1152usize, concat!( "Offset of field: ", - stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), + stringify!(pf_anchor), "::", - stringify!(rsize) + stringify!(ruleset) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ticket) as usize - ptr as usize }, - 24usize, + unsafe { ::std::ptr::addr_of!((*ptr).refcnt) as usize - ptr as usize }, + 1656usize, concat!( "Offset of field: ", - stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), + stringify!(pf_anchor), "::", - stringify!(ticket) + stringify!(refcnt) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).open) as usize - ptr as usize }, - 28usize, + unsafe { ::std::ptr::addr_of!((*ptr).match_) as usize - ptr as usize }, + 1660usize, concat!( "Offset of field: ", - stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), + stringify!(pf_anchor), "::", - stringify!(open) + stringify!(match_) ) ); } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_state_cmp { + pub id: u_int64_t, + pub creatorid: u_int32_t, + pub direction: u_int8_t, + pub pad: [u_int8_t; 3usize], +} #[test] -fn bindgen_test_layout_pf_ruleset__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_pf_state_cmp() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 96usize, - concat!("Size of: ", stringify!(pf_ruleset__bindgen_ty_1)) + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_state_cmp)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(pf_ruleset__bindgen_ty_1)) + concat!("Alignment of ", stringify!(pf_state_cmp)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).queues) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pf_ruleset__bindgen_ty_1), + stringify!(pf_state_cmp), + "::", + stringify!(id) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).creatorid) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_state_cmp), "::", - stringify!(queues) + stringify!(creatorid) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).active) as usize - ptr as usize }, - 32usize, + unsafe { ::std::ptr::addr_of!((*ptr).direction) as usize - ptr as usize }, + 12usize, concat!( "Offset of field: ", - stringify!(pf_ruleset__bindgen_ty_1), + stringify!(pf_state_cmp), "::", - stringify!(active) + stringify!(direction) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).inactive) as usize - ptr as usize }, - 64usize, + unsafe { ::std::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, + 13usize, concat!( "Offset of field: ", - stringify!(pf_ruleset__bindgen_ty_1), + stringify!(pf_state_cmp), "::", - stringify!(inactive) + stringify!(pad) ) ); } +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct pfsync_state_scrub { + pub pfss_flags: u_int16_t, + pub pfss_ttl: u_int8_t, + pub scrub_flag: u_int8_t, + pub pfss_ts_mod: u_int32_t, +} #[test] -fn bindgen_test_layout_pf_ruleset() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_pfsync_state_scrub() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 600usize, - concat!("Size of: ", stringify!(pf_ruleset)) - ); - assert_eq!( - ::std::mem::align_of::(), + ::std::mem::size_of::(), 8usize, - concat!("Alignment of ", stringify!(pf_ruleset)) + concat!("Size of: ", stringify!(pfsync_state_scrub)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rules) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pf_ruleset), - "::", - stringify!(rules) - ) + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(pfsync_state_scrub)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).anchor) as usize - ptr as usize }, - 576usize, + unsafe { ::std::ptr::addr_of!((*ptr).pfss_flags) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(pf_ruleset), + stringify!(pfsync_state_scrub), "::", - stringify!(anchor) + stringify!(pfss_flags) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tticket) as usize - ptr as usize }, - 584usize, + unsafe { ::std::ptr::addr_of!((*ptr).pfss_ttl) as usize - ptr as usize }, + 2usize, concat!( "Offset of field: ", - stringify!(pf_ruleset), + stringify!(pfsync_state_scrub), "::", - stringify!(tticket) + stringify!(pfss_ttl) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tables) as usize - ptr as usize }, - 588usize, + unsafe { ::std::ptr::addr_of!((*ptr).scrub_flag) as usize - ptr as usize }, + 3usize, concat!( "Offset of field: ", - stringify!(pf_ruleset), + stringify!(pfsync_state_scrub), "::", - stringify!(tables) + stringify!(scrub_flag) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).topen) as usize - ptr as usize }, - 592usize, + unsafe { ::std::ptr::addr_of!((*ptr).pfss_ts_mod) as usize - ptr as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(pf_ruleset), + stringify!(pfsync_state_scrub), "::", - stringify!(topen) + stringify!(pfss_ts_mod) ) ); } -#[repr(C)] +#[repr(C, packed)] #[derive(Debug, Copy, Clone)] -pub struct pf_anchor_node { - pub rbh_root: *mut pf_anchor, +pub struct pfsync_state_peer { + pub scrub: pfsync_state_scrub, + pub seqlo: u_int32_t, + pub seqhi: u_int32_t, + pub seqdiff: u_int32_t, + pub max_win: u_int16_t, + pub mss: u_int16_t, + pub state: u_int8_t, + pub wscale: u_int8_t, + pub pad: [u_int8_t; 6usize], } #[test] -fn bindgen_test_layout_pf_anchor_node() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_pfsync_state_peer() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(pf_anchor_node)) + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(pfsync_state_peer)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pf_anchor_node)) + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(pfsync_state_peer)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rbh_root) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).scrub) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pf_anchor_node), + stringify!(pfsync_state_peer), "::", - stringify!(rbh_root) + stringify!(scrub) ) ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pf_anchor { - pub entry_global: pf_anchor__bindgen_ty_1, - pub entry_node: pf_anchor__bindgen_ty_2, - pub parent: *mut pf_anchor, - pub children: pf_anchor_node, - pub name: [::std::os::raw::c_char; 64usize], - pub path: [::std::os::raw::c_char; 1024usize], - pub ruleset: pf_ruleset, - pub refcnt: ::std::os::raw::c_int, - pub match_: ::std::os::raw::c_int, - pub owner: [::std::os::raw::c_char; 64usize], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pf_anchor__bindgen_ty_1 { - pub rbe_left: *mut pf_anchor, - pub rbe_right: *mut pf_anchor, - pub rbe_parent: *mut pf_anchor, -} -#[test] -fn bindgen_test_layout_pf_anchor__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(pf_anchor__bindgen_ty_1)) - ); assert_eq!( - ::std::mem::align_of::(), + unsafe { ::std::ptr::addr_of!((*ptr).seqlo) as usize - ptr as usize }, 8usize, - concat!("Alignment of ", stringify!(pf_anchor__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rbe_left) as usize - ptr as usize }, - 0usize, concat!( "Offset of field: ", - stringify!(pf_anchor__bindgen_ty_1), + stringify!(pfsync_state_peer), "::", - stringify!(rbe_left) + stringify!(seqlo) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rbe_right) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).seqhi) as usize - ptr as usize }, + 12usize, concat!( "Offset of field: ", - stringify!(pf_anchor__bindgen_ty_1), + stringify!(pfsync_state_peer), "::", - stringify!(rbe_right) + stringify!(seqhi) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rbe_parent) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).seqdiff) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(pf_anchor__bindgen_ty_1), + stringify!(pfsync_state_peer), "::", - stringify!(rbe_parent) + stringify!(seqdiff) ) ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pf_anchor__bindgen_ty_2 { - pub rbe_left: *mut pf_anchor, - pub rbe_right: *mut pf_anchor, - pub rbe_parent: *mut pf_anchor, -} -#[test] -fn bindgen_test_layout_pf_anchor__bindgen_ty_2() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(pf_anchor__bindgen_ty_2)) + unsafe { ::std::ptr::addr_of!((*ptr).max_win) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(max_win) + ) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pf_anchor__bindgen_ty_2)) + unsafe { ::std::ptr::addr_of!((*ptr).mss) as usize - ptr as usize }, + 22usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(mss) + ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rbe_left) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, + 24usize, concat!( "Offset of field: ", - stringify!(pf_anchor__bindgen_ty_2), + stringify!(pfsync_state_peer), "::", - stringify!(rbe_left) + stringify!(state) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rbe_right) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).wscale) as usize - ptr as usize }, + 25usize, concat!( "Offset of field: ", - stringify!(pf_anchor__bindgen_ty_2), + stringify!(pfsync_state_peer), "::", - stringify!(rbe_right) + stringify!(wscale) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rbe_parent) as usize - ptr as usize }, - 16usize, + unsafe { ::std::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, + 26usize, concat!( "Offset of field: ", - stringify!(pf_anchor__bindgen_ty_2), + stringify!(pfsync_state_peer), "::", - stringify!(rbe_parent) + stringify!(pad) ) ); } +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pfsync_state_key { + pub addr: [pf_addr; 2usize], + pub port: [u_int16_t; 2usize], +} #[test] -fn bindgen_test_layout_pf_anchor() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_pfsync_state_key() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 1824usize, - concat!("Size of: ", stringify!(pf_anchor)) + ::std::mem::size_of::(), + 36usize, + concat!("Size of: ", stringify!(pfsync_state_key)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pf_anchor)) + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pfsync_state_key)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).entry_global) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pf_anchor), + stringify!(pfsync_state_key), "::", - stringify!(entry_global) + stringify!(addr) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).entry_node) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(pf_anchor), - "::", - stringify!(entry_node) - ) + unsafe { ::std::ptr::addr_of!((*ptr).port) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_key), + "::", + stringify!(port) + ) + ); +} +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub struct pfsync_state_1301 { + pub id: u_int64_t, + pub ifname: [::std::os::raw::c_char; 16usize], + pub key: [pfsync_state_key; 2usize], + pub src: pfsync_state_peer, + pub dst: pfsync_state_peer, + pub rt_addr: pf_addr, + pub rule: u_int32_t, + pub anchor: u_int32_t, + pub nat_rule: u_int32_t, + pub creation: u_int32_t, + pub expire: u_int32_t, + pub packets: [[u_int32_t; 2usize]; 2usize], + pub bytes: [[u_int32_t; 2usize]; 2usize], + pub creatorid: u_int32_t, + pub af: sa_family_t, + pub proto: u_int8_t, + pub direction: u_int8_t, + pub __spare: [u_int8_t; 2usize], + pub log: u_int8_t, + pub state_flags: u_int8_t, + pub timeout: u_int8_t, + pub sync_flags: u_int8_t, + pub updates: u_int8_t, +} +#[test] +fn bindgen_test_layout_pfsync_state_1301() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 242usize, + concat!("Size of: ", stringify!(pfsync_state_1301)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(pfsync_state_1301)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).parent) as usize - ptr as usize }, - 48usize, + unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(pf_anchor), + stringify!(pfsync_state_1301), "::", - stringify!(parent) + stringify!(id) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).children) as usize - ptr as usize }, - 56usize, + unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(pf_anchor), + stringify!(pfsync_state_1301), "::", - stringify!(children) + stringify!(ifname) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 64usize, + unsafe { ::std::ptr::addr_of!((*ptr).key) as usize - ptr as usize }, + 24usize, concat!( "Offset of field: ", - stringify!(pf_anchor), + stringify!(pfsync_state_1301), "::", - stringify!(name) + stringify!(key) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).path) as usize - ptr as usize }, - 128usize, + unsafe { ::std::ptr::addr_of!((*ptr).src) as usize - ptr as usize }, + 96usize, concat!( "Offset of field: ", - stringify!(pf_anchor), + stringify!(pfsync_state_1301), "::", - stringify!(path) + stringify!(src) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ruleset) as usize - ptr as usize }, - 1152usize, + unsafe { ::std::ptr::addr_of!((*ptr).dst) as usize - ptr as usize }, + 128usize, concat!( "Offset of field: ", - stringify!(pf_anchor), + stringify!(pfsync_state_1301), "::", - stringify!(ruleset) + stringify!(dst) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).refcnt) as usize - ptr as usize }, - 1752usize, + unsafe { ::std::ptr::addr_of!((*ptr).rt_addr) as usize - ptr as usize }, + 160usize, concat!( "Offset of field: ", - stringify!(pf_anchor), + stringify!(pfsync_state_1301), "::", - stringify!(refcnt) + stringify!(rt_addr) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).match_) as usize - ptr as usize }, - 1756usize, + unsafe { ::std::ptr::addr_of!((*ptr).rule) as usize - ptr as usize }, + 176usize, concat!( "Offset of field: ", - stringify!(pf_anchor), + stringify!(pfsync_state_1301), "::", - stringify!(match_) + stringify!(rule) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).owner) as usize - ptr as usize }, - 1760usize, + unsafe { ::std::ptr::addr_of!((*ptr).anchor) as usize - ptr as usize }, + 180usize, concat!( "Offset of field: ", - stringify!(pf_anchor), + stringify!(pfsync_state_1301), "::", - stringify!(owner) + stringify!(anchor) ) ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pf_status { - pub counters: [u_int64_t; 17usize], - pub lcounters: [u_int64_t; 7usize], - pub fcounters: [u_int64_t; 3usize], - pub scounters: [u_int64_t; 3usize], - pub pcounters: [[[u_int64_t; 3usize]; 2usize]; 2usize], - pub bcounters: [[u_int64_t; 2usize]; 2usize], - pub stateid: u_int64_t, - pub running: u_int32_t, - pub states: u_int32_t, - pub src_nodes: u_int32_t, - pub since: u_int64_t, - pub debug: u_int32_t, - pub hostid: u_int32_t, - pub ifname: [::std::os::raw::c_char; 16usize], - pub pf_chksum: [u_int8_t; 16usize], -} -#[test] -fn bindgen_test_layout_pf_status() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 440usize, - concat!("Size of: ", stringify!(pf_status)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pf_status)) - ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).counters) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).nat_rule) as usize - ptr as usize }, + 184usize, concat!( "Offset of field: ", - stringify!(pf_status), + stringify!(pfsync_state_1301), "::", - stringify!(counters) + stringify!(nat_rule) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lcounters) as usize - ptr as usize }, - 136usize, + unsafe { ::std::ptr::addr_of!((*ptr).creation) as usize - ptr as usize }, + 188usize, concat!( "Offset of field: ", - stringify!(pf_status), + stringify!(pfsync_state_1301), "::", - stringify!(lcounters) + stringify!(creation) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fcounters) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).expire) as usize - ptr as usize }, 192usize, concat!( "Offset of field: ", - stringify!(pf_status), + stringify!(pfsync_state_1301), "::", - stringify!(fcounters) + stringify!(expire) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).scounters) as usize - ptr as usize }, - 216usize, + unsafe { ::std::ptr::addr_of!((*ptr).packets) as usize - ptr as usize }, + 196usize, concat!( "Offset of field: ", - stringify!(pf_status), + stringify!(pfsync_state_1301), "::", - stringify!(scounters) + stringify!(packets) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pcounters) as usize - ptr as usize }, - 240usize, + unsafe { ::std::ptr::addr_of!((*ptr).bytes) as usize - ptr as usize }, + 212usize, concat!( "Offset of field: ", - stringify!(pf_status), + stringify!(pfsync_state_1301), "::", - stringify!(pcounters) + stringify!(bytes) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bcounters) as usize - ptr as usize }, - 336usize, + unsafe { ::std::ptr::addr_of!((*ptr).creatorid) as usize - ptr as usize }, + 228usize, concat!( "Offset of field: ", - stringify!(pf_status), + stringify!(pfsync_state_1301), "::", - stringify!(bcounters) + stringify!(creatorid) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stateid) as usize - ptr as usize }, - 368usize, + unsafe { ::std::ptr::addr_of!((*ptr).af) as usize - ptr as usize }, + 232usize, concat!( "Offset of field: ", - stringify!(pf_status), + stringify!(pfsync_state_1301), "::", - stringify!(stateid) + stringify!(af) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).running) as usize - ptr as usize }, - 376usize, + unsafe { ::std::ptr::addr_of!((*ptr).proto) as usize - ptr as usize }, + 233usize, concat!( "Offset of field: ", - stringify!(pf_status), + stringify!(pfsync_state_1301), "::", - stringify!(running) + stringify!(proto) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).states) as usize - ptr as usize }, - 380usize, + unsafe { ::std::ptr::addr_of!((*ptr).direction) as usize - ptr as usize }, + 234usize, concat!( "Offset of field: ", - stringify!(pf_status), + stringify!(pfsync_state_1301), "::", - stringify!(states) + stringify!(direction) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).src_nodes) as usize - ptr as usize }, - 384usize, + unsafe { ::std::ptr::addr_of!((*ptr).__spare) as usize - ptr as usize }, + 235usize, concat!( "Offset of field: ", - stringify!(pf_status), + stringify!(pfsync_state_1301), "::", - stringify!(src_nodes) + stringify!(__spare) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).since) as usize - ptr as usize }, - 392usize, + unsafe { ::std::ptr::addr_of!((*ptr).log) as usize - ptr as usize }, + 237usize, concat!( "Offset of field: ", - stringify!(pf_status), + stringify!(pfsync_state_1301), "::", - stringify!(since) + stringify!(log) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).debug) as usize - ptr as usize }, - 400usize, + unsafe { ::std::ptr::addr_of!((*ptr).state_flags) as usize - ptr as usize }, + 238usize, concat!( "Offset of field: ", - stringify!(pf_status), + stringify!(pfsync_state_1301), "::", - stringify!(debug) + stringify!(state_flags) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hostid) as usize - ptr as usize }, - 404usize, + unsafe { ::std::ptr::addr_of!((*ptr).timeout) as usize - ptr as usize }, + 239usize, concat!( "Offset of field: ", - stringify!(pf_status), + stringify!(pfsync_state_1301), "::", - stringify!(hostid) + stringify!(timeout) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, - 408usize, + unsafe { ::std::ptr::addr_of!((*ptr).sync_flags) as usize - ptr as usize }, + 240usize, concat!( "Offset of field: ", - stringify!(pf_status), + stringify!(pfsync_state_1301), "::", - stringify!(ifname) + stringify!(sync_flags) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pf_chksum) as usize - ptr as usize }, - 424usize, + unsafe { ::std::ptr::addr_of!((*ptr).updates) as usize - ptr as usize }, + 241usize, concat!( "Offset of field: ", - stringify!(pf_status), + stringify!(pfsync_state_1301), "::", - stringify!(pf_chksum) + stringify!(updates) ) ); } @@ -3886,7 +3861,7 @@ fn bindgen_test_layout_pfioc_rule() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 3104usize, + 3040usize, concat!("Size of: ", stringify!(pfioc_rule)) ); assert_eq!( @@ -3967,79 +3942,15 @@ fn bindgen_test_layout_pfioc_rule() { } #[repr(C)] #[derive(Copy, Clone)] -pub struct pfioc_state_addr_kill { - pub addr: pf_addr_wrap, - pub reserved_: [u_int8_t; 3usize], - pub neg: u_int8_t, - pub xport: pf_rule_xport, -} -#[test] -fn bindgen_test_layout_pfioc_state_addr_kill() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(pfioc_state_addr_kill)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pfioc_state_addr_kill)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pfioc_state_addr_kill), - "::", - stringify!(addr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved_) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(pfioc_state_addr_kill), - "::", - stringify!(reserved_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).neg) as usize - ptr as usize }, - 51usize, - concat!( - "Offset of field: ", - stringify!(pfioc_state_addr_kill), - "::", - stringify!(neg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xport) as usize - ptr as usize }, - 52usize, - concat!( - "Offset of field: ", - stringify!(pfioc_state_addr_kill), - "::", - stringify!(xport) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] pub struct pfioc_state_kill { + pub psk_pfcmp: pf_state_cmp, pub psk_af: sa_family_t, - pub psk_proto: u_int8_t, - pub psk_proto_variant: u_int8_t, - pub _pad: u_int8_t, - pub psk_src: pfioc_state_addr_kill, - pub psk_dst: pfioc_state_addr_kill, + pub psk_proto: ::std::os::raw::c_int, + pub psk_src: pf_rule_addr, + pub psk_dst: pf_rule_addr, pub psk_ifname: [::std::os::raw::c_char; 16usize], - pub psk_ownername: [::std::os::raw::c_char; 64usize], + pub psk_label: [::std::os::raw::c_char; 64usize], + pub psk_killed: u_int, } #[test] fn bindgen_test_layout_pfioc_state_kill() { @@ -4047,7 +3958,7 @@ fn bindgen_test_layout_pfioc_state_kill() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 216usize, + 224usize, concat!("Size of: ", stringify!(pfioc_state_kill)) ); assert_eq!( @@ -4056,48 +3967,38 @@ fn bindgen_test_layout_pfioc_state_kill() { concat!("Alignment of ", stringify!(pfioc_state_kill)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).psk_af) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).psk_pfcmp) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(pfioc_state_kill), "::", - stringify!(psk_af) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).psk_proto) as usize - ptr as usize }, - 1usize, - concat!( - "Offset of field: ", - stringify!(pfioc_state_kill), - "::", - stringify!(psk_proto) + stringify!(psk_pfcmp) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).psk_proto_variant) as usize - ptr as usize }, - 2usize, + unsafe { ::std::ptr::addr_of!((*ptr).psk_af) as usize - ptr as usize }, + 16usize, concat!( "Offset of field: ", stringify!(pfioc_state_kill), "::", - stringify!(psk_proto_variant) + stringify!(psk_af) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pad) as usize - ptr as usize }, - 3usize, + unsafe { ::std::ptr::addr_of!((*ptr).psk_proto) as usize - ptr as usize }, + 20usize, concat!( "Offset of field: ", stringify!(pfioc_state_kill), "::", - stringify!(_pad) + stringify!(psk_proto) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).psk_src) as usize - ptr as usize }, - 8usize, + 24usize, concat!( "Offset of field: ", stringify!(pfioc_state_kill), @@ -4107,7 +4008,7 @@ fn bindgen_test_layout_pfioc_state_kill() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).psk_dst) as usize - ptr as usize }, - 72usize, + 80usize, concat!( "Offset of field: ", stringify!(pfioc_state_kill), @@ -4126,13 +4027,23 @@ fn bindgen_test_layout_pfioc_state_kill() { ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).psk_ownername) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).psk_label) as usize - ptr as usize }, 152usize, concat!( "Offset of field: ", stringify!(pfioc_state_kill), "::", - stringify!(psk_ownername) + stringify!(psk_label) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psk_killed) as usize - ptr as usize }, + 216usize, + concat!( + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_killed) ) ); } @@ -4140,13 +4051,13 @@ fn bindgen_test_layout_pfioc_state_kill() { #[derive(Copy, Clone)] pub struct pfioc_states { pub ps_len: ::std::os::raw::c_int, - pub ps_u: pfioc_states__bindgen_ty_1, + pub __bindgen_anon_1: pfioc_states__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union pfioc_states__bindgen_ty_1 { - pub psu_buf: caddr_t, - pub psu_states: *mut pfsync_state, + pub ps_buf: *mut ::std::os::raw::c_void, + pub ps_states: *mut pfsync_state_1301, } #[test] fn bindgen_test_layout_pfioc_states__bindgen_ty_1() { @@ -4164,23 +4075,23 @@ fn bindgen_test_layout_pfioc_states__bindgen_ty_1() { concat!("Alignment of ", stringify!(pfioc_states__bindgen_ty_1)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).psu_buf) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ps_buf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(pfioc_states__bindgen_ty_1), "::", - stringify!(psu_buf) + stringify!(ps_buf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).psu_states) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ps_states) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(pfioc_states__bindgen_ty_1), "::", - stringify!(psu_states) + stringify!(ps_states) ) ); } @@ -4208,16 +4119,6 @@ fn bindgen_test_layout_pfioc_states() { stringify!(ps_len) ) ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ps_u) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(pfioc_states), - "::", - stringify!(ps_u) - ) - ); } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -4324,3 +4225,18 @@ fn bindgen_test_layout_pfioc_trans() { ) ); } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ifg_group { + pub _address: u8, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfi_dynaddr { + pub _address: u8, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfr_ktable { + pub _address: u8, +} diff --git a/src/ffi/pfvar/macos.rs b/src/ffi/pfvar/macos.rs new file mode 100644 index 0000000..067c7bb --- /dev/null +++ b/src/ffi/pfvar/macos.rs @@ -0,0 +1,4326 @@ +/* automatically generated by rust-bindgen 0.69.4 */ + +pub const PF_UNSPEC: u32 = 0; +pub const PF_LOCAL: u32 = 1; +pub const PF_UNIX: u32 = 1; +pub const PF_INET: u32 = 2; +pub const PF_IMPLINK: u32 = 3; +pub const PF_PUP: u32 = 4; +pub const PF_CHAOS: u32 = 5; +pub const PF_NS: u32 = 6; +pub const PF_ISO: u32 = 7; +pub const PF_OSI: u32 = 7; +pub const PF_ECMA: u32 = 8; +pub const PF_DATAKIT: u32 = 9; +pub const PF_CCITT: u32 = 10; +pub const PF_SNA: u32 = 11; +pub const PF_DECnet: u32 = 12; +pub const PF_DLI: u32 = 13; +pub const PF_LAT: u32 = 14; +pub const PF_HYLINK: u32 = 15; +pub const PF_APPLETALK: u32 = 16; +pub const PF_ROUTE: u32 = 17; +pub const PF_LINK: u32 = 18; +pub const PF_XTP: u32 = 19; +pub const PF_COIP: u32 = 20; +pub const PF_CNT: u32 = 21; +pub const PF_SIP: u32 = 24; +pub const PF_IPX: u32 = 23; +pub const PF_RTIP: u32 = 22; +pub const PF_PIP: u32 = 25; +pub const PF_NDRV: u32 = 27; +pub const PF_ISDN: u32 = 28; +pub const PF_KEY: u32 = 29; +pub const PF_INET6: u32 = 30; +pub const PF_NATM: u32 = 31; +pub const PF_SYSTEM: u32 = 32; +pub const PF_NETBIOS: u32 = 33; +pub const PF_PPP: u32 = 34; +pub const PF_RESERVED_36: u32 = 36; +pub const PF_UTUN: u32 = 38; +pub const PF_VSOCK: u32 = 40; +pub const PF_MAX: u32 = 41; +pub const PF_MD5_DIGEST_LENGTH: u32 = 16; +pub const PF_GRE_PPTP_VARIANT: u32 = 1; +pub const PF_POOL_IDMASK: u32 = 15; +pub const PF_POOL_TYPEMASK: u32 = 15; +pub const PF_POOL_STICKYADDR: u32 = 32; +pub const PF_WSCALE_FLAG: u32 = 128; +pub const PF_WSCALE_MASK: u32 = 15; +pub const PF_LOG: u32 = 1; +pub const PF_LOG_ALL: u32 = 2; +pub const PF_LOG_SOCKET_LOOKUP: u32 = 4; +pub const PF_TABLE_NAME_SIZE: u32 = 32; +pub const PF_OSFP_EXPANDED: u32 = 1; +pub const PF_OSFP_GENERIC: u32 = 2; +pub const PF_OSFP_NODETAIL: u32 = 4; +pub const PF_OSFP_LEN: u32 = 32; +pub const PF_OSFP_WSIZE_MOD: u32 = 1; +pub const PF_OSFP_WSIZE_DC: u32 = 2; +pub const PF_OSFP_WSIZE_MSS: u32 = 4; +pub const PF_OSFP_WSIZE_MTU: u32 = 8; +pub const PF_OSFP_PSIZE_MOD: u32 = 16; +pub const PF_OSFP_PSIZE_DC: u32 = 32; +pub const PF_OSFP_WSCALE: u32 = 64; +pub const PF_OSFP_WSCALE_MOD: u32 = 128; +pub const PF_OSFP_WSCALE_DC: u32 = 256; +pub const PF_OSFP_MSS: u32 = 512; +pub const PF_OSFP_MSS_MOD: u32 = 1024; +pub const PF_OSFP_MSS_DC: u32 = 2048; +pub const PF_OSFP_DF: u32 = 4096; +pub const PF_OSFP_TS0: u32 = 8192; +pub const PF_OSFP_INET6: u32 = 16384; +pub const PF_OSFP_MAXTTL_OFFSET: u32 = 40; +pub const PF_OSFP_TCPOPT_NOP: u32 = 0; +pub const PF_OSFP_TCPOPT_WSCALE: u32 = 1; +pub const PF_OSFP_TCPOPT_MSS: u32 = 2; +pub const PF_OSFP_TCPOPT_SACK: u32 = 3; +pub const PF_OSFP_TCPOPT_TS: u32 = 4; +pub const PF_OSFP_TCPOPT_BITS: u32 = 3; +pub const PF_ANCHOR_NAME_SIZE: u32 = 64; +pub const PF_SKIP_IFP: u32 = 0; +pub const PF_SKIP_DIR: u32 = 1; +pub const PF_SKIP_AF: u32 = 2; +pub const PF_SKIP_PROTO: u32 = 3; +pub const PF_SKIP_SRC_ADDR: u32 = 4; +pub const PF_SKIP_SRC_PORT: u32 = 5; +pub const PF_SKIP_DST_ADDR: u32 = 6; +pub const PF_SKIP_DST_PORT: u32 = 7; +pub const PF_SKIP_COUNT: u32 = 8; +pub const PF_RULE_LABEL_SIZE: u32 = 64; +pub const PF_QNAME_SIZE: u32 = 64; +pub const PF_TAG_NAME_SIZE: u32 = 64; +pub const PF_OWNER_NAME_SIZE: u32 = 64; +pub const PF_STATE_NORMAL: u32 = 1; +pub const PF_STATE_MODULATE: u32 = 2; +pub const PF_STATE_SYNPROXY: u32 = 3; +pub const PF_FLUSH: u32 = 1; +pub const PF_FLUSH_GLOBAL: u32 = 2; +pub const PFRULE_DROP: u32 = 0; +pub const PFRULE_RETURNRST: u32 = 1; +pub const PFRULE_FRAGMENT: u32 = 2; +pub const PFRULE_RETURNICMP: u32 = 4; +pub const PFRULE_RETURN: u32 = 8; +pub const PFRULE_NOSYNC: u32 = 16; +pub const PFRULE_SRCTRACK: u32 = 32; +pub const PFRULE_RULESRCTRACK: u32 = 64; +pub const PFRULE_NODF: u32 = 256; +pub const PFRULE_FRAGCROP: u32 = 512; +pub const PFRULE_FRAGDROP: u32 = 1024; +pub const PFRULE_RANDOMID: u32 = 2048; +pub const PFRULE_REASSEMBLE_TCP: u32 = 4096; +pub const PFRULE_TOS: u32 = 8192; +pub const PFRULE_DSCP: u32 = 16384; +pub const PFRULE_SC: u32 = 32768; +pub const PFRULE_IFBOUND: u32 = 65536; +pub const PFRULE_PFM: u32 = 131072; +pub const PF_TAG_NAME_SYSTEM_SERVICE: &[u8; 32] = b"com.apple.pf.system_service_tag\0"; +pub const PF_TAG_NAME_STACK_DROP: &[u8; 28] = b"com.apple.pf.stack_drop_tag\0"; +pub const PF_THRESHOLD_MULT: u32 = 1000; +pub const PF_THRESHOLD_MAX: u32 = 4294967; +pub const PF_RESERVED_ANCHOR: &[u8; 4] = b"_pf\0"; +pub const PF_DPORT_RANGE: u32 = 1; +pub const PF_RPORT_RANGE: u32 = 2; +pub const PF_ALTQ_BW_ABSOLUTE: u32 = 1; +pub const PF_ALTQ_BW_PERCENT: u32 = 2; +pub const PF_ALTQF_TBR: u32 = 1; +pub const PF_ALTQ_QRF_WEIGHT: u32 = 1; +pub type __uint8_t = ::std::os::raw::c_uchar; +pub type __uint16_t = ::std::os::raw::c_ushort; +pub type __int32_t = ::std::os::raw::c_int; +pub type __uint32_t = ::std::os::raw::c_uint; +pub type __darwin_pid_t = __int32_t; +pub type __darwin_uid_t = __uint32_t; +pub type u_int8_t = ::std::os::raw::c_uchar; +pub type u_int16_t = ::std::os::raw::c_ushort; +pub type u_int32_t = ::std::os::raw::c_uint; +pub type u_int64_t = ::std::os::raw::c_ulonglong; +pub type caddr_t = *mut ::std::os::raw::c_char; +pub type in_addr_t = __uint32_t; +pub type pid_t = __darwin_pid_t; +pub type uid_t = __darwin_uid_t; +pub type sa_family_t = __uint8_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct in_addr { + pub s_addr: in_addr_t, +} +#[test] +fn bindgen_test_layout_in_addr() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(in_addr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(in_addr)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).s_addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(in_addr), + "::", + stringify!(s_addr) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct in6_addr { + pub __u6_addr: in6_addr__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union in6_addr__bindgen_ty_1 { + pub __u6_addr8: [__uint8_t; 16usize], + pub __u6_addr16: [__uint16_t; 8usize], + pub __u6_addr32: [__uint32_t; 4usize], +} +#[test] +fn bindgen_test_layout_in6_addr__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(in6_addr__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(in6_addr__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__u6_addr8) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(in6_addr__bindgen_ty_1), + "::", + stringify!(__u6_addr8) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__u6_addr16) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(in6_addr__bindgen_ty_1), + "::", + stringify!(__u6_addr16) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__u6_addr32) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(in6_addr__bindgen_ty_1), + "::", + stringify!(__u6_addr32) + ) + ); +} +#[test] +fn bindgen_test_layout_in6_addr() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(in6_addr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(in6_addr)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__u6_addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(in6_addr), + "::", + stringify!(__u6_addr) + ) + ); +} +pub const PF_INOUT: _bindgen_ty_6 = _bindgen_ty_6::PF_INOUT; +pub const PF_IN: _bindgen_ty_6 = _bindgen_ty_6::PF_IN; +pub const PF_OUT: _bindgen_ty_6 = _bindgen_ty_6::PF_OUT; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_6 { + PF_INOUT = 0, + PF_IN = 1, + PF_OUT = 2, +} +pub const PF_PASS: _bindgen_ty_7 = _bindgen_ty_7::PF_PASS; +pub const PF_DROP: _bindgen_ty_7 = _bindgen_ty_7::PF_DROP; +pub const PF_SCRUB: _bindgen_ty_7 = _bindgen_ty_7::PF_SCRUB; +pub const PF_NOSCRUB: _bindgen_ty_7 = _bindgen_ty_7::PF_NOSCRUB; +pub const PF_NAT: _bindgen_ty_7 = _bindgen_ty_7::PF_NAT; +pub const PF_NONAT: _bindgen_ty_7 = _bindgen_ty_7::PF_NONAT; +pub const PF_BINAT: _bindgen_ty_7 = _bindgen_ty_7::PF_BINAT; +pub const PF_NOBINAT: _bindgen_ty_7 = _bindgen_ty_7::PF_NOBINAT; +pub const PF_RDR: _bindgen_ty_7 = _bindgen_ty_7::PF_RDR; +pub const PF_NORDR: _bindgen_ty_7 = _bindgen_ty_7::PF_NORDR; +pub const PF_SYNPROXY_DROP: _bindgen_ty_7 = _bindgen_ty_7::PF_SYNPROXY_DROP; +pub const PF_DUMMYNET: _bindgen_ty_7 = _bindgen_ty_7::PF_DUMMYNET; +pub const PF_NODUMMYNET: _bindgen_ty_7 = _bindgen_ty_7::PF_NODUMMYNET; +pub const PF_NAT64: _bindgen_ty_7 = _bindgen_ty_7::PF_NAT64; +pub const PF_NONAT64: _bindgen_ty_7 = _bindgen_ty_7::PF_NONAT64; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_7 { + PF_PASS = 0, + PF_DROP = 1, + PF_SCRUB = 2, + PF_NOSCRUB = 3, + PF_NAT = 4, + PF_NONAT = 5, + PF_BINAT = 6, + PF_NOBINAT = 7, + PF_RDR = 8, + PF_NORDR = 9, + PF_SYNPROXY_DROP = 10, + PF_DUMMYNET = 11, + PF_NODUMMYNET = 12, + PF_NAT64 = 13, + PF_NONAT64 = 14, +} +pub const PF_RULESET_SCRUB: _bindgen_ty_8 = _bindgen_ty_8::PF_RULESET_SCRUB; +pub const PF_RULESET_FILTER: _bindgen_ty_8 = _bindgen_ty_8::PF_RULESET_FILTER; +pub const PF_RULESET_NAT: _bindgen_ty_8 = _bindgen_ty_8::PF_RULESET_NAT; +pub const PF_RULESET_BINAT: _bindgen_ty_8 = _bindgen_ty_8::PF_RULESET_BINAT; +pub const PF_RULESET_RDR: _bindgen_ty_8 = _bindgen_ty_8::PF_RULESET_RDR; +pub const PF_RULESET_DUMMYNET: _bindgen_ty_8 = _bindgen_ty_8::PF_RULESET_DUMMYNET; +pub const PF_RULESET_MAX: _bindgen_ty_8 = _bindgen_ty_8::PF_RULESET_MAX; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_8 { + PF_RULESET_SCRUB = 0, + PF_RULESET_FILTER = 1, + PF_RULESET_NAT = 2, + PF_RULESET_BINAT = 3, + PF_RULESET_RDR = 4, + PF_RULESET_DUMMYNET = 5, + PF_RULESET_MAX = 6, +} +pub const PF_OP_NONE: _bindgen_ty_9 = _bindgen_ty_9::PF_OP_NONE; +pub const PF_OP_IRG: _bindgen_ty_9 = _bindgen_ty_9::PF_OP_IRG; +pub const PF_OP_EQ: _bindgen_ty_9 = _bindgen_ty_9::PF_OP_EQ; +pub const PF_OP_NE: _bindgen_ty_9 = _bindgen_ty_9::PF_OP_NE; +pub const PF_OP_LT: _bindgen_ty_9 = _bindgen_ty_9::PF_OP_LT; +pub const PF_OP_LE: _bindgen_ty_9 = _bindgen_ty_9::PF_OP_LE; +pub const PF_OP_GT: _bindgen_ty_9 = _bindgen_ty_9::PF_OP_GT; +pub const PF_OP_GE: _bindgen_ty_9 = _bindgen_ty_9::PF_OP_GE; +pub const PF_OP_XRG: _bindgen_ty_9 = _bindgen_ty_9::PF_OP_XRG; +pub const PF_OP_RRG: _bindgen_ty_9 = _bindgen_ty_9::PF_OP_RRG; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_9 { + PF_OP_NONE = 0, + PF_OP_IRG = 1, + PF_OP_EQ = 2, + PF_OP_NE = 3, + PF_OP_LT = 4, + PF_OP_LE = 5, + PF_OP_GT = 6, + PF_OP_GE = 7, + PF_OP_XRG = 8, + PF_OP_RRG = 9, +} +pub const PF_DEBUG_NONE: _bindgen_ty_10 = _bindgen_ty_10::PF_DEBUG_NONE; +pub const PF_DEBUG_URGENT: _bindgen_ty_10 = _bindgen_ty_10::PF_DEBUG_URGENT; +pub const PF_DEBUG_MISC: _bindgen_ty_10 = _bindgen_ty_10::PF_DEBUG_MISC; +pub const PF_DEBUG_NOISY: _bindgen_ty_10 = _bindgen_ty_10::PF_DEBUG_NOISY; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_10 { + PF_DEBUG_NONE = 0, + PF_DEBUG_URGENT = 1, + PF_DEBUG_MISC = 2, + PF_DEBUG_NOISY = 3, +} +pub const PF_CHANGE_NONE: _bindgen_ty_11 = _bindgen_ty_11::PF_CHANGE_NONE; +pub const PF_CHANGE_ADD_HEAD: _bindgen_ty_11 = _bindgen_ty_11::PF_CHANGE_ADD_HEAD; +pub const PF_CHANGE_ADD_TAIL: _bindgen_ty_11 = _bindgen_ty_11::PF_CHANGE_ADD_TAIL; +pub const PF_CHANGE_ADD_BEFORE: _bindgen_ty_11 = _bindgen_ty_11::PF_CHANGE_ADD_BEFORE; +pub const PF_CHANGE_ADD_AFTER: _bindgen_ty_11 = _bindgen_ty_11::PF_CHANGE_ADD_AFTER; +pub const PF_CHANGE_REMOVE: _bindgen_ty_11 = _bindgen_ty_11::PF_CHANGE_REMOVE; +pub const PF_CHANGE_GET_TICKET: _bindgen_ty_11 = _bindgen_ty_11::PF_CHANGE_GET_TICKET; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_11 { + PF_CHANGE_NONE = 0, + PF_CHANGE_ADD_HEAD = 1, + PF_CHANGE_ADD_TAIL = 2, + PF_CHANGE_ADD_BEFORE = 3, + PF_CHANGE_ADD_AFTER = 4, + PF_CHANGE_REMOVE = 5, + PF_CHANGE_GET_TICKET = 6, +} +pub const PF_GET_NONE: _bindgen_ty_12 = _bindgen_ty_12::PF_GET_NONE; +pub const PF_GET_CLR_CNTR: _bindgen_ty_12 = _bindgen_ty_12::PF_GET_CLR_CNTR; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_12 { + PF_GET_NONE = 0, + PF_GET_CLR_CNTR = 1, +} +pub const PF_NOPFROUTE: _bindgen_ty_14 = _bindgen_ty_14::PF_NOPFROUTE; +pub const PF_FASTROUTE: _bindgen_ty_14 = _bindgen_ty_14::PF_FASTROUTE; +pub const PF_ROUTETO: _bindgen_ty_14 = _bindgen_ty_14::PF_ROUTETO; +pub const PF_DUPTO: _bindgen_ty_14 = _bindgen_ty_14::PF_DUPTO; +pub const PF_REPLYTO: _bindgen_ty_14 = _bindgen_ty_14::PF_REPLYTO; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_14 { + PF_NOPFROUTE = 0, + PF_FASTROUTE = 1, + PF_ROUTETO = 2, + PF_DUPTO = 3, + PF_REPLYTO = 4, +} +pub const PF_LIMIT_STATES: _bindgen_ty_15 = _bindgen_ty_15::PF_LIMIT_STATES; +pub const PF_LIMIT_APP_STATES: _bindgen_ty_15 = _bindgen_ty_15::PF_LIMIT_APP_STATES; +pub const PF_LIMIT_SRC_NODES: _bindgen_ty_15 = _bindgen_ty_15::PF_LIMIT_SRC_NODES; +pub const PF_LIMIT_FRAGS: _bindgen_ty_15 = _bindgen_ty_15::PF_LIMIT_FRAGS; +pub const PF_LIMIT_TABLES: _bindgen_ty_15 = _bindgen_ty_15::PF_LIMIT_TABLES; +pub const PF_LIMIT_TABLE_ENTRIES: _bindgen_ty_15 = _bindgen_ty_15::PF_LIMIT_TABLE_ENTRIES; +pub const PF_LIMIT_MAX: _bindgen_ty_15 = _bindgen_ty_15::PF_LIMIT_MAX; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_15 { + PF_LIMIT_STATES = 0, + PF_LIMIT_APP_STATES = 1, + PF_LIMIT_SRC_NODES = 2, + PF_LIMIT_FRAGS = 3, + PF_LIMIT_TABLES = 4, + PF_LIMIT_TABLE_ENTRIES = 5, + PF_LIMIT_MAX = 6, +} +pub const PF_POOL_NONE: _bindgen_ty_16 = _bindgen_ty_16::PF_POOL_NONE; +pub const PF_POOL_BITMASK: _bindgen_ty_16 = _bindgen_ty_16::PF_POOL_BITMASK; +pub const PF_POOL_RANDOM: _bindgen_ty_16 = _bindgen_ty_16::PF_POOL_RANDOM; +pub const PF_POOL_SRCHASH: _bindgen_ty_16 = _bindgen_ty_16::PF_POOL_SRCHASH; +pub const PF_POOL_ROUNDROBIN: _bindgen_ty_16 = _bindgen_ty_16::PF_POOL_ROUNDROBIN; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_16 { + PF_POOL_NONE = 0, + PF_POOL_BITMASK = 1, + PF_POOL_RANDOM = 2, + PF_POOL_SRCHASH = 3, + PF_POOL_ROUNDROBIN = 4, +} +pub const PF_ADDR_ADDRMASK: _bindgen_ty_17 = _bindgen_ty_17::PF_ADDR_ADDRMASK; +pub const PF_ADDR_NOROUTE: _bindgen_ty_17 = _bindgen_ty_17::PF_ADDR_NOROUTE; +pub const PF_ADDR_DYNIFTL: _bindgen_ty_17 = _bindgen_ty_17::PF_ADDR_DYNIFTL; +pub const PF_ADDR_TABLE: _bindgen_ty_17 = _bindgen_ty_17::PF_ADDR_TABLE; +pub const PF_ADDR_RTLABEL: _bindgen_ty_17 = _bindgen_ty_17::PF_ADDR_RTLABEL; +pub const PF_ADDR_URPFFAILED: _bindgen_ty_17 = _bindgen_ty_17::PF_ADDR_URPFFAILED; +pub const PF_ADDR_RANGE: _bindgen_ty_17 = _bindgen_ty_17::PF_ADDR_RANGE; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_17 { + PF_ADDR_ADDRMASK = 0, + PF_ADDR_NOROUTE = 1, + PF_ADDR_DYNIFTL = 2, + PF_ADDR_TABLE = 3, + PF_ADDR_RTLABEL = 4, + PF_ADDR_URPFFAILED = 5, + PF_ADDR_RANGE = 6, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_addr { + pub pfa: pf_addr__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pf_addr__bindgen_ty_1 { + pub _v4addr: in_addr, + pub _v6addr: in6_addr, + pub _addr8: [u_int8_t; 16usize], + pub _addr16: [u_int16_t; 8usize], + pub _addr32: [u_int32_t; 4usize], +} +#[test] +fn bindgen_test_layout_pf_addr__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_addr__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_addr__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._v4addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr__bindgen_ty_1), + "::", + stringify!(_v4addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._v6addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr__bindgen_ty_1), + "::", + stringify!(_v6addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._addr8) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr__bindgen_ty_1), + "::", + stringify!(_addr8) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._addr16) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr__bindgen_ty_1), + "::", + stringify!(_addr16) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._addr32) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr__bindgen_ty_1), + "::", + stringify!(_addr32) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_addr() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_addr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_addr)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfa) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr), + "::", + stringify!(pfa) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_addr_wrap { + pub v: pf_addr_wrap__bindgen_ty_1, + pub p: pf_addr_wrap__bindgen_ty_2, + pub type_: u_int8_t, + pub iflags: u_int8_t, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pf_addr_wrap__bindgen_ty_1 { + pub a: pf_addr_wrap__bindgen_ty_1__bindgen_ty_1, + pub ifname: [::std::os::raw::c_char; 16usize], + pub tblname: [::std::os::raw::c_char; 32usize], + pub rtlabelname: [::std::os::raw::c_char; 32usize], + pub rtlabel: u_int32_t, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_addr_wrap__bindgen_ty_1__bindgen_ty_1 { + pub addr: pf_addr, + pub mask: pf_addr, +} +#[test] +fn bindgen_test_layout_pf_addr_wrap__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!( + "Size of: ", + stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!( + "Alignment of ", + stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).mask) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(mask) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_addr_wrap__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(pf_addr_wrap__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_addr_wrap__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_1), + "::", + stringify!(a) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_1), + "::", + stringify!(ifname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tblname) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_1), + "::", + stringify!(tblname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtlabelname) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_1), + "::", + stringify!(rtlabelname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtlabel) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_1), + "::", + stringify!(rtlabel) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pf_addr_wrap__bindgen_ty_2 { + pub dyn_: *mut ::std::os::raw::c_void, + pub tbl: *mut ::std::os::raw::c_void, + pub dyncnt: ::std::os::raw::c_int, + pub tblcnt: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_pf_addr_wrap__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(pf_addr_wrap__bindgen_ty_2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_addr_wrap__bindgen_ty_2)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).dyn_) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_2), + "::", + stringify!(dyn_) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tbl) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_2), + "::", + stringify!(tbl) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).dyncnt) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_2), + "::", + stringify!(dyncnt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tblcnt) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_2), + "::", + stringify!(tblcnt) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_addr_wrap() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(pf_addr_wrap)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_addr_wrap)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).v) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap), + "::", + stringify!(v) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).p) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap), + "::", + stringify!(p) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).iflags) as usize - ptr as usize }, + 41usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap), + "::", + stringify!(iflags) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_port_range { + pub port: [u_int16_t; 2usize], + pub op: u_int8_t, +} +#[test] +fn bindgen_test_layout_pf_port_range() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 6usize, + concat!("Size of: ", stringify!(pf_port_range)) + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + concat!("Alignment of ", stringify!(pf_port_range)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).port) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_port_range), + "::", + stringify!(port) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).op) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(pf_port_range), + "::", + stringify!(op) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pf_rule_xport { + pub range: pf_port_range, + pub call_id: u_int16_t, + pub spi: u_int32_t, +} +#[test] +fn bindgen_test_layout_pf_rule_xport() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(pf_rule_xport)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_rule_xport)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).range) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_xport), + "::", + stringify!(range) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).call_id) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_xport), + "::", + stringify!(call_id) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).spi) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_xport), + "::", + stringify!(spi) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_rule_uid { + pub uid: [uid_t; 2usize], + pub op: u_int8_t, + pub _pad: [u_int8_t; 3usize], +} +#[test] +fn bindgen_test_layout_pf_rule_uid() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(pf_rule_uid)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_rule_uid)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).uid) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_uid), + "::", + stringify!(uid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).op) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_uid), + "::", + stringify!(op) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._pad) as usize - ptr as usize }, + 9usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_uid), + "::", + stringify!(_pad) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_rule_gid { + pub gid: [uid_t; 2usize], + pub op: u_int8_t, + pub _pad: [u_int8_t; 3usize], +} +#[test] +fn bindgen_test_layout_pf_rule_gid() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(pf_rule_gid)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_rule_gid)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).gid) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_gid), + "::", + stringify!(gid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).op) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_gid), + "::", + stringify!(op) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._pad) as usize - ptr as usize }, + 9usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_gid), + "::", + stringify!(_pad) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_rule_addr { + pub addr: pf_addr_wrap, + pub xport: pf_rule_xport, + pub neg: u_int8_t, +} +#[test] +fn bindgen_test_layout_pf_rule_addr() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(pf_rule_addr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_rule_addr)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_addr), + "::", + stringify!(addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).xport) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_addr), + "::", + stringify!(xport) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).neg) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_addr), + "::", + stringify!(neg) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_pooladdr { + pub addr: pf_addr_wrap, + pub entries: pf_pooladdr__bindgen_ty_1, + pub ifname: [::std::os::raw::c_char; 16usize], + pub kif: *mut ::std::os::raw::c_void, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_pooladdr__bindgen_ty_1 { + pub tqe_next: *mut pf_pooladdr, + pub tqe_prev: *mut *mut pf_pooladdr, +} +#[test] +fn bindgen_test_layout_pf_pooladdr__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_pooladdr__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_pooladdr__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tqe_next) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_pooladdr__bindgen_ty_1), + "::", + stringify!(tqe_next) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tqe_prev) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_pooladdr__bindgen_ty_1), + "::", + stringify!(tqe_prev) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_pooladdr() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 88usize, + concat!("Size of: ", stringify!(pf_pooladdr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_pooladdr)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_pooladdr), + "::", + stringify!(addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).entries) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(pf_pooladdr), + "::", + stringify!(entries) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(pf_pooladdr), + "::", + stringify!(ifname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).kif) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(pf_pooladdr), + "::", + stringify!(kif) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_palist { + pub tqh_first: *mut pf_pooladdr, + pub tqh_last: *mut *mut pf_pooladdr, +} +#[test] +fn bindgen_test_layout_pf_palist() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_palist)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_palist)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tqh_first) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_palist), + "::", + stringify!(tqh_first) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tqh_last) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_palist), + "::", + stringify!(tqh_last) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_poolhashkey { + pub pfk: pf_poolhashkey__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pf_poolhashkey__bindgen_ty_1 { + pub key8: [u_int8_t; 16usize], + pub key16: [u_int16_t; 8usize], + pub key32: [u_int32_t; 4usize], +} +#[test] +fn bindgen_test_layout_pf_poolhashkey__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_poolhashkey__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_poolhashkey__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).key8) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_poolhashkey__bindgen_ty_1), + "::", + stringify!(key8) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).key16) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_poolhashkey__bindgen_ty_1), + "::", + stringify!(key16) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).key32) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_poolhashkey__bindgen_ty_1), + "::", + stringify!(key32) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_poolhashkey() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_poolhashkey)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_poolhashkey)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfk) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_poolhashkey), + "::", + stringify!(pfk) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_pool { + pub list: pf_palist, + pub cur: *mut ::std::os::raw::c_void, + pub key: pf_poolhashkey, + pub counter: pf_addr, + pub tblidx: ::std::os::raw::c_int, + pub proxy_port: [u_int16_t; 2usize], + pub port_op: u_int8_t, + pub opts: u_int8_t, + pub af: sa_family_t, +} +#[test] +fn bindgen_test_layout_pf_pool() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 72usize, + concat!("Size of: ", stringify!(pf_pool)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_pool)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).list) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(list) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cur) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(cur) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).key) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(key) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).counter) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(counter) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tblidx) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(tblidx) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).proxy_port) as usize - ptr as usize }, + 60usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(proxy_port) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).port_op) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(port_op) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).opts) as usize - ptr as usize }, + 65usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(opts) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).af) as usize - ptr as usize }, + 66usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(af) + ) + ); +} +pub type pf_osfp_t = u_int32_t; +#[repr(C)] +#[derive(Copy, Clone)] +pub union pf_rule_ptr { + pub ptr: *mut pf_rule, + pub nr: u_int32_t, +} +#[test] +fn bindgen_test_layout_pf_rule_ptr() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(pf_rule_ptr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_rule_ptr)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ptr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_ptr), + "::", + stringify!(ptr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_ptr), + "::", + stringify!(nr) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_rule { + pub src: pf_rule_addr, + pub dst: pf_rule_addr, + pub skip: [pf_rule_ptr; 8usize], + pub label: [::std::os::raw::c_char; 64usize], + pub ifname: [::std::os::raw::c_char; 16usize], + pub qname: [::std::os::raw::c_char; 64usize], + pub pqname: [::std::os::raw::c_char; 64usize], + pub tagname: [::std::os::raw::c_char; 64usize], + pub match_tagname: [::std::os::raw::c_char; 64usize], + pub overload_tblname: [::std::os::raw::c_char; 32usize], + pub entries: pf_rule__bindgen_ty_1, + pub rpool: pf_pool, + pub evaluations: u_int64_t, + pub packets: [u_int64_t; 2usize], + pub bytes: [u_int64_t; 2usize], + pub ticket: u_int64_t, + pub owner: [::std::os::raw::c_char; 64usize], + pub priority: u_int32_t, + pub kif: *mut ::std::os::raw::c_void, + pub anchor: *mut pf_anchor, + pub overload_tbl: *mut ::std::os::raw::c_void, + pub os_fingerprint: pf_osfp_t, + pub rtableid: ::std::os::raw::c_uint, + pub timeout: [u_int32_t; 26usize], + pub states: u_int32_t, + pub max_states: u_int32_t, + pub src_nodes: u_int32_t, + pub max_src_nodes: u_int32_t, + pub max_src_states: u_int32_t, + pub max_src_conn: u_int32_t, + pub max_src_conn_rate: pf_rule__bindgen_ty_2, + pub qid: u_int32_t, + pub pqid: u_int32_t, + pub rt_listid: u_int32_t, + pub nr: u_int32_t, + pub prob: u_int32_t, + pub cuid: uid_t, + pub cpid: pid_t, + pub return_icmp: u_int16_t, + pub return_icmp6: u_int16_t, + pub max_mss: u_int16_t, + pub tag: u_int16_t, + pub match_tag: u_int16_t, + pub uid: pf_rule_uid, + pub gid: pf_rule_gid, + pub rule_flag: u_int32_t, + pub action: u_int8_t, + pub direction: u_int8_t, + pub log: u_int8_t, + pub logif: u_int8_t, + pub quick: u_int8_t, + pub ifnot: u_int8_t, + pub match_tag_not: u_int8_t, + pub natpass: u_int8_t, + pub keep_state: u_int8_t, + pub af: sa_family_t, + pub proto: u_int8_t, + pub type_: u_int8_t, + pub code: u_int8_t, + pub flags: u_int8_t, + pub flagset: u_int8_t, + pub min_ttl: u_int8_t, + pub allow_opts: u_int8_t, + pub rt: u_int8_t, + pub return_ttl: u_int8_t, + pub tos: u_int8_t, + pub anchor_relative: u_int8_t, + pub anchor_wildcard: u_int8_t, + pub flush: u_int8_t, + pub proto_variant: u_int8_t, + pub extfilter: u_int8_t, + pub extmap: u_int8_t, + pub dnpipe: u_int32_t, + pub dntype: u_int32_t, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_rule__bindgen_ty_1 { + pub tqe_next: *mut pf_rule, + pub tqe_prev: *mut *mut pf_rule, +} +#[test] +fn bindgen_test_layout_pf_rule__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_rule__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_rule__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tqe_next) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule__bindgen_ty_1), + "::", + stringify!(tqe_next) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tqe_prev) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_rule__bindgen_ty_1), + "::", + stringify!(tqe_prev) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_rule__bindgen_ty_2 { + pub limit: u_int32_t, + pub seconds: u_int32_t, +} +#[test] +fn bindgen_test_layout_pf_rule__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(pf_rule__bindgen_ty_2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_rule__bindgen_ty_2)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).limit) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule__bindgen_ty_2), + "::", + stringify!(limit) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).seconds) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(pf_rule__bindgen_ty_2), + "::", + stringify!(seconds) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_rule() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 1040usize, + concat!("Size of: ", stringify!(pf_rule)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_rule)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).src) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(src) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).dst) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(dst) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).skip) as usize - ptr as usize }, + 128usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(skip) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, + 192usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(label) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, + 256usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(ifname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).qname) as usize - ptr as usize }, + 272usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(qname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pqname) as usize - ptr as usize }, + 336usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(pqname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tagname) as usize - ptr as usize }, + 400usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(tagname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).match_tagname) as usize - ptr as usize }, + 464usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(match_tagname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).overload_tblname) as usize - ptr as usize }, + 528usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(overload_tblname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).entries) as usize - ptr as usize }, + 560usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(entries) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rpool) as usize - ptr as usize }, + 576usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(rpool) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).evaluations) as usize - ptr as usize }, + 648usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(evaluations) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).packets) as usize - ptr as usize }, + 656usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(packets) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).bytes) as usize - ptr as usize }, + 672usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(bytes) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ticket) as usize - ptr as usize }, + 688usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(ticket) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).owner) as usize - ptr as usize }, + 696usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(owner) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).priority) as usize - ptr as usize }, + 760usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(priority) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).kif) as usize - ptr as usize }, + 768usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(kif) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).anchor) as usize - ptr as usize }, + 776usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(anchor) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).overload_tbl) as usize - ptr as usize }, + 784usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(overload_tbl) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).os_fingerprint) as usize - ptr as usize }, + 792usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(os_fingerprint) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtableid) as usize - ptr as usize }, + 796usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(rtableid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).timeout) as usize - ptr as usize }, + 800usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(timeout) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).states) as usize - ptr as usize }, + 904usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(states) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).max_states) as usize - ptr as usize }, + 908usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(max_states) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).src_nodes) as usize - ptr as usize }, + 912usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(src_nodes) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).max_src_nodes) as usize - ptr as usize }, + 916usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(max_src_nodes) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).max_src_states) as usize - ptr as usize }, + 920usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(max_src_states) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).max_src_conn) as usize - ptr as usize }, + 924usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(max_src_conn) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).max_src_conn_rate) as usize - ptr as usize }, + 928usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(max_src_conn_rate) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).qid) as usize - ptr as usize }, + 936usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(qid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pqid) as usize - ptr as usize }, + 940usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(pqid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rt_listid) as usize - ptr as usize }, + 944usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(rt_listid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nr) as usize - ptr as usize }, + 948usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(nr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, + 952usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(prob) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cuid) as usize - ptr as usize }, + 956usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(cuid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cpid) as usize - ptr as usize }, + 960usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(cpid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).return_icmp) as usize - ptr as usize }, + 964usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(return_icmp) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).return_icmp6) as usize - ptr as usize }, + 966usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(return_icmp6) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).max_mss) as usize - ptr as usize }, + 968usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(max_mss) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, + 970usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(tag) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).match_tag) as usize - ptr as usize }, + 972usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(match_tag) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).uid) as usize - ptr as usize }, + 976usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(uid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).gid) as usize - ptr as usize }, + 988usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(gid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rule_flag) as usize - ptr as usize }, + 1000usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(rule_flag) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, + 1004usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(action) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).direction) as usize - ptr as usize }, + 1005usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(direction) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).log) as usize - ptr as usize }, + 1006usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(log) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).logif) as usize - ptr as usize }, + 1007usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(logif) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).quick) as usize - ptr as usize }, + 1008usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(quick) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifnot) as usize - ptr as usize }, + 1009usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(ifnot) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).match_tag_not) as usize - ptr as usize }, + 1010usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(match_tag_not) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).natpass) as usize - ptr as usize }, + 1011usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(natpass) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).keep_state) as usize - ptr as usize }, + 1012usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(keep_state) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).af) as usize - ptr as usize }, + 1013usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(af) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).proto) as usize - ptr as usize }, + 1014usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(proto) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + 1015usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).code) as usize - ptr as usize }, + 1016usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(code) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 1017usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).flagset) as usize - ptr as usize }, + 1018usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(flagset) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).min_ttl) as usize - ptr as usize }, + 1019usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(min_ttl) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).allow_opts) as usize - ptr as usize }, + 1020usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(allow_opts) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rt) as usize - ptr as usize }, + 1021usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(rt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).return_ttl) as usize - ptr as usize }, + 1022usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(return_ttl) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tos) as usize - ptr as usize }, + 1023usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(tos) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).anchor_relative) as usize - ptr as usize }, + 1024usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(anchor_relative) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).anchor_wildcard) as usize - ptr as usize }, + 1025usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(anchor_wildcard) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).flush) as usize - ptr as usize }, + 1026usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(flush) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).proto_variant) as usize - ptr as usize }, + 1027usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(proto_variant) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).extfilter) as usize - ptr as usize }, + 1028usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(extfilter) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).extmap) as usize - ptr as usize }, + 1029usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(extmap) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).dnpipe) as usize - ptr as usize }, + 1032usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(dnpipe) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).dntype) as usize - ptr as usize }, + 1036usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(dntype) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pf_state_xport { + pub port: u_int16_t, + pub call_id: u_int16_t, + pub spi: u_int32_t, +} +#[test] +fn bindgen_test_layout_pf_state_xport() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(pf_state_xport)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_state_xport)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).port) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_state_xport), + "::", + stringify!(port) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).call_id) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_state_xport), + "::", + stringify!(call_id) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).spi) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_state_xport), + "::", + stringify!(spi) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct hook_desc { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct hook_desc_head { + pub tqh_first: *mut hook_desc, + pub tqh_last: *mut *mut hook_desc, +} +#[test] +fn bindgen_test_layout_hook_desc_head() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(hook_desc_head)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(hook_desc_head)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tqh_first) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hook_desc_head), + "::", + stringify!(tqh_first) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tqh_last) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hook_desc_head), + "::", + stringify!(tqh_last) + ) + ); +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct pfsync_state_scrub { + pub pfss_flags: u_int16_t, + pub pfss_ttl: u_int8_t, + pub scrub_flag: u_int8_t, + pub pfss_ts_mod: u_int32_t, +} +#[test] +fn bindgen_test_layout_pfsync_state_scrub() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(pfsync_state_scrub)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(pfsync_state_scrub)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfss_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_scrub), + "::", + stringify!(pfss_flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfss_ttl) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_scrub), + "::", + stringify!(pfss_ttl) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).scrub_flag) as usize - ptr as usize }, + 3usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_scrub), + "::", + stringify!(scrub_flag) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfss_ts_mod) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_scrub), + "::", + stringify!(pfss_ts_mod) + ) + ); +} +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub struct pfsync_state_host { + pub addr: pf_addr, + pub xport: pf_state_xport, + pub pad: [u_int16_t; 2usize], +} +#[test] +fn bindgen_test_layout_pfsync_state_host() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(pfsync_state_host)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(pfsync_state_host)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_host), + "::", + stringify!(addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).xport) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_host), + "::", + stringify!(xport) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_host), + "::", + stringify!(pad) + ) + ); +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct pfsync_state_peer { + pub scrub: pfsync_state_scrub, + pub seqlo: u_int32_t, + pub seqhi: u_int32_t, + pub seqdiff: u_int32_t, + pub max_win: u_int16_t, + pub mss: u_int16_t, + pub state: u_int8_t, + pub wscale: u_int8_t, + pub pad: [u_int8_t; 6usize], +} +#[test] +fn bindgen_test_layout_pfsync_state_peer() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(pfsync_state_peer)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(pfsync_state_peer)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).scrub) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(scrub) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).seqlo) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(seqlo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).seqhi) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(seqhi) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).seqdiff) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(seqdiff) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).max_win) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(max_win) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).mss) as usize - ptr as usize }, + 22usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(mss) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(state) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).wscale) as usize - ptr as usize }, + 25usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(wscale) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, + 26usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(pad) + ) + ); +} +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub struct pfsync_state { + pub id: [u_int32_t; 2usize], + pub ifname: [::std::os::raw::c_char; 16usize], + pub lan: pfsync_state_host, + pub gwy: pfsync_state_host, + pub ext_lan: pfsync_state_host, + pub ext_gwy: pfsync_state_host, + pub src: pfsync_state_peer, + pub dst: pfsync_state_peer, + pub rt_addr: pf_addr, + pub unlink_hooks: hook_desc_head, + pub rule: u_int32_t, + pub anchor: u_int32_t, + pub nat_rule: u_int32_t, + pub creation: u_int64_t, + pub expire: u_int64_t, + pub packets: [[u_int32_t; 2usize]; 2usize], + pub bytes: [[u_int32_t; 2usize]; 2usize], + pub creatorid: u_int32_t, + pub tag: u_int16_t, + pub af_lan: sa_family_t, + pub af_gwy: sa_family_t, + pub proto: u_int8_t, + pub direction: u_int8_t, + pub log: u_int8_t, + pub allow_opts: u_int8_t, + pub timeout: u_int8_t, + pub sync_flags: u_int8_t, + pub updates: u_int8_t, + pub proto_variant: u_int8_t, + pub __pad: u_int8_t, + pub flowhash: u_int32_t, +} +#[test] +fn bindgen_test_layout_pfsync_state() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 297usize, + concat!("Size of: ", stringify!(pfsync_state)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(pfsync_state)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(id) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(ifname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lan) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(lan) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).gwy) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(gwy) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ext_lan) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(ext_lan) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ext_gwy) as usize - ptr as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(ext_gwy) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).src) as usize - ptr as usize }, + 120usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(src) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).dst) as usize - ptr as usize }, + 152usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(dst) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rt_addr) as usize - ptr as usize }, + 184usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(rt_addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).unlink_hooks) as usize - ptr as usize }, + 200usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(unlink_hooks) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rule) as usize - ptr as usize }, + 216usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(rule) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).anchor) as usize - ptr as usize }, + 220usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(anchor) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nat_rule) as usize - ptr as usize }, + 224usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(nat_rule) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).creation) as usize - ptr as usize }, + 228usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(creation) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).expire) as usize - ptr as usize }, + 236usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(expire) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).packets) as usize - ptr as usize }, + 244usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(packets) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).bytes) as usize - ptr as usize }, + 260usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(bytes) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).creatorid) as usize - ptr as usize }, + 276usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(creatorid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, + 280usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(tag) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).af_lan) as usize - ptr as usize }, + 282usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(af_lan) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).af_gwy) as usize - ptr as usize }, + 283usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(af_gwy) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).proto) as usize - ptr as usize }, + 284usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(proto) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).direction) as usize - ptr as usize }, + 285usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(direction) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).log) as usize - ptr as usize }, + 286usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(log) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).allow_opts) as usize - ptr as usize }, + 287usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(allow_opts) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).timeout) as usize - ptr as usize }, + 288usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(timeout) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sync_flags) as usize - ptr as usize }, + 289usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(sync_flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).updates) as usize - ptr as usize }, + 290usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(updates) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).proto_variant) as usize - ptr as usize }, + 291usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(proto_variant) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__pad) as usize - ptr as usize }, + 292usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(__pad) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).flowhash) as usize - ptr as usize }, + 293usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(flowhash) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_rulequeue { + pub tqh_first: *mut pf_rule, + pub tqh_last: *mut *mut pf_rule, +} +#[test] +fn bindgen_test_layout_pf_rulequeue() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_rulequeue)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_rulequeue)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tqh_first) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rulequeue), + "::", + stringify!(tqh_first) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tqh_last) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_rulequeue), + "::", + stringify!(tqh_last) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_ruleset { + pub rules: [pf_ruleset__bindgen_ty_1; 6usize], + pub anchor: *mut pf_anchor, + pub tticket: u_int32_t, + pub tables: ::std::os::raw::c_int, + pub topen: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_ruleset__bindgen_ty_1 { + pub queues: [pf_rulequeue; 2usize], + pub active: pf_ruleset__bindgen_ty_1__bindgen_ty_1, + pub inactive: pf_ruleset__bindgen_ty_1__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_ruleset__bindgen_ty_1__bindgen_ty_1 { + pub ptr: *mut pf_rulequeue, + pub ptr_array: *mut *mut pf_rule, + pub rcount: u_int32_t, + pub rsize: u_int32_t, + pub ticket: u_int32_t, + pub open: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_pf_ruleset__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!( + "Size of: ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ptr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(ptr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ptr_array) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(ptr_array) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rcount) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(rcount) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rsize) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(rsize) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ticket) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(ticket) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).open) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(open) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_ruleset__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 96usize, + concat!("Size of: ", stringify!(pf_ruleset__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_ruleset__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).queues) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1), + "::", + stringify!(queues) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).active) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1), + "::", + stringify!(active) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).inactive) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1), + "::", + stringify!(inactive) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_ruleset() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 600usize, + concat!("Size of: ", stringify!(pf_ruleset)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_ruleset)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rules) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset), + "::", + stringify!(rules) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).anchor) as usize - ptr as usize }, + 576usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset), + "::", + stringify!(anchor) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tticket) as usize - ptr as usize }, + 584usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset), + "::", + stringify!(tticket) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tables) as usize - ptr as usize }, + 588usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset), + "::", + stringify!(tables) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).topen) as usize - ptr as usize }, + 592usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset), + "::", + stringify!(topen) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_anchor_node { + pub rbh_root: *mut pf_anchor, +} +#[test] +fn bindgen_test_layout_pf_anchor_node() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(pf_anchor_node)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_anchor_node)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbh_root) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor_node), + "::", + stringify!(rbh_root) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_anchor { + pub entry_global: pf_anchor__bindgen_ty_1, + pub entry_node: pf_anchor__bindgen_ty_2, + pub parent: *mut pf_anchor, + pub children: pf_anchor_node, + pub name: [::std::os::raw::c_char; 64usize], + pub path: [::std::os::raw::c_char; 1024usize], + pub ruleset: pf_ruleset, + pub refcnt: ::std::os::raw::c_int, + pub match_: ::std::os::raw::c_int, + pub owner: [::std::os::raw::c_char; 64usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_anchor__bindgen_ty_1 { + pub rbe_left: *mut pf_anchor, + pub rbe_right: *mut pf_anchor, + pub rbe_parent: *mut pf_anchor, +} +#[test] +fn bindgen_test_layout_pf_anchor__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(pf_anchor__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_anchor__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbe_left) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor__bindgen_ty_1), + "::", + stringify!(rbe_left) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbe_right) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor__bindgen_ty_1), + "::", + stringify!(rbe_right) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbe_parent) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor__bindgen_ty_1), + "::", + stringify!(rbe_parent) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_anchor__bindgen_ty_2 { + pub rbe_left: *mut pf_anchor, + pub rbe_right: *mut pf_anchor, + pub rbe_parent: *mut pf_anchor, +} +#[test] +fn bindgen_test_layout_pf_anchor__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(pf_anchor__bindgen_ty_2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_anchor__bindgen_ty_2)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbe_left) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor__bindgen_ty_2), + "::", + stringify!(rbe_left) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbe_right) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor__bindgen_ty_2), + "::", + stringify!(rbe_right) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbe_parent) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor__bindgen_ty_2), + "::", + stringify!(rbe_parent) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_anchor() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 1824usize, + concat!("Size of: ", stringify!(pf_anchor)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_anchor)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).entry_global) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(entry_global) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).entry_node) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(entry_node) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).parent) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(parent) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).children) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(children) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).path) as usize - ptr as usize }, + 128usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(path) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ruleset) as usize - ptr as usize }, + 1152usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(ruleset) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).refcnt) as usize - ptr as usize }, + 1752usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(refcnt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).match_) as usize - ptr as usize }, + 1756usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(match_) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).owner) as usize - ptr as usize }, + 1760usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(owner) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_status { + pub counters: [u_int64_t; 17usize], + pub lcounters: [u_int64_t; 7usize], + pub fcounters: [u_int64_t; 3usize], + pub scounters: [u_int64_t; 3usize], + pub pcounters: [[[u_int64_t; 3usize]; 2usize]; 2usize], + pub bcounters: [[u_int64_t; 2usize]; 2usize], + pub stateid: u_int64_t, + pub running: u_int32_t, + pub states: u_int32_t, + pub src_nodes: u_int32_t, + pub since: u_int64_t, + pub debug: u_int32_t, + pub hostid: u_int32_t, + pub ifname: [::std::os::raw::c_char; 16usize], + pub pf_chksum: [u_int8_t; 16usize], +} +#[test] +fn bindgen_test_layout_pf_status() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 440usize, + concat!("Size of: ", stringify!(pf_status)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_status)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).counters) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(counters) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lcounters) as usize - ptr as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(lcounters) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fcounters) as usize - ptr as usize }, + 192usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(fcounters) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).scounters) as usize - ptr as usize }, + 216usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(scounters) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pcounters) as usize - ptr as usize }, + 240usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(pcounters) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).bcounters) as usize - ptr as usize }, + 336usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(bcounters) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).stateid) as usize - ptr as usize }, + 368usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(stateid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).running) as usize - ptr as usize }, + 376usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(running) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).states) as usize - ptr as usize }, + 380usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(states) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).src_nodes) as usize - ptr as usize }, + 384usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(src_nodes) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).since) as usize - ptr as usize }, + 392usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(since) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).debug) as usize - ptr as usize }, + 400usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(debug) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hostid) as usize - ptr as usize }, + 404usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(hostid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, + 408usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(ifname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pf_chksum) as usize - ptr as usize }, + 424usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(pf_chksum) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pfioc_pooladdr { + pub action: u_int32_t, + pub ticket: u_int32_t, + pub nr: u_int32_t, + pub r_num: u_int32_t, + pub r_action: u_int8_t, + pub r_last: u_int8_t, + pub af: u_int8_t, + pub anchor: [::std::os::raw::c_char; 1024usize], + pub addr: pf_pooladdr, +} +#[test] +fn bindgen_test_layout_pfioc_pooladdr() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 1136usize, + concat!("Size of: ", stringify!(pfioc_pooladdr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfioc_pooladdr)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_pooladdr), + "::", + stringify!(action) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ticket) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(pfioc_pooladdr), + "::", + stringify!(ticket) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nr) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pfioc_pooladdr), + "::", + stringify!(nr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).r_num) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(pfioc_pooladdr), + "::", + stringify!(r_num) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).r_action) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pfioc_pooladdr), + "::", + stringify!(r_action) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).r_last) as usize - ptr as usize }, + 17usize, + concat!( + "Offset of field: ", + stringify!(pfioc_pooladdr), + "::", + stringify!(r_last) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).af) as usize - ptr as usize }, + 18usize, + concat!( + "Offset of field: ", + stringify!(pfioc_pooladdr), + "::", + stringify!(af) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).anchor) as usize - ptr as usize }, + 19usize, + concat!( + "Offset of field: ", + stringify!(pfioc_pooladdr), + "::", + stringify!(anchor) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 1048usize, + concat!( + "Offset of field: ", + stringify!(pfioc_pooladdr), + "::", + stringify!(addr) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pfioc_rule { + pub action: u_int32_t, + pub ticket: u_int32_t, + pub pool_ticket: u_int32_t, + pub nr: u_int32_t, + pub anchor: [::std::os::raw::c_char; 1024usize], + pub anchor_call: [::std::os::raw::c_char; 1024usize], + pub rule: pf_rule, +} +#[test] +fn bindgen_test_layout_pfioc_rule() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 3104usize, + concat!("Size of: ", stringify!(pfioc_rule)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfioc_rule)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_rule), + "::", + stringify!(action) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ticket) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(pfioc_rule), + "::", + stringify!(ticket) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pool_ticket) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pfioc_rule), + "::", + stringify!(pool_ticket) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nr) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(pfioc_rule), + "::", + stringify!(nr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).anchor) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pfioc_rule), + "::", + stringify!(anchor) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).anchor_call) as usize - ptr as usize }, + 1040usize, + concat!( + "Offset of field: ", + stringify!(pfioc_rule), + "::", + stringify!(anchor_call) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rule) as usize - ptr as usize }, + 2064usize, + concat!( + "Offset of field: ", + stringify!(pfioc_rule), + "::", + stringify!(rule) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pfioc_state_addr_kill { + pub addr: pf_addr_wrap, + pub reserved_: [u_int8_t; 3usize], + pub neg: u_int8_t, + pub xport: pf_rule_xport, +} +#[test] +fn bindgen_test_layout_pfioc_state_addr_kill() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(pfioc_state_addr_kill)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfioc_state_addr_kill)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_state_addr_kill), + "::", + stringify!(addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).reserved_) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(pfioc_state_addr_kill), + "::", + stringify!(reserved_) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).neg) as usize - ptr as usize }, + 51usize, + concat!( + "Offset of field: ", + stringify!(pfioc_state_addr_kill), + "::", + stringify!(neg) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).xport) as usize - ptr as usize }, + 52usize, + concat!( + "Offset of field: ", + stringify!(pfioc_state_addr_kill), + "::", + stringify!(xport) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pfioc_state_kill { + pub psk_af: sa_family_t, + pub psk_proto: u_int8_t, + pub psk_proto_variant: u_int8_t, + pub _pad: u_int8_t, + pub psk_src: pfioc_state_addr_kill, + pub psk_dst: pfioc_state_addr_kill, + pub psk_ifname: [::std::os::raw::c_char; 16usize], + pub psk_ownername: [::std::os::raw::c_char; 64usize], +} +#[test] +fn bindgen_test_layout_pfioc_state_kill() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 216usize, + concat!("Size of: ", stringify!(pfioc_state_kill)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfioc_state_kill)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psk_af) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_af) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psk_proto) as usize - ptr as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_proto) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psk_proto_variant) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_proto_variant) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._pad) as usize - ptr as usize }, + 3usize, + concat!( + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(_pad) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psk_src) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_src) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psk_dst) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_dst) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psk_ifname) as usize - ptr as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_ifname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psk_ownername) as usize - ptr as usize }, + 152usize, + concat!( + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_ownername) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pfioc_states { + pub ps_len: ::std::os::raw::c_int, + pub ps_u: pfioc_states__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pfioc_states__bindgen_ty_1 { + pub psu_buf: caddr_t, + pub psu_states: *mut pfsync_state, +} +#[test] +fn bindgen_test_layout_pfioc_states__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(pfioc_states__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfioc_states__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psu_buf) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_states__bindgen_ty_1), + "::", + stringify!(psu_buf) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psu_states) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_states__bindgen_ty_1), + "::", + stringify!(psu_states) + ) + ); +} +#[test] +fn bindgen_test_layout_pfioc_states() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pfioc_states)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfioc_states)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ps_len) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_states), + "::", + stringify!(ps_len) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ps_u) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pfioc_states), + "::", + stringify!(ps_u) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfioc_trans { + pub size: ::std::os::raw::c_int, + pub esize: ::std::os::raw::c_int, + pub array: *mut pfioc_trans_pfioc_trans_e, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfioc_trans_pfioc_trans_e { + pub rs_num: ::std::os::raw::c_int, + pub anchor: [::std::os::raw::c_char; 1024usize], + pub ticket: u_int32_t, +} +#[test] +fn bindgen_test_layout_pfioc_trans_pfioc_trans_e() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 1032usize, + concat!("Size of: ", stringify!(pfioc_trans_pfioc_trans_e)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pfioc_trans_pfioc_trans_e)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rs_num) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_trans_pfioc_trans_e), + "::", + stringify!(rs_num) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).anchor) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(pfioc_trans_pfioc_trans_e), + "::", + stringify!(anchor) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ticket) as usize - ptr as usize }, + 1028usize, + concat!( + "Offset of field: ", + stringify!(pfioc_trans_pfioc_trans_e), + "::", + stringify!(ticket) + ) + ); +} +#[test] +fn bindgen_test_layout_pfioc_trans() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pfioc_trans)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfioc_trans)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_trans), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).esize) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(pfioc_trans), + "::", + stringify!(esize) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).array) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pfioc_trans), + "::", + stringify!(array) + ) + ); +} From f38f5a5ba4bb051d1a56e6acf50a8ee5d361fbae Mon Sep 17 00:00:00 2001 From: Alvin Peters Date: Sun, 16 Jun 2024 02:52:54 +1000 Subject: [PATCH 04/17] Add and update bindings Also set up the script to generate bindings from OpenBSD and FreeBSD. --- generate_bindings.sh | 131 +- src/ffi/mod.rs | 8 + src/ffi/pfvar/macos.rs | 2248 ++++++++-------- src/ffi/pfvar/openbsd.rs | 5404 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 6647 insertions(+), 1144 deletions(-) create mode 100644 src/ffi/pfvar/openbsd.rs diff --git a/generate_bindings.sh b/generate_bindings.sh index 029e6d3..5ea7121 100755 --- a/generate_bindings.sh +++ b/generate_bindings.sh @@ -1,28 +1,119 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh # Please always have the latest version of bindgen and rustfmt installed before using this script # Download the pfvar.h file to generate bindings for from: # https://github.com/apple-oss-distributions/xnu/blob/main/bsd/net/pfvar.h -pfvar_h_path=${1:?"Specify path to pfvar.h as first argument"} +main() { + os=${OS:-$(uname -s)} + # Takes inputs from user if provided, otherwise set it to empty and let the script sort it out. + case $os in + 'Darwin') + mac_os "${1}" "${2}" + ;; + 'FreeBSD') + freebsd "${1}" "${2}" + ;; + 'OpenBSD') + openbsd "${1}" "${2}" + ;; + *) + >&2 echo "Unknown or unsupported operating system: '${os}'" + >&2 echo "Supported operating systems are: 'Darwin' (macOS), 'FreeBSD', 'OpenBSD'" + >&2 echo "The operating system is autodetected using 'uname -s' or manually defined with \$OS variable" + exit 1 + ;; + esac +} -SDK_PATH=$(xcodebuild -sdk macosx Path -version) -echo "Using macOS SDK at:" -echo " $SDK_PATH" -echo "" +mac_os() { + SDK_PATH=$(xcodebuild -sdk macosx Path -version) + # Download pfvar.h if not provided + if [ -z "${1}" ]; then + input=./_pfvar_macos.h + apple_pfvar_download_url="https://raw.githubusercontent.com/apple-oss-distributions/xnu/main/bsd/net/pfvar.h" + echo "Downloading pfvar.h from ${apple_pfvar_download_url}" + if ! curl -o "${input}" "${apple_pfvar_download_url}"; then + >&2 echo "Failed to download pfvar.h" + exit 1 + fi + else + input=${1} + fi + output=${2:-./src/ffi/pfvar/macos.rs} + echo "Using macOS SDK at:" + echo " $SDK_PATH" + echo "" + bindgen \ + --allowlist-type pf_status \ + --allowlist-type pfioc_rule \ + --allowlist-type pfioc_pooladdr \ + --allowlist-type pfioc_trans \ + --allowlist-type pfioc_states \ + --allowlist-type pfioc_state_kill \ + --allowlist-var PF_.* \ + --allowlist-var PFRULE_.* \ + --default-enum-style rust \ + -o "${output}" "${input}" -- \ + -DPRIVATE \ + -I"$SDK_PATH/usr/include" \ + -I"$SDK_PATH/System/Library/Frameworks/Kernel.framework/Versions/A/Headers" + rm "$input" + echo "pfvar.h bindings for macOS has been generated at: ${output}" +} -bindgen \ - --allowlist-type pf_status \ - --allowlist-type pfioc_rule \ - --allowlist-type pfioc_pooladdr \ - --allowlist-type pfioc_trans \ - --allowlist-type pfioc_states \ - --allowlist-type pfioc_state_kill \ - --allowlist-var PF_.* \ - --allowlist-var PFRULE_.* \ - --default-enum-style rust \ - -o ./src/ffi/pfvar.rs "$pfvar_h_path" -- \ - -DPRIVATE \ - -I"$SDK_PATH/usr/include" \ - -I"$SDK_PATH/System/Library/Frameworks/Kernel.framework/Versions/A/Headers" +freebsd() { + if [ -z "${1}" ]; then + input=/usr/include/net/pfvar.h + printf "#include \n#include " > _pfvar_wrapper.h + else + input=${1} + fi + output=${2:-./src/ffi/pfvar/freebsd.rs} + bindgen \ + --allowlist-type pf_status \ + --allowlist-type pfioc_rule \ + --allowlist-type pfioc_pooladdr \ + --allowlist-type pfioc_trans \ + --allowlist-type pfioc_states \ + --allowlist-type pfioc_state_kill \ + --allowlist-var PF_.* \ + --allowlist-var PFRULE_.* \ + --default-enum-style rust \ + -o "${output}" "${input}" + rm "${input}" + echo "pfvar.h bindings for FreeBSD has been generated at: ${output}" +} + +openbsd() { + if [ -z "${1}" ]; then + input=./_pfvar_wrapper_openbsd.h + # Need to create a wrapper header because pfvar.h needs if.h to be included first. + printf "#include \n#include " > "${input}" + else + input=${1} + fi + # OpenBSD has a weird way of packaging LLVM/Clang. Needs to be manually specified. + if [ -z "$LIBCLANG_PATH" ]; then + >&2 echo "\$LIBCLANG_PATH is missing. An LLVM toolchain has to be installed first e.g.: pkg_add llvm17" + >&2 echo "Then set LIBCLANG_PATH to that LLVM's lib directory (if LLVM 17 is installed):" + >&2 echo "export LIBCLANG_PATH=/usr/local/llvm17/lib" + exit 1 + fi + bindgen \ + --allowlist-type pf_status \ + --allowlist-type pfioc_rule \ + --allowlist-type pfioc_pooladdr \ + --allowlist-type pfioc_trans \ + --allowlist-type pfioc_states \ + --allowlist-type pfioc_state_kill \ + --allowlist-var PF_.* \ + --allowlist-var PFRULE_.* \ + --default-enum-style rust \ + -o "${output}" "${input}" + rm "${input}" + echo "pfvar.h bindings for OpenBSD has been generated at: ${output}" +} + +main "$@" diff --git a/src/ffi/mod.rs b/src/ffi/mod.rs index 67595b7..6fd0463 100644 --- a/src/ffi/mod.rs +++ b/src/ffi/mod.rs @@ -24,6 +24,14 @@ pub mod pfvar; #[path = "pfvar/freebsd.rs"] pub mod pfvar; +#[cfg(target_os = "openbsd")] +#[allow(non_camel_case_types)] +#[allow(non_upper_case_globals)] +#[allow(non_snake_case)] +#[allow(dead_code)] +#[path = "pfvar/openbsd.rs"] +pub mod pfvar; + pub mod tcp { use std::os::raw::c_uint; diff --git a/src/ffi/pfvar/macos.rs b/src/ffi/pfvar/macos.rs index 067c7bb..f7737bc 100644 --- a/src/ffi/pfvar/macos.rs +++ b/src/ffi/pfvar/macos.rs @@ -163,10 +163,10 @@ fn bindgen_test_layout_in_addr() { unsafe { ::std::ptr::addr_of!((*ptr).s_addr) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(in_addr), - "::", - stringify!(s_addr) + "Offset of field: ", + stringify!(in_addr), + "::", + stringify!(s_addr) ) ); } @@ -201,30 +201,30 @@ fn bindgen_test_layout_in6_addr__bindgen_ty_1() { unsafe { ::std::ptr::addr_of!((*ptr).__u6_addr8) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(in6_addr__bindgen_ty_1), - "::", - stringify!(__u6_addr8) + "Offset of field: ", + stringify!(in6_addr__bindgen_ty_1), + "::", + stringify!(__u6_addr8) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__u6_addr16) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(in6_addr__bindgen_ty_1), - "::", - stringify!(__u6_addr16) + "Offset of field: ", + stringify!(in6_addr__bindgen_ty_1), + "::", + stringify!(__u6_addr16) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__u6_addr32) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(in6_addr__bindgen_ty_1), - "::", - stringify!(__u6_addr32) + "Offset of field: ", + stringify!(in6_addr__bindgen_ty_1), + "::", + stringify!(__u6_addr32) ) ); } @@ -246,10 +246,10 @@ fn bindgen_test_layout_in6_addr() { unsafe { ::std::ptr::addr_of!((*ptr).__u6_addr) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(in6_addr), - "::", - stringify!(__u6_addr) + "Offset of field: ", + stringify!(in6_addr), + "::", + stringify!(__u6_addr) ) ); } @@ -474,50 +474,50 @@ fn bindgen_test_layout_pf_addr__bindgen_ty_1() { unsafe { ::std::ptr::addr_of!((*ptr)._v4addr) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_addr__bindgen_ty_1), - "::", - stringify!(_v4addr) + "Offset of field: ", + stringify!(pf_addr__bindgen_ty_1), + "::", + stringify!(_v4addr) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr)._v6addr) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_addr__bindgen_ty_1), - "::", - stringify!(_v6addr) + "Offset of field: ", + stringify!(pf_addr__bindgen_ty_1), + "::", + stringify!(_v6addr) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr)._addr8) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_addr__bindgen_ty_1), - "::", - stringify!(_addr8) + "Offset of field: ", + stringify!(pf_addr__bindgen_ty_1), + "::", + stringify!(_addr8) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr)._addr16) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_addr__bindgen_ty_1), - "::", - stringify!(_addr16) + "Offset of field: ", + stringify!(pf_addr__bindgen_ty_1), + "::", + stringify!(_addr16) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr)._addr32) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_addr__bindgen_ty_1), - "::", - stringify!(_addr32) + "Offset of field: ", + stringify!(pf_addr__bindgen_ty_1), + "::", + stringify!(_addr32) ) ); } @@ -539,10 +539,10 @@ fn bindgen_test_layout_pf_addr() { unsafe { ::std::ptr::addr_of!((*ptr).pfa) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_addr), - "::", - stringify!(pfa) + "Offset of field: ", + stringify!(pf_addr), + "::", + stringify!(pfa) ) ); } @@ -578,36 +578,36 @@ fn bindgen_test_layout_pf_addr_wrap__bindgen_ty_1__bindgen_ty_1() { ::std::mem::size_of::(), 32usize, concat!( - "Size of: ", - stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1) + "Size of: ", + stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::(), 4usize, concat!( - "Alignment of ", - stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1) + "Alignment of ", + stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(addr) + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(addr) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).mask) as usize - ptr as usize }, 16usize, concat!( - "Offset of field: ", - stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(mask) + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(mask) ) ); } @@ -630,50 +630,50 @@ fn bindgen_test_layout_pf_addr_wrap__bindgen_ty_1() { unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_addr_wrap__bindgen_ty_1), - "::", - stringify!(a) + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_1), + "::", + stringify!(a) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_addr_wrap__bindgen_ty_1), - "::", - stringify!(ifname) + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_1), + "::", + stringify!(ifname) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tblname) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_addr_wrap__bindgen_ty_1), - "::", - stringify!(tblname) + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_1), + "::", + stringify!(tblname) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rtlabelname) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_addr_wrap__bindgen_ty_1), - "::", - stringify!(rtlabelname) + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_1), + "::", + stringify!(rtlabelname) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rtlabel) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_addr_wrap__bindgen_ty_1), - "::", - stringify!(rtlabel) + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_1), + "::", + stringify!(rtlabel) ) ); } @@ -704,40 +704,40 @@ fn bindgen_test_layout_pf_addr_wrap__bindgen_ty_2() { unsafe { ::std::ptr::addr_of!((*ptr).dyn_) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_addr_wrap__bindgen_ty_2), - "::", - stringify!(dyn_) + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_2), + "::", + stringify!(dyn_) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tbl) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_addr_wrap__bindgen_ty_2), - "::", - stringify!(tbl) + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_2), + "::", + stringify!(tbl) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).dyncnt) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_addr_wrap__bindgen_ty_2), - "::", - stringify!(dyncnt) + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_2), + "::", + stringify!(dyncnt) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tblcnt) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_addr_wrap__bindgen_ty_2), - "::", - stringify!(tblcnt) + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_2), + "::", + stringify!(tblcnt) ) ); } @@ -759,40 +759,40 @@ fn bindgen_test_layout_pf_addr_wrap() { unsafe { ::std::ptr::addr_of!((*ptr).v) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_addr_wrap), - "::", - stringify!(v) + "Offset of field: ", + stringify!(pf_addr_wrap), + "::", + stringify!(v) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).p) as usize - ptr as usize }, 32usize, concat!( - "Offset of field: ", - stringify!(pf_addr_wrap), - "::", - stringify!(p) + "Offset of field: ", + stringify!(pf_addr_wrap), + "::", + stringify!(p) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 40usize, concat!( - "Offset of field: ", - stringify!(pf_addr_wrap), - "::", - stringify!(type_) + "Offset of field: ", + stringify!(pf_addr_wrap), + "::", + stringify!(type_) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).iflags) as usize - ptr as usize }, 41usize, concat!( - "Offset of field: ", - stringify!(pf_addr_wrap), - "::", - stringify!(iflags) + "Offset of field: ", + stringify!(pf_addr_wrap), + "::", + stringify!(iflags) ) ); } @@ -820,20 +820,20 @@ fn bindgen_test_layout_pf_port_range() { unsafe { ::std::ptr::addr_of!((*ptr).port) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_port_range), - "::", - stringify!(port) + "Offset of field: ", + stringify!(pf_port_range), + "::", + stringify!(port) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).op) as usize - ptr as usize }, 4usize, concat!( - "Offset of field: ", - stringify!(pf_port_range), - "::", - stringify!(op) + "Offset of field: ", + stringify!(pf_port_range), + "::", + stringify!(op) ) ); } @@ -862,30 +862,30 @@ fn bindgen_test_layout_pf_rule_xport() { unsafe { ::std::ptr::addr_of!((*ptr).range) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_rule_xport), - "::", - stringify!(range) + "Offset of field: ", + stringify!(pf_rule_xport), + "::", + stringify!(range) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).call_id) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_rule_xport), - "::", - stringify!(call_id) + "Offset of field: ", + stringify!(pf_rule_xport), + "::", + stringify!(call_id) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).spi) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_rule_xport), - "::", - stringify!(spi) + "Offset of field: ", + stringify!(pf_rule_xport), + "::", + stringify!(spi) ) ); } @@ -914,30 +914,30 @@ fn bindgen_test_layout_pf_rule_uid() { unsafe { ::std::ptr::addr_of!((*ptr).uid) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_rule_uid), - "::", - stringify!(uid) + "Offset of field: ", + stringify!(pf_rule_uid), + "::", + stringify!(uid) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).op) as usize - ptr as usize }, 8usize, concat!( - "Offset of field: ", - stringify!(pf_rule_uid), - "::", - stringify!(op) + "Offset of field: ", + stringify!(pf_rule_uid), + "::", + stringify!(op) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr)._pad) as usize - ptr as usize }, 9usize, concat!( - "Offset of field: ", - stringify!(pf_rule_uid), - "::", - stringify!(_pad) + "Offset of field: ", + stringify!(pf_rule_uid), + "::", + stringify!(_pad) ) ); } @@ -966,30 +966,30 @@ fn bindgen_test_layout_pf_rule_gid() { unsafe { ::std::ptr::addr_of!((*ptr).gid) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_rule_gid), - "::", - stringify!(gid) + "Offset of field: ", + stringify!(pf_rule_gid), + "::", + stringify!(gid) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).op) as usize - ptr as usize }, 8usize, concat!( - "Offset of field: ", - stringify!(pf_rule_gid), - "::", - stringify!(op) + "Offset of field: ", + stringify!(pf_rule_gid), + "::", + stringify!(op) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr)._pad) as usize - ptr as usize }, 9usize, concat!( - "Offset of field: ", - stringify!(pf_rule_gid), - "::", - stringify!(_pad) + "Offset of field: ", + stringify!(pf_rule_gid), + "::", + stringify!(_pad) ) ); } @@ -1018,30 +1018,30 @@ fn bindgen_test_layout_pf_rule_addr() { unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_rule_addr), - "::", - stringify!(addr) + "Offset of field: ", + stringify!(pf_rule_addr), + "::", + stringify!(addr) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).xport) as usize - ptr as usize }, 48usize, concat!( - "Offset of field: ", - stringify!(pf_rule_addr), - "::", - stringify!(xport) + "Offset of field: ", + stringify!(pf_rule_addr), + "::", + stringify!(xport) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).neg) as usize - ptr as usize }, 56usize, concat!( - "Offset of field: ", - stringify!(pf_rule_addr), - "::", - stringify!(neg) + "Offset of field: ", + stringify!(pf_rule_addr), + "::", + stringify!(neg) ) ); } @@ -1078,20 +1078,20 @@ fn bindgen_test_layout_pf_pooladdr__bindgen_ty_1() { unsafe { ::std::ptr::addr_of!((*ptr).tqe_next) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_pooladdr__bindgen_ty_1), - "::", - stringify!(tqe_next) + "Offset of field: ", + stringify!(pf_pooladdr__bindgen_ty_1), + "::", + stringify!(tqe_next) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tqe_prev) as usize - ptr as usize }, 8usize, concat!( - "Offset of field: ", - stringify!(pf_pooladdr__bindgen_ty_1), - "::", - stringify!(tqe_prev) + "Offset of field: ", + stringify!(pf_pooladdr__bindgen_ty_1), + "::", + stringify!(tqe_prev) ) ); } @@ -1113,40 +1113,40 @@ fn bindgen_test_layout_pf_pooladdr() { unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_pooladdr), - "::", - stringify!(addr) + "Offset of field: ", + stringify!(pf_pooladdr), + "::", + stringify!(addr) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).entries) as usize - ptr as usize }, 48usize, concat!( - "Offset of field: ", - stringify!(pf_pooladdr), - "::", - stringify!(entries) + "Offset of field: ", + stringify!(pf_pooladdr), + "::", + stringify!(entries) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, 64usize, concat!( - "Offset of field: ", - stringify!(pf_pooladdr), - "::", - stringify!(ifname) + "Offset of field: ", + stringify!(pf_pooladdr), + "::", + stringify!(ifname) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).kif) as usize - ptr as usize }, 80usize, concat!( - "Offset of field: ", - stringify!(pf_pooladdr), - "::", - stringify!(kif) + "Offset of field: ", + stringify!(pf_pooladdr), + "::", + stringify!(kif) ) ); } @@ -1174,20 +1174,20 @@ fn bindgen_test_layout_pf_palist() { unsafe { ::std::ptr::addr_of!((*ptr).tqh_first) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_palist), - "::", - stringify!(tqh_first) + "Offset of field: ", + stringify!(pf_palist), + "::", + stringify!(tqh_first) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tqh_last) as usize - ptr as usize }, 8usize, concat!( - "Offset of field: ", - stringify!(pf_palist), - "::", - stringify!(tqh_last) + "Offset of field: ", + stringify!(pf_palist), + "::", + stringify!(tqh_last) ) ); } @@ -1222,30 +1222,30 @@ fn bindgen_test_layout_pf_poolhashkey__bindgen_ty_1() { unsafe { ::std::ptr::addr_of!((*ptr).key8) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_poolhashkey__bindgen_ty_1), - "::", - stringify!(key8) + "Offset of field: ", + stringify!(pf_poolhashkey__bindgen_ty_1), + "::", + stringify!(key8) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).key16) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_poolhashkey__bindgen_ty_1), - "::", - stringify!(key16) + "Offset of field: ", + stringify!(pf_poolhashkey__bindgen_ty_1), + "::", + stringify!(key16) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).key32) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_poolhashkey__bindgen_ty_1), - "::", - stringify!(key32) + "Offset of field: ", + stringify!(pf_poolhashkey__bindgen_ty_1), + "::", + stringify!(key32) ) ); } @@ -1267,10 +1267,10 @@ fn bindgen_test_layout_pf_poolhashkey() { unsafe { ::std::ptr::addr_of!((*ptr).pfk) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_poolhashkey), - "::", - stringify!(pfk) + "Offset of field: ", + stringify!(pf_poolhashkey), + "::", + stringify!(pfk) ) ); } @@ -1305,90 +1305,90 @@ fn bindgen_test_layout_pf_pool() { unsafe { ::std::ptr::addr_of!((*ptr).list) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_pool), - "::", - stringify!(list) + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(list) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).cur) as usize - ptr as usize }, 16usize, concat!( - "Offset of field: ", - stringify!(pf_pool), - "::", - stringify!(cur) + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(cur) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).key) as usize - ptr as usize }, 24usize, concat!( - "Offset of field: ", - stringify!(pf_pool), - "::", - stringify!(key) + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(key) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).counter) as usize - ptr as usize }, 40usize, concat!( - "Offset of field: ", - stringify!(pf_pool), - "::", - stringify!(counter) + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(counter) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tblidx) as usize - ptr as usize }, 56usize, concat!( - "Offset of field: ", - stringify!(pf_pool), - "::", - stringify!(tblidx) + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(tblidx) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).proxy_port) as usize - ptr as usize }, 60usize, concat!( - "Offset of field: ", - stringify!(pf_pool), - "::", - stringify!(proxy_port) + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(proxy_port) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).port_op) as usize - ptr as usize }, 64usize, concat!( - "Offset of field: ", - stringify!(pf_pool), - "::", - stringify!(port_op) + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(port_op) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).opts) as usize - ptr as usize }, 65usize, concat!( - "Offset of field: ", - stringify!(pf_pool), - "::", - stringify!(opts) + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(opts) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).af) as usize - ptr as usize }, 66usize, concat!( - "Offset of field: ", - stringify!(pf_pool), - "::", - stringify!(af) + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(af) ) ); } @@ -1417,20 +1417,20 @@ fn bindgen_test_layout_pf_rule_ptr() { unsafe { ::std::ptr::addr_of!((*ptr).ptr) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_rule_ptr), - "::", - stringify!(ptr) + "Offset of field: ", + stringify!(pf_rule_ptr), + "::", + stringify!(ptr) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nr) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_rule_ptr), - "::", - stringify!(nr) + "Offset of field: ", + stringify!(pf_rule_ptr), + "::", + stringify!(nr) ) ); } @@ -1537,20 +1537,20 @@ fn bindgen_test_layout_pf_rule__bindgen_ty_1() { unsafe { ::std::ptr::addr_of!((*ptr).tqe_next) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_rule__bindgen_ty_1), - "::", - stringify!(tqe_next) + "Offset of field: ", + stringify!(pf_rule__bindgen_ty_1), + "::", + stringify!(tqe_next) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tqe_prev) as usize - ptr as usize }, 8usize, concat!( - "Offset of field: ", - stringify!(pf_rule__bindgen_ty_1), - "::", - stringify!(tqe_prev) + "Offset of field: ", + stringify!(pf_rule__bindgen_ty_1), + "::", + stringify!(tqe_prev) ) ); } @@ -1579,20 +1579,20 @@ fn bindgen_test_layout_pf_rule__bindgen_ty_2() { unsafe { ::std::ptr::addr_of!((*ptr).limit) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_rule__bindgen_ty_2), - "::", - stringify!(limit) + "Offset of field: ", + stringify!(pf_rule__bindgen_ty_2), + "::", + stringify!(limit) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).seconds) as usize - ptr as usize }, 4usize, concat!( - "Offset of field: ", - stringify!(pf_rule__bindgen_ty_2), - "::", - stringify!(seconds) + "Offset of field: ", + stringify!(pf_rule__bindgen_ty_2), + "::", + stringify!(seconds) ) ); } @@ -1614,740 +1614,740 @@ fn bindgen_test_layout_pf_rule() { unsafe { ::std::ptr::addr_of!((*ptr).src) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(src) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(src) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).dst) as usize - ptr as usize }, 64usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(dst) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(dst) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).skip) as usize - ptr as usize }, 128usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(skip) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(skip) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, 192usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(label) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(label) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, 256usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(ifname) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(ifname) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).qname) as usize - ptr as usize }, 272usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(qname) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(qname) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pqname) as usize - ptr as usize }, 336usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(pqname) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(pqname) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tagname) as usize - ptr as usize }, 400usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(tagname) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(tagname) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).match_tagname) as usize - ptr as usize }, 464usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(match_tagname) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(match_tagname) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).overload_tblname) as usize - ptr as usize }, 528usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(overload_tblname) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(overload_tblname) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).entries) as usize - ptr as usize }, 560usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(entries) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(entries) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rpool) as usize - ptr as usize }, 576usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(rpool) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(rpool) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).evaluations) as usize - ptr as usize }, 648usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(evaluations) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(evaluations) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).packets) as usize - ptr as usize }, 656usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(packets) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(packets) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).bytes) as usize - ptr as usize }, 672usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(bytes) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(bytes) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ticket) as usize - ptr as usize }, 688usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(ticket) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(ticket) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).owner) as usize - ptr as usize }, 696usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(owner) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(owner) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).priority) as usize - ptr as usize }, 760usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(priority) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(priority) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).kif) as usize - ptr as usize }, 768usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(kif) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(kif) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).anchor) as usize - ptr as usize }, 776usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(anchor) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(anchor) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).overload_tbl) as usize - ptr as usize }, 784usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(overload_tbl) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(overload_tbl) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).os_fingerprint) as usize - ptr as usize }, 792usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(os_fingerprint) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(os_fingerprint) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rtableid) as usize - ptr as usize }, 796usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(rtableid) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(rtableid) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).timeout) as usize - ptr as usize }, 800usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(timeout) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(timeout) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).states) as usize - ptr as usize }, 904usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(states) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(states) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).max_states) as usize - ptr as usize }, 908usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(max_states) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(max_states) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).src_nodes) as usize - ptr as usize }, 912usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(src_nodes) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(src_nodes) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).max_src_nodes) as usize - ptr as usize }, 916usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(max_src_nodes) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(max_src_nodes) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).max_src_states) as usize - ptr as usize }, 920usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(max_src_states) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(max_src_states) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).max_src_conn) as usize - ptr as usize }, 924usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(max_src_conn) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(max_src_conn) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).max_src_conn_rate) as usize - ptr as usize }, 928usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(max_src_conn_rate) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(max_src_conn_rate) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).qid) as usize - ptr as usize }, 936usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(qid) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(qid) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pqid) as usize - ptr as usize }, 940usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(pqid) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(pqid) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rt_listid) as usize - ptr as usize }, 944usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(rt_listid) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(rt_listid) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nr) as usize - ptr as usize }, 948usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(nr) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(nr) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, 952usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(prob) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(prob) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).cuid) as usize - ptr as usize }, 956usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(cuid) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(cuid) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).cpid) as usize - ptr as usize }, 960usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(cpid) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(cpid) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).return_icmp) as usize - ptr as usize }, 964usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(return_icmp) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(return_icmp) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).return_icmp6) as usize - ptr as usize }, 966usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(return_icmp6) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(return_icmp6) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).max_mss) as usize - ptr as usize }, 968usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(max_mss) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(max_mss) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, 970usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(tag) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(tag) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).match_tag) as usize - ptr as usize }, 972usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(match_tag) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(match_tag) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).uid) as usize - ptr as usize }, 976usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(uid) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(uid) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).gid) as usize - ptr as usize }, 988usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(gid) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(gid) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rule_flag) as usize - ptr as usize }, 1000usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(rule_flag) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(rule_flag) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, 1004usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(action) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(action) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).direction) as usize - ptr as usize }, 1005usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(direction) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(direction) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).log) as usize - ptr as usize }, 1006usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(log) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(log) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).logif) as usize - ptr as usize }, 1007usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(logif) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(logif) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).quick) as usize - ptr as usize }, 1008usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(quick) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(quick) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ifnot) as usize - ptr as usize }, 1009usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(ifnot) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(ifnot) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).match_tag_not) as usize - ptr as usize }, 1010usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(match_tag_not) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(match_tag_not) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).natpass) as usize - ptr as usize }, 1011usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(natpass) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(natpass) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).keep_state) as usize - ptr as usize }, 1012usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(keep_state) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(keep_state) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).af) as usize - ptr as usize }, 1013usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(af) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(af) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).proto) as usize - ptr as usize }, 1014usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(proto) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(proto) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 1015usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(type_) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(type_) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).code) as usize - ptr as usize }, 1016usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(code) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(code) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 1017usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(flags) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(flags) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).flagset) as usize - ptr as usize }, 1018usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(flagset) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(flagset) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).min_ttl) as usize - ptr as usize }, 1019usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(min_ttl) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(min_ttl) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).allow_opts) as usize - ptr as usize }, 1020usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(allow_opts) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(allow_opts) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rt) as usize - ptr as usize }, 1021usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(rt) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(rt) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).return_ttl) as usize - ptr as usize }, 1022usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(return_ttl) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(return_ttl) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tos) as usize - ptr as usize }, 1023usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(tos) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(tos) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).anchor_relative) as usize - ptr as usize }, 1024usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(anchor_relative) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(anchor_relative) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).anchor_wildcard) as usize - ptr as usize }, 1025usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(anchor_wildcard) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(anchor_wildcard) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).flush) as usize - ptr as usize }, 1026usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(flush) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(flush) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).proto_variant) as usize - ptr as usize }, 1027usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(proto_variant) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(proto_variant) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).extfilter) as usize - ptr as usize }, 1028usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(extfilter) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(extfilter) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).extmap) as usize - ptr as usize }, 1029usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(extmap) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(extmap) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).dnpipe) as usize - ptr as usize }, 1032usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(dnpipe) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(dnpipe) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).dntype) as usize - ptr as usize }, 1036usize, concat!( - "Offset of field: ", - stringify!(pf_rule), - "::", - stringify!(dntype) + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(dntype) ) ); } @@ -2376,30 +2376,30 @@ fn bindgen_test_layout_pf_state_xport() { unsafe { ::std::ptr::addr_of!((*ptr).port) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_state_xport), - "::", - stringify!(port) + "Offset of field: ", + stringify!(pf_state_xport), + "::", + stringify!(port) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).call_id) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_state_xport), - "::", - stringify!(call_id) + "Offset of field: ", + stringify!(pf_state_xport), + "::", + stringify!(call_id) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).spi) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_state_xport), - "::", - stringify!(spi) + "Offset of field: ", + stringify!(pf_state_xport), + "::", + stringify!(spi) ) ); } @@ -2432,20 +2432,20 @@ fn bindgen_test_layout_hook_desc_head() { unsafe { ::std::ptr::addr_of!((*ptr).tqh_first) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(hook_desc_head), - "::", - stringify!(tqh_first) + "Offset of field: ", + stringify!(hook_desc_head), + "::", + stringify!(tqh_first) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tqh_last) as usize - ptr as usize }, 8usize, concat!( - "Offset of field: ", - stringify!(hook_desc_head), - "::", - stringify!(tqh_last) + "Offset of field: ", + stringify!(hook_desc_head), + "::", + stringify!(tqh_last) ) ); } @@ -2475,40 +2475,40 @@ fn bindgen_test_layout_pfsync_state_scrub() { unsafe { ::std::ptr::addr_of!((*ptr).pfss_flags) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pfsync_state_scrub), - "::", - stringify!(pfss_flags) + "Offset of field: ", + stringify!(pfsync_state_scrub), + "::", + stringify!(pfss_flags) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pfss_ttl) as usize - ptr as usize }, 2usize, concat!( - "Offset of field: ", - stringify!(pfsync_state_scrub), - "::", - stringify!(pfss_ttl) + "Offset of field: ", + stringify!(pfsync_state_scrub), + "::", + stringify!(pfss_ttl) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scrub_flag) as usize - ptr as usize }, 3usize, concat!( - "Offset of field: ", - stringify!(pfsync_state_scrub), - "::", - stringify!(scrub_flag) + "Offset of field: ", + stringify!(pfsync_state_scrub), + "::", + stringify!(scrub_flag) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pfss_ts_mod) as usize - ptr as usize }, 4usize, concat!( - "Offset of field: ", - stringify!(pfsync_state_scrub), - "::", - stringify!(pfss_ts_mod) + "Offset of field: ", + stringify!(pfsync_state_scrub), + "::", + stringify!(pfss_ts_mod) ) ); } @@ -2537,30 +2537,30 @@ fn bindgen_test_layout_pfsync_state_host() { unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pfsync_state_host), - "::", - stringify!(addr) + "Offset of field: ", + stringify!(pfsync_state_host), + "::", + stringify!(addr) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).xport) as usize - ptr as usize }, 16usize, concat!( - "Offset of field: ", - stringify!(pfsync_state_host), - "::", - stringify!(xport) + "Offset of field: ", + stringify!(pfsync_state_host), + "::", + stringify!(xport) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, 20usize, concat!( - "Offset of field: ", - stringify!(pfsync_state_host), - "::", - stringify!(pad) + "Offset of field: ", + stringify!(pfsync_state_host), + "::", + stringify!(pad) ) ); } @@ -2595,90 +2595,90 @@ fn bindgen_test_layout_pfsync_state_peer() { unsafe { ::std::ptr::addr_of!((*ptr).scrub) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pfsync_state_peer), - "::", - stringify!(scrub) + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(scrub) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).seqlo) as usize - ptr as usize }, 8usize, concat!( - "Offset of field: ", - stringify!(pfsync_state_peer), - "::", - stringify!(seqlo) + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(seqlo) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).seqhi) as usize - ptr as usize }, 12usize, concat!( - "Offset of field: ", - stringify!(pfsync_state_peer), - "::", - stringify!(seqhi) + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(seqhi) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).seqdiff) as usize - ptr as usize }, 16usize, concat!( - "Offset of field: ", - stringify!(pfsync_state_peer), - "::", - stringify!(seqdiff) + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(seqdiff) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).max_win) as usize - ptr as usize }, 20usize, concat!( - "Offset of field: ", - stringify!(pfsync_state_peer), - "::", - stringify!(max_win) + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(max_win) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).mss) as usize - ptr as usize }, 22usize, concat!( - "Offset of field: ", - stringify!(pfsync_state_peer), - "::", - stringify!(mss) + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(mss) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, 24usize, concat!( - "Offset of field: ", - stringify!(pfsync_state_peer), - "::", - stringify!(state) + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(state) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).wscale) as usize - ptr as usize }, 25usize, concat!( - "Offset of field: ", - stringify!(pfsync_state_peer), - "::", - stringify!(wscale) + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(wscale) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, 26usize, concat!( - "Offset of field: ", - stringify!(pfsync_state_peer), - "::", - stringify!(pad) + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(pad) ) ); } @@ -2735,310 +2735,310 @@ fn bindgen_test_layout_pfsync_state() { unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(id) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(id) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, 8usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(ifname) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(ifname) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).lan) as usize - ptr as usize }, 24usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(lan) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(lan) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).gwy) as usize - ptr as usize }, 48usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(gwy) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(gwy) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ext_lan) as usize - ptr as usize }, 72usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(ext_lan) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(ext_lan) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ext_gwy) as usize - ptr as usize }, 96usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(ext_gwy) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(ext_gwy) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).src) as usize - ptr as usize }, 120usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(src) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(src) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).dst) as usize - ptr as usize }, 152usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(dst) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(dst) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rt_addr) as usize - ptr as usize }, 184usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(rt_addr) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(rt_addr) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).unlink_hooks) as usize - ptr as usize }, 200usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(unlink_hooks) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(unlink_hooks) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rule) as usize - ptr as usize }, 216usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(rule) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(rule) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).anchor) as usize - ptr as usize }, 220usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(anchor) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(anchor) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nat_rule) as usize - ptr as usize }, 224usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(nat_rule) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(nat_rule) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).creation) as usize - ptr as usize }, 228usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(creation) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(creation) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).expire) as usize - ptr as usize }, 236usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(expire) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(expire) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).packets) as usize - ptr as usize }, 244usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(packets) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(packets) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).bytes) as usize - ptr as usize }, 260usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(bytes) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(bytes) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).creatorid) as usize - ptr as usize }, 276usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(creatorid) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(creatorid) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, 280usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(tag) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(tag) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).af_lan) as usize - ptr as usize }, 282usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(af_lan) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(af_lan) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).af_gwy) as usize - ptr as usize }, 283usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(af_gwy) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(af_gwy) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).proto) as usize - ptr as usize }, 284usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(proto) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(proto) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).direction) as usize - ptr as usize }, 285usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(direction) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(direction) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).log) as usize - ptr as usize }, 286usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(log) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(log) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).allow_opts) as usize - ptr as usize }, 287usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(allow_opts) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(allow_opts) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).timeout) as usize - ptr as usize }, 288usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(timeout) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(timeout) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sync_flags) as usize - ptr as usize }, 289usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(sync_flags) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(sync_flags) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).updates) as usize - ptr as usize }, 290usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(updates) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(updates) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).proto_variant) as usize - ptr as usize }, 291usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(proto_variant) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(proto_variant) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__pad) as usize - ptr as usize }, 292usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(__pad) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(__pad) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).flowhash) as usize - ptr as usize }, 293usize, concat!( - "Offset of field: ", - stringify!(pfsync_state), - "::", - stringify!(flowhash) + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(flowhash) ) ); } @@ -3066,20 +3066,20 @@ fn bindgen_test_layout_pf_rulequeue() { unsafe { ::std::ptr::addr_of!((*ptr).tqh_first) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_rulequeue), - "::", - stringify!(tqh_first) + "Offset of field: ", + stringify!(pf_rulequeue), + "::", + stringify!(tqh_first) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tqh_last) as usize - ptr as usize }, 8usize, concat!( - "Offset of field: ", - stringify!(pf_rulequeue), - "::", - stringify!(tqh_last) + "Offset of field: ", + stringify!(pf_rulequeue), + "::", + stringify!(tqh_last) ) ); } @@ -3118,76 +3118,76 @@ fn bindgen_test_layout_pf_ruleset__bindgen_ty_1__bindgen_ty_1() { ::std::mem::size_of::(), 32usize, concat!( - "Size of: ", - stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1) + "Size of: ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!( - "Alignment of ", - stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1) + "Alignment of ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ptr) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(ptr) + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(ptr) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ptr_array) as usize - ptr as usize }, 8usize, concat!( - "Offset of field: ", - stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(ptr_array) + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(ptr_array) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rcount) as usize - ptr as usize }, 16usize, concat!( - "Offset of field: ", - stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(rcount) + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(rcount) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsize) as usize - ptr as usize }, 20usize, concat!( - "Offset of field: ", - stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(rsize) + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(rsize) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ticket) as usize - ptr as usize }, 24usize, concat!( - "Offset of field: ", - stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(ticket) + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(ticket) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).open) as usize - ptr as usize }, 28usize, concat!( - "Offset of field: ", - stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(open) + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(open) ) ); } @@ -3210,30 +3210,30 @@ fn bindgen_test_layout_pf_ruleset__bindgen_ty_1() { unsafe { ::std::ptr::addr_of!((*ptr).queues) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_ruleset__bindgen_ty_1), - "::", - stringify!(queues) + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1), + "::", + stringify!(queues) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).active) as usize - ptr as usize }, 32usize, concat!( - "Offset of field: ", - stringify!(pf_ruleset__bindgen_ty_1), - "::", - stringify!(active) + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1), + "::", + stringify!(active) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).inactive) as usize - ptr as usize }, 64usize, concat!( - "Offset of field: ", - stringify!(pf_ruleset__bindgen_ty_1), - "::", - stringify!(inactive) + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1), + "::", + stringify!(inactive) ) ); } @@ -3255,50 +3255,50 @@ fn bindgen_test_layout_pf_ruleset() { unsafe { ::std::ptr::addr_of!((*ptr).rules) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_ruleset), - "::", - stringify!(rules) + "Offset of field: ", + stringify!(pf_ruleset), + "::", + stringify!(rules) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).anchor) as usize - ptr as usize }, 576usize, concat!( - "Offset of field: ", - stringify!(pf_ruleset), - "::", - stringify!(anchor) + "Offset of field: ", + stringify!(pf_ruleset), + "::", + stringify!(anchor) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tticket) as usize - ptr as usize }, 584usize, concat!( - "Offset of field: ", - stringify!(pf_ruleset), - "::", - stringify!(tticket) + "Offset of field: ", + stringify!(pf_ruleset), + "::", + stringify!(tticket) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tables) as usize - ptr as usize }, 588usize, concat!( - "Offset of field: ", - stringify!(pf_ruleset), - "::", - stringify!(tables) + "Offset of field: ", + stringify!(pf_ruleset), + "::", + stringify!(tables) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).topen) as usize - ptr as usize }, 592usize, concat!( - "Offset of field: ", - stringify!(pf_ruleset), - "::", - stringify!(topen) + "Offset of field: ", + stringify!(pf_ruleset), + "::", + stringify!(topen) ) ); } @@ -3325,10 +3325,10 @@ fn bindgen_test_layout_pf_anchor_node() { unsafe { ::std::ptr::addr_of!((*ptr).rbh_root) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_anchor_node), - "::", - stringify!(rbh_root) + "Offset of field: ", + stringify!(pf_anchor_node), + "::", + stringify!(rbh_root) ) ); } @@ -3372,30 +3372,30 @@ fn bindgen_test_layout_pf_anchor__bindgen_ty_1() { unsafe { ::std::ptr::addr_of!((*ptr).rbe_left) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_anchor__bindgen_ty_1), - "::", - stringify!(rbe_left) + "Offset of field: ", + stringify!(pf_anchor__bindgen_ty_1), + "::", + stringify!(rbe_left) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rbe_right) as usize - ptr as usize }, 8usize, concat!( - "Offset of field: ", - stringify!(pf_anchor__bindgen_ty_1), - "::", - stringify!(rbe_right) + "Offset of field: ", + stringify!(pf_anchor__bindgen_ty_1), + "::", + stringify!(rbe_right) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rbe_parent) as usize - ptr as usize }, 16usize, concat!( - "Offset of field: ", - stringify!(pf_anchor__bindgen_ty_1), - "::", - stringify!(rbe_parent) + "Offset of field: ", + stringify!(pf_anchor__bindgen_ty_1), + "::", + stringify!(rbe_parent) ) ); } @@ -3425,30 +3425,30 @@ fn bindgen_test_layout_pf_anchor__bindgen_ty_2() { unsafe { ::std::ptr::addr_of!((*ptr).rbe_left) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_anchor__bindgen_ty_2), - "::", - stringify!(rbe_left) + "Offset of field: ", + stringify!(pf_anchor__bindgen_ty_2), + "::", + stringify!(rbe_left) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rbe_right) as usize - ptr as usize }, 8usize, concat!( - "Offset of field: ", - stringify!(pf_anchor__bindgen_ty_2), - "::", - stringify!(rbe_right) + "Offset of field: ", + stringify!(pf_anchor__bindgen_ty_2), + "::", + stringify!(rbe_right) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rbe_parent) as usize - ptr as usize }, 16usize, concat!( - "Offset of field: ", - stringify!(pf_anchor__bindgen_ty_2), - "::", - stringify!(rbe_parent) + "Offset of field: ", + stringify!(pf_anchor__bindgen_ty_2), + "::", + stringify!(rbe_parent) ) ); } @@ -3470,100 +3470,100 @@ fn bindgen_test_layout_pf_anchor() { unsafe { ::std::ptr::addr_of!((*ptr).entry_global) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_anchor), - "::", - stringify!(entry_global) + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(entry_global) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).entry_node) as usize - ptr as usize }, 24usize, concat!( - "Offset of field: ", - stringify!(pf_anchor), - "::", - stringify!(entry_node) + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(entry_node) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).parent) as usize - ptr as usize }, 48usize, concat!( - "Offset of field: ", - stringify!(pf_anchor), - "::", - stringify!(parent) + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(parent) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).children) as usize - ptr as usize }, 56usize, concat!( - "Offset of field: ", - stringify!(pf_anchor), - "::", - stringify!(children) + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(children) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, 64usize, concat!( - "Offset of field: ", - stringify!(pf_anchor), - "::", - stringify!(name) + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(name) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).path) as usize - ptr as usize }, 128usize, concat!( - "Offset of field: ", - stringify!(pf_anchor), - "::", - stringify!(path) + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(path) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ruleset) as usize - ptr as usize }, 1152usize, concat!( - "Offset of field: ", - stringify!(pf_anchor), - "::", - stringify!(ruleset) + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(ruleset) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).refcnt) as usize - ptr as usize }, 1752usize, concat!( - "Offset of field: ", - stringify!(pf_anchor), - "::", - stringify!(refcnt) + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(refcnt) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).match_) as usize - ptr as usize }, 1756usize, concat!( - "Offset of field: ", - stringify!(pf_anchor), - "::", - stringify!(match_) + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(match_) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).owner) as usize - ptr as usize }, 1760usize, concat!( - "Offset of field: ", - stringify!(pf_anchor), - "::", - stringify!(owner) + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(owner) ) ); } @@ -3604,150 +3604,150 @@ fn bindgen_test_layout_pf_status() { unsafe { ::std::ptr::addr_of!((*ptr).counters) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pf_status), - "::", - stringify!(counters) + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(counters) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).lcounters) as usize - ptr as usize }, 136usize, concat!( - "Offset of field: ", - stringify!(pf_status), - "::", - stringify!(lcounters) + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(lcounters) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fcounters) as usize - ptr as usize }, 192usize, concat!( - "Offset of field: ", - stringify!(pf_status), - "::", - stringify!(fcounters) + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(fcounters) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scounters) as usize - ptr as usize }, 216usize, concat!( - "Offset of field: ", - stringify!(pf_status), - "::", - stringify!(scounters) + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(scounters) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcounters) as usize - ptr as usize }, 240usize, concat!( - "Offset of field: ", - stringify!(pf_status), - "::", - stringify!(pcounters) + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(pcounters) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).bcounters) as usize - ptr as usize }, 336usize, concat!( - "Offset of field: ", - stringify!(pf_status), - "::", - stringify!(bcounters) + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(bcounters) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).stateid) as usize - ptr as usize }, 368usize, concat!( - "Offset of field: ", - stringify!(pf_status), - "::", - stringify!(stateid) + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(stateid) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).running) as usize - ptr as usize }, 376usize, concat!( - "Offset of field: ", - stringify!(pf_status), - "::", - stringify!(running) + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(running) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).states) as usize - ptr as usize }, 380usize, concat!( - "Offset of field: ", - stringify!(pf_status), - "::", - stringify!(states) + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(states) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).src_nodes) as usize - ptr as usize }, 384usize, concat!( - "Offset of field: ", - stringify!(pf_status), - "::", - stringify!(src_nodes) + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(src_nodes) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).since) as usize - ptr as usize }, 392usize, concat!( - "Offset of field: ", - stringify!(pf_status), - "::", - stringify!(since) + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(since) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).debug) as usize - ptr as usize }, 400usize, concat!( - "Offset of field: ", - stringify!(pf_status), - "::", - stringify!(debug) + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(debug) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hostid) as usize - ptr as usize }, 404usize, concat!( - "Offset of field: ", - stringify!(pf_status), - "::", - stringify!(hostid) + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(hostid) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, 408usize, concat!( - "Offset of field: ", - stringify!(pf_status), - "::", - stringify!(ifname) + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(ifname) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pf_chksum) as usize - ptr as usize }, 424usize, concat!( - "Offset of field: ", - stringify!(pf_status), - "::", - stringify!(pf_chksum) + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(pf_chksum) ) ); } @@ -3782,90 +3782,90 @@ fn bindgen_test_layout_pfioc_pooladdr() { unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pfioc_pooladdr), - "::", - stringify!(action) + "Offset of field: ", + stringify!(pfioc_pooladdr), + "::", + stringify!(action) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ticket) as usize - ptr as usize }, 4usize, concat!( - "Offset of field: ", - stringify!(pfioc_pooladdr), - "::", - stringify!(ticket) + "Offset of field: ", + stringify!(pfioc_pooladdr), + "::", + stringify!(ticket) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nr) as usize - ptr as usize }, 8usize, concat!( - "Offset of field: ", - stringify!(pfioc_pooladdr), - "::", - stringify!(nr) + "Offset of field: ", + stringify!(pfioc_pooladdr), + "::", + stringify!(nr) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).r_num) as usize - ptr as usize }, 12usize, concat!( - "Offset of field: ", - stringify!(pfioc_pooladdr), - "::", - stringify!(r_num) + "Offset of field: ", + stringify!(pfioc_pooladdr), + "::", + stringify!(r_num) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).r_action) as usize - ptr as usize }, 16usize, concat!( - "Offset of field: ", - stringify!(pfioc_pooladdr), - "::", - stringify!(r_action) + "Offset of field: ", + stringify!(pfioc_pooladdr), + "::", + stringify!(r_action) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).r_last) as usize - ptr as usize }, 17usize, concat!( - "Offset of field: ", - stringify!(pfioc_pooladdr), - "::", - stringify!(r_last) + "Offset of field: ", + stringify!(pfioc_pooladdr), + "::", + stringify!(r_last) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).af) as usize - ptr as usize }, 18usize, concat!( - "Offset of field: ", - stringify!(pfioc_pooladdr), - "::", - stringify!(af) + "Offset of field: ", + stringify!(pfioc_pooladdr), + "::", + stringify!(af) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).anchor) as usize - ptr as usize }, 19usize, concat!( - "Offset of field: ", - stringify!(pfioc_pooladdr), - "::", - stringify!(anchor) + "Offset of field: ", + stringify!(pfioc_pooladdr), + "::", + stringify!(anchor) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, 1048usize, concat!( - "Offset of field: ", - stringify!(pfioc_pooladdr), - "::", - stringify!(addr) + "Offset of field: ", + stringify!(pfioc_pooladdr), + "::", + stringify!(addr) ) ); } @@ -3898,70 +3898,70 @@ fn bindgen_test_layout_pfioc_rule() { unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pfioc_rule), - "::", - stringify!(action) + "Offset of field: ", + stringify!(pfioc_rule), + "::", + stringify!(action) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ticket) as usize - ptr as usize }, 4usize, concat!( - "Offset of field: ", - stringify!(pfioc_rule), - "::", - stringify!(ticket) + "Offset of field: ", + stringify!(pfioc_rule), + "::", + stringify!(ticket) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pool_ticket) as usize - ptr as usize }, 8usize, concat!( - "Offset of field: ", - stringify!(pfioc_rule), - "::", - stringify!(pool_ticket) + "Offset of field: ", + stringify!(pfioc_rule), + "::", + stringify!(pool_ticket) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nr) as usize - ptr as usize }, 12usize, concat!( - "Offset of field: ", - stringify!(pfioc_rule), - "::", - stringify!(nr) + "Offset of field: ", + stringify!(pfioc_rule), + "::", + stringify!(nr) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).anchor) as usize - ptr as usize }, 16usize, concat!( - "Offset of field: ", - stringify!(pfioc_rule), - "::", - stringify!(anchor) + "Offset of field: ", + stringify!(pfioc_rule), + "::", + stringify!(anchor) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).anchor_call) as usize - ptr as usize }, 1040usize, concat!( - "Offset of field: ", - stringify!(pfioc_rule), - "::", - stringify!(anchor_call) + "Offset of field: ", + stringify!(pfioc_rule), + "::", + stringify!(anchor_call) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rule) as usize - ptr as usize }, 2064usize, concat!( - "Offset of field: ", - stringify!(pfioc_rule), - "::", - stringify!(rule) + "Offset of field: ", + stringify!(pfioc_rule), + "::", + stringify!(rule) ) ); } @@ -3992,40 +3992,40 @@ fn bindgen_test_layout_pfioc_state_addr_kill() { unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pfioc_state_addr_kill), - "::", - stringify!(addr) + "Offset of field: ", + stringify!(pfioc_state_addr_kill), + "::", + stringify!(addr) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_) as usize - ptr as usize }, 48usize, concat!( - "Offset of field: ", - stringify!(pfioc_state_addr_kill), - "::", - stringify!(reserved_) + "Offset of field: ", + stringify!(pfioc_state_addr_kill), + "::", + stringify!(reserved_) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).neg) as usize - ptr as usize }, 51usize, concat!( - "Offset of field: ", - stringify!(pfioc_state_addr_kill), - "::", - stringify!(neg) + "Offset of field: ", + stringify!(pfioc_state_addr_kill), + "::", + stringify!(neg) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).xport) as usize - ptr as usize }, 52usize, concat!( - "Offset of field: ", - stringify!(pfioc_state_addr_kill), - "::", - stringify!(xport) + "Offset of field: ", + stringify!(pfioc_state_addr_kill), + "::", + stringify!(xport) ) ); } @@ -4059,80 +4059,80 @@ fn bindgen_test_layout_pfioc_state_kill() { unsafe { ::std::ptr::addr_of!((*ptr).psk_af) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pfioc_state_kill), - "::", - stringify!(psk_af) + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_af) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).psk_proto) as usize - ptr as usize }, 1usize, concat!( - "Offset of field: ", - stringify!(pfioc_state_kill), - "::", - stringify!(psk_proto) + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_proto) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).psk_proto_variant) as usize - ptr as usize }, 2usize, concat!( - "Offset of field: ", - stringify!(pfioc_state_kill), - "::", - stringify!(psk_proto_variant) + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_proto_variant) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr)._pad) as usize - ptr as usize }, 3usize, concat!( - "Offset of field: ", - stringify!(pfioc_state_kill), - "::", - stringify!(_pad) + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(_pad) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).psk_src) as usize - ptr as usize }, 8usize, concat!( - "Offset of field: ", - stringify!(pfioc_state_kill), - "::", - stringify!(psk_src) + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_src) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).psk_dst) as usize - ptr as usize }, 72usize, concat!( - "Offset of field: ", - stringify!(pfioc_state_kill), - "::", - stringify!(psk_dst) + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_dst) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).psk_ifname) as usize - ptr as usize }, 136usize, concat!( - "Offset of field: ", - stringify!(pfioc_state_kill), - "::", - stringify!(psk_ifname) + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_ifname) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).psk_ownername) as usize - ptr as usize }, 152usize, concat!( - "Offset of field: ", - stringify!(pfioc_state_kill), - "::", - stringify!(psk_ownername) + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_ownername) ) ); } @@ -4167,20 +4167,20 @@ fn bindgen_test_layout_pfioc_states__bindgen_ty_1() { unsafe { ::std::ptr::addr_of!((*ptr).psu_buf) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pfioc_states__bindgen_ty_1), - "::", - stringify!(psu_buf) + "Offset of field: ", + stringify!(pfioc_states__bindgen_ty_1), + "::", + stringify!(psu_buf) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).psu_states) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pfioc_states__bindgen_ty_1), - "::", - stringify!(psu_states) + "Offset of field: ", + stringify!(pfioc_states__bindgen_ty_1), + "::", + stringify!(psu_states) ) ); } @@ -4202,20 +4202,20 @@ fn bindgen_test_layout_pfioc_states() { unsafe { ::std::ptr::addr_of!((*ptr).ps_len) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pfioc_states), - "::", - stringify!(ps_len) + "Offset of field: ", + stringify!(pfioc_states), + "::", + stringify!(ps_len) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ps_u) as usize - ptr as usize }, 8usize, concat!( - "Offset of field: ", - stringify!(pfioc_states), - "::", - stringify!(ps_u) + "Offset of field: ", + stringify!(pfioc_states), + "::", + stringify!(ps_u) ) ); } @@ -4252,30 +4252,30 @@ fn bindgen_test_layout_pfioc_trans_pfioc_trans_e() { unsafe { ::std::ptr::addr_of!((*ptr).rs_num) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pfioc_trans_pfioc_trans_e), - "::", - stringify!(rs_num) + "Offset of field: ", + stringify!(pfioc_trans_pfioc_trans_e), + "::", + stringify!(rs_num) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).anchor) as usize - ptr as usize }, 4usize, concat!( - "Offset of field: ", - stringify!(pfioc_trans_pfioc_trans_e), - "::", - stringify!(anchor) + "Offset of field: ", + stringify!(pfioc_trans_pfioc_trans_e), + "::", + stringify!(anchor) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ticket) as usize - ptr as usize }, 1028usize, concat!( - "Offset of field: ", - stringify!(pfioc_trans_pfioc_trans_e), - "::", - stringify!(ticket) + "Offset of field: ", + stringify!(pfioc_trans_pfioc_trans_e), + "::", + stringify!(ticket) ) ); } @@ -4297,30 +4297,30 @@ fn bindgen_test_layout_pfioc_trans() { unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, concat!( - "Offset of field: ", - stringify!(pfioc_trans), - "::", - stringify!(size) + "Offset of field: ", + stringify!(pfioc_trans), + "::", + stringify!(size) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).esize) as usize - ptr as usize }, 4usize, concat!( - "Offset of field: ", - stringify!(pfioc_trans), - "::", - stringify!(esize) + "Offset of field: ", + stringify!(pfioc_trans), + "::", + stringify!(esize) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).array) as usize - ptr as usize }, 8usize, concat!( - "Offset of field: ", - stringify!(pfioc_trans), - "::", - stringify!(array) + "Offset of field: ", + stringify!(pfioc_trans), + "::", + stringify!(array) ) ); } diff --git a/src/ffi/pfvar/openbsd.rs b/src/ffi/pfvar/openbsd.rs new file mode 100644 index 0000000..9f0fbd0 --- /dev/null +++ b/src/ffi/pfvar/openbsd.rs @@ -0,0 +1,5404 @@ +/* automatically generated by rust-bindgen 0.69.4 */ + +pub const PF_UNSPEC: u32 = 0; +pub const PF_LOCAL: u32 = 1; +pub const PF_UNIX: u32 = 1; +pub const PF_INET: u32 = 2; +pub const PF_IMPLINK: u32 = 3; +pub const PF_PUP: u32 = 4; +pub const PF_CHAOS: u32 = 5; +pub const PF_NS: u32 = 6; +pub const PF_ISO: u32 = 7; +pub const PF_OSI: u32 = 7; +pub const PF_ECMA: u32 = 8; +pub const PF_DATAKIT: u32 = 9; +pub const PF_CCITT: u32 = 10; +pub const PF_SNA: u32 = 11; +pub const PF_DECnet: u32 = 12; +pub const PF_DLI: u32 = 13; +pub const PF_LAT: u32 = 14; +pub const PF_HYLINK: u32 = 15; +pub const PF_APPLETALK: u32 = 16; +pub const PF_ROUTE: u32 = 17; +pub const PF_LINK: u32 = 18; +pub const PF_XTP: u32 = 19; +pub const PF_COIP: u32 = 20; +pub const PF_CNT: u32 = 21; +pub const PF_IPX: u32 = 23; +pub const PF_INET6: u32 = 24; +pub const PF_RTIP: u32 = 22; +pub const PF_PIP: u32 = 25; +pub const PF_ISDN: u32 = 26; +pub const PF_NATM: u32 = 27; +pub const PF_ENCAP: u32 = 28; +pub const PF_SIP: u32 = 29; +pub const PF_KEY: u32 = 30; +pub const PF_BPF: u32 = 31; +pub const PF_BLUETOOTH: u32 = 32; +pub const PF_MPLS: u32 = 33; +pub const PF_PFLOW: u32 = 34; +pub const PF_PIPEX: u32 = 35; +pub const PF_MAX: u32 = 36; +pub const PF_MD5_DIGEST_LENGTH: u32 = 16; +pub const PF_FRAG_STALE: u32 = 200; +pub const PF_FRAG_ENTRY_POINTS: u32 = 16; +pub const PF_FRAG_ENTRY_LIMIT: u32 = 64; +pub const PF_POOL_IDMASK: u32 = 15; +pub const PF_POOL_TYPEMASK: u32 = 15; +pub const PF_POOL_STICKYADDR: u32 = 32; +pub const PF_WSCALE_FLAG: u32 = 128; +pub const PF_WSCALE_MASK: u32 = 15; +pub const PF_LOG: u32 = 1; +pub const PF_LOG_ALL: u32 = 2; +pub const PF_LOG_USER: u32 = 4; +pub const PF_LOG_FORCE: u32 = 8; +pub const PF_LOG_MATCHES: u32 = 16; +pub const PF_TABLE_NAME_SIZE: u32 = 32; +pub const PF_DEBUGNAME: &[u8; 5] = b"pf: \0"; +pub const PF_THRESHOLD_MULT: u32 = 1000; +pub const PF_THRESHOLD_MAX: u32 = 4294967; +pub const PF_OSFP_EXPANDED: u32 = 1; +pub const PF_OSFP_GENERIC: u32 = 2; +pub const PF_OSFP_NODETAIL: u32 = 4; +pub const PF_OSFP_LEN: u32 = 32; +pub const PF_OSFP_WSIZE_MOD: u32 = 1; +pub const PF_OSFP_WSIZE_DC: u32 = 2; +pub const PF_OSFP_WSIZE_MSS: u32 = 4; +pub const PF_OSFP_WSIZE_MTU: u32 = 8; +pub const PF_OSFP_PSIZE_MOD: u32 = 16; +pub const PF_OSFP_PSIZE_DC: u32 = 32; +pub const PF_OSFP_WSCALE: u32 = 64; +pub const PF_OSFP_WSCALE_MOD: u32 = 128; +pub const PF_OSFP_WSCALE_DC: u32 = 256; +pub const PF_OSFP_MSS: u32 = 512; +pub const PF_OSFP_MSS_MOD: u32 = 1024; +pub const PF_OSFP_MSS_DC: u32 = 2048; +pub const PF_OSFP_DF: u32 = 4096; +pub const PF_OSFP_TS0: u32 = 8192; +pub const PF_OSFP_INET6: u32 = 16384; +pub const PF_OSFP_MAXTTL_OFFSET: u32 = 40; +pub const PF_OSFP_TCPOPT_NOP: u32 = 0; +pub const PF_OSFP_TCPOPT_WSCALE: u32 = 1; +pub const PF_OSFP_TCPOPT_MSS: u32 = 2; +pub const PF_OSFP_TCPOPT_SACK: u32 = 3; +pub const PF_OSFP_TCPOPT_TS: u32 = 4; +pub const PF_OSFP_TCPOPT_BITS: u32 = 3; +pub const PF_ANCHOR_STACK_MAX: u32 = 64; +pub const PF_ANCHOR_NAME_SIZE: u32 = 64; +pub const PF_ANCHOR_MAXPATH: u32 = 959; +pub const PF_ANCHOR_HIWAT: u32 = 512; +pub const PF_OPTIMIZER_TABLE_PFX: &[u8; 13] = b"__automatic_\0"; +pub const PF_SKIP_IFP: u32 = 0; +pub const PF_SKIP_DIR: u32 = 1; +pub const PF_SKIP_RDOM: u32 = 2; +pub const PF_SKIP_AF: u32 = 3; +pub const PF_SKIP_PROTO: u32 = 4; +pub const PF_SKIP_SRC_ADDR: u32 = 5; +pub const PF_SKIP_DST_ADDR: u32 = 6; +pub const PF_SKIP_SRC_PORT: u32 = 7; +pub const PF_SKIP_DST_PORT: u32 = 8; +pub const PF_SKIP_COUNT: u32 = 9; +pub const PF_RULE_LABEL_SIZE: u32 = 64; +pub const PF_QNAME_SIZE: u32 = 64; +pub const PF_TAG_NAME_SIZE: u32 = 64; +pub const PF_STATE_NORMAL: u32 = 1; +pub const PF_STATE_MODULATE: u32 = 2; +pub const PF_STATE_SYNPROXY: u32 = 3; +pub const PF_FLUSH: u32 = 1; +pub const PF_FLUSH_GLOBAL: u32 = 2; +pub const PFRULE_DROP: u32 = 0; +pub const PFRULE_RETURNRST: u32 = 1; +pub const PFRULE_FRAGMENT: u32 = 2; +pub const PFRULE_RETURNICMP: u32 = 4; +pub const PFRULE_RETURN: u32 = 8; +pub const PFRULE_NOSYNC: u32 = 16; +pub const PFRULE_SRCTRACK: u32 = 32; +pub const PFRULE_RULESRCTRACK: u32 = 64; +pub const PFRULE_SETDELAY: u32 = 128; +pub const PFRULE_IFBOUND: u32 = 65536; +pub const PFRULE_STATESLOPPY: u32 = 131072; +pub const PFRULE_PFLOW: u32 = 262144; +pub const PFRULE_ONCE: u32 = 1048576; +pub const PFRULE_AFTO: u32 = 2097152; +pub const PFRULE_EXPIRED: u32 = 4194304; +pub const PF_PKTDELAY_MAXPKTS: u32 = 10000; +pub const PF_RESERVED_ANCHOR: &[u8; 4] = b"_pf\0"; +pub const PF_DPORT_RANGE: u32 = 1; +pub const PF_RPORT_RANGE: u32 = 2; +pub const PF_REASS_ENABLED: u32 = 1; +pub const PF_REASS_NODF: u32 = 2; +pub const PF_SYNCOOKIES_NEVER: u32 = 0; +pub const PF_SYNCOOKIES_ALWAYS: u32 = 1; +pub const PF_SYNCOOKIES_ADAPTIVE: u32 = 2; +pub const PF_SYNCOOKIES_MODE_MAX: u32 = 2; +pub const PF_SYNCOOKIES_HIWATPCT: u32 = 25; +pub const PF_SYNCOOKIES_LOWATPCT: u32 = 12; +pub const PF_PRIO_ZERO: u32 = 255; +pub type __uint8_t = ::std::os::raw::c_uchar; +pub type __uint16_t = ::std::os::raw::c_ushort; +pub type __int32_t = ::std::os::raw::c_int; +pub type __uint32_t = ::std::os::raw::c_uint; +pub type __int64_t = ::std::os::raw::c_longlong; +pub type __uint64_t = ::std::os::raw::c_ulonglong; +pub type __in_addr_t = __uint32_t; +pub type __pid_t = __int32_t; +pub type __sa_family_t = __uint8_t; +pub type __time_t = __int64_t; +pub type __uid_t = __uint32_t; +pub type u_char = ::std::os::raw::c_uchar; +pub type u_int = ::std::os::raw::c_uint; +pub type u_int8_t = __uint8_t; +pub type u_int16_t = __uint16_t; +pub type u_int32_t = __uint32_t; +pub type u_int64_t = __uint64_t; +pub type caddr_t = *mut ::std::os::raw::c_char; +pub type uid_t = __uid_t; +pub type pid_t = __pid_t; +pub type time_t = __time_t; +pub type sa_family_t = __sa_family_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct refcnt { + pub r_refs: ::std::os::raw::c_uint, + pub r_traceidx: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_refcnt() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(refcnt)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(refcnt)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).r_refs) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(refcnt), + "::", + stringify!(r_refs) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).r_traceidx) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(refcnt), + "::", + stringify!(r_traceidx) + ) + ); +} +pub type in_addr_t = __in_addr_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct in_addr { + pub s_addr: in_addr_t, +} +#[test] +fn bindgen_test_layout_in_addr() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(in_addr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(in_addr)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).s_addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(in_addr), + "::", + stringify!(s_addr) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct in6_addr { + pub __u6_addr: in6_addr__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union in6_addr__bindgen_ty_1 { + pub __u6_addr8: [u_int8_t; 16usize], + pub __u6_addr16: [u_int16_t; 8usize], + pub __u6_addr32: [u_int32_t; 4usize], +} +#[test] +fn bindgen_test_layout_in6_addr__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(in6_addr__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(in6_addr__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__u6_addr8) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(in6_addr__bindgen_ty_1), + "::", + stringify!(__u6_addr8) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__u6_addr16) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(in6_addr__bindgen_ty_1), + "::", + stringify!(__u6_addr16) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__u6_addr32) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(in6_addr__bindgen_ty_1), + "::", + stringify!(__u6_addr32) + ) + ); +} +#[test] +fn bindgen_test_layout_in6_addr() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(in6_addr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(in6_addr)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__u6_addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(in6_addr), + "::", + stringify!(__u6_addr) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct radix_node { + pub rn_mklist: *mut radix_mask, + pub rn_p: *mut radix_node, + pub rn_b: ::std::os::raw::c_short, + pub rn_bmask: ::std::os::raw::c_char, + pub rn_flags: u_char, + pub rn_u: radix_node__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union radix_node__bindgen_ty_1 { + pub rn_leaf: radix_node__bindgen_ty_1__bindgen_ty_1, + pub rn_node: radix_node__bindgen_ty_1__bindgen_ty_2, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct radix_node__bindgen_ty_1__bindgen_ty_1 { + pub rn_Key: caddr_t, + pub rn_Mask: caddr_t, + pub rn_Dupedkey: *mut radix_node, +} +#[test] +fn bindgen_test_layout_radix_node__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!( + "Size of: ", + stringify!(radix_node__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(radix_node__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rn_Key) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(radix_node__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(rn_Key) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rn_Mask) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(radix_node__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(rn_Mask) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rn_Dupedkey) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(radix_node__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(rn_Dupedkey) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct radix_node__bindgen_ty_1__bindgen_ty_2 { + pub rn_Off: ::std::os::raw::c_int, + pub rn_L: *mut radix_node, + pub rn_R: *mut radix_node, +} +#[test] +fn bindgen_test_layout_radix_node__bindgen_ty_1__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!( + "Size of: ", + stringify!(radix_node__bindgen_ty_1__bindgen_ty_2) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(radix_node__bindgen_ty_1__bindgen_ty_2) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rn_Off) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(radix_node__bindgen_ty_1__bindgen_ty_2), + "::", + stringify!(rn_Off) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rn_L) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(radix_node__bindgen_ty_1__bindgen_ty_2), + "::", + stringify!(rn_L) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rn_R) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(radix_node__bindgen_ty_1__bindgen_ty_2), + "::", + stringify!(rn_R) + ) + ); +} +#[test] +fn bindgen_test_layout_radix_node__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(radix_node__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(radix_node__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rn_leaf) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(radix_node__bindgen_ty_1), + "::", + stringify!(rn_leaf) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rn_node) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(radix_node__bindgen_ty_1), + "::", + stringify!(rn_node) + ) + ); +} +#[test] +fn bindgen_test_layout_radix_node() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(radix_node)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(radix_node)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rn_mklist) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(radix_node), + "::", + stringify!(rn_mklist) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rn_p) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(radix_node), + "::", + stringify!(rn_p) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rn_b) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(radix_node), + "::", + stringify!(rn_b) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rn_bmask) as usize - ptr as usize }, + 18usize, + concat!( + "Offset of field: ", + stringify!(radix_node), + "::", + stringify!(rn_bmask) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rn_flags) as usize - ptr as usize }, + 19usize, + concat!( + "Offset of field: ", + stringify!(radix_node), + "::", + stringify!(rn_flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rn_u) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(radix_node), + "::", + stringify!(rn_u) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct radix_mask { + pub rm_b: ::std::os::raw::c_short, + pub rm_unused: ::std::os::raw::c_char, + pub rm_flags: u_char, + pub rm_mklist: *mut radix_mask, + pub rm_rmu: radix_mask__bindgen_ty_1, + pub rm_refs: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union radix_mask__bindgen_ty_1 { + pub rmu_mask: caddr_t, + pub rmu_leaf: *mut radix_node, +} +#[test] +fn bindgen_test_layout_radix_mask__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(radix_mask__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(radix_mask__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rmu_mask) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(radix_mask__bindgen_ty_1), + "::", + stringify!(rmu_mask) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rmu_leaf) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(radix_mask__bindgen_ty_1), + "::", + stringify!(rmu_leaf) + ) + ); +} +#[test] +fn bindgen_test_layout_radix_mask() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(radix_mask)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(radix_mask)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rm_b) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(radix_mask), + "::", + stringify!(rm_b) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rm_unused) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(radix_mask), + "::", + stringify!(rm_unused) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rm_flags) as usize - ptr as usize }, + 3usize, + concat!( + "Offset of field: ", + stringify!(radix_mask), + "::", + stringify!(rm_flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rm_mklist) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(radix_mask), + "::", + stringify!(rm_mklist) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rm_rmu) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(radix_mask), + "::", + stringify!(rm_rmu) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rm_refs) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(radix_mask), + "::", + stringify!(rm_refs) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct radix_node_head { + pub rnh_treetop: *mut radix_node, + pub rnh_addrsize: ::std::os::raw::c_int, + pub rnh_pktsize: ::std::os::raw::c_int, + pub rnh_nodes: [radix_node; 3usize], + pub rnh_rtableid: u_int, +} +#[test] +fn bindgen_test_layout_radix_node_head() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 168usize, + concat!("Size of: ", stringify!(radix_node_head)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(radix_node_head)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rnh_treetop) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(radix_node_head), + "::", + stringify!(rnh_treetop) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rnh_addrsize) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(radix_node_head), + "::", + stringify!(rnh_addrsize) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rnh_pktsize) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(radix_node_head), + "::", + stringify!(rnh_pktsize) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rnh_nodes) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(radix_node_head), + "::", + stringify!(rnh_nodes) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rnh_rtableid) as usize - ptr as usize }, + 160usize, + concat!( + "Offset of field: ", + stringify!(radix_node_head), + "::", + stringify!(rnh_rtableid) + ) + ); +} +pub const PF_INOUT: _bindgen_ty_1 = _bindgen_ty_1::PF_INOUT; +pub const PF_IN: _bindgen_ty_1 = _bindgen_ty_1::PF_IN; +pub const PF_OUT: _bindgen_ty_1 = _bindgen_ty_1::PF_OUT; +pub const PF_FWD: _bindgen_ty_1 = _bindgen_ty_1::PF_FWD; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_1 { + PF_INOUT = 0, + PF_IN = 1, + PF_OUT = 2, + PF_FWD = 3, +} +pub const PF_PASS: _bindgen_ty_2 = _bindgen_ty_2::PF_PASS; +pub const PF_DROP: _bindgen_ty_2 = _bindgen_ty_2::PF_DROP; +pub const PF_SCRUB: _bindgen_ty_2 = _bindgen_ty_2::PF_SCRUB; +pub const PF_NOSCRUB: _bindgen_ty_2 = _bindgen_ty_2::PF_NOSCRUB; +pub const PF_NAT: _bindgen_ty_2 = _bindgen_ty_2::PF_NAT; +pub const PF_NONAT: _bindgen_ty_2 = _bindgen_ty_2::PF_NONAT; +pub const PF_BINAT: _bindgen_ty_2 = _bindgen_ty_2::PF_BINAT; +pub const PF_NOBINAT: _bindgen_ty_2 = _bindgen_ty_2::PF_NOBINAT; +pub const PF_RDR: _bindgen_ty_2 = _bindgen_ty_2::PF_RDR; +pub const PF_NORDR: _bindgen_ty_2 = _bindgen_ty_2::PF_NORDR; +pub const PF_SYNPROXY_DROP: _bindgen_ty_2 = _bindgen_ty_2::PF_SYNPROXY_DROP; +pub const PF_DEFER: _bindgen_ty_2 = _bindgen_ty_2::PF_DEFER; +pub const PF_MATCH: _bindgen_ty_2 = _bindgen_ty_2::PF_MATCH; +pub const PF_DIVERT: _bindgen_ty_2 = _bindgen_ty_2::PF_DIVERT; +pub const PF_RT: _bindgen_ty_2 = _bindgen_ty_2::PF_RT; +pub const PF_AFRT: _bindgen_ty_2 = _bindgen_ty_2::PF_AFRT; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_2 { + PF_PASS = 0, + PF_DROP = 1, + PF_SCRUB = 2, + PF_NOSCRUB = 3, + PF_NAT = 4, + PF_NONAT = 5, + PF_BINAT = 6, + PF_NOBINAT = 7, + PF_RDR = 8, + PF_NORDR = 9, + PF_SYNPROXY_DROP = 10, + PF_DEFER = 11, + PF_MATCH = 12, + PF_DIVERT = 13, + PF_RT = 14, + PF_AFRT = 15, +} +pub const PF_TRANS_RULESET: _bindgen_ty_3 = _bindgen_ty_3::PF_TRANS_RULESET; +pub const PF_TRANS_TABLE: _bindgen_ty_3 = _bindgen_ty_3::PF_TRANS_TABLE; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_3 { + PF_TRANS_RULESET = 0, + PF_TRANS_TABLE = 1, +} +pub const PF_OP_NONE: _bindgen_ty_4 = _bindgen_ty_4::PF_OP_NONE; +pub const PF_OP_IRG: _bindgen_ty_4 = _bindgen_ty_4::PF_OP_IRG; +pub const PF_OP_EQ: _bindgen_ty_4 = _bindgen_ty_4::PF_OP_EQ; +pub const PF_OP_NE: _bindgen_ty_4 = _bindgen_ty_4::PF_OP_NE; +pub const PF_OP_LT: _bindgen_ty_4 = _bindgen_ty_4::PF_OP_LT; +pub const PF_OP_LE: _bindgen_ty_4 = _bindgen_ty_4::PF_OP_LE; +pub const PF_OP_GT: _bindgen_ty_4 = _bindgen_ty_4::PF_OP_GT; +pub const PF_OP_GE: _bindgen_ty_4 = _bindgen_ty_4::PF_OP_GE; +pub const PF_OP_XRG: _bindgen_ty_4 = _bindgen_ty_4::PF_OP_XRG; +pub const PF_OP_RRG: _bindgen_ty_4 = _bindgen_ty_4::PF_OP_RRG; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_4 { + PF_OP_NONE = 0, + PF_OP_IRG = 1, + PF_OP_EQ = 2, + PF_OP_NE = 3, + PF_OP_LT = 4, + PF_OP_LE = 5, + PF_OP_GT = 6, + PF_OP_GE = 7, + PF_OP_XRG = 8, + PF_OP_RRG = 9, +} +pub const PF_CHANGE_NONE: _bindgen_ty_5 = _bindgen_ty_5::PF_CHANGE_NONE; +pub const PF_CHANGE_ADD_HEAD: _bindgen_ty_5 = _bindgen_ty_5::PF_CHANGE_ADD_HEAD; +pub const PF_CHANGE_ADD_TAIL: _bindgen_ty_5 = _bindgen_ty_5::PF_CHANGE_ADD_TAIL; +pub const PF_CHANGE_ADD_BEFORE: _bindgen_ty_5 = _bindgen_ty_5::PF_CHANGE_ADD_BEFORE; +pub const PF_CHANGE_ADD_AFTER: _bindgen_ty_5 = _bindgen_ty_5::PF_CHANGE_ADD_AFTER; +pub const PF_CHANGE_REMOVE: _bindgen_ty_5 = _bindgen_ty_5::PF_CHANGE_REMOVE; +pub const PF_CHANGE_GET_TICKET: _bindgen_ty_5 = _bindgen_ty_5::PF_CHANGE_GET_TICKET; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_5 { + PF_CHANGE_NONE = 0, + PF_CHANGE_ADD_HEAD = 1, + PF_CHANGE_ADD_TAIL = 2, + PF_CHANGE_ADD_BEFORE = 3, + PF_CHANGE_ADD_AFTER = 4, + PF_CHANGE_REMOVE = 5, + PF_CHANGE_GET_TICKET = 6, +} +pub const PF_GET_NONE: _bindgen_ty_6 = _bindgen_ty_6::PF_GET_NONE; +pub const PF_GET_CLR_CNTR: _bindgen_ty_6 = _bindgen_ty_6::PF_GET_CLR_CNTR; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_6 { + PF_GET_NONE = 0, + PF_GET_CLR_CNTR = 1, +} +pub const PF_SK_WIRE: _bindgen_ty_7 = _bindgen_ty_7::PF_SK_WIRE; +pub const PF_SK_STACK: _bindgen_ty_7 = _bindgen_ty_7::PF_SK_STACK; +pub const PF_SK_BOTH: _bindgen_ty_7 = _bindgen_ty_7::PF_SK_BOTH; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_7 { + PF_SK_WIRE = 0, + PF_SK_STACK = 1, + PF_SK_BOTH = 2, +} +pub const PF_PEER_SRC: _bindgen_ty_8 = _bindgen_ty_8::PF_PEER_SRC; +pub const PF_PEER_DST: _bindgen_ty_8 = _bindgen_ty_8::PF_PEER_DST; +pub const PF_PEER_BOTH: _bindgen_ty_8 = _bindgen_ty_8::PF_PEER_BOTH; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_8 { + PF_PEER_SRC = 0, + PF_PEER_DST = 1, + PF_PEER_BOTH = 2, +} +pub const PF_NOPFROUTE: _bindgen_ty_10 = _bindgen_ty_10::PF_NOPFROUTE; +pub const PF_ROUTETO: _bindgen_ty_10 = _bindgen_ty_10::PF_ROUTETO; +pub const PF_DUPTO: _bindgen_ty_10 = _bindgen_ty_10::PF_DUPTO; +pub const PF_REPLYTO: _bindgen_ty_10 = _bindgen_ty_10::PF_REPLYTO; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_10 { + PF_NOPFROUTE = 0, + PF_ROUTETO = 1, + PF_DUPTO = 2, + PF_REPLYTO = 3, +} +pub const PF_LIMIT_STATES: _bindgen_ty_11 = _bindgen_ty_11::PF_LIMIT_STATES; +pub const PF_LIMIT_SRC_NODES: _bindgen_ty_11 = _bindgen_ty_11::PF_LIMIT_SRC_NODES; +pub const PF_LIMIT_FRAGS: _bindgen_ty_11 = _bindgen_ty_11::PF_LIMIT_FRAGS; +pub const PF_LIMIT_TABLES: _bindgen_ty_11 = _bindgen_ty_11::PF_LIMIT_TABLES; +pub const PF_LIMIT_TABLE_ENTRIES: _bindgen_ty_11 = _bindgen_ty_11::PF_LIMIT_TABLE_ENTRIES; +pub const PF_LIMIT_PKTDELAY_PKTS: _bindgen_ty_11 = _bindgen_ty_11::PF_LIMIT_PKTDELAY_PKTS; +pub const PF_LIMIT_ANCHORS: _bindgen_ty_11 = _bindgen_ty_11::PF_LIMIT_ANCHORS; +pub const PF_LIMIT_MAX: _bindgen_ty_11 = _bindgen_ty_11::PF_LIMIT_MAX; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_11 { + PF_LIMIT_STATES = 0, + PF_LIMIT_SRC_NODES = 1, + PF_LIMIT_FRAGS = 2, + PF_LIMIT_TABLES = 3, + PF_LIMIT_TABLE_ENTRIES = 4, + PF_LIMIT_PKTDELAY_PKTS = 5, + PF_LIMIT_ANCHORS = 6, + PF_LIMIT_MAX = 7, +} +pub const PF_POOL_NONE: _bindgen_ty_12 = _bindgen_ty_12::PF_POOL_NONE; +pub const PF_POOL_BITMASK: _bindgen_ty_12 = _bindgen_ty_12::PF_POOL_BITMASK; +pub const PF_POOL_RANDOM: _bindgen_ty_12 = _bindgen_ty_12::PF_POOL_RANDOM; +pub const PF_POOL_SRCHASH: _bindgen_ty_12 = _bindgen_ty_12::PF_POOL_SRCHASH; +pub const PF_POOL_ROUNDROBIN: _bindgen_ty_12 = _bindgen_ty_12::PF_POOL_ROUNDROBIN; +pub const PF_POOL_LEASTSTATES: _bindgen_ty_12 = _bindgen_ty_12::PF_POOL_LEASTSTATES; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_12 { + PF_POOL_NONE = 0, + PF_POOL_BITMASK = 1, + PF_POOL_RANDOM = 2, + PF_POOL_SRCHASH = 3, + PF_POOL_ROUNDROBIN = 4, + PF_POOL_LEASTSTATES = 5, +} +pub const PF_ADDR_ADDRMASK: _bindgen_ty_13 = _bindgen_ty_13::PF_ADDR_ADDRMASK; +pub const PF_ADDR_NOROUTE: _bindgen_ty_13 = _bindgen_ty_13::PF_ADDR_NOROUTE; +pub const PF_ADDR_DYNIFTL: _bindgen_ty_13 = _bindgen_ty_13::PF_ADDR_DYNIFTL; +pub const PF_ADDR_TABLE: _bindgen_ty_13 = _bindgen_ty_13::PF_ADDR_TABLE; +pub const PF_ADDR_RTLABEL: _bindgen_ty_13 = _bindgen_ty_13::PF_ADDR_RTLABEL; +pub const PF_ADDR_URPFFAILED: _bindgen_ty_13 = _bindgen_ty_13::PF_ADDR_URPFFAILED; +pub const PF_ADDR_RANGE: _bindgen_ty_13 = _bindgen_ty_13::PF_ADDR_RANGE; +pub const PF_ADDR_NONE: _bindgen_ty_13 = _bindgen_ty_13::PF_ADDR_NONE; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_13 { + PF_ADDR_ADDRMASK = 0, + PF_ADDR_NOROUTE = 1, + PF_ADDR_DYNIFTL = 2, + PF_ADDR_TABLE = 3, + PF_ADDR_RTLABEL = 4, + PF_ADDR_URPFFAILED = 5, + PF_ADDR_RANGE = 6, + PF_ADDR_NONE = 7, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_addr { + pub pfa: pf_addr__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pf_addr__bindgen_ty_1 { + pub v4: in_addr, + pub v6: in6_addr, + pub addr8: [u_int8_t; 16usize], + pub addr16: [u_int16_t; 8usize], + pub addr32: [u_int32_t; 4usize], +} +#[test] +fn bindgen_test_layout_pf_addr__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_addr__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_addr__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).v4) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr__bindgen_ty_1), + "::", + stringify!(v4) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).v6) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr__bindgen_ty_1), + "::", + stringify!(v6) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).addr8) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr__bindgen_ty_1), + "::", + stringify!(addr8) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).addr16) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr__bindgen_ty_1), + "::", + stringify!(addr16) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).addr32) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr__bindgen_ty_1), + "::", + stringify!(addr32) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_addr() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_addr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_addr)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfa) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr), + "::", + stringify!(pfa) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_addr_wrap { + pub v: pf_addr_wrap__bindgen_ty_1, + pub p: pf_addr_wrap__bindgen_ty_2, + pub type_: u_int8_t, + pub iflags: u_int8_t, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pf_addr_wrap__bindgen_ty_1 { + pub a: pf_addr_wrap__bindgen_ty_1__bindgen_ty_1, + pub ifname: [::std::os::raw::c_char; 16usize], + pub tblname: [::std::os::raw::c_char; 32usize], + pub rtlabelname: [::std::os::raw::c_char; 32usize], + pub rtlabel: u_int32_t, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_addr_wrap__bindgen_ty_1__bindgen_ty_1 { + pub addr: pf_addr, + pub mask: pf_addr, +} +#[test] +fn bindgen_test_layout_pf_addr_wrap__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!( + "Size of: ", + stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!( + "Alignment of ", + stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).mask) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(mask) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_addr_wrap__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(pf_addr_wrap__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_addr_wrap__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_1), + "::", + stringify!(a) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_1), + "::", + stringify!(ifname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tblname) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_1), + "::", + stringify!(tblname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtlabelname) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_1), + "::", + stringify!(rtlabelname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtlabel) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_1), + "::", + stringify!(rtlabel) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pf_addr_wrap__bindgen_ty_2 { + pub dyn_: *mut pfi_dynaddr, + pub tbl: *mut pfr_ktable, + pub dyncnt: ::std::os::raw::c_int, + pub tblcnt: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_pf_addr_wrap__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(pf_addr_wrap__bindgen_ty_2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_addr_wrap__bindgen_ty_2)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).dyn_) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_2), + "::", + stringify!(dyn_) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tbl) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_2), + "::", + stringify!(tbl) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).dyncnt) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_2), + "::", + stringify!(dyncnt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tblcnt) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap__bindgen_ty_2), + "::", + stringify!(tblcnt) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_addr_wrap() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(pf_addr_wrap)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_addr_wrap)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).v) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap), + "::", + stringify!(v) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).p) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap), + "::", + stringify!(p) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).iflags) as usize - ptr as usize }, + 41usize, + concat!( + "Offset of field: ", + stringify!(pf_addr_wrap), + "::", + stringify!(iflags) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_rule_uid { + pub uid: [uid_t; 2usize], + pub op: u_int8_t, +} +#[test] +fn bindgen_test_layout_pf_rule_uid() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(pf_rule_uid)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_rule_uid)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).uid) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_uid), + "::", + stringify!(uid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).op) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_uid), + "::", + stringify!(op) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_rule_gid { + pub gid: [uid_t; 2usize], + pub op: u_int8_t, +} +#[test] +fn bindgen_test_layout_pf_rule_gid() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(pf_rule_gid)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_rule_gid)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).gid) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_gid), + "::", + stringify!(gid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).op) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_gid), + "::", + stringify!(op) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_rule_addr { + pub addr: pf_addr_wrap, + pub port: [u_int16_t; 2usize], + pub neg: u_int8_t, + pub port_op: u_int8_t, + pub weight: u_int16_t, +} +#[test] +fn bindgen_test_layout_pf_rule_addr() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(pf_rule_addr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_rule_addr)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_addr), + "::", + stringify!(addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).port) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_addr), + "::", + stringify!(port) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).neg) as usize - ptr as usize }, + 52usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_addr), + "::", + stringify!(neg) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).port_op) as usize - ptr as usize }, + 53usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_addr), + "::", + stringify!(port_op) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).weight) as usize - ptr as usize }, + 54usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_addr), + "::", + stringify!(weight) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_threshold { + pub limit: u_int32_t, + pub seconds: u_int32_t, + pub count: u_int32_t, + pub last: u_int32_t, +} +#[test] +fn bindgen_test_layout_pf_threshold() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_threshold)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_threshold)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).limit) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_threshold), + "::", + stringify!(limit) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).seconds) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(pf_threshold), + "::", + stringify!(seconds) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_threshold), + "::", + stringify!(count) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).last) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(pf_threshold), + "::", + stringify!(last) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_poolhashkey { + pub pfk: pf_poolhashkey__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pf_poolhashkey__bindgen_ty_1 { + pub key8: [u_int8_t; 16usize], + pub key16: [u_int16_t; 8usize], + pub key32: [u_int32_t; 4usize], +} +#[test] +fn bindgen_test_layout_pf_poolhashkey__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_poolhashkey__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_poolhashkey__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).key8) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_poolhashkey__bindgen_ty_1), + "::", + stringify!(key8) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).key16) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_poolhashkey__bindgen_ty_1), + "::", + stringify!(key16) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).key32) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_poolhashkey__bindgen_ty_1), + "::", + stringify!(key32) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_poolhashkey() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_poolhashkey)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_poolhashkey)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfk) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_poolhashkey), + "::", + stringify!(pfk) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_pool { + pub addr: pf_addr_wrap, + pub key: pf_poolhashkey, + pub counter: pf_addr, + pub ifname: [::std::os::raw::c_char; 16usize], + pub kif: *mut pfi_kif, + pub tblidx: ::std::os::raw::c_int, + pub states: u_int64_t, + pub curweight: ::std::os::raw::c_int, + pub weight: u_int16_t, + pub proxy_port: [u_int16_t; 2usize], + pub port_op: u_int8_t, + pub opts: u_int8_t, +} +#[test] +fn bindgen_test_layout_pf_pool() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 136usize, + concat!("Size of: ", stringify!(pf_pool)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_pool)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).key) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(key) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).counter) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(counter) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(ifname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).kif) as usize - ptr as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(kif) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tblidx) as usize - ptr as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(tblidx) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).states) as usize - ptr as usize }, + 112usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(states) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).curweight) as usize - ptr as usize }, + 120usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(curweight) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).weight) as usize - ptr as usize }, + 124usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(weight) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).proxy_port) as usize - ptr as usize }, + 126usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(proxy_port) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).port_op) as usize - ptr as usize }, + 130usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(port_op) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).opts) as usize - ptr as usize }, + 131usize, + concat!( + "Offset of field: ", + stringify!(pf_pool), + "::", + stringify!(opts) + ) + ); +} +pub type pf_osfp_t = u_int32_t; +#[repr(C)] +#[derive(Copy, Clone)] +pub union pf_rule_ptr { + pub ptr: *mut pf_rule, + pub nr: u_int32_t, +} +#[test] +fn bindgen_test_layout_pf_rule_ptr() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(pf_rule_ptr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_rule_ptr)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ptr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_ptr), + "::", + stringify!(ptr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_ptr), + "::", + stringify!(nr) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_rule { + pub src: pf_rule_addr, + pub dst: pf_rule_addr, + pub skip: [pf_rule_ptr; 9usize], + pub label: [::std::os::raw::c_char; 64usize], + pub ifname: [::std::os::raw::c_char; 16usize], + pub rcv_ifname: [::std::os::raw::c_char; 16usize], + pub qname: [::std::os::raw::c_char; 64usize], + pub pqname: [::std::os::raw::c_char; 64usize], + pub tagname: [::std::os::raw::c_char; 64usize], + pub match_tagname: [::std::os::raw::c_char; 64usize], + pub overload_tblname: [::std::os::raw::c_char; 32usize], + pub entries: pf_rule__bindgen_ty_1, + pub nat: pf_pool, + pub rdr: pf_pool, + pub route: pf_pool, + pub pktrate: pf_threshold, + pub evaluations: u_int64_t, + pub packets: [u_int64_t; 2usize], + pub bytes: [u_int64_t; 2usize], + pub kif: *mut pfi_kif, + pub rcv_kif: *mut pfi_kif, + pub anchor: *mut pf_anchor, + pub overload_tbl: *mut pfr_ktable, + pub os_fingerprint: pf_osfp_t, + pub rtableid: ::std::os::raw::c_int, + pub onrdomain: ::std::os::raw::c_int, + pub timeout: [u_int32_t; 20usize], + pub states_cur: u_int32_t, + pub states_tot: u_int32_t, + pub max_states: u_int32_t, + pub src_nodes: u_int32_t, + pub max_src_nodes: u_int32_t, + pub max_src_states: u_int32_t, + pub max_src_conn: u_int32_t, + pub max_src_conn_rate: pf_rule__bindgen_ty_2, + pub qid: u_int32_t, + pub pqid: u_int32_t, + pub rt_listid: u_int32_t, + pub nr: u_int32_t, + pub prob: u_int32_t, + pub cuid: uid_t, + pub cpid: pid_t, + pub return_icmp: u_int16_t, + pub return_icmp6: u_int16_t, + pub max_mss: u_int16_t, + pub tag: u_int16_t, + pub match_tag: u_int16_t, + pub scrub_flags: u_int16_t, + pub delay: u_int16_t, + pub uid: pf_rule_uid, + pub gid: pf_rule_gid, + pub rule_flag: u_int32_t, + pub action: u_int8_t, + pub direction: u_int8_t, + pub log: u_int8_t, + pub logif: u_int8_t, + pub quick: u_int8_t, + pub ifnot: u_int8_t, + pub match_tag_not: u_int8_t, + pub keep_state: u_int8_t, + pub af: sa_family_t, + pub proto: u_int8_t, + pub type_: u_int16_t, + pub code: u_int16_t, + pub flags: u_int8_t, + pub flagset: u_int8_t, + pub min_ttl: u_int8_t, + pub allow_opts: u_int8_t, + pub rt: u_int8_t, + pub return_ttl: u_int8_t, + pub tos: u_int8_t, + pub set_tos: u_int8_t, + pub anchor_relative: u_int8_t, + pub anchor_wildcard: u_int8_t, + pub flush: u_int8_t, + pub prio: u_int8_t, + pub set_prio: [u_int8_t; 2usize], + pub naf: sa_family_t, + pub rcvifnot: u_int8_t, + pub divert: pf_rule__bindgen_ty_3, + pub exptime: time_t, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_rule__bindgen_ty_1 { + pub tqe_next: *mut pf_rule, + pub tqe_prev: *mut *mut pf_rule, +} +#[test] +fn bindgen_test_layout_pf_rule__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_rule__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_rule__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tqe_next) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule__bindgen_ty_1), + "::", + stringify!(tqe_next) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tqe_prev) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_rule__bindgen_ty_1), + "::", + stringify!(tqe_prev) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_rule__bindgen_ty_2 { + pub limit: u_int32_t, + pub seconds: u_int32_t, +} +#[test] +fn bindgen_test_layout_pf_rule__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(pf_rule__bindgen_ty_2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_rule__bindgen_ty_2)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).limit) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule__bindgen_ty_2), + "::", + stringify!(limit) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).seconds) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(pf_rule__bindgen_ty_2), + "::", + stringify!(seconds) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_rule__bindgen_ty_3 { + pub addr: pf_addr, + pub port: u_int16_t, + pub type_: u_int8_t, +} +#[test] +fn bindgen_test_layout_pf_rule__bindgen_ty_3() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(pf_rule__bindgen_ty_3)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_rule__bindgen_ty_3)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule__bindgen_ty_3), + "::", + stringify!(addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).port) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pf_rule__bindgen_ty_3), + "::", + stringify!(port) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + 18usize, + concat!( + "Offset of field: ", + stringify!(pf_rule__bindgen_ty_3), + "::", + stringify!(type_) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_rule() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 1344usize, + concat!("Size of: ", stringify!(pf_rule)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_rule)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).src) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(src) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).dst) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(dst) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).skip) as usize - ptr as usize }, + 112usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(skip) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, + 184usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(label) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, + 248usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(ifname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rcv_ifname) as usize - ptr as usize }, + 264usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(rcv_ifname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).qname) as usize - ptr as usize }, + 280usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(qname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pqname) as usize - ptr as usize }, + 344usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(pqname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tagname) as usize - ptr as usize }, + 408usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(tagname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).match_tagname) as usize - ptr as usize }, + 472usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(match_tagname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).overload_tblname) as usize - ptr as usize }, + 536usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(overload_tblname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).entries) as usize - ptr as usize }, + 568usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(entries) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nat) as usize - ptr as usize }, + 584usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(nat) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rdr) as usize - ptr as usize }, + 720usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(rdr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).route) as usize - ptr as usize }, + 856usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(route) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pktrate) as usize - ptr as usize }, + 992usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(pktrate) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).evaluations) as usize - ptr as usize }, + 1008usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(evaluations) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).packets) as usize - ptr as usize }, + 1016usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(packets) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).bytes) as usize - ptr as usize }, + 1032usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(bytes) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).kif) as usize - ptr as usize }, + 1048usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(kif) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rcv_kif) as usize - ptr as usize }, + 1056usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(rcv_kif) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).anchor) as usize - ptr as usize }, + 1064usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(anchor) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).overload_tbl) as usize - ptr as usize }, + 1072usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(overload_tbl) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).os_fingerprint) as usize - ptr as usize }, + 1080usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(os_fingerprint) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtableid) as usize - ptr as usize }, + 1084usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(rtableid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).onrdomain) as usize - ptr as usize }, + 1088usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(onrdomain) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).timeout) as usize - ptr as usize }, + 1092usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(timeout) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).states_cur) as usize - ptr as usize }, + 1172usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(states_cur) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).states_tot) as usize - ptr as usize }, + 1176usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(states_tot) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).max_states) as usize - ptr as usize }, + 1180usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(max_states) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).src_nodes) as usize - ptr as usize }, + 1184usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(src_nodes) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).max_src_nodes) as usize - ptr as usize }, + 1188usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(max_src_nodes) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).max_src_states) as usize - ptr as usize }, + 1192usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(max_src_states) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).max_src_conn) as usize - ptr as usize }, + 1196usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(max_src_conn) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).max_src_conn_rate) as usize - ptr as usize }, + 1200usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(max_src_conn_rate) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).qid) as usize - ptr as usize }, + 1208usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(qid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pqid) as usize - ptr as usize }, + 1212usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(pqid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rt_listid) as usize - ptr as usize }, + 1216usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(rt_listid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nr) as usize - ptr as usize }, + 1220usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(nr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, + 1224usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(prob) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cuid) as usize - ptr as usize }, + 1228usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(cuid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cpid) as usize - ptr as usize }, + 1232usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(cpid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).return_icmp) as usize - ptr as usize }, + 1236usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(return_icmp) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).return_icmp6) as usize - ptr as usize }, + 1238usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(return_icmp6) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).max_mss) as usize - ptr as usize }, + 1240usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(max_mss) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, + 1242usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(tag) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).match_tag) as usize - ptr as usize }, + 1244usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(match_tag) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).scrub_flags) as usize - ptr as usize }, + 1246usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(scrub_flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).delay) as usize - ptr as usize }, + 1248usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(delay) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).uid) as usize - ptr as usize }, + 1252usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(uid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).gid) as usize - ptr as usize }, + 1264usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(gid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rule_flag) as usize - ptr as usize }, + 1276usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(rule_flag) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, + 1280usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(action) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).direction) as usize - ptr as usize }, + 1281usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(direction) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).log) as usize - ptr as usize }, + 1282usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(log) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).logif) as usize - ptr as usize }, + 1283usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(logif) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).quick) as usize - ptr as usize }, + 1284usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(quick) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifnot) as usize - ptr as usize }, + 1285usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(ifnot) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).match_tag_not) as usize - ptr as usize }, + 1286usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(match_tag_not) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).keep_state) as usize - ptr as usize }, + 1287usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(keep_state) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).af) as usize - ptr as usize }, + 1288usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(af) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).proto) as usize - ptr as usize }, + 1289usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(proto) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + 1290usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).code) as usize - ptr as usize }, + 1292usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(code) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 1294usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).flagset) as usize - ptr as usize }, + 1295usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(flagset) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).min_ttl) as usize - ptr as usize }, + 1296usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(min_ttl) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).allow_opts) as usize - ptr as usize }, + 1297usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(allow_opts) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rt) as usize - ptr as usize }, + 1298usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(rt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).return_ttl) as usize - ptr as usize }, + 1299usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(return_ttl) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tos) as usize - ptr as usize }, + 1300usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(tos) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).set_tos) as usize - ptr as usize }, + 1301usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(set_tos) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).anchor_relative) as usize - ptr as usize }, + 1302usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(anchor_relative) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).anchor_wildcard) as usize - ptr as usize }, + 1303usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(anchor_wildcard) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).flush) as usize - ptr as usize }, + 1304usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(flush) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).prio) as usize - ptr as usize }, + 1305usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(prio) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).set_prio) as usize - ptr as usize }, + 1306usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(set_prio) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).naf) as usize - ptr as usize }, + 1308usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(naf) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rcvifnot) as usize - ptr as usize }, + 1309usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(rcvifnot) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).divert) as usize - ptr as usize }, + 1312usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(divert) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).exptime) as usize - ptr as usize }, + 1336usize, + concat!( + "Offset of field: ", + stringify!(pf_rule), + "::", + stringify!(exptime) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_state_cmp { + pub id: u_int64_t, + pub creatorid: u_int32_t, + pub direction: u_int8_t, + pub pad: [u_int8_t; 3usize], +} +#[test] +fn bindgen_test_layout_pf_state_cmp() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_state_cmp)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_state_cmp)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_state_cmp), + "::", + stringify!(id) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).creatorid) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_state_cmp), + "::", + stringify!(creatorid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).direction) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(pf_state_cmp), + "::", + stringify!(direction) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, + 13usize, + concat!( + "Offset of field: ", + stringify!(pf_state_cmp), + "::", + stringify!(pad) + ) + ); +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct pfsync_state_scrub { + pub pfss_flags: u_int16_t, + pub pfss_ttl: u_int8_t, + pub scrub_flag: u_int8_t, + pub pfss_ts_mod: u_int32_t, +} +#[test] +fn bindgen_test_layout_pfsync_state_scrub() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(pfsync_state_scrub)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(pfsync_state_scrub)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfss_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_scrub), + "::", + stringify!(pfss_flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfss_ttl) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_scrub), + "::", + stringify!(pfss_ttl) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).scrub_flag) as usize - ptr as usize }, + 3usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_scrub), + "::", + stringify!(scrub_flag) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfss_ts_mod) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_scrub), + "::", + stringify!(pfss_ts_mod) + ) + ); +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct pfsync_state_peer { + pub scrub: pfsync_state_scrub, + pub seqlo: u_int32_t, + pub seqhi: u_int32_t, + pub seqdiff: u_int32_t, + pub max_win: u_int16_t, + pub mss: u_int16_t, + pub state: u_int8_t, + pub wscale: u_int8_t, + pub pad: [u_int8_t; 6usize], +} +#[test] +fn bindgen_test_layout_pfsync_state_peer() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(pfsync_state_peer)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(pfsync_state_peer)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).scrub) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(scrub) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).seqlo) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(seqlo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).seqhi) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(seqhi) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).seqdiff) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(seqdiff) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).max_win) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(max_win) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).mss) as usize - ptr as usize }, + 22usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(mss) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(state) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).wscale) as usize - ptr as usize }, + 25usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(wscale) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, + 26usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_peer), + "::", + stringify!(pad) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pfsync_state_key { + pub addr: [pf_addr; 2usize], + pub port: [u_int16_t; 2usize], + pub rdomain: u_int16_t, + pub af: sa_family_t, + pub pad: u_int8_t, +} +#[test] +fn bindgen_test_layout_pfsync_state_key() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(pfsync_state_key)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pfsync_state_key)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_key), + "::", + stringify!(addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).port) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_key), + "::", + stringify!(port) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rdomain) as usize - ptr as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_key), + "::", + stringify!(rdomain) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).af) as usize - ptr as usize }, + 38usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_key), + "::", + stringify!(af) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, + 39usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state_key), + "::", + stringify!(pad) + ) + ); +} +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub struct pfsync_state { + pub id: u_int64_t, + pub ifname: [::std::os::raw::c_char; 16usize], + pub key: [pfsync_state_key; 2usize], + pub src: pfsync_state_peer, + pub dst: pfsync_state_peer, + pub rt_addr: pf_addr, + pub rule: u_int32_t, + pub anchor: u_int32_t, + pub nat_rule: u_int32_t, + pub creation: u_int32_t, + pub expire: u_int32_t, + pub packets: [[u_int32_t; 2usize]; 2usize], + pub bytes: [[u_int32_t; 2usize]; 2usize], + pub creatorid: u_int32_t, + pub rtableid: [i32; 2usize], + pub max_mss: u_int16_t, + pub af: sa_family_t, + pub proto: u_int8_t, + pub direction: u_int8_t, + pub log: u_int8_t, + pub rt: u_int8_t, + pub timeout: u_int8_t, + pub sync_flags: u_int8_t, + pub updates: u_int8_t, + pub min_ttl: u_int8_t, + pub set_tos: u_int8_t, + pub state_flags: u_int16_t, + pub set_prio: [u_int8_t; 2usize], +} +#[test] +fn bindgen_test_layout_pfsync_state() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 264usize, + concat!("Size of: ", stringify!(pfsync_state)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(pfsync_state)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(id) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(ifname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).key) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(key) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).src) as usize - ptr as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(src) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).dst) as usize - ptr as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(dst) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rt_addr) as usize - ptr as usize }, + 168usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(rt_addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rule) as usize - ptr as usize }, + 184usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(rule) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).anchor) as usize - ptr as usize }, + 188usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(anchor) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nat_rule) as usize - ptr as usize }, + 192usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(nat_rule) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).creation) as usize - ptr as usize }, + 196usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(creation) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).expire) as usize - ptr as usize }, + 200usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(expire) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).packets) as usize - ptr as usize }, + 204usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(packets) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).bytes) as usize - ptr as usize }, + 220usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(bytes) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).creatorid) as usize - ptr as usize }, + 236usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(creatorid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtableid) as usize - ptr as usize }, + 240usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(rtableid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).max_mss) as usize - ptr as usize }, + 248usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(max_mss) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).af) as usize - ptr as usize }, + 250usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(af) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).proto) as usize - ptr as usize }, + 251usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(proto) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).direction) as usize - ptr as usize }, + 252usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(direction) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).log) as usize - ptr as usize }, + 253usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(log) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rt) as usize - ptr as usize }, + 254usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(rt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).timeout) as usize - ptr as usize }, + 255usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(timeout) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sync_flags) as usize - ptr as usize }, + 256usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(sync_flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).updates) as usize - ptr as usize }, + 257usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(updates) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).min_ttl) as usize - ptr as usize }, + 258usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(min_ttl) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).set_tos) as usize - ptr as usize }, + 259usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(set_tos) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).state_flags) as usize - ptr as usize }, + 260usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(state_flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).set_prio) as usize - ptr as usize }, + 262usize, + concat!( + "Offset of field: ", + stringify!(pfsync_state), + "::", + stringify!(set_prio) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_rulequeue { + pub tqh_first: *mut pf_rule, + pub tqh_last: *mut *mut pf_rule, +} +#[test] +fn bindgen_test_layout_pf_rulequeue() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pf_rulequeue)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_rulequeue)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tqh_first) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rulequeue), + "::", + stringify!(tqh_first) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tqh_last) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_rulequeue), + "::", + stringify!(tqh_last) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_ruleset { + pub rules: pf_ruleset__bindgen_ty_1, + pub anchor: *mut pf_anchor, + pub tticket: u_int32_t, + pub tables: ::std::os::raw::c_int, + pub topen: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_ruleset__bindgen_ty_1 { + pub queues: [pf_rulequeue; 2usize], + pub active: pf_ruleset__bindgen_ty_1__bindgen_ty_1, + pub inactive: pf_ruleset__bindgen_ty_1__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_ruleset__bindgen_ty_1__bindgen_ty_1 { + pub ptr: *mut pf_rulequeue, + pub rcount: u_int32_t, + pub version: u_int32_t, + pub open: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_pf_ruleset__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!( + "Size of: ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ptr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(ptr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rcount) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(rcount) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).open) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(open) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_ruleset__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 80usize, + concat!("Size of: ", stringify!(pf_ruleset__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_ruleset__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).queues) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1), + "::", + stringify!(queues) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).active) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1), + "::", + stringify!(active) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).inactive) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset__bindgen_ty_1), + "::", + stringify!(inactive) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_ruleset() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 104usize, + concat!("Size of: ", stringify!(pf_ruleset)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_ruleset)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rules) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset), + "::", + stringify!(rules) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).anchor) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset), + "::", + stringify!(anchor) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tticket) as usize - ptr as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset), + "::", + stringify!(tticket) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tables) as usize - ptr as usize }, + 92usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset), + "::", + stringify!(tables) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).topen) as usize - ptr as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(pf_ruleset), + "::", + stringify!(topen) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_anchor_node { + pub rbh_root: *mut pf_anchor, +} +#[test] +fn bindgen_test_layout_pf_anchor_node() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(pf_anchor_node)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_anchor_node)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbh_root) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor_node), + "::", + stringify!(rbh_root) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_anchor { + pub entry_global: pf_anchor__bindgen_ty_1, + pub entry_node: pf_anchor__bindgen_ty_2, + pub parent: *mut pf_anchor, + pub children: pf_anchor_node, + pub name: [::std::os::raw::c_char; 64usize], + pub path: [::std::os::raw::c_char; 1024usize], + pub ruleset: pf_ruleset, + pub refcnt: ::std::os::raw::c_int, + pub match_: ::std::os::raw::c_int, + pub ref_: refcnt, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_anchor__bindgen_ty_1 { + pub rbe_left: *mut pf_anchor, + pub rbe_right: *mut pf_anchor, + pub rbe_parent: *mut pf_anchor, + pub rbe_color: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_pf_anchor__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(pf_anchor__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_anchor__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbe_left) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor__bindgen_ty_1), + "::", + stringify!(rbe_left) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbe_right) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor__bindgen_ty_1), + "::", + stringify!(rbe_right) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbe_parent) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor__bindgen_ty_1), + "::", + stringify!(rbe_parent) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbe_color) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor__bindgen_ty_1), + "::", + stringify!(rbe_color) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_anchor__bindgen_ty_2 { + pub rbe_left: *mut pf_anchor, + pub rbe_right: *mut pf_anchor, + pub rbe_parent: *mut pf_anchor, + pub rbe_color: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_pf_anchor__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(pf_anchor__bindgen_ty_2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_anchor__bindgen_ty_2)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbe_left) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor__bindgen_ty_2), + "::", + stringify!(rbe_left) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbe_right) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor__bindgen_ty_2), + "::", + stringify!(rbe_right) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbe_parent) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor__bindgen_ty_2), + "::", + stringify!(rbe_parent) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbe_color) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor__bindgen_ty_2), + "::", + stringify!(rbe_color) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_anchor() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 1288usize, + concat!("Size of: ", stringify!(pf_anchor)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_anchor)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).entry_global) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(entry_global) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).entry_node) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(entry_node) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).parent) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(parent) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).children) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(children) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).path) as usize - ptr as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(path) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ruleset) as usize - ptr as usize }, + 1168usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(ruleset) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).refcnt) as usize - ptr as usize }, + 1272usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(refcnt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).match_) as usize - ptr as usize }, + 1276usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(match_) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ref_) as usize - ptr as usize }, + 1280usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor), + "::", + stringify!(ref_) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfr_table { + pub pfrt_anchor: [::std::os::raw::c_char; 1024usize], + pub pfrt_name: [::std::os::raw::c_char; 32usize], + pub pfrt_flags: u_int32_t, + pub pfrt_fback: u_int8_t, +} +#[test] +fn bindgen_test_layout_pfr_table() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 1064usize, + concat!("Size of: ", stringify!(pfr_table)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pfr_table)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrt_anchor) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfr_table), + "::", + stringify!(pfrt_anchor) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrt_name) as usize - ptr as usize }, + 1024usize, + concat!( + "Offset of field: ", + stringify!(pfr_table), + "::", + stringify!(pfrt_name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrt_flags) as usize - ptr as usize }, + 1056usize, + concat!( + "Offset of field: ", + stringify!(pfr_table), + "::", + stringify!(pfrt_flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrt_fback) as usize - ptr as usize }, + 1060usize, + concat!( + "Offset of field: ", + stringify!(pfr_table), + "::", + stringify!(pfrt_fback) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfr_tstats { + pub pfrts_t: pfr_table, + pub pfrts_packets: [[u_int64_t; 4usize]; 2usize], + pub pfrts_bytes: [[u_int64_t; 4usize]; 2usize], + pub pfrts_match: u_int64_t, + pub pfrts_nomatch: u_int64_t, + pub pfrts_tzero: time_t, + pub pfrts_cnt: ::std::os::raw::c_int, + pub pfrts_refcnt: [::std::os::raw::c_int; 2usize], +} +#[test] +fn bindgen_test_layout_pfr_tstats() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 1232usize, + concat!("Size of: ", stringify!(pfr_tstats)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfr_tstats)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrts_t) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfr_tstats), + "::", + stringify!(pfrts_t) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrts_packets) as usize - ptr as usize }, + 1064usize, + concat!( + "Offset of field: ", + stringify!(pfr_tstats), + "::", + stringify!(pfrts_packets) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrts_bytes) as usize - ptr as usize }, + 1128usize, + concat!( + "Offset of field: ", + stringify!(pfr_tstats), + "::", + stringify!(pfrts_bytes) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrts_match) as usize - ptr as usize }, + 1192usize, + concat!( + "Offset of field: ", + stringify!(pfr_tstats), + "::", + stringify!(pfrts_match) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrts_nomatch) as usize - ptr as usize }, + 1200usize, + concat!( + "Offset of field: ", + stringify!(pfr_tstats), + "::", + stringify!(pfrts_nomatch) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrts_tzero) as usize - ptr as usize }, + 1208usize, + concat!( + "Offset of field: ", + stringify!(pfr_tstats), + "::", + stringify!(pfrts_tzero) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrts_cnt) as usize - ptr as usize }, + 1216usize, + concat!( + "Offset of field: ", + stringify!(pfr_tstats), + "::", + stringify!(pfrts_cnt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrts_refcnt) as usize - ptr as usize }, + 1220usize, + concat!( + "Offset of field: ", + stringify!(pfr_tstats), + "::", + stringify!(pfrts_refcnt) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfr_ktable { + pub pfrkt_ts: pfr_tstats, + pub pfrkt_tree: pfr_ktable__bindgen_ty_1, + pub pfrkt_workq: pfr_ktable__bindgen_ty_2, + pub pfrkt_ip4: *mut radix_node_head, + pub pfrkt_ip6: *mut radix_node_head, + pub pfrkt_shadow: *mut pfr_ktable, + pub pfrkt_root: *mut pfr_ktable, + pub pfrkt_rs: *mut pf_ruleset, + pub pfrkt_larg: ::std::os::raw::c_long, + pub pfrkt_nflags: ::std::os::raw::c_int, + pub pfrkt_refcntcost: u_int64_t, + pub pfrkt_gcdweight: u_int16_t, + pub pfrkt_maxweight: u_int16_t, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfr_ktable__bindgen_ty_1 { + pub rbe_left: *mut pfr_ktable, + pub rbe_right: *mut pfr_ktable, + pub rbe_parent: *mut pfr_ktable, + pub rbe_color: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_pfr_ktable__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(pfr_ktable__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfr_ktable__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbe_left) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfr_ktable__bindgen_ty_1), + "::", + stringify!(rbe_left) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbe_right) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pfr_ktable__bindgen_ty_1), + "::", + stringify!(rbe_right) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbe_parent) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pfr_ktable__bindgen_ty_1), + "::", + stringify!(rbe_parent) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbe_color) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(pfr_ktable__bindgen_ty_1), + "::", + stringify!(rbe_color) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfr_ktable__bindgen_ty_2 { + pub sle_next: *mut pfr_ktable, +} +#[test] +fn bindgen_test_layout_pfr_ktable__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(pfr_ktable__bindgen_ty_2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfr_ktable__bindgen_ty_2)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sle_next) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfr_ktable__bindgen_ty_2), + "::", + stringify!(sle_next) + ) + ); +} +#[test] +fn bindgen_test_layout_pfr_ktable() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 1344usize, + concat!("Size of: ", stringify!(pfr_ktable)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfr_ktable)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrkt_ts) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfr_ktable), + "::", + stringify!(pfrkt_ts) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrkt_tree) as usize - ptr as usize }, + 1232usize, + concat!( + "Offset of field: ", + stringify!(pfr_ktable), + "::", + stringify!(pfrkt_tree) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrkt_workq) as usize - ptr as usize }, + 1264usize, + concat!( + "Offset of field: ", + stringify!(pfr_ktable), + "::", + stringify!(pfrkt_workq) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrkt_ip4) as usize - ptr as usize }, + 1272usize, + concat!( + "Offset of field: ", + stringify!(pfr_ktable), + "::", + stringify!(pfrkt_ip4) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrkt_ip6) as usize - ptr as usize }, + 1280usize, + concat!( + "Offset of field: ", + stringify!(pfr_ktable), + "::", + stringify!(pfrkt_ip6) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrkt_shadow) as usize - ptr as usize }, + 1288usize, + concat!( + "Offset of field: ", + stringify!(pfr_ktable), + "::", + stringify!(pfrkt_shadow) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrkt_root) as usize - ptr as usize }, + 1296usize, + concat!( + "Offset of field: ", + stringify!(pfr_ktable), + "::", + stringify!(pfrkt_root) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrkt_rs) as usize - ptr as usize }, + 1304usize, + concat!( + "Offset of field: ", + stringify!(pfr_ktable), + "::", + stringify!(pfrkt_rs) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrkt_larg) as usize - ptr as usize }, + 1312usize, + concat!( + "Offset of field: ", + stringify!(pfr_ktable), + "::", + stringify!(pfrkt_larg) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrkt_nflags) as usize - ptr as usize }, + 1320usize, + concat!( + "Offset of field: ", + stringify!(pfr_ktable), + "::", + stringify!(pfrkt_nflags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrkt_refcntcost) as usize - ptr as usize }, + 1328usize, + concat!( + "Offset of field: ", + stringify!(pfr_ktable), + "::", + stringify!(pfrkt_refcntcost) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrkt_gcdweight) as usize - ptr as usize }, + 1336usize, + concat!( + "Offset of field: ", + stringify!(pfr_ktable), + "::", + stringify!(pfrkt_gcdweight) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrkt_maxweight) as usize - ptr as usize }, + 1338usize, + concat!( + "Offset of field: ", + stringify!(pfr_ktable), + "::", + stringify!(pfrkt_maxweight) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ifnet { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ifg_group { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfi_kif { + pub pfik_name: [::std::os::raw::c_char; 16usize], + pub pfik_tree: pfi_kif__bindgen_ty_1, + pub pfik_packets: [[[u_int64_t; 2usize]; 2usize]; 2usize], + pub pfik_bytes: [[[u_int64_t; 2usize]; 2usize]; 2usize], + pub pfik_tzero: time_t, + pub pfik_flags: ::std::os::raw::c_int, + pub pfik_flags_new: ::std::os::raw::c_int, + pub pfik_ah_cookie: *mut ::std::os::raw::c_void, + pub pfik_ifp: *mut ifnet, + pub pfik_group: *mut ifg_group, + pub pfik_states: ::std::os::raw::c_int, + pub pfik_rules: ::std::os::raw::c_int, + pub pfik_routes: ::std::os::raw::c_int, + pub pfik_srcnodes: ::std::os::raw::c_int, + pub pfik_flagrefs: ::std::os::raw::c_int, + pub pfik_dynaddrs: pfi_kif__bindgen_ty_2, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfi_kif__bindgen_ty_1 { + pub rbe_left: *mut pfi_kif, + pub rbe_right: *mut pfi_kif, + pub rbe_parent: *mut pfi_kif, + pub rbe_color: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_pfi_kif__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(pfi_kif__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfi_kif__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbe_left) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif__bindgen_ty_1), + "::", + stringify!(rbe_left) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbe_right) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif__bindgen_ty_1), + "::", + stringify!(rbe_right) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbe_parent) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif__bindgen_ty_1), + "::", + stringify!(rbe_parent) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbe_color) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif__bindgen_ty_1), + "::", + stringify!(rbe_color) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfi_kif__bindgen_ty_2 { + pub tqh_first: *mut pfi_dynaddr, + pub tqh_last: *mut *mut pfi_dynaddr, +} +#[test] +fn bindgen_test_layout_pfi_kif__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pfi_kif__bindgen_ty_2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfi_kif__bindgen_ty_2)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tqh_first) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif__bindgen_ty_2), + "::", + stringify!(tqh_first) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tqh_last) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif__bindgen_ty_2), + "::", + stringify!(tqh_last) + ) + ); +} +#[test] +fn bindgen_test_layout_pfi_kif() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 256usize, + concat!("Size of: ", stringify!(pfi_kif)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfi_kif)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfik_name) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif), + "::", + stringify!(pfik_name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfik_tree) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif), + "::", + stringify!(pfik_tree) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfik_packets) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif), + "::", + stringify!(pfik_packets) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfik_bytes) as usize - ptr as usize }, + 112usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif), + "::", + stringify!(pfik_bytes) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfik_tzero) as usize - ptr as usize }, + 176usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif), + "::", + stringify!(pfik_tzero) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfik_flags) as usize - ptr as usize }, + 184usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif), + "::", + stringify!(pfik_flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfik_flags_new) as usize - ptr as usize }, + 188usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif), + "::", + stringify!(pfik_flags_new) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfik_ah_cookie) as usize - ptr as usize }, + 192usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif), + "::", + stringify!(pfik_ah_cookie) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfik_ifp) as usize - ptr as usize }, + 200usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif), + "::", + stringify!(pfik_ifp) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfik_group) as usize - ptr as usize }, + 208usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif), + "::", + stringify!(pfik_group) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfik_states) as usize - ptr as usize }, + 216usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif), + "::", + stringify!(pfik_states) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfik_rules) as usize - ptr as usize }, + 220usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif), + "::", + stringify!(pfik_rules) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfik_routes) as usize - ptr as usize }, + 224usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif), + "::", + stringify!(pfik_routes) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfik_srcnodes) as usize - ptr as usize }, + 228usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif), + "::", + stringify!(pfik_srcnodes) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfik_flagrefs) as usize - ptr as usize }, + 232usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif), + "::", + stringify!(pfik_flagrefs) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfik_dynaddrs) as usize - ptr as usize }, + 240usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif), + "::", + stringify!(pfik_dynaddrs) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_status { + pub counters: [u_int64_t; 17usize], + pub lcounters: [u_int64_t; 10usize], + pub fcounters: [u_int64_t; 3usize], + pub scounters: [u_int64_t; 3usize], + pub pcounters: [[[u_int64_t; 3usize]; 2usize]; 2usize], + pub bcounters: [[u_int64_t; 2usize]; 2usize], + pub stateid: u_int64_t, + pub syncookies_inflight: [u_int64_t; 2usize], + pub since: time_t, + pub running: u_int32_t, + pub states: u_int32_t, + pub states_halfopen: u_int32_t, + pub src_nodes: u_int32_t, + pub debug: u_int32_t, + pub hostid: u_int32_t, + pub reass: u_int32_t, + pub syncookies_active: u_int8_t, + pub syncookies_mode: u_int8_t, + pub pad: [u_int8_t; 2usize], + pub ifname: [::std::os::raw::c_char; 16usize], + pub pf_chksum: [u_int8_t; 16usize], +} +#[test] +fn bindgen_test_layout_pf_status() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 488usize, + concat!("Size of: ", stringify!(pf_status)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_status)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).counters) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(counters) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lcounters) as usize - ptr as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(lcounters) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fcounters) as usize - ptr as usize }, + 216usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(fcounters) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).scounters) as usize - ptr as usize }, + 240usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(scounters) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pcounters) as usize - ptr as usize }, + 264usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(pcounters) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).bcounters) as usize - ptr as usize }, + 360usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(bcounters) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).stateid) as usize - ptr as usize }, + 392usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(stateid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).syncookies_inflight) as usize - ptr as usize }, + 400usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(syncookies_inflight) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).since) as usize - ptr as usize }, + 416usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(since) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).running) as usize - ptr as usize }, + 424usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(running) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).states) as usize - ptr as usize }, + 428usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(states) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).states_halfopen) as usize - ptr as usize }, + 432usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(states_halfopen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).src_nodes) as usize - ptr as usize }, + 436usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(src_nodes) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).debug) as usize - ptr as usize }, + 440usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(debug) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hostid) as usize - ptr as usize }, + 444usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(hostid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).reass) as usize - ptr as usize }, + 448usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(reass) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).syncookies_active) as usize - ptr as usize }, + 452usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(syncookies_active) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).syncookies_mode) as usize - ptr as usize }, + 453usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(syncookies_mode) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, + 454usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(pad) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, + 456usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(ifname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pf_chksum) as usize - ptr as usize }, + 472usize, + concat!( + "Offset of field: ", + stringify!(pf_status), + "::", + stringify!(pf_chksum) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pfioc_rule { + pub action: u_int32_t, + pub ticket: u_int32_t, + pub nr: u_int32_t, + pub anchor: [::std::os::raw::c_char; 1024usize], + pub anchor_call: [::std::os::raw::c_char; 1024usize], + pub rule: pf_rule, +} +#[test] +fn bindgen_test_layout_pfioc_rule() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 3408usize, + concat!("Size of: ", stringify!(pfioc_rule)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfioc_rule)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_rule), + "::", + stringify!(action) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ticket) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(pfioc_rule), + "::", + stringify!(ticket) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nr) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pfioc_rule), + "::", + stringify!(nr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).anchor) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(pfioc_rule), + "::", + stringify!(anchor) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).anchor_call) as usize - ptr as usize }, + 1036usize, + concat!( + "Offset of field: ", + stringify!(pfioc_rule), + "::", + stringify!(anchor_call) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rule) as usize - ptr as usize }, + 2064usize, + concat!( + "Offset of field: ", + stringify!(pfioc_rule), + "::", + stringify!(rule) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pfioc_state_kill { + pub psk_pfcmp: pf_state_cmp, + pub psk_af: sa_family_t, + pub psk_proto: ::std::os::raw::c_int, + pub psk_src: pf_rule_addr, + pub psk_dst: pf_rule_addr, + pub psk_ifname: [::std::os::raw::c_char; 16usize], + pub psk_label: [::std::os::raw::c_char; 64usize], + pub psk_killed: u_int, + pub psk_rdomain: u_int16_t, +} +#[test] +fn bindgen_test_layout_pfioc_state_kill() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 224usize, + concat!("Size of: ", stringify!(pfioc_state_kill)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfioc_state_kill)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psk_pfcmp) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_pfcmp) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psk_af) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_af) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psk_proto) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_proto) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psk_src) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_src) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psk_dst) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_dst) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psk_ifname) as usize - ptr as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_ifname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psk_label) as usize - ptr as usize }, + 152usize, + concat!( + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_label) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psk_killed) as usize - ptr as usize }, + 216usize, + concat!( + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_killed) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psk_rdomain) as usize - ptr as usize }, + 220usize, + concat!( + "Offset of field: ", + stringify!(pfioc_state_kill), + "::", + stringify!(psk_rdomain) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pfioc_states { + pub ps_len: usize, + pub ps_u: pfioc_states__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pfioc_states__bindgen_ty_1 { + pub psu_buf: caddr_t, + pub psu_states: *mut pfsync_state, +} +#[test] +fn bindgen_test_layout_pfioc_states__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(pfioc_states__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfioc_states__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psu_buf) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_states__bindgen_ty_1), + "::", + stringify!(psu_buf) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psu_states) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_states__bindgen_ty_1), + "::", + stringify!(psu_states) + ) + ); +} +#[test] +fn bindgen_test_layout_pfioc_states() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pfioc_states)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfioc_states)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ps_len) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_states), + "::", + stringify!(ps_len) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ps_u) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pfioc_states), + "::", + stringify!(ps_u) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfioc_trans { + pub size: ::std::os::raw::c_int, + pub esize: ::std::os::raw::c_int, + pub array: *mut pfioc_trans_pfioc_trans_e, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfioc_trans_pfioc_trans_e { + pub type_: ::std::os::raw::c_int, + pub anchor: [::std::os::raw::c_char; 1024usize], + pub ticket: u_int32_t, +} +#[test] +fn bindgen_test_layout_pfioc_trans_pfioc_trans_e() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 1032usize, + concat!("Size of: ", stringify!(pfioc_trans_pfioc_trans_e)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pfioc_trans_pfioc_trans_e)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_trans_pfioc_trans_e), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).anchor) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(pfioc_trans_pfioc_trans_e), + "::", + stringify!(anchor) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ticket) as usize - ptr as usize }, + 1028usize, + concat!( + "Offset of field: ", + stringify!(pfioc_trans_pfioc_trans_e), + "::", + stringify!(ticket) + ) + ); +} +#[test] +fn bindgen_test_layout_pfioc_trans() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pfioc_trans)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfioc_trans)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_trans), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).esize) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(pfioc_trans), + "::", + stringify!(esize) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).array) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pfioc_trans), + "::", + stringify!(array) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfi_dynaddr { + pub _address: u8, +} From a0849d0aacb7f374af25be0d4856f2520345ecf3 Mon Sep 17 00:00:00 2001 From: Alvin Peters Date: Sun, 16 Jun 2024 03:20:59 +1000 Subject: [PATCH 05/17] Fix FreeBSD pfvar bindings --- src/ffi/mod.rs | 17 ----------------- src/ffi/pfvar.rs | 12 ++++++++++++ 2 files changed, 12 insertions(+), 17 deletions(-) create mode 100644 src/ffi/pfvar.rs diff --git a/src/ffi/mod.rs b/src/ffi/mod.rs index 6fd0463..20d5f99 100644 --- a/src/ffi/mod.rs +++ b/src/ffi/mod.rs @@ -13,23 +13,6 @@ use nix::{ioctl_none, ioctl_readwrite}; #[allow(non_upper_case_globals)] #[allow(non_snake_case)] #[allow(dead_code)] -#[path = "pfvar/macos.rs"] -pub mod pfvar; - -#[cfg(target_os = "freebsd")] -#[allow(non_camel_case_types)] -#[allow(non_upper_case_globals)] -#[allow(non_snake_case)] -#[allow(dead_code)] -#[path = "pfvar/freebsd.rs"] -pub mod pfvar; - -#[cfg(target_os = "openbsd")] -#[allow(non_camel_case_types)] -#[allow(non_upper_case_globals)] -#[allow(non_snake_case)] -#[allow(dead_code)] -#[path = "pfvar/openbsd.rs"] pub mod pfvar; pub mod tcp { diff --git a/src/ffi/pfvar.rs b/src/ffi/pfvar.rs new file mode 100644 index 0000000..b84a577 --- /dev/null +++ b/src/ffi/pfvar.rs @@ -0,0 +1,12 @@ +#[cfg(target_os = "macos")] +include!("./pfvar/macos.rs"); + +#[cfg(target_os = "freebsd")] +include!("./pfvar/freebsd.rs"); + +#[cfg(target_os = "openbsd")] +include!("./pfvar/openbsd.rs"); + +// FreeBSD uses different (but mostly compatible) pfsync_state between FreeBSD 13 and 14 +#[cfg(target_os = "freebsd")] +pub use pfsync_state_1301 as pfsync_state; From 24518714e53b4ea108f3662ca36f2ea33ea930d6 Mon Sep 17 00:00:00 2001 From: Alvin Peters Date: Sun, 16 Jun 2024 03:34:14 +1000 Subject: [PATCH 06/17] Fix binding compile issues --- src/ffi/mod.rs | 1 - src/ffi/pfvar.rs | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ffi/mod.rs b/src/ffi/mod.rs index 20d5f99..99c80c6 100644 --- a/src/ffi/mod.rs +++ b/src/ffi/mod.rs @@ -8,7 +8,6 @@ use nix::{ioctl_none, ioctl_readwrite}; -#[cfg(target_os = "macos")] #[allow(non_camel_case_types)] #[allow(non_upper_case_globals)] #[allow(non_snake_case)] diff --git a/src/ffi/pfvar.rs b/src/ffi/pfvar.rs index b84a577..82d8d92 100644 --- a/src/ffi/pfvar.rs +++ b/src/ffi/pfvar.rs @@ -7,6 +7,9 @@ include!("./pfvar/freebsd.rs"); #[cfg(target_os = "openbsd")] include!("./pfvar/openbsd.rs"); +#[cfg(not(any(target_os = "macos", target_os = "freebsd", target_os = "openbsd")))] +compile_error!("Current operating system is not supported!"); + // FreeBSD uses different (but mostly compatible) pfsync_state between FreeBSD 13 and 14 #[cfg(target_os = "freebsd")] pub use pfsync_state_1301 as pfsync_state; From 2f6573516a872d15b25d82c4a44d306939aade25 Mon Sep 17 00:00:00 2001 From: Alvin Peters Date: Sun, 16 Jun 2024 04:00:38 +1000 Subject: [PATCH 07/17] Include PFR_.* variables to bindgen --- generate_bindings.sh | 1 + src/ffi/mod.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/generate_bindings.sh b/generate_bindings.sh index 5ea7121..f31b0bd 100755 --- a/generate_bindings.sh +++ b/generate_bindings.sh @@ -109,6 +109,7 @@ openbsd() { --allowlist-type pfioc_states \ --allowlist-type pfioc_state_kill \ --allowlist-var PF_.* \ + --allowlist-var PFR_.* \ --allowlist-var PFRULE_.* \ --default-enum-style rust \ -o "${output}" "${input}" diff --git a/src/ffi/mod.rs b/src/ffi/mod.rs index 99c80c6..180490d 100644 --- a/src/ffi/mod.rs +++ b/src/ffi/mod.rs @@ -56,8 +56,10 @@ ioctl_readwrite!(pf_delete_rule, b'D', 28, pfvar::pfioc_rule); // DIOCKILLSTATES ioctl_readwrite!(pf_kill_states, b'D', 41, pfvar::pfioc_state_kill); // DIOCBEGINADDRS +#[cfg(any(target_os = "macos", target_os = "freebsd"))] ioctl_readwrite!(pf_begin_addrs, b'D', 51, pfvar::pfioc_pooladdr); // DIOCADDADDR +#[cfg(any(target_os = "macos", target_os = "freebsd"))] ioctl_readwrite!(pf_add_addr, b'D', 52, pfvar::pfioc_pooladdr); // DIOCXBEGIN ioctl_readwrite!(pf_begin_trans, b'D', 81, pfvar::pfioc_trans); From 763ee87f283627ca8141f9c44a6d7b267dcccd80 Mon Sep 17 00:00:00 2001 From: Alvin Peters Date: Sun, 16 Jun 2024 04:10:18 +1000 Subject: [PATCH 08/17] Fix generate_bindings.sh, again --- generate_bindings.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate_bindings.sh b/generate_bindings.sh index f31b0bd..96a80be 100755 --- a/generate_bindings.sh +++ b/generate_bindings.sh @@ -66,7 +66,6 @@ mac_os() { freebsd() { if [ -z "${1}" ]; then input=/usr/include/net/pfvar.h - printf "#include \n#include " > _pfvar_wrapper.h else input=${1} fi @@ -94,6 +93,7 @@ openbsd() { else input=${1} fi + output=${2:-./src/ffi/pfvar/openbsd.rs} # OpenBSD has a weird way of packaging LLVM/Clang. Needs to be manually specified. if [ -z "$LIBCLANG_PATH" ]; then >&2 echo "\$LIBCLANG_PATH is missing. An LLVM toolchain has to be installed first e.g.: pkg_add llvm17" From 25f801d4be015c1c555048e9944ad10c947d17a1 Mon Sep 17 00:00:00 2001 From: Alvin Peters Date: Sun, 16 Jun 2024 04:12:26 +1000 Subject: [PATCH 09/17] Include PFR_.* variables --- src/ffi/pfvar/openbsd.rs | 80 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/src/ffi/pfvar/openbsd.rs b/src/ffi/pfvar/openbsd.rs index 9f0fbd0..9c209f0 100644 --- a/src/ffi/pfvar/openbsd.rs +++ b/src/ffi/pfvar/openbsd.rs @@ -123,6 +123,16 @@ pub const PFRULE_AFTO: u32 = 2097152; pub const PFRULE_EXPIRED: u32 = 4194304; pub const PF_PKTDELAY_MAXPKTS: u32 = 10000; pub const PF_RESERVED_ANCHOR: &[u8; 4] = b"_pf\0"; +pub const PFR_TFLAG_PERSIST: u32 = 1; +pub const PFR_TFLAG_CONST: u32 = 2; +pub const PFR_TFLAG_ACTIVE: u32 = 4; +pub const PFR_TFLAG_INACTIVE: u32 = 8; +pub const PFR_TFLAG_REFERENCED: u32 = 16; +pub const PFR_TFLAG_REFDANCHOR: u32 = 32; +pub const PFR_TFLAG_COUNTERS: u32 = 64; +pub const PFR_TFLAG_USRMASK: u32 = 67; +pub const PFR_TFLAG_SETMASK: u32 = 60; +pub const PFR_TFLAG_ALLMASK: u32 = 127; pub const PF_DPORT_RANGE: u32 = 1; pub const PF_RPORT_RANGE: u32 = 2; pub const PF_REASS_ENABLED: u32 = 1; @@ -134,6 +144,16 @@ pub const PF_SYNCOOKIES_MODE_MAX: u32 = 2; pub const PF_SYNCOOKIES_HIWATPCT: u32 = 25; pub const PF_SYNCOOKIES_LOWATPCT: u32 = 12; pub const PF_PRIO_ZERO: u32 = 255; +pub const PFR_KTABLE_HIWAT: u32 = 1000; +pub const PFR_KENTRY_HIWAT: u32 = 200000; +pub const PFR_KENTRY_HIWAT_SMALL: u32 = 100000; +pub const PFR_FLAG_DUMMY: u32 = 2; +pub const PFR_FLAG_FEEDBACK: u32 = 4; +pub const PFR_FLAG_CLSTATS: u32 = 8; +pub const PFR_FLAG_ADDRSTOO: u32 = 16; +pub const PFR_FLAG_REPLACE: u32 = 32; +pub const PFR_FLAG_ALLRSETS: u32 = 64; +pub const PFR_FLAG_ALLMASK: u32 = 127; pub type __uint8_t = ::std::os::raw::c_uchar; pub type __uint16_t = ::std::os::raw::c_ushort; pub type __int32_t = ::std::os::raw::c_int; @@ -4081,6 +4101,66 @@ fn bindgen_test_layout_pfr_table() { ) ); } +pub const PFR_FB_NONE: _bindgen_ty_14 = _bindgen_ty_14::PFR_FB_NONE; +pub const PFR_FB_MATCH: _bindgen_ty_14 = _bindgen_ty_14::PFR_FB_MATCH; +pub const PFR_FB_ADDED: _bindgen_ty_14 = _bindgen_ty_14::PFR_FB_ADDED; +pub const PFR_FB_DELETED: _bindgen_ty_14 = _bindgen_ty_14::PFR_FB_DELETED; +pub const PFR_FB_CHANGED: _bindgen_ty_14 = _bindgen_ty_14::PFR_FB_CHANGED; +pub const PFR_FB_CLEARED: _bindgen_ty_14 = _bindgen_ty_14::PFR_FB_CLEARED; +pub const PFR_FB_DUPLICATE: _bindgen_ty_14 = _bindgen_ty_14::PFR_FB_DUPLICATE; +pub const PFR_FB_NOTMATCH: _bindgen_ty_14 = _bindgen_ty_14::PFR_FB_NOTMATCH; +pub const PFR_FB_CONFLICT: _bindgen_ty_14 = _bindgen_ty_14::PFR_FB_CONFLICT; +pub const PFR_FB_NOCOUNT: _bindgen_ty_14 = _bindgen_ty_14::PFR_FB_NOCOUNT; +pub const PFR_FB_MAX: _bindgen_ty_14 = _bindgen_ty_14::PFR_FB_MAX; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_14 { + PFR_FB_NONE = 0, + PFR_FB_MATCH = 1, + PFR_FB_ADDED = 2, + PFR_FB_DELETED = 3, + PFR_FB_CHANGED = 4, + PFR_FB_CLEARED = 5, + PFR_FB_DUPLICATE = 6, + PFR_FB_NOTMATCH = 7, + PFR_FB_CONFLICT = 8, + PFR_FB_NOCOUNT = 9, + PFR_FB_MAX = 10, +} +pub const PFR_DIR_IN: _bindgen_ty_15 = _bindgen_ty_15::PFR_DIR_IN; +pub const PFR_DIR_OUT: _bindgen_ty_15 = _bindgen_ty_15::PFR_DIR_OUT; +pub const PFR_DIR_MAX: _bindgen_ty_15 = _bindgen_ty_15::PFR_DIR_MAX; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_15 { + PFR_DIR_IN = 0, + PFR_DIR_OUT = 1, + PFR_DIR_MAX = 2, +} +pub const PFR_OP_BLOCK: _bindgen_ty_16 = _bindgen_ty_16::PFR_OP_BLOCK; +pub const PFR_OP_MATCH: _bindgen_ty_16 = _bindgen_ty_16::PFR_OP_MATCH; +pub const PFR_OP_PASS: _bindgen_ty_16 = _bindgen_ty_16::PFR_OP_PASS; +pub const PFR_OP_ADDR_MAX: _bindgen_ty_16 = _bindgen_ty_16::PFR_OP_ADDR_MAX; +pub const PFR_OP_TABLE_MAX: _bindgen_ty_16 = _bindgen_ty_16::PFR_OP_TABLE_MAX; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_16 { + PFR_OP_BLOCK = 0, + PFR_OP_MATCH = 1, + PFR_OP_PASS = 2, + PFR_OP_ADDR_MAX = 3, + PFR_OP_TABLE_MAX = 4, +} +pub const PFR_REFCNT_RULE: _bindgen_ty_17 = _bindgen_ty_17::PFR_REFCNT_RULE; +pub const PFR_REFCNT_ANCHOR: _bindgen_ty_17 = _bindgen_ty_17::PFR_REFCNT_ANCHOR; +pub const PFR_REFCNT_MAX: _bindgen_ty_17 = _bindgen_ty_17::PFR_REFCNT_MAX; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_17 { + PFR_REFCNT_RULE = 0, + PFR_REFCNT_ANCHOR = 1, + PFR_REFCNT_MAX = 2, +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct pfr_tstats { From f3e1de3dd54aa896b9c42a33593d6f07bba111f0 Mon Sep 17 00:00:00 2001 From: Alvin Peters Date: Sun, 16 Jun 2024 04:17:57 +1000 Subject: [PATCH 10/17] Add pfr_addr to OpenBSD binding --- generate_bindings.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/generate_bindings.sh b/generate_bindings.sh index 96a80be..a2b3097 100755 --- a/generate_bindings.sh +++ b/generate_bindings.sh @@ -108,6 +108,7 @@ openbsd() { --allowlist-type pfioc_trans \ --allowlist-type pfioc_states \ --allowlist-type pfioc_state_kill \ + --allowlist-type pfr_table \ --allowlist-var PF_.* \ --allowlist-var PFR_.* \ --allowlist-var PFRULE_.* \ From 48eeddaa47604edf9a2dd16c2767431fe99778b8 Mon Sep 17 00:00:00 2001 From: Alvin Peters Date: Sun, 16 Jun 2024 04:23:19 +1000 Subject: [PATCH 11/17] pfr_addr not pfr_table! --- generate_bindings.sh | 2 +- src/ffi/pfvar/openbsd.rs | 171 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 172 insertions(+), 1 deletion(-) diff --git a/generate_bindings.sh b/generate_bindings.sh index a2b3097..8ac6a63 100755 --- a/generate_bindings.sh +++ b/generate_bindings.sh @@ -108,7 +108,7 @@ openbsd() { --allowlist-type pfioc_trans \ --allowlist-type pfioc_states \ --allowlist-type pfioc_state_kill \ - --allowlist-type pfr_table \ + --allowlist-type pfr_addr \ --allowlist-var PF_.* \ --allowlist-var PFR_.* \ --allowlist-var PFRULE_.* \ diff --git a/src/ffi/pfvar/openbsd.rs b/src/ffi/pfvar/openbsd.rs index 9c209f0..32685e8 100644 --- a/src/ffi/pfvar/openbsd.rs +++ b/src/ffi/pfvar/openbsd.rs @@ -4127,6 +4127,177 @@ pub enum _bindgen_ty_14 { PFR_FB_NOCOUNT = 9, PFR_FB_MAX = 10, } +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pfr_addr { + pub pfra_u: pfr_addr__bindgen_ty_1, + pub pfra_ifname: [::std::os::raw::c_char; 16usize], + pub pfra_states: u_int32_t, + pub pfra_weight: u_int16_t, + pub pfra_af: u_int8_t, + pub pfra_net: u_int8_t, + pub pfra_not: u_int8_t, + pub pfra_fback: u_int8_t, + pub pfra_type: u_int8_t, + pub pad: [u_int8_t; 7usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pfr_addr__bindgen_ty_1 { + pub _pfra_ip4addr: in_addr, + pub _pfra_ip6addr: in6_addr, +} +#[test] +fn bindgen_test_layout_pfr_addr__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(pfr_addr__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pfr_addr__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._pfra_ip4addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfr_addr__bindgen_ty_1), + "::", + stringify!(_pfra_ip4addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._pfra_ip6addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfr_addr__bindgen_ty_1), + "::", + stringify!(_pfra_ip6addr) + ) + ); +} +#[test] +fn bindgen_test_layout_pfr_addr() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 52usize, + concat!("Size of: ", stringify!(pfr_addr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pfr_addr)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfra_u) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfr_addr), + "::", + stringify!(pfra_u) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfra_ifname) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pfr_addr), + "::", + stringify!(pfra_ifname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfra_states) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(pfr_addr), + "::", + stringify!(pfra_states) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfra_weight) as usize - ptr as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(pfr_addr), + "::", + stringify!(pfra_weight) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfra_af) as usize - ptr as usize }, + 38usize, + concat!( + "Offset of field: ", + stringify!(pfr_addr), + "::", + stringify!(pfra_af) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfra_net) as usize - ptr as usize }, + 39usize, + concat!( + "Offset of field: ", + stringify!(pfr_addr), + "::", + stringify!(pfra_net) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfra_not) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(pfr_addr), + "::", + stringify!(pfra_not) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfra_fback) as usize - ptr as usize }, + 41usize, + concat!( + "Offset of field: ", + stringify!(pfr_addr), + "::", + stringify!(pfra_fback) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfra_type) as usize - ptr as usize }, + 42usize, + concat!( + "Offset of field: ", + stringify!(pfr_addr), + "::", + stringify!(pfra_type) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, + 43usize, + concat!( + "Offset of field: ", + stringify!(pfr_addr), + "::", + stringify!(pad) + ) + ); +} pub const PFR_DIR_IN: _bindgen_ty_15 = _bindgen_ty_15::PFR_DIR_IN; pub const PFR_DIR_OUT: _bindgen_ty_15 = _bindgen_ty_15::PFR_DIR_OUT; pub const PFR_DIR_MAX: _bindgen_ty_15 = _bindgen_ty_15::PFR_DIR_MAX; From 5340d2c809444e7b147f0805d7fa11a6d61ff7b4 Mon Sep 17 00:00:00 2001 From: Alvin Peters Date: Sun, 16 Jun 2024 04:35:53 +1000 Subject: [PATCH 12/17] Actually add pfioc_table --- generate_bindings.sh | 2 +- src/ffi/pfvar/openbsd.rs | 209 ++++++++++++++++++++++++--------------- 2 files changed, 130 insertions(+), 81 deletions(-) diff --git a/generate_bindings.sh b/generate_bindings.sh index 8ac6a63..7569dd8 100755 --- a/generate_bindings.sh +++ b/generate_bindings.sh @@ -105,12 +105,12 @@ openbsd() { --allowlist-type pf_status \ --allowlist-type pfioc_rule \ --allowlist-type pfioc_pooladdr \ + --allowlist-type pfioc_table \ --allowlist-type pfioc_trans \ --allowlist-type pfioc_states \ --allowlist-type pfioc_state_kill \ --allowlist-type pfr_addr \ --allowlist-var PF_.* \ - --allowlist-var PFR_.* \ --allowlist-var PFRULE_.* \ --default-enum-style rust \ -o "${output}" "${input}" diff --git a/src/ffi/pfvar/openbsd.rs b/src/ffi/pfvar/openbsd.rs index 32685e8..9fe9769 100644 --- a/src/ffi/pfvar/openbsd.rs +++ b/src/ffi/pfvar/openbsd.rs @@ -123,16 +123,6 @@ pub const PFRULE_AFTO: u32 = 2097152; pub const PFRULE_EXPIRED: u32 = 4194304; pub const PF_PKTDELAY_MAXPKTS: u32 = 10000; pub const PF_RESERVED_ANCHOR: &[u8; 4] = b"_pf\0"; -pub const PFR_TFLAG_PERSIST: u32 = 1; -pub const PFR_TFLAG_CONST: u32 = 2; -pub const PFR_TFLAG_ACTIVE: u32 = 4; -pub const PFR_TFLAG_INACTIVE: u32 = 8; -pub const PFR_TFLAG_REFERENCED: u32 = 16; -pub const PFR_TFLAG_REFDANCHOR: u32 = 32; -pub const PFR_TFLAG_COUNTERS: u32 = 64; -pub const PFR_TFLAG_USRMASK: u32 = 67; -pub const PFR_TFLAG_SETMASK: u32 = 60; -pub const PFR_TFLAG_ALLMASK: u32 = 127; pub const PF_DPORT_RANGE: u32 = 1; pub const PF_RPORT_RANGE: u32 = 2; pub const PF_REASS_ENABLED: u32 = 1; @@ -144,16 +134,6 @@ pub const PF_SYNCOOKIES_MODE_MAX: u32 = 2; pub const PF_SYNCOOKIES_HIWATPCT: u32 = 25; pub const PF_SYNCOOKIES_LOWATPCT: u32 = 12; pub const PF_PRIO_ZERO: u32 = 255; -pub const PFR_KTABLE_HIWAT: u32 = 1000; -pub const PFR_KENTRY_HIWAT: u32 = 200000; -pub const PFR_KENTRY_HIWAT_SMALL: u32 = 100000; -pub const PFR_FLAG_DUMMY: u32 = 2; -pub const PFR_FLAG_FEEDBACK: u32 = 4; -pub const PFR_FLAG_CLSTATS: u32 = 8; -pub const PFR_FLAG_ADDRSTOO: u32 = 16; -pub const PFR_FLAG_REPLACE: u32 = 32; -pub const PFR_FLAG_ALLRSETS: u32 = 64; -pub const PFR_FLAG_ALLMASK: u32 = 127; pub type __uint8_t = ::std::os::raw::c_uchar; pub type __uint16_t = ::std::os::raw::c_ushort; pub type __int32_t = ::std::os::raw::c_int; @@ -4101,32 +4081,6 @@ fn bindgen_test_layout_pfr_table() { ) ); } -pub const PFR_FB_NONE: _bindgen_ty_14 = _bindgen_ty_14::PFR_FB_NONE; -pub const PFR_FB_MATCH: _bindgen_ty_14 = _bindgen_ty_14::PFR_FB_MATCH; -pub const PFR_FB_ADDED: _bindgen_ty_14 = _bindgen_ty_14::PFR_FB_ADDED; -pub const PFR_FB_DELETED: _bindgen_ty_14 = _bindgen_ty_14::PFR_FB_DELETED; -pub const PFR_FB_CHANGED: _bindgen_ty_14 = _bindgen_ty_14::PFR_FB_CHANGED; -pub const PFR_FB_CLEARED: _bindgen_ty_14 = _bindgen_ty_14::PFR_FB_CLEARED; -pub const PFR_FB_DUPLICATE: _bindgen_ty_14 = _bindgen_ty_14::PFR_FB_DUPLICATE; -pub const PFR_FB_NOTMATCH: _bindgen_ty_14 = _bindgen_ty_14::PFR_FB_NOTMATCH; -pub const PFR_FB_CONFLICT: _bindgen_ty_14 = _bindgen_ty_14::PFR_FB_CONFLICT; -pub const PFR_FB_NOCOUNT: _bindgen_ty_14 = _bindgen_ty_14::PFR_FB_NOCOUNT; -pub const PFR_FB_MAX: _bindgen_ty_14 = _bindgen_ty_14::PFR_FB_MAX; -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum _bindgen_ty_14 { - PFR_FB_NONE = 0, - PFR_FB_MATCH = 1, - PFR_FB_ADDED = 2, - PFR_FB_DELETED = 3, - PFR_FB_CHANGED = 4, - PFR_FB_CLEARED = 5, - PFR_FB_DUPLICATE = 6, - PFR_FB_NOTMATCH = 7, - PFR_FB_CONFLICT = 8, - PFR_FB_NOCOUNT = 9, - PFR_FB_MAX = 10, -} #[repr(C)] #[derive(Copy, Clone)] pub struct pfr_addr { @@ -4298,40 +4252,6 @@ fn bindgen_test_layout_pfr_addr() { ) ); } -pub const PFR_DIR_IN: _bindgen_ty_15 = _bindgen_ty_15::PFR_DIR_IN; -pub const PFR_DIR_OUT: _bindgen_ty_15 = _bindgen_ty_15::PFR_DIR_OUT; -pub const PFR_DIR_MAX: _bindgen_ty_15 = _bindgen_ty_15::PFR_DIR_MAX; -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum _bindgen_ty_15 { - PFR_DIR_IN = 0, - PFR_DIR_OUT = 1, - PFR_DIR_MAX = 2, -} -pub const PFR_OP_BLOCK: _bindgen_ty_16 = _bindgen_ty_16::PFR_OP_BLOCK; -pub const PFR_OP_MATCH: _bindgen_ty_16 = _bindgen_ty_16::PFR_OP_MATCH; -pub const PFR_OP_PASS: _bindgen_ty_16 = _bindgen_ty_16::PFR_OP_PASS; -pub const PFR_OP_ADDR_MAX: _bindgen_ty_16 = _bindgen_ty_16::PFR_OP_ADDR_MAX; -pub const PFR_OP_TABLE_MAX: _bindgen_ty_16 = _bindgen_ty_16::PFR_OP_TABLE_MAX; -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum _bindgen_ty_16 { - PFR_OP_BLOCK = 0, - PFR_OP_MATCH = 1, - PFR_OP_PASS = 2, - PFR_OP_ADDR_MAX = 3, - PFR_OP_TABLE_MAX = 4, -} -pub const PFR_REFCNT_RULE: _bindgen_ty_17 = _bindgen_ty_17::PFR_REFCNT_RULE; -pub const PFR_REFCNT_ANCHOR: _bindgen_ty_17 = _bindgen_ty_17::PFR_REFCNT_ANCHOR; -pub const PFR_REFCNT_MAX: _bindgen_ty_17 = _bindgen_ty_17::PFR_REFCNT_MAX; -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum _bindgen_ty_17 { - PFR_REFCNT_RULE = 0, - PFR_REFCNT_ANCHOR = 1, - PFR_REFCNT_MAX = 2, -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct pfr_tstats { @@ -5650,6 +5570,135 @@ fn bindgen_test_layout_pfioc_trans() { } #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct pfioc_table { + pub pfrio_table: pfr_table, + pub pfrio_buffer: *mut ::std::os::raw::c_void, + pub pfrio_esize: ::std::os::raw::c_int, + pub pfrio_size: ::std::os::raw::c_int, + pub pfrio_size2: ::std::os::raw::c_int, + pub pfrio_nadd: ::std::os::raw::c_int, + pub pfrio_ndel: ::std::os::raw::c_int, + pub pfrio_nchange: ::std::os::raw::c_int, + pub pfrio_flags: ::std::os::raw::c_int, + pub pfrio_ticket: u_int32_t, +} +#[test] +fn bindgen_test_layout_pfioc_table() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 1104usize, + concat!("Size of: ", stringify!(pfioc_table)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfioc_table)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrio_table) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_table), + "::", + stringify!(pfrio_table) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrio_buffer) as usize - ptr as usize }, + 1064usize, + concat!( + "Offset of field: ", + stringify!(pfioc_table), + "::", + stringify!(pfrio_buffer) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrio_esize) as usize - ptr as usize }, + 1072usize, + concat!( + "Offset of field: ", + stringify!(pfioc_table), + "::", + stringify!(pfrio_esize) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrio_size) as usize - ptr as usize }, + 1076usize, + concat!( + "Offset of field: ", + stringify!(pfioc_table), + "::", + stringify!(pfrio_size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrio_size2) as usize - ptr as usize }, + 1080usize, + concat!( + "Offset of field: ", + stringify!(pfioc_table), + "::", + stringify!(pfrio_size2) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrio_nadd) as usize - ptr as usize }, + 1084usize, + concat!( + "Offset of field: ", + stringify!(pfioc_table), + "::", + stringify!(pfrio_nadd) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrio_ndel) as usize - ptr as usize }, + 1088usize, + concat!( + "Offset of field: ", + stringify!(pfioc_table), + "::", + stringify!(pfrio_ndel) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrio_nchange) as usize - ptr as usize }, + 1092usize, + concat!( + "Offset of field: ", + stringify!(pfioc_table), + "::", + stringify!(pfrio_nchange) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrio_flags) as usize - ptr as usize }, + 1096usize, + concat!( + "Offset of field: ", + stringify!(pfioc_table), + "::", + stringify!(pfrio_flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrio_ticket) as usize - ptr as usize }, + 1100usize, + concat!( + "Offset of field: ", + stringify!(pfioc_table), + "::", + stringify!(pfrio_ticket) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct pfi_dynaddr { pub _address: u8, } From 8cdacda85232997d0ed6012959c41c957c6e3ec4 Mon Sep 17 00:00:00 2001 From: Alvin Peters Date: Sun, 16 Jun 2024 08:42:34 +1000 Subject: [PATCH 13/17] Do some work on enabling Open/FreeBSD support --- src/ffi/mod.rs | 4 ++++ src/lib.rs | 4 ++++ src/utils.rs | 10 ++++++++++ 3 files changed, 18 insertions(+) diff --git a/src/ffi/mod.rs b/src/ffi/mod.rs index 180490d..1bd83af 100644 --- a/src/ffi/mod.rs +++ b/src/ffi/mod.rs @@ -61,6 +61,10 @@ ioctl_readwrite!(pf_begin_addrs, b'D', 51, pfvar::pfioc_pooladdr); // DIOCADDADDR #[cfg(any(target_os = "macos", target_os = "freebsd"))] ioctl_readwrite!(pf_add_addr, b'D', 52, pfvar::pfioc_pooladdr); + +#[cfg(target_os = "openbsd")] + + // DIOCXBEGIN ioctl_readwrite!(pf_begin_trans, b'D', 81, pfvar::pfioc_trans); // DIOCXCOMMIT diff --git a/src/lib.rs b/src/lib.rs index d22a03d..7634f98 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -232,6 +232,8 @@ impl PfCtl { pub fn add_rule(&mut self, anchor: &str, rule: &FilterRule) -> Result<()> { let mut pfioc_rule = unsafe { mem::zeroed::() }; + // OpenBSD has no pool tickets + #[cfg(any(target_os = "macos", target_os = "freebsd"))] pfioc_rule.pool_ticket = utils::get_pool_ticket(self.fd())?; pfioc_rule.ticket = utils::get_ticket(self.fd(), anchor, AnchorKind::Filter)?; anchor @@ -257,6 +259,8 @@ impl PfCtl { // register redirect address in newly created address pool let redirect_to = rule.get_redirect_to(); + // OpenBSD has no pool tickets + #[cfg(any(target_os = "macos", target_os = "freebsd"))] let pool_ticket = utils::get_pool_ticket(self.fd())?; utils::add_pool_address(self.fd(), redirect_to.ip(), pool_ticket)?; diff --git a/src/utils.rs b/src/utils.rs index b45b18a..a0ae890 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -26,6 +26,7 @@ pub fn open_pf() -> Result { } /// Add pool address using the pool ticket previously obtained via `get_pool_ticket()` +#[cfg(any(target_os = "macos", target_os = "freebsd"))] pub fn add_pool_address>( fd: RawFd, pool_addr: A, @@ -38,12 +39,21 @@ pub fn add_pool_address>( } /// Get pool ticket +#[cfg(any(target_os = "macos", target_os = "freebsd"))] pub fn get_pool_ticket(fd: RawFd) -> Result { let mut pfioc_pooladdr = unsafe { mem::zeroed::() }; ioctl_guard!(ffi::pf_begin_addrs(fd, &mut pfioc_pooladdr))?; Ok(pfioc_pooladdr.ticket) } +/// Get table ticket +#[cfg(target_os = "openbsd")] +pub fn get_table_ticket(fd: RawFd) -> Result { + let mut pfioc_table = unsafe { mem::zeroed::() }; + ioctl_guard!(ffi::pf_begin_addrs(fd, &mut pfioc_pooladdr))?; + Ok(pfioc_pooladdr.ticket) +} + pub fn get_ticket(fd: RawFd, anchor: &str, kind: AnchorKind) -> Result { let mut pfioc_rule = unsafe { mem::zeroed::() }; pfioc_rule.action = ffi::pfvar::PF_CHANGE_GET_TICKET as u32; From 71962eaec195db8151366e4551026927c611e6ae Mon Sep 17 00:00:00 2001 From: Alvin Peters Date: Sun, 16 Jun 2024 12:04:41 +1000 Subject: [PATCH 14/17] Save current work, add pf_rulset to bindings Just realised that anchors = pf_ruleset on BSDs --- generate_bindings.sh | 5 +- src/ffi/mod.rs | 11 +++- src/lib.rs | 126 +++++++++++++++++++++++++++++++------------ src/utils.rs | 25 +++++---- 4 files changed, 119 insertions(+), 48 deletions(-) diff --git a/generate_bindings.sh b/generate_bindings.sh index 7569dd8..daf68b0 100755 --- a/generate_bindings.sh +++ b/generate_bindings.sh @@ -104,12 +104,13 @@ openbsd() { bindgen \ --allowlist-type pf_status \ --allowlist-type pfioc_rule \ + --allowlist-type pfioc_ruleset \ --allowlist-type pfioc_pooladdr \ - --allowlist-type pfioc_table \ + --allowlist-type pfioc_table \ --allowlist-type pfioc_trans \ --allowlist-type pfioc_states \ --allowlist-type pfioc_state_kill \ - --allowlist-type pfr_addr \ + --allowlist-type pfr_addr \ --allowlist-var PF_.* \ --allowlist-var PFRULE_.* \ --default-enum-style rust \ diff --git a/src/ffi/mod.rs b/src/ffi/mod.rs index 1bd83af..ec23622 100644 --- a/src/ffi/mod.rs +++ b/src/ffi/mod.rs @@ -50,8 +50,11 @@ ioctl_readwrite!(pf_get_states, b'D', 25, pfvar::pfioc_states); // DIOCCHANGERULE ioctl_readwrite!(pf_change_rule, b'D', 26, pfvar::pfioc_rule); // DIOCINSERTRULE +// Substituted on FreeBSD and OpenBSD by DIOCCHANGERULE with rule.action = PF_CHANGE_REMOVE ioctl_readwrite!(pf_insert_rule, b'D', 27, pfvar::pfioc_rule); // DIOCDELETERULE +// Substituted on FreeBSD and OpenBSD by DIOCCHANGERULE with rule.action = PF_CHANGE_REMOVE +#[cfg(any(target_os = "macos"))] ioctl_readwrite!(pf_delete_rule, b'D', 28, pfvar::pfioc_rule); // DIOCKILLSTATES ioctl_readwrite!(pf_kill_states, b'D', 41, pfvar::pfioc_state_kill); @@ -62,10 +65,14 @@ ioctl_readwrite!(pf_begin_addrs, b'D', 51, pfvar::pfioc_pooladdr); #[cfg(any(target_os = "macos", target_os = "freebsd"))] ioctl_readwrite!(pf_add_addr, b'D', 52, pfvar::pfioc_pooladdr); -#[cfg(target_os = "openbsd")] - // DIOCXBEGIN ioctl_readwrite!(pf_begin_trans, b'D', 81, pfvar::pfioc_trans); // DIOCXCOMMIT ioctl_readwrite!(pf_commit_trans, b'D', 82, pfvar::pfioc_trans); + +// DIOCXEND +// Required by OpenBSD to release the ticket obtained by the DIOCGETRULES command. +// TODO: Switch to openbsd before push +#[cfg(any(target_os = "macos"))] +ioctl_readwrite!(pf_end_trans, b'D', 100, pfvar::u_int32_t); \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 7634f98..07e33d3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -198,30 +198,66 @@ impl PfCtl { pub fn add_anchor(&mut self, name: &str, kind: AnchorKind) -> Result<()> { let mut pfioc_rule = unsafe { mem::zeroed::() }; - - pfioc_rule.rule.action = kind.into(); - name.try_copy_to(&mut pfioc_rule.anchor_call[..]) - .chain_err(|| ErrorKind::InvalidArgument("Invalid anchor name"))?; - - ioctl_guard!(ffi::pf_insert_rule(self.fd(), &mut pfioc_rule))?; + #[cfg(target_os = "macos")] { + pfioc_rule.rule.action = kind.into(); + name.try_copy_to(&mut pfioc_rule.anchor_call[..]) + .chain_err(|| ErrorKind::InvalidArgument("Invalid anchor name"))?; + ioctl_guard!(ffi::pf_insert_rule(self.fd(), &mut pfioc_rule))?; + } + #[cfg(any(target_os = "freebsd", target_os = "openbsd"))] { + anchor_rule.ticket = utils::get_ticket( + self.fd(), + name, + )?; + anchor_rule.rule.action = ffi::pfvar::PF_CHANGE_REMOVE as u32; + ioctl_guard!(ffi::pf_change_rule(self.fd(), &mut pfioc_rule)) + } Ok(()) } /// Same as `add_anchor`, but `StateAlreadyActive` errors are supressed and exchanged for /// `Ok(())`. - pub fn try_add_anchor(&mut self, name: &str, kind: AnchorKind) -> Result<()> { - ignore_error_kind!(self.add_anchor(name, kind), ErrorKind::StateAlreadyActive) + pub fn try_add_anchor( + &mut self, name: &str, + #[cfg(target_os = "macos")] + kind: AnchorKind + ) -> Result<()> { + ignore_error_kind!( + self.add_anchor(name, + #[cfg(target_os = "macos")] + kind + ), ErrorKind::StateAlreadyActive) } - pub fn remove_anchor(&mut self, name: &str, kind: AnchorKind) -> Result<()> { + pub fn remove_anchor( + &mut self, + name: &str, + #[cfg(target_os = "macos")] + kind: AnchorKind + ) -> Result<()> { self.with_anchor_rule(name, kind, |mut anchor_rule| { - ioctl_guard!(ffi::pf_delete_rule(self.fd(), &mut anchor_rule)) + #[cfg(target_os = "macos")] + return ioctl_guard!(ffi::pf_delete_rule(self.fd(), &mut anchor_rule)); + #[cfg(any(target_os = "freebsd", target_os = "openbsd"))] { + anchor_rule.ticket = utils::get_ticket( + self.fd(), + name, + )?; + anchor_rule.rule.action = ffi::pfvar::PF_CHANGE_REMOVE as u32; + ioctl_guard!(ffi::pf_change_rule(self.fd(), &mut pfioc_rule)) + } + }) } /// Same as `remove_anchor`, but `AnchorDoesNotExist` errors are supressed and exchanged for /// `Ok(())`. - pub fn try_remove_anchor(&mut self, name: &str, kind: AnchorKind) -> Result<()> { + pub fn try_remove_anchor( + &mut self, + name: &str, + #[cfg(target_os = "macos")] + kind: AnchorKind + ) -> Result<()> { ignore_error_kind!( self.remove_anchor(name, kind), ErrorKind::AnchorDoesNotExist @@ -233,15 +269,25 @@ impl PfCtl { let mut pfioc_rule = unsafe { mem::zeroed::() }; // OpenBSD has no pool tickets - #[cfg(any(target_os = "macos", target_os = "freebsd"))] - pfioc_rule.pool_ticket = utils::get_pool_ticket(self.fd())?; - pfioc_rule.ticket = utils::get_ticket(self.fd(), anchor, AnchorKind::Filter)?; + #[cfg(any(target_os = "macos", target_os = "freebsd"))] { + pfioc_rule.pool_ticket = utils::get_pool_ticket(self.fd())?; + } + pfioc_rule.ticket = utils::get_ticket( + self.fd(), + anchor, + #[cfg(target_os = "macos")] + AnchorKind::Filter + )?; anchor .try_copy_to(&mut pfioc_rule.anchor[..]) .chain_err(|| ErrorKind::InvalidArgument("Invalid anchor name"))?; rule.try_copy_to(&mut pfioc_rule.rule)?; - - pfioc_rule.action = ffi::pfvar::PF_CHANGE_ADD_TAIL as u32; + #[cfg(target_os = "macos")] { + pfioc_rule.action = ffi::pfvar::PF_CHANGE_ADD_TAIL as u32; + } + #[cfg(any(target_os = "freebsd", target_os = "openbsd"))] { + pfioc_rule.rule.action = ffi::pfvar::PF_CHANGE_ADD_TAIL as u32; + } ioctl_guard!(ffi::pf_change_rule(self.fd(), &mut pfioc_rule)) } @@ -260,17 +306,17 @@ impl PfCtl { // register redirect address in newly created address pool let redirect_to = rule.get_redirect_to(); // OpenBSD has no pool tickets - #[cfg(any(target_os = "macos", target_os = "freebsd"))] - let pool_ticket = utils::get_pool_ticket(self.fd())?; - utils::add_pool_address(self.fd(), redirect_to.ip(), pool_ticket)?; - - // copy address pool in pf_rule - let redirect_pool = redirect_to.ip().to_pool_addr_list()?; - pfioc_rule.rule.rpool.list = unsafe { redirect_pool.to_palist() }; - redirect_to.port().try_copy_to(&mut pfioc_rule.rule.rpool)?; + #[cfg(any(target_os = "macos", target_os = "freebsd"))] { + let pool_ticket = utils::get_pool_ticket(self.fd())?; + utils::add_pool_address(self.fd(), redirect_to.ip(), pool_ticket)?; + let redirect_pool = redirect_to.ip().to_pool_addr_list()?; + pfioc_rule.rule.rpool.list = unsafe { redirect_pool.to_palist() }; + redirect_to.port().try_copy_to(&mut pfioc_rule.rule.rpool)?; + // set pool ticket + pfioc_rule.pool_ticket = pool_ticket; + } - // set tickets - pfioc_rule.pool_ticket = pool_ticket; + // set ticket pfioc_rule.ticket = utils::get_ticket(self.fd(), anchor, AnchorKind::Redirect)?; // append rule @@ -352,15 +398,29 @@ impl PfCtl { where F: FnOnce(ffi::pfvar::pfioc_rule) -> Result, { - let mut pfioc_rule = unsafe { mem::zeroed::() }; - pfioc_rule.rule.action = kind.into(); - ioctl_guard!(ffi::pf_get_rules(self.fd(), &mut pfioc_rule))?; - pfioc_rule.action = ffi::pfvar::PF_GET_NONE as u32; - for i in 0..pfioc_rule.nr { - pfioc_rule.nr = i; + #[cfg(target_os = "macos")] { + let mut pfioc_rule = unsafe { mem::zeroed::() }; + pfioc_rule.rule.action = kind.into(); + ioctl_guard!(ffi::pf_get_rules(self.fd(), &mut pfioc_rule))?; + pfioc_rule.action = ffi::pfvar::PF_GET_NONE as u32; + for i in 0..pfioc_rule.nr { + pfioc_rule.nr = i; + ioctl_guard!(ffi::pf_get_rule(self.fd(), &mut pfioc_rule))?; + if compare_cstr_safe(name, &pfioc_rule.anchor_call)? { + return f(pfioc_rule); + } + } + } + #[cfg(any(target_os = "freebsd", target_os = "openbsd"))] { + let mut pfioc_rule = unsafe { mem::zeroed::() }; + ioctl_guard!(ffi::pf_get_rules(self.fd(), &mut pfioc_rule))?; + pfioc_rule.rule.action = ffi::pfvar::PF_GET_NONE as u8; ioctl_guard!(ffi::pf_get_rule(self.fd(), &mut pfioc_rule))?; if compare_cstr_safe(name, &pfioc_rule.anchor_call)? { - return f(pfioc_rule); + let mut ticket = pfioc_rule.ticket; + let res = f(pfioc_rule); + ioctl_guard!(ffi::pf_end_trans(self.fd(), &mut ticket))?; + return res; } } bail!(ErrorKind::AnchorDoesNotExist); diff --git a/src/utils.rs b/src/utils.rs index a0ae890..16db042 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -46,18 +46,21 @@ pub fn get_pool_ticket(fd: RawFd) -> Result { Ok(pfioc_pooladdr.ticket) } -/// Get table ticket -#[cfg(target_os = "openbsd")] -pub fn get_table_ticket(fd: RawFd) -> Result { - let mut pfioc_table = unsafe { mem::zeroed::() }; - ioctl_guard!(ffi::pf_begin_addrs(fd, &mut pfioc_pooladdr))?; - Ok(pfioc_pooladdr.ticket) -} - -pub fn get_ticket(fd: RawFd, anchor: &str, kind: AnchorKind) -> Result { +pub fn get_ticket( + fd: RawFd, + anchor:&str, + #[cfg(target_os = "macos")] + kind: AnchorKind +) -> Result { let mut pfioc_rule = unsafe { mem::zeroed::() }; - pfioc_rule.action = ffi::pfvar::PF_CHANGE_GET_TICKET as u32; - pfioc_rule.rule.action = kind.into(); + #[cfg(target_os = "macos")] { + pfioc_rule.action = ffi::pfvar::PF_CHANGE_GET_TICKET as u32; + pfioc_rule.rule.action = kind.into(); + } + // pfioc_rule.action is ignored on FreeBSD and OpenBSD + #[cfg(any(target_os = "openbsd", target_os = "freebsd"))] { + pfioc_rule.rule.action = ffi::pfvar::PF_CHANGE_GET_TICKET as u8; + } anchor .try_copy_to(&mut pfioc_rule.anchor[..]) .chain_err(|| ErrorKind::InvalidArgument("Invalid anchor name"))?; From 4e5cea92223f8c7b14010164822c444ff0d061d7 Mon Sep 17 00:00:00 2001 From: Alvin Peters Date: Sun, 16 Jun 2024 12:07:28 +1000 Subject: [PATCH 15/17] Update bindings for OpenBSD --- src/ffi/pfvar/openbsd.rs | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/ffi/pfvar/openbsd.rs b/src/ffi/pfvar/openbsd.rs index 9fe9769..01fc5b0 100644 --- a/src/ffi/pfvar/openbsd.rs +++ b/src/ffi/pfvar/openbsd.rs @@ -5465,6 +5465,58 @@ fn bindgen_test_layout_pfioc_states() { } #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct pfioc_ruleset { + pub nr: u_int32_t, + pub path: [::std::os::raw::c_char; 1024usize], + pub name: [::std::os::raw::c_char; 64usize], +} +#[test] +fn bindgen_test_layout_pfioc_ruleset() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 1092usize, + concat!("Size of: ", stringify!(pfioc_ruleset)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pfioc_ruleset)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_ruleset), + "::", + stringify!(nr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).path) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(pfioc_ruleset), + "::", + stringify!(path) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, + 1028usize, + concat!( + "Offset of field: ", + stringify!(pfioc_ruleset), + "::", + stringify!(name) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct pfioc_trans { pub size: ::std::os::raw::c_int, pub esize: ::std::os::raw::c_int, From c7922d5e58a5afc568be55790b16474e3dee0e8e Mon Sep 17 00:00:00 2001 From: Alvin Peters Date: Sun, 16 Jun 2024 12:58:01 +1000 Subject: [PATCH 16/17] Save current progress --- generate_bindings.sh | 3 +- src/ffi/mod.rs | 11 ++++--- src/lib.rs | 70 ++++++++++++++++++++++++++++---------------- src/rule/port.rs | 1 + src/utils.rs | 6 +++- 5 files changed, 59 insertions(+), 32 deletions(-) diff --git a/generate_bindings.sh b/generate_bindings.sh index daf68b0..d93b4c3 100755 --- a/generate_bindings.sh +++ b/generate_bindings.sh @@ -73,15 +73,16 @@ freebsd() { bindgen \ --allowlist-type pf_status \ --allowlist-type pfioc_rule \ + --allowlist-type pfioc_ruleset \ --allowlist-type pfioc_pooladdr \ --allowlist-type pfioc_trans \ --allowlist-type pfioc_states \ --allowlist-type pfioc_state_kill \ + --allowlist-type pfsync_state_1301 \ --allowlist-var PF_.* \ --allowlist-var PFRULE_.* \ --default-enum-style rust \ -o "${output}" "${input}" - rm "${input}" echo "pfvar.h bindings for FreeBSD has been generated at: ${output}" } diff --git a/src/ffi/mod.rs b/src/ffi/mod.rs index ec23622..8d0e65a 100644 --- a/src/ffi/mod.rs +++ b/src/ffi/mod.rs @@ -64,8 +64,12 @@ ioctl_readwrite!(pf_begin_addrs, b'D', 51, pfvar::pfioc_pooladdr); // DIOCADDADDR #[cfg(any(target_os = "macos", target_os = "freebsd"))] ioctl_readwrite!(pf_add_addr, b'D', 52, pfvar::pfioc_pooladdr); - - +// DIOCGETRULESETS +#[cfg(any(target_os = "freebsd", target_os = "openbsd"))] +ioctl_readwrite!(pf_get_rulesets, b'D', 58, pfvar::pfioc_ruleset); +// DIOCGETRULESET +#[cfg(any(target_os = "freebsd", target_os = "openbsd"))] +ioctl_readwrite!(pf_get_ruleset, b'D', 59, pfvar::pfioc_ruleset); // DIOCXBEGIN ioctl_readwrite!(pf_begin_trans, b'D', 81, pfvar::pfioc_trans); // DIOCXCOMMIT @@ -73,6 +77,5 @@ ioctl_readwrite!(pf_commit_trans, b'D', 82, pfvar::pfioc_trans); // DIOCXEND // Required by OpenBSD to release the ticket obtained by the DIOCGETRULES command. -// TODO: Switch to openbsd before push -#[cfg(any(target_os = "macos"))] +#[cfg(any(target_os = "openbsd"))] ioctl_readwrite!(pf_end_trans, b'D', 100, pfvar::u_int32_t); \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 07e33d3..c8ad568 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -200,18 +200,13 @@ impl PfCtl { let mut pfioc_rule = unsafe { mem::zeroed::() }; #[cfg(target_os = "macos")] { pfioc_rule.rule.action = kind.into(); - name.try_copy_to(&mut pfioc_rule.anchor_call[..]) - .chain_err(|| ErrorKind::InvalidArgument("Invalid anchor name"))?; - ioctl_guard!(ffi::pf_insert_rule(self.fd(), &mut pfioc_rule))?; } #[cfg(any(target_os = "freebsd", target_os = "openbsd"))] { - anchor_rule.ticket = utils::get_ticket( - self.fd(), - name, - )?; - anchor_rule.rule.action = ffi::pfvar::PF_CHANGE_REMOVE as u32; - ioctl_guard!(ffi::pf_change_rule(self.fd(), &mut pfioc_rule)) + pfioc_rule.rule.action = ffi::pfvar::PF_CHANGE_REMOVE as u8; } + name.try_copy_to(&mut pfioc_rule.anchor_call[..]) + .chain_err(|| ErrorKind::InvalidArgument("Invalid anchor name"))?; + ioctl_guard!(ffi::pf_insert_rule(self.fd(), &mut pfioc_rule))?; Ok(()) } @@ -236,15 +231,16 @@ impl PfCtl { kind: AnchorKind ) -> Result<()> { self.with_anchor_rule(name, kind, |mut anchor_rule| { - #[cfg(target_os = "macos")] - return ioctl_guard!(ffi::pf_delete_rule(self.fd(), &mut anchor_rule)); + #[cfg(target_os = "macos")] { + ioctl_guard!(ffi::pf_delete_rule(self.fd(), &mut anchor_rule)) + } #[cfg(any(target_os = "freebsd", target_os = "openbsd"))] { anchor_rule.ticket = utils::get_ticket( self.fd(), name, )?; - anchor_rule.rule.action = ffi::pfvar::PF_CHANGE_REMOVE as u32; - ioctl_guard!(ffi::pf_change_rule(self.fd(), &mut pfioc_rule)) + anchor_rule.rule.action = ffi::pfvar::PF_CHANGE_REMOVE as u8; + ioctl_guard!(ffi::pf_change_rule(self.fd(), &mut anchor_rule)) } }) @@ -259,7 +255,10 @@ impl PfCtl { kind: AnchorKind ) -> Result<()> { ignore_error_kind!( - self.remove_anchor(name, kind), + self.remove_anchor(name, + #[cfg(target_os = "macos")] + kind + ), ErrorKind::AnchorDoesNotExist ) } @@ -286,7 +285,7 @@ impl PfCtl { pfioc_rule.action = ffi::pfvar::PF_CHANGE_ADD_TAIL as u32; } #[cfg(any(target_os = "freebsd", target_os = "openbsd"))] { - pfioc_rule.rule.action = ffi::pfvar::PF_CHANGE_ADD_TAIL as u32; + pfioc_rule.rule.action = ffi::pfvar::PF_CHANGE_ADD_TAIL as u8; } ioctl_guard!(ffi::pf_change_rule(self.fd(), &mut pfioc_rule)) } @@ -317,7 +316,10 @@ impl PfCtl { } // set ticket - pfioc_rule.ticket = utils::get_ticket(self.fd(), anchor, AnchorKind::Redirect)?; + pfioc_rule.ticket = utils::get_ticket(self.fd(), anchor, + #[cfg(target_os = "macos")] + AnchorKind::Redirect + )?; // append rule pfioc_rule.action = ffi::pfvar::PF_CHANGE_ADD_TAIL as u32; @@ -341,7 +343,10 @@ impl PfCtl { pub fn clear_states(&mut self, anchor_name: &str, kind: AnchorKind) -> Result { let pfsync_states = self.get_states()?; if !pfsync_states.is_empty() { - self.with_anchor_rule(anchor_name, kind, |anchor_rule| { + self.with_anchor_rule(anchor_name, + #[cfg(target_os = "macos")] + kind, + |anchor_rule| { pfsync_states .iter() .filter(|pfsync_state| pfsync_state.anchor == anchor_rule.nr) @@ -385,7 +390,7 @@ impl PfCtl { } } - /// Helper function to find an anchor in main ruleset matching by name and kind. + /// Helper function to find an anchor in main ruleset matching by name and (on macOS) kind. /// /// Calls closure with anchor rule (`pfioc_rule`) on match. /// Provided `pfioc_rule` can be used to modify or remove the anchor rule. @@ -394,12 +399,18 @@ impl PfCtl { /// - Returns Result from call to closure on match. /// - Returns `ErrorKind::AnchorDoesNotExist` on mismatch, the closure is not called in that /// case. - fn with_anchor_rule(&self, name: &str, kind: AnchorKind, f: F) -> Result + fn with_anchor_rule( + &self, name: + &str, + #[cfg(target_os = "macos")] + kind: AnchorKind, + f: F + ) -> Result where F: FnOnce(ffi::pfvar::pfioc_rule) -> Result, { + let mut pfioc_rule = unsafe { mem::zeroed::() }; #[cfg(target_os = "macos")] { - let mut pfioc_rule = unsafe { mem::zeroed::() }; pfioc_rule.rule.action = kind.into(); ioctl_guard!(ffi::pf_get_rules(self.fd(), &mut pfioc_rule))?; pfioc_rule.action = ffi::pfvar::PF_GET_NONE as u32; @@ -412,16 +423,21 @@ impl PfCtl { } } #[cfg(any(target_os = "freebsd", target_os = "openbsd"))] { - let mut pfioc_rule = unsafe { mem::zeroed::() }; + name.try_copy_to(&mut pfioc_rule.anchor[..]) + .chain_err(|| ErrorKind::InvalidArgument("Invalid anchor name"))?; ioctl_guard!(ffi::pf_get_rules(self.fd(), &mut pfioc_rule))?; - pfioc_rule.rule.action = ffi::pfvar::PF_GET_NONE as u8; - ioctl_guard!(ffi::pf_get_rule(self.fd(), &mut pfioc_rule))?; - if compare_cstr_safe(name, &pfioc_rule.anchor_call)? { + // Didn't return EINVAL? Awesome. + #[cfg(target_os = "openbsd")] { + return f(pfioc_rule); + } + // Run function now because we have to dispose of the ticket afterwards. + #[cfg(target_os = "openbsd")] { let mut ticket = pfioc_rule.ticket; let res = f(pfioc_rule); ioctl_guard!(ffi::pf_end_trans(self.fd(), &mut ticket))?; return res; } + } bail!(ErrorKind::AnchorDoesNotExist); } @@ -467,8 +483,10 @@ fn setup_pfioc_state_kill( pfioc_state_kill.psk_proto = pfsync_state.proto; pfioc_state_kill.psk_proto_variant = pfsync_state.proto_variant; pfioc_state_kill.psk_ifname = pfsync_state.ifname; - pfioc_state_kill.psk_src.addr.v.a.addr = pfsync_state.lan.addr; - pfioc_state_kill.psk_dst.addr.v.a.addr = pfsync_state.ext_lan.addr; + #[cfg(target_os = "macos")] { + pfioc_state_kill.psk_src.addr.v.a.addr = pfsync_state.lan.addr; + pfioc_state_kill.psk_dst.addr.v.a.addr = pfsync_state.ext_lan.addr; + } } #[cfg(test)] diff --git a/src/rule/port.rs b/src/rule/port.rs index 0db3da6..7335258 100644 --- a/src/rule/port.rs +++ b/src/rule/port.rs @@ -23,6 +23,7 @@ impl From for Port { } } +#[cfg(target_os = "macos")] impl TryCopyTo for Port { fn try_copy_to(&self, pf_port_range: &mut ffi::pfvar::pf_port_range) -> Result<()> { match *self { diff --git a/src/utils.rs b/src/utils.rs index 16db042..b77e873 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -6,7 +6,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use crate::{conversion::TryCopyTo, ffi, AnchorKind, ErrorKind, PoolAddr, Result, ResultExt}; +use crate::{conversion::TryCopyTo, ffi, ErrorKind, PoolAddr, Result, ResultExt}; + +#[cfg(target_os = "macos")] +use crate::AnchorKind; + use std::{ fs::{File, OpenOptions}, mem, From 9bd176bcd8639ad01c43665294e69441183a31f9 Mon Sep 17 00:00:00 2001 From: Alvin Peters Date: Wed, 19 Jun 2024 12:10:53 +1000 Subject: [PATCH 17/17] Update FreeBSD bindings --- src/ffi/pfvar/freebsd.rs | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/ffi/pfvar/freebsd.rs b/src/ffi/pfvar/freebsd.rs index 67c23ba..cda6022 100644 --- a/src/ffi/pfvar/freebsd.rs +++ b/src/ffi/pfvar/freebsd.rs @@ -4122,6 +4122,58 @@ fn bindgen_test_layout_pfioc_states() { } #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct pfioc_ruleset { + pub nr: u_int32_t, + pub path: [::std::os::raw::c_char; 1024usize], + pub name: [::std::os::raw::c_char; 64usize], +} +#[test] +fn bindgen_test_layout_pfioc_ruleset() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 1092usize, + concat!("Size of: ", stringify!(pfioc_ruleset)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pfioc_ruleset)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_ruleset), + "::", + stringify!(nr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).path) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(pfioc_ruleset), + "::", + stringify!(path) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, + 1028usize, + concat!( + "Offset of field: ", + stringify!(pfioc_ruleset), + "::", + stringify!(name) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct pfioc_trans { pub size: ::std::os::raw::c_int, pub esize: ::std::os::raw::c_int,