From e691853f44f5be49078e461af42c3fc1911eac3b Mon Sep 17 00:00:00 2001 From: ge9 <37699433+ge9@users.noreply.github.com> Date: Fri, 20 Sep 2024 00:09:58 +0900 Subject: [PATCH 01/18] add support for OpenBSD/pf (#1567) --- crates/shadowsocks-service/Cargo.toml | 2 +- crates/shadowsocks-service/src/config.rs | 27 + .../src/local/redir/sys/unix/mod.rs | 5 + .../redir/sys/unix/pfvar_bindgen_openbsd.rs | 16756 ++++++++++++++++ .../src/local/redir/tcprelay/sys/unix/bsd.rs | 4 +- .../src/local/redir/tcprelay/sys/unix/mod.rs | 3 +- .../udprelay/sys/unix/{bsd.rs => freebsd.rs} | 24 - .../src/local/redir/udprelay/sys/unix/mod.rs | 7 +- .../local/redir/udprelay/sys/unix/openbsd.rs | 360 + 9 files changed, 17159 insertions(+), 29 deletions(-) create mode 100644 crates/shadowsocks-service/src/local/redir/sys/unix/pfvar_bindgen_openbsd.rs rename crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/{bsd.rs => freebsd.rs} (94%) create mode 100644 crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/openbsd.rs diff --git a/crates/shadowsocks-service/Cargo.toml b/crates/shadowsocks-service/Cargo.toml index be2f63b7e982..44f2654bd846 100644 --- a/crates/shadowsocks-service/Cargo.toml +++ b/crates/shadowsocks-service/Cargo.toml @@ -208,7 +208,7 @@ bson = { version = "2.12.0", optional = true } shadowsocks = { version = "1.20.2", path = "../shadowsocks", default-features = false } # Just for the ioctl call macro -[target.'cfg(any(target_os = "macos", target_os = "ios", target_os = "freebsd"))'.dependencies] +[target.'cfg(any(target_os = "macos", target_os = "ios", target_os = "freebsd", target_os = "openbsd"))'.dependencies] nix = { version = "0.29", features = ["ioctl"] } [target.'cfg(windows)'.dependencies] diff --git a/crates/shadowsocks-service/src/config.rs b/crates/shadowsocks-service/src/config.rs index 5a82323ef9aa..4586b0c848a3 100644 --- a/crates/shadowsocks-service/src/config.rs +++ b/crates/shadowsocks-service/src/config.rs @@ -480,6 +480,7 @@ cfg_if! { /// Document: #[cfg(any( target_os = "freebsd", + target_os = "openbsd", target_os = "macos", target_os = "ios" ))] @@ -544,6 +545,30 @@ cfg_if! { const AVAILABLE_TYPES: &[&str] = &[RedirType::PacketFilter.name(), RedirType::IpFirewall.name()]; AVAILABLE_TYPES } + } else if #[cfg(target_os = "openbsd")] { + /// Default TCP transparent proxy solution on this platform + pub fn tcp_default() -> RedirType { + RedirType::PacketFilter + } + + /// Available TCP transparent proxy types + #[doc(hidden)] + pub fn tcp_available_types() -> &'static [&'static str] { + const AVAILABLE_TYPES: &[&str] = &[RedirType::PacketFilter.name()]; + AVAILABLE_TYPES + } + + /// Default UDP transparent proxy solution on this platform + pub fn udp_default() -> RedirType { + RedirType::PacketFilter + } + + /// Available UDP transparent proxy types + #[doc(hidden)] + pub const fn udp_available_types() -> &'static [&'static str] { + const AVAILABLE_TYPES: &[&str] = &[RedirType::PacketFilter.name()]; + AVAILABLE_TYPES + } } else if #[cfg(any(target_os = "macos", target_os = "ios"))] { /// Default TCP transparent proxy solution on this platform pub fn tcp_default() -> RedirType { @@ -614,6 +639,7 @@ cfg_if! { #[cfg(any( target_os = "freebsd", + target_os = "openbsd", target_os = "macos", target_os = "ios" ))] @@ -654,6 +680,7 @@ cfg_if! { #[cfg(any( target_os = "freebsd", + target_os = "openbsd", target_os = "macos", target_os = "ios", ))] diff --git a/crates/shadowsocks-service/src/local/redir/sys/unix/mod.rs b/crates/shadowsocks-service/src/local/redir/sys/unix/mod.rs index 2c910bf870c6..cd0eeec7c0cd 100644 --- a/crates/shadowsocks-service/src/local/redir/sys/unix/mod.rs +++ b/crates/shadowsocks-service/src/local/redir/sys/unix/mod.rs @@ -20,5 +20,10 @@ cfg_if! { #[allow(dead_code, non_upper_case_globals, non_snake_case, non_camel_case_types)] #[allow(clippy::useless_transmute, clippy::too_many_arguments, clippy::unnecessary_cast)] mod pfvar; + } else if #[cfg(target_os = "openbsd")] { + #[path = "pfvar_bindgen_openbsd.rs"] + #[allow(dead_code, non_upper_case_globals, non_snake_case, non_camel_case_types)] + #[allow(clippy::useless_transmute, clippy::too_many_arguments, clippy::unnecessary_cast)] + mod pfvar; } } diff --git a/crates/shadowsocks-service/src/local/redir/sys/unix/pfvar_bindgen_openbsd.rs b/crates/shadowsocks-service/src/local/redir/sys/unix/pfvar_bindgen_openbsd.rs new file mode 100644 index 000000000000..28e5d3905918 --- /dev/null +++ b/crates/shadowsocks-service/src/local/redir/sys/unix/pfvar_bindgen_openbsd.rs @@ -0,0 +1,16756 @@ +/* automatically generated by rust-bindgen 0.69.4 */ + +pub const __ISO_C_VISIBLE: u32 = 2011; +pub const __XPG_VISIBLE: u32 = 700; +pub const __POSIX_VISIBLE: u32 = 200809; +pub const __BSD_VISIBLE: u32 = 1; +pub const _STACKALIGNBYTES: u32 = 15; +pub const _MAX_PAGE_SHIFT: u32 = 12; +pub const INT8_MIN: i32 = -128; +pub const INT16_MIN: i32 = -32768; +pub const INT32_MIN: i32 = -2147483648; +pub const INT64_MIN: i64 = -9223372036854775808; +pub const INT8_MAX: u32 = 127; +pub const INT16_MAX: u32 = 32767; +pub const INT32_MAX: u32 = 2147483647; +pub const INT64_MAX: u64 = 9223372036854775807; +pub const UINT8_MAX: u32 = 255; +pub const UINT16_MAX: u32 = 65535; +pub const UINT32_MAX: u32 = 4294967295; +pub const UINT64_MAX: i32 = -1; +pub const INT_LEAST8_MIN: i32 = -128; +pub const INT_LEAST16_MIN: i32 = -32768; +pub const INT_LEAST32_MIN: i32 = -2147483648; +pub const INT_LEAST64_MIN: i64 = -9223372036854775808; +pub const INT_LEAST8_MAX: u32 = 127; +pub const INT_LEAST16_MAX: u32 = 32767; +pub const INT_LEAST32_MAX: u32 = 2147483647; +pub const INT_LEAST64_MAX: u64 = 9223372036854775807; +pub const UINT_LEAST8_MAX: u32 = 255; +pub const UINT_LEAST16_MAX: u32 = 65535; +pub const UINT_LEAST32_MAX: u32 = 4294967295; +pub const UINT_LEAST64_MAX: i32 = -1; +pub const INTPTR_MIN: i64 = -9223372036854775808; +pub const INTPTR_MAX: u64 = 9223372036854775807; +pub const UINTPTR_MAX: i32 = -1; +pub const INTMAX_MIN: i64 = -9223372036854775808; +pub const INTMAX_MAX: u64 = 9223372036854775807; +pub const UINTMAX_MAX: i32 = -1; +pub const PTRDIFF_MIN: i64 = -9223372036854775808; +pub const PTRDIFF_MAX: u64 = 9223372036854775807; +pub const SIG_ATOMIC_MIN: i32 = -2147483648; +pub const SIG_ATOMIC_MAX: u32 = 2147483647; +pub const SIZE_MAX: i32 = -1; +pub const WCHAR_MIN: i32 = -2147483648; +pub const WCHAR_MAX: u32 = 2147483647; +pub const WINT_MIN: i32 = -2147483648; +pub const WINT_MAX: u32 = 2147483647; +pub const UIO_MAXIOV: u32 = 1024; +pub const _LITTLE_ENDIAN: u32 = 1234; +pub const _BIG_ENDIAN: u32 = 4321; +pub const _PDP_ENDIAN: u32 = 3412; +pub const _QUAD_HIGHWORD: u32 = 1; +pub const _QUAD_LOWWORD: u32 = 0; +pub const LITTLE_ENDIAN: u32 = 1234; +pub const BIG_ENDIAN: u32 = 4321; +pub const PDP_ENDIAN: u32 = 3412; +pub const SOCK_STREAM: u32 = 1; +pub const SOCK_DGRAM: u32 = 2; +pub const SOCK_RAW: u32 = 3; +pub const SOCK_RDM: u32 = 4; +pub const SOCK_SEQPACKET: u32 = 5; +pub const SOCK_CLOEXEC: u32 = 32768; +pub const SOCK_NONBLOCK: u32 = 16384; +pub const SOCK_DNS: u32 = 4096; +pub const SO_DEBUG: u32 = 1; +pub const SO_ACCEPTCONN: u32 = 2; +pub const SO_REUSEADDR: u32 = 4; +pub const SO_KEEPALIVE: u32 = 8; +pub const SO_DONTROUTE: u32 = 16; +pub const SO_BROADCAST: u32 = 32; +pub const SO_USELOOPBACK: u32 = 64; +pub const SO_LINGER: u32 = 128; +pub const SO_OOBINLINE: u32 = 256; +pub const SO_REUSEPORT: u32 = 512; +pub const SO_TIMESTAMP: u32 = 2048; +pub const SO_BINDANY: u32 = 4096; +pub const SO_ZEROIZE: u32 = 8192; +pub const SO_SNDBUF: u32 = 4097; +pub const SO_RCVBUF: u32 = 4098; +pub const SO_SNDLOWAT: u32 = 4099; +pub const SO_RCVLOWAT: u32 = 4100; +pub const SO_SNDTIMEO: u32 = 4101; +pub const SO_RCVTIMEO: u32 = 4102; +pub const SO_ERROR: u32 = 4103; +pub const SO_TYPE: u32 = 4104; +pub const SO_NETPROC: u32 = 4128; +pub const SO_RTABLE: u32 = 4129; +pub const SO_PEERCRED: u32 = 4130; +pub const SO_SPLICE: u32 = 4131; +pub const SO_DOMAIN: u32 = 4132; +pub const SO_PROTOCOL: u32 = 4133; +pub const RT_TABLEID_MAX: u32 = 255; +pub const RT_TABLEID_BITS: u32 = 8; +pub const RT_TABLEID_MASK: u32 = 255; +pub const SOL_SOCKET: u32 = 65535; +pub const AF_UNSPEC: u32 = 0; +pub const AF_UNIX: u32 = 1; +pub const AF_LOCAL: u32 = 1; +pub const AF_INET: u32 = 2; +pub const AF_IMPLINK: u32 = 3; +pub const AF_PUP: u32 = 4; +pub const AF_CHAOS: u32 = 5; +pub const AF_NS: u32 = 6; +pub const AF_ISO: u32 = 7; +pub const AF_OSI: u32 = 7; +pub const AF_ECMA: u32 = 8; +pub const AF_DATAKIT: u32 = 9; +pub const AF_CCITT: u32 = 10; +pub const AF_SNA: u32 = 11; +pub const AF_DECnet: u32 = 12; +pub const AF_DLI: u32 = 13; +pub const AF_LAT: u32 = 14; +pub const AF_HYLINK: u32 = 15; +pub const AF_APPLETALK: u32 = 16; +pub const AF_ROUTE: u32 = 17; +pub const AF_LINK: u32 = 18; +pub const pseudo_AF_XTP: u32 = 19; +pub const AF_COIP: u32 = 20; +pub const AF_CNT: u32 = 21; +pub const pseudo_AF_RTIP: u32 = 22; +pub const AF_IPX: u32 = 23; +pub const AF_INET6: u32 = 24; +pub const pseudo_AF_PIP: u32 = 25; +pub const AF_ISDN: u32 = 26; +pub const AF_E164: u32 = 26; +pub const AF_NATM: u32 = 27; +pub const AF_ENCAP: u32 = 28; +pub const AF_SIP: u32 = 29; +pub const AF_KEY: u32 = 30; +pub const pseudo_AF_HDRCMPLT: u32 = 31; +pub const AF_BLUETOOTH: u32 = 32; +pub const AF_MPLS: u32 = 33; +pub const pseudo_AF_PFLOW: u32 = 34; +pub const pseudo_AF_PIPEX: u32 = 35; +pub const AF_MAX: u32 = 36; +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 SHUT_RD: u32 = 0; +pub const SHUT_WR: u32 = 1; +pub const SHUT_RDWR: u32 = 2; +pub const NET_MAXID: u32 = 36; +pub const NET_RT_DUMP: u32 = 1; +pub const NET_RT_FLAGS: u32 = 2; +pub const NET_RT_IFLIST: u32 = 3; +pub const NET_RT_STATS: u32 = 4; +pub const NET_RT_TABLE: u32 = 5; +pub const NET_RT_IFNAMES: u32 = 6; +pub const NET_RT_SOURCE: u32 = 7; +pub const NET_RT_MAXID: u32 = 8; +pub const NET_UNIX_INFLIGHT: u32 = 6; +pub const NET_UNIX_DEFERRED: u32 = 7; +pub const NET_UNIX_MAXID: u32 = 8; +pub const UNPCTL_RECVSPACE: u32 = 1; +pub const UNPCTL_SENDSPACE: u32 = 2; +pub const NET_UNIX_PROTO_MAXID: u32 = 3; +pub const NET_LINK_IFRXQ: u32 = 1; +pub const NET_LINK_MAXID: u32 = 2; +pub const NET_LINK_IFRXQ_PRESSURE_RETURN: u32 = 1; +pub const NET_LINK_IFRXQ_PRESSURE_DROP: u32 = 2; +pub const NET_LINK_IFRXQ_MAXID: u32 = 3; +pub const NET_KEY_SADB_DUMP: u32 = 1; +pub const NET_KEY_SPD_DUMP: u32 = 2; +pub const NET_KEY_MAXID: u32 = 3; +pub const NET_BPF_BUFSIZE: u32 = 1; +pub const NET_BPF_MAXBUFSIZE: u32 = 2; +pub const NET_BPF_MAXID: u32 = 3; +pub const NET_PFLOW_STATS: u32 = 1; +pub const NET_PFLOW_MAXID: u32 = 2; +pub const SOMAXCONN: u32 = 128; +pub const MSG_OOB: u32 = 1; +pub const MSG_PEEK: u32 = 2; +pub const MSG_DONTROUTE: u32 = 4; +pub const MSG_EOR: u32 = 8; +pub const MSG_TRUNC: u32 = 16; +pub const MSG_CTRUNC: u32 = 32; +pub const MSG_WAITALL: u32 = 64; +pub const MSG_DONTWAIT: u32 = 128; +pub const MSG_BCAST: u32 = 256; +pub const MSG_MCAST: u32 = 512; +pub const MSG_NOSIGNAL: u32 = 1024; +pub const MSG_CMSG_CLOEXEC: u32 = 2048; +pub const MSG_WAITFORONE: u32 = 4096; +pub const SCM_RIGHTS: u32 = 1; +pub const SCM_TIMESTAMP: u32 = 4; +pub const IF_NAMESIZE: u32 = 16; +pub const FD_SETSIZE: u32 = 1024; +pub const __NBBY: u32 = 8; +pub const NBBY: u32 = 8; +pub const DST_NONE: u32 = 0; +pub const DST_USA: u32 = 1; +pub const DST_AUST: u32 = 2; +pub const DST_WET: u32 = 3; +pub const DST_MET: u32 = 4; +pub const DST_EET: u32 = 5; +pub const DST_CAN: u32 = 6; +pub const ITIMER_REAL: u32 = 0; +pub const ITIMER_VIRTUAL: u32 = 1; +pub const ITIMER_PROF: u32 = 2; +pub const CLOCKS_PER_SEC: u32 = 100; +pub const CLOCK_REALTIME: u32 = 0; +pub const CLOCK_PROCESS_CPUTIME_ID: u32 = 2; +pub const CLOCK_MONOTONIC: u32 = 3; +pub const CLOCK_THREAD_CPUTIME_ID: u32 = 4; +pub const CLOCK_UPTIME: u32 = 5; +pub const CLOCK_BOOTTIME: u32 = 6; +pub const TIMER_RELTIME: u32 = 0; +pub const TIMER_ABSTIME: u32 = 1; +pub const CLK_TCK: u32 = 100; +pub const TIME_UTC: u32 = 1; +pub const MCLPOOLS: u32 = 8; +pub const IFQ_NQUEUES: u32 = 8; +pub const IFQ_MINPRIO: u32 = 0; +pub const IFQ_MAXPRIO: u32 = 7; +pub const IFQ_DEFPRIO: u32 = 3; +pub const LINK_STATE_UNKNOWN: u32 = 0; +pub const LINK_STATE_INVALID: u32 = 1; +pub const LINK_STATE_DOWN: u32 = 2; +pub const LINK_STATE_KALIVE_DOWN: u32 = 3; +pub const LINK_STATE_UP: u32 = 4; +pub const LINK_STATE_HALF_DUPLEX: u32 = 5; +pub const LINK_STATE_FULL_DUPLEX: u32 = 6; +pub const IFNAMSIZ: u32 = 16; +pub const IFDESCRSIZE: u32 = 64; +pub const IFF_UP: u32 = 1; +pub const IFF_BROADCAST: u32 = 2; +pub const IFF_DEBUG: u32 = 4; +pub const IFF_LOOPBACK: u32 = 8; +pub const IFF_POINTOPOINT: u32 = 16; +pub const IFF_STATICARP: u32 = 32; +pub const IFF_RUNNING: u32 = 64; +pub const IFF_NOARP: u32 = 128; +pub const IFF_PROMISC: u32 = 256; +pub const IFF_ALLMULTI: u32 = 512; +pub const IFF_OACTIVE: u32 = 1024; +pub const IFF_SIMPLEX: u32 = 2048; +pub const IFF_LINK0: u32 = 4096; +pub const IFF_LINK1: u32 = 8192; +pub const IFF_LINK2: u32 = 16384; +pub const IFF_MULTICAST: u32 = 32768; +pub const IFF_CANTCHANGE: u32 = 36434; +pub const IFXF_MPSAFE: u32 = 1; +pub const IFXF_CLONED: u32 = 2; +pub const IFXF_AUTOCONF6TEMP: u32 = 4; +pub const IFXF_MPLS: u32 = 8; +pub const IFXF_WOL: u32 = 16; +pub const IFXF_AUTOCONF6: u32 = 32; +pub const IFXF_INET6_NOSOII: u32 = 64; +pub const IFXF_AUTOCONF4: u32 = 128; +pub const IFXF_MONITOR: u32 = 256; +pub const IFXF_LRO: u32 = 512; +pub const IFXF_CANTCHANGE: u32 = 3; +pub const IFCAP_CSUM_IPv4: u32 = 1; +pub const IFCAP_CSUM_TCPv4: u32 = 2; +pub const IFCAP_CSUM_UDPv4: u32 = 4; +pub const IFCAP_VLAN_MTU: u32 = 16; +pub const IFCAP_VLAN_HWTAGGING: u32 = 32; +pub const IFCAP_CSUM_TCPv6: u32 = 128; +pub const IFCAP_CSUM_UDPv6: u32 = 256; +pub const IFCAP_TSOv4: u32 = 4096; +pub const IFCAP_TSOv6: u32 = 8192; +pub const IFCAP_LRO: u32 = 16384; +pub const IFCAP_WOL: u32 = 32768; +pub const IFCAP_CSUM_MASK: u32 = 391; +pub const IFQCTL_LEN: u32 = 1; +pub const IFQCTL_MAXLEN: u32 = 2; +pub const IFQCTL_DROPS: u32 = 3; +pub const IFQCTL_CONGESTION: u32 = 4; +pub const IFQCTL_MAXID: u32 = 5; +pub const IFAN_ARRIVAL: u32 = 0; +pub const IFAN_DEPARTURE: u32 = 1; +pub const IFG_ALL: &[u8; 4] = b"all\0"; +pub const IFG_EGRESS: &[u8; 7] = b"egress\0"; +pub const IF_HDRPRIO_MIN: u32 = 0; +pub const IF_HDRPRIO_MAX: u32 = 7; +pub const IF_HDRPRIO_PACKET: i32 = -1; +pub const IF_HDRPRIO_PAYLOAD: i32 = -2; +pub const IF_HDRPRIO_OUTER: i32 = -3; +pub const IF_PWE3_ETHERNET: u32 = 1; +pub const IF_PWE3_IP: u32 = 2; +pub const IFLR_PREFIX: u32 = 32768; +pub const IFSFF_ADDR_EEPROM: u32 = 160; +pub const IFSFF_ADDR_DDM: u32 = 162; +pub const IFSFF_DATA_LEN: u32 = 256; +pub const ARPHRD_ETHER: u32 = 1; +pub const ARPHRD_IEEE802: u32 = 6; +pub const ARPHRD_FRELAY: u32 = 15; +pub const ARPHRD_IEEE1394: u32 = 24; +pub const ARPOP_REQUEST: u32 = 1; +pub const ARPOP_REPLY: u32 = 2; +pub const ARPOP_REVREQUEST: u32 = 3; +pub const ARPOP_REVREPLY: u32 = 4; +pub const ARPOP_INVREQUEST: u32 = 8; +pub const ARPOP_INVREPLY: u32 = 9; +pub const ATF_INUSE: u32 = 1; +pub const ATF_COM: u32 = 2; +pub const ATF_PERM: u32 = 4; +pub const ATF_PUBL: u32 = 8; +pub const ATF_USETRAILERS: u32 = 16; +pub const SPLAY_NEGINF: i32 = -1; +pub const SPLAY_INF: u32 = 1; +pub const RB_BLACK: u32 = 0; +pub const RB_RED: u32 = 1; +pub const RB_NEGINF: i32 = -1; +pub const RB_INF: u32 = 1; +pub const LO_CLASSFLAGS: u32 = 65535; +pub const LO_INITIALIZED: u32 = 65536; +pub const LO_WITNESS: u32 = 131072; +pub const LO_QUIET: u32 = 262144; +pub const LO_RECURSABLE: u32 = 524288; +pub const LO_SLEEPABLE: u32 = 1048576; +pub const LO_UPGRADABLE: u32 = 2097152; +pub const LO_DUPOK: u32 = 4194304; +pub const LO_IS_VNODE: u32 = 8388608; +pub const LO_CLASSMASK: u32 = 251658240; +pub const LO_NOPROFILE: u32 = 268435456; +pub const LO_NEW: u32 = 536870912; +pub const LO_CLASSSHIFT: u32 = 24; +pub const RWL_DUPOK: u32 = 1; +pub const RWL_NOWITNESS: u32 = 2; +pub const RWL_IS_VNODE: u32 = 4; +pub const RWLOCK_WAIT: u32 = 1; +pub const RWLOCK_WRWANT: u32 = 2; +pub const RWLOCK_WRLOCK: u32 = 4; +pub const RWLOCK_MASK: u32 = 7; +pub const RWLOCK_READER_SHIFT: u32 = 3; +pub const RWLOCK_READ_INCR: u32 = 8; +pub const RW_WRITE: u32 = 1; +pub const RW_READ: u32 = 2; +pub const RW_DOWNGRADE: u32 = 4; +pub const RW_OPMASK: u32 = 7; +pub const RW_INTR: u32 = 16; +pub const RW_SLEEPFAIL: u32 = 32; +pub const RW_NOSLEEP: u32 = 64; +pub const RW_RECURSEFAIL: u32 = 128; +pub const RW_DUPOK: u32 = 256; +pub const RW_WRITE_OTHER: u32 = 256; +pub const ARG_MAX: u32 = 524288; +pub const CHILD_MAX: u32 = 80; +pub const LINK_MAX: u32 = 32767; +pub const MAX_CANON: u32 = 255; +pub const MAX_INPUT: u32 = 255; +pub const NAME_MAX: u32 = 255; +pub const NGROUPS_MAX: u32 = 16; +pub const OPEN_MAX: u32 = 64; +pub const PATH_MAX: u32 = 1024; +pub const PIPE_BUF: u32 = 512; +pub const SYMLINK_MAX: u32 = 1024; +pub const SYMLOOP_MAX: u32 = 32; +pub const BC_DIM_MAX: u32 = 65535; +pub const COLL_WEIGHTS_MAX: u32 = 2; +pub const EXPR_NEST_MAX: u32 = 32; +pub const LINE_MAX: u32 = 2048; +pub const RE_DUP_MAX: u32 = 255; +pub const IOV_MAX: u32 = 1024; +pub const NZERO: u32 = 20; +pub const TTY_NAME_MAX: u32 = 260; +pub const LOGIN_NAME_MAX: u32 = 32; +pub const HOST_NAME_MAX: u32 = 255; +pub const _MAXCOMLEN: u32 = 24; +pub const TIMEOUT_PROC: u32 = 1; +pub const TIMEOUT_ONQUEUE: u32 = 2; +pub const TIMEOUT_INITIALIZED: u32 = 4; +pub const TIMEOUT_TRIGGERED: u32 = 8; +pub const TIMEOUT_MPSAFE: u32 = 16; +pub const IPPROTO_IP: u32 = 0; +pub const IPPROTO_HOPOPTS: u32 = 0; +pub const IPPROTO_ICMP: u32 = 1; +pub const IPPROTO_IGMP: u32 = 2; +pub const IPPROTO_GGP: u32 = 3; +pub const IPPROTO_IPIP: u32 = 4; +pub const IPPROTO_IPV4: u32 = 4; +pub const IPPROTO_TCP: u32 = 6; +pub const IPPROTO_EGP: u32 = 8; +pub const IPPROTO_PUP: u32 = 12; +pub const IPPROTO_UDP: u32 = 17; +pub const IPPROTO_IDP: u32 = 22; +pub const IPPROTO_TP: u32 = 29; +pub const IPPROTO_IPV6: u32 = 41; +pub const IPPROTO_ROUTING: u32 = 43; +pub const IPPROTO_FRAGMENT: u32 = 44; +pub const IPPROTO_RSVP: u32 = 46; +pub const IPPROTO_GRE: u32 = 47; +pub const IPPROTO_ESP: u32 = 50; +pub const IPPROTO_AH: u32 = 51; +pub const IPPROTO_MOBILE: u32 = 55; +pub const IPPROTO_ICMPV6: u32 = 58; +pub const IPPROTO_NONE: u32 = 59; +pub const IPPROTO_DSTOPTS: u32 = 60; +pub const IPPROTO_EON: u32 = 80; +pub const IPPROTO_ETHERIP: u32 = 97; +pub const IPPROTO_ENCAP: u32 = 98; +pub const IPPROTO_PIM: u32 = 103; +pub const IPPROTO_IPCOMP: u32 = 108; +pub const IPPROTO_CARP: u32 = 112; +pub const IPPROTO_SCTP: u32 = 132; +pub const IPPROTO_UDPLITE: u32 = 136; +pub const IPPROTO_MPLS: u32 = 137; +pub const IPPROTO_PFSYNC: u32 = 240; +pub const IPPROTO_RAW: u32 = 255; +pub const IPPROTO_MAX: u32 = 256; +pub const IPPROTO_DIVERT: u32 = 258; +pub const IPPORT_RESERVED: u32 = 1024; +pub const IPPORT_USERRESERVED: u32 = 49151; +pub const IPPORT_HIFIRSTAUTO: u32 = 49152; +pub const IPPORT_HILASTAUTO: u32 = 65535; +pub const IPPROTO_DONE: u32 = 257; +pub const IN_CLASSA_NSHIFT: u32 = 24; +pub const IN_CLASSA_MAX: u32 = 128; +pub const IN_CLASSB_NSHIFT: u32 = 16; +pub const IN_CLASSB_MAX: u32 = 65536; +pub const IN_CLASSC_NSHIFT: u32 = 8; +pub const IN_CLASSD_NSHIFT: u32 = 28; +pub const IN_RFC3021_NSHIFT: u32 = 31; +pub const IN_LOOPBACKNET: u32 = 127; +pub const IP_OPTIONS: u32 = 1; +pub const IP_HDRINCL: u32 = 2; +pub const IP_TOS: u32 = 3; +pub const IP_TTL: u32 = 4; +pub const IP_RECVOPTS: u32 = 5; +pub const IP_RECVRETOPTS: u32 = 6; +pub const IP_RECVDSTADDR: u32 = 7; +pub const IP_RETOPTS: u32 = 8; +pub const IP_MULTICAST_IF: u32 = 9; +pub const IP_MULTICAST_TTL: u32 = 10; +pub const IP_MULTICAST_LOOP: u32 = 11; +pub const IP_ADD_MEMBERSHIP: u32 = 12; +pub const IP_DROP_MEMBERSHIP: u32 = 13; +pub const IP_PORTRANGE: u32 = 19; +pub const IP_AUTH_LEVEL: u32 = 20; +pub const IP_ESP_TRANS_LEVEL: u32 = 21; +pub const IP_ESP_NETWORK_LEVEL: u32 = 22; +pub const IP_IPSEC_LOCAL_ID: u32 = 23; +pub const IP_IPSEC_REMOTE_ID: u32 = 24; +pub const IP_IPSEC_LOCAL_CRED: u32 = 25; +pub const IP_IPSEC_REMOTE_CRED: u32 = 26; +pub const IP_IPSEC_LOCAL_AUTH: u32 = 27; +pub const IP_IPSEC_REMOTE_AUTH: u32 = 28; +pub const IP_IPCOMP_LEVEL: u32 = 29; +pub const IP_RECVIF: u32 = 30; +pub const IP_RECVTTL: u32 = 31; +pub const IP_MINTTL: u32 = 32; +pub const IP_RECVDSTPORT: u32 = 33; +pub const IP_PIPEX: u32 = 34; +pub const IP_RECVRTABLE: u32 = 35; +pub const IP_IPSECFLOWINFO: u32 = 36; +pub const IP_IPDEFTTL: u32 = 37; +pub const IP_SENDSRCADDR: u32 = 7; +pub const IP_RTABLE: u32 = 4129; +pub const IPSEC_LEVEL_BYPASS: u32 = 0; +pub const IPSEC_LEVEL_NONE: u32 = 0; +pub const IPSEC_LEVEL_AVAIL: u32 = 1; +pub const IPSEC_LEVEL_USE: u32 = 2; +pub const IPSEC_LEVEL_REQUIRE: u32 = 3; +pub const IPSEC_LEVEL_UNIQUE: u32 = 4; +pub const IPSEC_LEVEL_DEFAULT: u32 = 1; +pub const IPSEC_AUTH_LEVEL_DEFAULT: u32 = 1; +pub const IPSEC_ESP_TRANS_LEVEL_DEFAULT: u32 = 1; +pub const IPSEC_ESP_NETWORK_LEVEL_DEFAULT: u32 = 1; +pub const IPSEC_IPCOMP_LEVEL_DEFAULT: u32 = 1; +pub const IP_DEFAULT_MULTICAST_TTL: u32 = 1; +pub const IP_DEFAULT_MULTICAST_LOOP: u32 = 1; +pub const IP_MIN_MEMBERSHIPS: u32 = 15; +pub const IP_MAX_MEMBERSHIPS: u32 = 4095; +pub const IP_PORTRANGE_DEFAULT: u32 = 0; +pub const IP_PORTRANGE_HIGH: u32 = 1; +pub const IP_PORTRANGE_LOW: u32 = 2; +pub const INET_ADDRSTRLEN: u32 = 16; +pub const IPPROTO_MAXID: u32 = 259; +pub const IPCTL_FORWARDING: u32 = 1; +pub const IPCTL_SENDREDIRECTS: u32 = 2; +pub const IPCTL_DEFTTL: u32 = 3; +pub const IPCTL_SOURCEROUTE: u32 = 5; +pub const IPCTL_DIRECTEDBCAST: u32 = 6; +pub const IPCTL_IPPORT_FIRSTAUTO: u32 = 7; +pub const IPCTL_IPPORT_LASTAUTO: u32 = 8; +pub const IPCTL_IPPORT_HIFIRSTAUTO: u32 = 9; +pub const IPCTL_IPPORT_HILASTAUTO: u32 = 10; +pub const IPCTL_IPPORT_MAXQUEUE: u32 = 11; +pub const IPCTL_ENCDEBUG: u32 = 12; +pub const IPCTL_IPSEC_STATS: u32 = 13; +pub const IPCTL_IPSEC_EXPIRE_ACQUIRE: u32 = 14; +pub const IPCTL_IPSEC_EMBRYONIC_SA_TIMEOUT: u32 = 15; +pub const IPCTL_IPSEC_REQUIRE_PFS: u32 = 16; +pub const IPCTL_IPSEC_SOFT_ALLOCATIONS: u32 = 17; +pub const IPCTL_IPSEC_ALLOCATIONS: u32 = 18; +pub const IPCTL_IPSEC_SOFT_BYTES: u32 = 19; +pub const IPCTL_IPSEC_BYTES: u32 = 20; +pub const IPCTL_IPSEC_TIMEOUT: u32 = 21; +pub const IPCTL_IPSEC_SOFT_TIMEOUT: u32 = 22; +pub const IPCTL_IPSEC_SOFT_FIRSTUSE: u32 = 23; +pub const IPCTL_IPSEC_FIRSTUSE: u32 = 24; +pub const IPCTL_IPSEC_ENC_ALGORITHM: u32 = 25; +pub const IPCTL_IPSEC_AUTH_ALGORITHM: u32 = 26; +pub const IPCTL_MTUDISC: u32 = 27; +pub const IPCTL_MTUDISCTIMEOUT: u32 = 28; +pub const IPCTL_IPSEC_IPCOMP_ALGORITHM: u32 = 29; +pub const IPCTL_IFQUEUE: u32 = 30; +pub const IPCTL_MFORWARDING: u32 = 31; +pub const IPCTL_MULTIPATH: u32 = 32; +pub const IPCTL_STATS: u32 = 33; +pub const IPCTL_MRTPROTO: u32 = 34; +pub const IPCTL_MRTSTATS: u32 = 35; +pub const IPCTL_ARPQUEUED: u32 = 36; +pub const IPCTL_MRTMFC: u32 = 37; +pub const IPCTL_MRTVIF: u32 = 38; +pub const IPCTL_ARPTIMEOUT: u32 = 39; +pub const IPCTL_ARPDOWN: u32 = 40; +pub const IPCTL_ARPQUEUE: u32 = 41; +pub const IPCTL_MAXID: u32 = 42; +pub const INET6_ADDRSTRLEN: u32 = 46; +pub const __IPV6_ADDR_SCOPE_NODELOCAL: u32 = 1; +pub const __IPV6_ADDR_SCOPE_INTFACELOCAL: u32 = 1; +pub const __IPV6_ADDR_SCOPE_LINKLOCAL: u32 = 2; +pub const __IPV6_ADDR_SCOPE_SITELOCAL: u32 = 5; +pub const __IPV6_ADDR_SCOPE_ORGLOCAL: u32 = 8; +pub const __IPV6_ADDR_SCOPE_GLOBAL: u32 = 14; +pub const IPV6_UNICAST_HOPS: u32 = 4; +pub const IPV6_MULTICAST_IF: u32 = 9; +pub const IPV6_MULTICAST_HOPS: u32 = 10; +pub const IPV6_MULTICAST_LOOP: u32 = 11; +pub const IPV6_JOIN_GROUP: u32 = 12; +pub const IPV6_LEAVE_GROUP: u32 = 13; +pub const IPV6_PORTRANGE: u32 = 14; +pub const ICMP6_FILTER: u32 = 18; +pub const IPV6_CHECKSUM: u32 = 26; +pub const IPV6_V6ONLY: u32 = 27; +pub const IPV6_RTHDRDSTOPTS: u32 = 35; +pub const IPV6_RECVPKTINFO: u32 = 36; +pub const IPV6_RECVHOPLIMIT: u32 = 37; +pub const IPV6_RECVRTHDR: u32 = 38; +pub const IPV6_RECVHOPOPTS: u32 = 39; +pub const IPV6_RECVDSTOPTS: u32 = 40; +pub const IPV6_USE_MIN_MTU: u32 = 42; +pub const IPV6_RECVPATHMTU: u32 = 43; +pub const IPV6_PATHMTU: u32 = 44; +pub const IPV6_PKTINFO: u32 = 46; +pub const IPV6_HOPLIMIT: u32 = 47; +pub const IPV6_NEXTHOP: u32 = 48; +pub const IPV6_HOPOPTS: u32 = 49; +pub const IPV6_DSTOPTS: u32 = 50; +pub const IPV6_RTHDR: u32 = 51; +pub const IPV6_AUTH_LEVEL: u32 = 53; +pub const IPV6_ESP_TRANS_LEVEL: u32 = 54; +pub const IPV6_ESP_NETWORK_LEVEL: u32 = 55; +pub const IPSEC6_OUTSA: u32 = 56; +pub const IPV6_RECVTCLASS: u32 = 57; +pub const IPV6_AUTOFLOWLABEL: u32 = 59; +pub const IPV6_IPCOMP_LEVEL: u32 = 60; +pub const IPV6_TCLASS: u32 = 61; +pub const IPV6_DONTFRAG: u32 = 62; +pub const IPV6_PIPEX: u32 = 63; +pub const IPV6_RECVDSTPORT: u32 = 64; +pub const IPV6_MINHOPCOUNT: u32 = 65; +pub const IPV6_RTABLE: u32 = 4129; +pub const IPV6_RTHDR_LOOSE: u32 = 0; +pub const IPV6_RTHDR_TYPE_0: u32 = 0; +pub const IPV6_DEFAULT_MULTICAST_HOPS: u32 = 1; +pub const IPV6_DEFAULT_MULTICAST_LOOP: u32 = 1; +pub const IPV6_PORTRANGE_DEFAULT: u32 = 0; +pub const IPV6_PORTRANGE_HIGH: u32 = 1; +pub const IPV6_PORTRANGE_LOW: u32 = 2; +pub const IPV6PROTO_MAXID: u32 = 259; +pub const IPV6CTL_FORWARDING: u32 = 1; +pub const IPV6CTL_SENDREDIRECTS: u32 = 2; +pub const IPV6CTL_DEFHLIM: u32 = 3; +pub const IPV6CTL_FORWSRCRT: u32 = 5; +pub const IPV6CTL_STATS: u32 = 6; +pub const IPV6CTL_MRTSTATS: u32 = 7; +pub const IPV6CTL_MRTPROTO: u32 = 8; +pub const IPV6CTL_MAXFRAGPACKETS: u32 = 9; +pub const IPV6CTL_SOURCECHECK: u32 = 10; +pub const IPV6CTL_SOURCECHECK_LOGINT: u32 = 11; +pub const IPV6CTL_ACCEPT_RTADV: u32 = 12; +pub const IPV6CTL_LOG_INTERVAL: u32 = 14; +pub const IPV6CTL_HDRNESTLIMIT: u32 = 15; +pub const IPV6CTL_DAD_COUNT: u32 = 16; +pub const IPV6CTL_AUTO_FLOWLABEL: u32 = 17; +pub const IPV6CTL_DEFMCASTHLIM: u32 = 18; +pub const IPV6CTL_USE_DEPRECATED: u32 = 21; +pub const IPV6CTL_MAXFRAGS: u32 = 41; +pub const IPV6CTL_MFORWARDING: u32 = 42; +pub const IPV6CTL_MULTIPATH: u32 = 43; +pub const IPV6CTL_MCAST_PMTU: u32 = 44; +pub const IPV6CTL_NEIGHBORGCTHRESH: u32 = 45; +pub const IPV6CTL_MAXDYNROUTES: u32 = 48; +pub const IPV6CTL_DAD_PENDING: u32 = 49; +pub const IPV6CTL_MTUDISCTIMEOUT: u32 = 50; +pub const IPV6CTL_IFQUEUE: u32 = 51; +pub const IPV6CTL_MRTMIF: u32 = 52; +pub const IPV6CTL_MRTMFC: u32 = 53; +pub const IPV6CTL_SOIIKEY: u32 = 54; +pub const IPV6CTL_MAXID: u32 = 55; +pub const RNF_NORMAL: u32 = 1; +pub const RNF_ROOT: u32 = 2; +pub const RNF_ACTIVE: u32 = 4; +pub const RTF_UP: u32 = 1; +pub const RTF_GATEWAY: u32 = 2; +pub const RTF_HOST: u32 = 4; +pub const RTF_REJECT: u32 = 8; +pub const RTF_DYNAMIC: u32 = 16; +pub const RTF_MODIFIED: u32 = 32; +pub const RTF_DONE: u32 = 64; +pub const RTF_CLONING: u32 = 256; +pub const RTF_MULTICAST: u32 = 512; +pub const RTF_LLINFO: u32 = 1024; +pub const RTF_STATIC: u32 = 2048; +pub const RTF_BLACKHOLE: u32 = 4096; +pub const RTF_PROTO3: u32 = 8192; +pub const RTF_PROTO2: u32 = 16384; +pub const RTF_ANNOUNCE: u32 = 16384; +pub const RTF_PROTO1: u32 = 32768; +pub const RTF_CLONED: u32 = 65536; +pub const RTF_CACHED: u32 = 131072; +pub const RTF_MPATH: u32 = 262144; +pub const RTF_MPLS: u32 = 1048576; +pub const RTF_LOCAL: u32 = 2097152; +pub const RTF_BROADCAST: u32 = 4194304; +pub const RTF_CONNECTED: u32 = 8388608; +pub const RTF_BFD: u32 = 16777216; +pub const RTF_FMASK: u32 = 17890312; +pub const RTP_NONE: u32 = 0; +pub const RTP_LOCAL: u32 = 1; +pub const RTP_CONNECTED: u32 = 4; +pub const RTP_STATIC: u32 = 8; +pub const RTP_EIGRP: u32 = 28; +pub const RTP_OSPF: u32 = 32; +pub const RTP_ISIS: u32 = 36; +pub const RTP_RIP: u32 = 40; +pub const RTP_BGP: u32 = 48; +pub const RTP_DEFAULT: u32 = 56; +pub const RTP_PROPOSAL_STATIC: u32 = 57; +pub const RTP_PROPOSAL_DHCLIENT: u32 = 58; +pub const RTP_PROPOSAL_SLAAC: u32 = 59; +pub const RTP_PROPOSAL_UMB: u32 = 60; +pub const RTP_PROPOSAL_PPP: u32 = 61; +pub const RTP_PROPOSAL_SOLICIT: u32 = 62; +pub const RTP_MAX: u32 = 63; +pub const RTP_ANY: u32 = 64; +pub const RTP_MASK: u32 = 127; +pub const RTP_DOWN: u32 = 128; +pub const RTM_VERSION: u32 = 5; +pub const RTM_MAXSIZE: u32 = 2048; +pub const RTM_ADD: u32 = 1; +pub const RTM_DELETE: u32 = 2; +pub const RTM_CHANGE: u32 = 3; +pub const RTM_GET: u32 = 4; +pub const RTM_LOSING: u32 = 5; +pub const RTM_REDIRECT: u32 = 6; +pub const RTM_MISS: u32 = 7; +pub const RTM_RESOLVE: u32 = 11; +pub const RTM_NEWADDR: u32 = 12; +pub const RTM_DELADDR: u32 = 13; +pub const RTM_IFINFO: u32 = 14; +pub const RTM_IFANNOUNCE: u32 = 15; +pub const RTM_DESYNC: u32 = 16; +pub const RTM_INVALIDATE: u32 = 17; +pub const RTM_BFD: u32 = 18; +pub const RTM_PROPOSAL: u32 = 19; +pub const RTM_CHGADDRATTR: u32 = 20; +pub const RTM_80211INFO: u32 = 21; +pub const RTM_SOURCE: u32 = 22; +pub const RTV_MTU: u32 = 1; +pub const RTV_HOPCOUNT: u32 = 2; +pub const RTV_EXPIRE: u32 = 4; +pub const RTV_RPIPE: u32 = 8; +pub const RTV_SPIPE: u32 = 16; +pub const RTV_SSTHRESH: u32 = 32; +pub const RTV_RTT: u32 = 64; +pub const RTV_RTTVAR: u32 = 128; +pub const RTA_DST: u32 = 1; +pub const RTA_GATEWAY: u32 = 2; +pub const RTA_NETMASK: u32 = 4; +pub const RTA_GENMASK: u32 = 8; +pub const RTA_IFP: u32 = 16; +pub const RTA_IFA: u32 = 32; +pub const RTA_AUTHOR: u32 = 64; +pub const RTA_BRD: u32 = 128; +pub const RTA_SRC: u32 = 256; +pub const RTA_SRCMASK: u32 = 512; +pub const RTA_LABEL: u32 = 1024; +pub const RTA_BFD: u32 = 2048; +pub const RTA_DNS: u32 = 4096; +pub const RTA_STATIC: u32 = 8192; +pub const RTA_SEARCH: u32 = 16384; +pub const RTAX_DST: u32 = 0; +pub const RTAX_GATEWAY: u32 = 1; +pub const RTAX_NETMASK: u32 = 2; +pub const RTAX_GENMASK: u32 = 3; +pub const RTAX_IFP: u32 = 4; +pub const RTAX_IFA: u32 = 5; +pub const RTAX_AUTHOR: u32 = 6; +pub const RTAX_BRD: u32 = 7; +pub const RTAX_SRC: u32 = 8; +pub const RTAX_SRCMASK: u32 = 9; +pub const RTAX_LABEL: u32 = 10; +pub const RTAX_BFD: u32 = 11; +pub const RTAX_DNS: u32 = 12; +pub const RTAX_STATIC: u32 = 13; +pub const RTAX_SEARCH: u32 = 14; +pub const RTAX_MAX: u32 = 15; +pub const ROUTE_MSGFILTER: u32 = 1; +pub const ROUTE_TABLEFILTER: u32 = 2; +pub const ROUTE_PRIOFILTER: u32 = 3; +pub const ROUTE_FLAGFILTER: u32 = 4; +pub const RTABLE_ANY: u32 = 4294967295; +pub const RTLABEL_LEN: u32 = 32; +pub const RTDNS_LEN: u32 = 128; +pub const RTSTATIC_LEN: u32 = 128; +pub const RTSEARCH_LEN: u32 = 128; +pub const PF_MD5_DIGEST_LENGTH: u32 = 16; +pub const PFTM_TCP_FIRST_PACKET_VAL: u32 = 120; +pub const PFTM_TCP_OPENING_VAL: u32 = 30; +pub const PFTM_TCP_ESTABLISHED_VAL: u32 = 86400; +pub const PFTM_TCP_CLOSING_VAL: u32 = 900; +pub const PFTM_TCP_FIN_WAIT_VAL: u32 = 45; +pub const PFTM_TCP_CLOSED_VAL: u32 = 90; +pub const PFTM_UDP_FIRST_PACKET_VAL: u32 = 60; +pub const PFTM_UDP_SINGLE_VAL: u32 = 30; +pub const PFTM_UDP_MULTIPLE_VAL: u32 = 60; +pub const PFTM_ICMP_FIRST_PACKET_VAL: u32 = 20; +pub const PFTM_ICMP_ERROR_REPLY_VAL: u32 = 10; +pub const PFTM_OTHER_FIRST_PACKET_VAL: u32 = 60; +pub const PFTM_OTHER_SINGLE_VAL: u32 = 30; +pub const PFTM_OTHER_MULTIPLE_VAL: u32 = 60; +pub const PFTM_FRAG_VAL: u32 = 60; +pub const PFTM_INTERVAL_VAL: u32 = 10; +pub const PFTM_SRC_NODE_VAL: u32 = 0; +pub const PFTM_TS_DIFF_VAL: u32 = 30; +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 PFI_AFLAG_NETWORK: u32 = 1; +pub const PFI_AFLAG_BROADCAST: u32 = 2; +pub const PFI_AFLAG_PEER: u32 = 4; +pub const PFI_AFLAG_MODEMASK: u32 = 7; +pub const PFI_AFLAG_NOALIAS: u32 = 8; +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 _FP_RESERVED_BIT: u32 = 1; +pub const _FP_UNUSED_BITS: u32 = 1; +pub const _FP_CLASS_BITS: u32 = 10; +pub const _FP_VERSION_BITS: u32 = 10; +pub const _FP_SUBTYPE_BITS: u32 = 10; +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 PFSTATE_HIWAT: u32 = 100000; +pub const PFSTATE_ADAPT_START: u32 = 60000; +pub const PFSTATE_ADAPT_END: u32 = 120000; +pub const PF_PKTDELAY_MAXPKTS: u32 = 10000; +pub const PFSNODE_HIWAT: u32 = 10000; +pub const PFSS_TIMESTAMP: u32 = 1; +pub const PFSS_PAWS: u32 = 16; +pub const PFSS_PAWS_IDLED: u32 = 32; +pub const PFSS_DATA_TS: u32 = 64; +pub const PFSS_DATA_NOTS: u32 = 128; +pub const PFSTATE_ALLOWOPTS: u32 = 1; +pub const PFSTATE_SLOPPY: u32 = 2; +pub const PFSTATE_PFLOW: u32 = 4; +pub const PFSTATE_NOSYNC: u32 = 8; +pub const PFSTATE_ACK: u32 = 16; +pub const PFSTATE_NODF: u32 = 32; +pub const PFSTATE_SETTOS: u32 = 64; +pub const PFSTATE_RANDOMID: u32 = 128; +pub const PFSTATE_SCRUB_TCP: u32 = 256; +pub const PFSTATE_SETPRIO: u32 = 512; +pub const PFSTATE_INP_UNLINKED: u32 = 1024; +pub const PFSTATE_SCRUBMASK: u32 = 416; +pub const PFSTATE_SETMASK: u32 = 576; +pub const PFSYNC_SCRUB_FLAG_VALID: u32 = 1; +pub const PFSYNC_FLAG_SRCNODE: u32 = 4; +pub const PFSYNC_FLAG_NATSRCNODE: u32 = 8; +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 PFRKE_FLAG_NOT: u32 = 1; +pub const PFRKE_FLAG_MARK: u32 = 2; +pub const PFI_IFLAG_SKIP: u32 = 256; +pub const PFI_IFLAG_ANY: u32 = 512; +pub const PF_DPORT_RANGE: u32 = 1; +pub const PF_RPORT_RANGE: u32 = 2; +pub const PFRES_MATCH: u32 = 0; +pub const PFRES_BADOFF: u32 = 1; +pub const PFRES_FRAG: u32 = 2; +pub const PFRES_SHORT: u32 = 3; +pub const PFRES_NORM: u32 = 4; +pub const PFRES_MEMORY: u32 = 5; +pub const PFRES_TS: u32 = 6; +pub const PFRES_CONGEST: u32 = 7; +pub const PFRES_IPOPTIONS: u32 = 8; +pub const PFRES_PROTCKSUM: u32 = 9; +pub const PFRES_BADSTATE: u32 = 10; +pub const PFRES_STATEINS: u32 = 11; +pub const PFRES_MAXSTATES: u32 = 12; +pub const PFRES_SRCLIMIT: u32 = 13; +pub const PFRES_SYNPROXY: u32 = 14; +pub const PFRES_TRANSLATE: u32 = 15; +pub const PFRES_NOROUTE: u32 = 16; +pub const PFRES_MAX: u32 = 17; +pub const LCNT_STATES: u32 = 0; +pub const LCNT_SRCSTATES: u32 = 1; +pub const LCNT_SRCNODES: u32 = 2; +pub const LCNT_SRCCONN: u32 = 3; +pub const LCNT_SRCCONNRATE: u32 = 4; +pub const LCNT_OVERLOAD_TABLE: u32 = 5; +pub const LCNT_OVERLOAD_FLUSH: u32 = 6; +pub const LCNT_SYNFLOODS: u32 = 7; +pub const LCNT_SYNCOOKIES_SENT: u32 = 8; +pub const LCNT_SYNCOOKIES_VALID: u32 = 9; +pub const LCNT_MAX: u32 = 10; +pub const PFUDPS_NO_TRAFFIC: u32 = 0; +pub const PFUDPS_SINGLE: u32 = 1; +pub const PFUDPS_MULTIPLE: u32 = 2; +pub const PFUDPS_NSTATES: u32 = 3; +pub const PFOTHERS_NO_TRAFFIC: u32 = 0; +pub const PFOTHERS_SINGLE: u32 = 1; +pub const PFOTHERS_MULTIPLE: u32 = 2; +pub const PFOTHERS_NSTATES: u32 = 3; +pub const FCNT_STATE_SEARCH: u32 = 0; +pub const FCNT_STATE_INSERT: u32 = 1; +pub const FCNT_STATE_REMOVALS: u32 = 2; +pub const FCNT_MAX: u32 = 3; +pub const SCNT_SRC_NODE_SEARCH: u32 = 0; +pub const SCNT_SRC_NODE_INSERT: u32 = 1; +pub const SCNT_SRC_NODE_REMOVALS: u32 = 2; +pub const SCNT_MAX: u32 = 3; +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 const PFQS_FLOWQUEUE: u32 = 1; +pub const PFQS_ROOTCLASS: u32 = 2; +pub const PFQS_DEFAULT: u32 = 4096; +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 __int8_t = ::std::os::raw::c_schar; +pub type __uint8_t = ::std::os::raw::c_uchar; +pub type __int16_t = ::std::os::raw::c_short; +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 __int_least8_t = __int8_t; +pub type __uint_least8_t = __uint8_t; +pub type __int_least16_t = __int16_t; +pub type __uint_least16_t = __uint16_t; +pub type __int_least32_t = __int32_t; +pub type __uint_least32_t = __uint32_t; +pub type __int_least64_t = __int64_t; +pub type __uint_least64_t = __uint64_t; +pub type __int_fast8_t = __int32_t; +pub type __uint_fast8_t = __uint32_t; +pub type __int_fast16_t = __int32_t; +pub type __uint_fast16_t = __uint32_t; +pub type __int_fast32_t = __int32_t; +pub type __uint_fast32_t = __uint32_t; +pub type __int_fast64_t = __int64_t; +pub type __uint_fast64_t = __uint64_t; +pub type __intptr_t = ::std::os::raw::c_long; +pub type __uintptr_t = ::std::os::raw::c_ulong; +pub type __intmax_t = __int64_t; +pub type __uintmax_t = __uint64_t; +pub type __register_t = ::std::os::raw::c_long; +pub type __vaddr_t = ::std::os::raw::c_ulong; +pub type __paddr_t = ::std::os::raw::c_ulong; +pub type __vsize_t = ::std::os::raw::c_ulong; +pub type __psize_t = ::std::os::raw::c_ulong; +pub type __double_t = f64; +pub type __float_t = f32; +pub type __ptrdiff_t = ::std::os::raw::c_long; +pub type __size_t = ::std::os::raw::c_ulong; +pub type __ssize_t = ::std::os::raw::c_long; +pub type __va_list = __builtin_va_list; +pub type __wchar_t = ::std::os::raw::c_int; +pub type __wint_t = ::std::os::raw::c_int; +pub type __rune_t = ::std::os::raw::c_int; +pub type __wctrans_t = *mut ::std::os::raw::c_void; +pub type __wctype_t = *mut ::std::os::raw::c_void; +pub type int_least8_t = __int_least8_t; +pub type uint_least8_t = __uint_least8_t; +pub type int_least16_t = __int_least16_t; +pub type uint_least16_t = __uint_least16_t; +pub type int_least32_t = __int_least32_t; +pub type uint_least32_t = __uint_least32_t; +pub type int_least64_t = __int_least64_t; +pub type uint_least64_t = __uint_least64_t; +pub type int_fast8_t = __int_fast8_t; +pub type uint_fast8_t = __uint_fast8_t; +pub type int_fast16_t = __int_fast16_t; +pub type uint_fast16_t = __uint_fast16_t; +pub type int_fast32_t = __int_fast32_t; +pub type uint_fast32_t = __uint_fast32_t; +pub type int_fast64_t = __int_fast64_t; +pub type uint_fast64_t = __uint_fast64_t; +pub type intmax_t = __intmax_t; +pub type uintmax_t = __uintmax_t; +pub type __blkcnt_t = __int64_t; +pub type __blksize_t = __int32_t; +pub type __clock_t = __int64_t; +pub type __clockid_t = __int32_t; +pub type __cpuid_t = ::std::os::raw::c_ulong; +pub type __dev_t = __int32_t; +pub type __fixpt_t = __uint32_t; +pub type __fsblkcnt_t = __uint64_t; +pub type __fsfilcnt_t = __uint64_t; +pub type __gid_t = __uint32_t; +pub type __id_t = __uint32_t; +pub type __in_addr_t = __uint32_t; +pub type __in_port_t = __uint16_t; +pub type __ino_t = __uint64_t; +pub type __key_t = ::std::os::raw::c_long; +pub type __mode_t = __uint32_t; +pub type __nlink_t = __uint32_t; +pub type __off_t = __int64_t; +pub type __pid_t = __int32_t; +pub type __rlim_t = __uint64_t; +pub type __sa_family_t = __uint8_t; +pub type __segsz_t = __int32_t; +pub type __socklen_t = __uint32_t; +pub type __suseconds_t = ::std::os::raw::c_long; +pub type __time_t = __int64_t; +pub type __timer_t = __int32_t; +pub type __uid_t = __uint32_t; +pub type __useconds_t = __uint32_t; +#[repr(C)] +#[derive(Copy, Clone)] +pub union __mbstate_t { + pub __mbstate8: [::std::os::raw::c_char; 128usize], + pub __mbstateL: __int64_t, +} +#[test] +fn bindgen_test_layout___mbstate_t() { + const UNINIT: ::std::mem::MaybeUninit<__mbstate_t> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<__mbstate_t>(), + 128usize, + concat!("Size of: ", stringify!(__mbstate_t)) + ); + assert_eq!( + ::std::mem::align_of::<__mbstate_t>(), + 8usize, + concat!("Alignment of ", stringify!(__mbstate_t)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__mbstate8) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__mbstate_t), + "::", + stringify!(__mbstate8) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__mbstateL) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__mbstate_t), + "::", + stringify!(__mbstateL) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct iovec { + pub iov_base: *mut ::std::os::raw::c_void, + pub iov_len: usize, +} +#[test] +fn bindgen_test_layout_iovec() { + 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!(iovec)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(iovec)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).iov_base) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(iovec), + "::", + stringify!(iov_base) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).iov_len) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(iovec), + "::", + stringify!(iov_len) + ) + ); +} +pub const uio_rw_UIO_READ: uio_rw = 0; +pub const uio_rw_UIO_WRITE: uio_rw = 1; +pub type uio_rw = ::std::os::raw::c_uint; +pub const uio_seg_UIO_USERSPACE: uio_seg = 0; +pub const uio_seg_UIO_SYSSPACE: uio_seg = 1; +pub type uio_seg = ::std::os::raw::c_uint; +extern "C" { + pub fn preadv( + arg1: ::std::os::raw::c_int, + arg2: *const iovec, + arg3: ::std::os::raw::c_int, + arg4: __off_t, + ) -> isize; +} +extern "C" { + pub fn pwritev( + arg1: ::std::os::raw::c_int, + arg2: *const iovec, + arg3: ::std::os::raw::c_int, + arg4: __off_t, + ) -> isize; +} +extern "C" { + pub fn readv( + arg1: ::std::os::raw::c_int, + arg2: *const iovec, + arg3: ::std::os::raw::c_int, + ) -> isize; +} +extern "C" { + pub fn writev( + arg1: ::std::os::raw::c_int, + arg2: *const iovec, + arg3: ::std::os::raw::c_int, + ) -> isize; +} +pub type u_char = ::std::os::raw::c_uchar; +pub type u_short = ::std::os::raw::c_ushort; +pub type u_int = ::std::os::raw::c_uint; +pub type u_long = ::std::os::raw::c_ulong; +pub type unchar = ::std::os::raw::c_uchar; +pub type ushort = ::std::os::raw::c_ushort; +pub type uint = ::std::os::raw::c_uint; +pub type ulong = ::std::os::raw::c_ulong; +pub type cpuid_t = __cpuid_t; +pub type register_t = __register_t; +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 quad_t = __int64_t; +pub type u_quad_t = __uint64_t; +pub type vaddr_t = __vaddr_t; +pub type paddr_t = __paddr_t; +pub type vsize_t = __vsize_t; +pub type psize_t = __psize_t; +pub type blkcnt_t = __blkcnt_t; +pub type blksize_t = __blksize_t; +pub type caddr_t = *mut ::std::os::raw::c_char; +pub type daddr32_t = __int32_t; +pub type daddr_t = __int64_t; +pub type dev_t = __dev_t; +pub type fixpt_t = __fixpt_t; +pub type gid_t = __gid_t; +pub type id_t = __id_t; +pub type ino_t = __ino_t; +pub type key_t = __key_t; +pub type mode_t = __mode_t; +pub type nlink_t = __nlink_t; +pub type rlim_t = __rlim_t; +pub type segsz_t = __segsz_t; +pub type uid_t = __uid_t; +pub type useconds_t = __useconds_t; +pub type suseconds_t = __suseconds_t; +pub type fsblkcnt_t = __fsblkcnt_t; +pub type fsfilcnt_t = __fsfilcnt_t; +pub type clock_t = __clock_t; +pub type clockid_t = __clockid_t; +pub type pid_t = __pid_t; +pub type time_t = __time_t; +pub type timer_t = __timer_t; +pub type off_t = __off_t; +extern "C" { + pub fn lseek(arg1: ::std::os::raw::c_int, arg2: off_t, arg3: ::std::os::raw::c_int) -> off_t; +} +extern "C" { + pub fn ftruncate(arg1: ::std::os::raw::c_int, arg2: off_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn truncate(arg1: *const ::std::os::raw::c_char, arg2: off_t) -> ::std::os::raw::c_int; +} +pub type socklen_t = __socklen_t; +pub type sa_family_t = __sa_family_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct linger { + pub l_onoff: ::std::os::raw::c_int, + pub l_linger: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_linger() { + 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!(linger)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(linger)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).l_onoff) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(linger), + "::", + stringify!(l_onoff) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).l_linger) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(linger), + "::", + stringify!(l_linger) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct timeval { + pub tv_sec: time_t, + pub tv_usec: suseconds_t, +} +#[test] +fn bindgen_test_layout_timeval() { + 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!(timeval)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(timeval)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(timeval), + "::", + stringify!(tv_sec) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(timeval), + "::", + stringify!(tv_usec) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct splice { + pub sp_fd: ::std::os::raw::c_int, + pub sp_max: off_t, + pub sp_idle: timeval, +} +#[test] +fn bindgen_test_layout_splice() { + 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!(splice)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(splice)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sp_fd) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(splice), + "::", + stringify!(sp_fd) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sp_max) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(splice), + "::", + stringify!(sp_max) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sp_idle) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(splice), + "::", + stringify!(sp_idle) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr { + pub sa_len: __uint8_t, + pub sa_family: sa_family_t, + pub sa_data: [::std::os::raw::c_char; 14usize], +} +#[test] +fn bindgen_test_layout_sockaddr() { + 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!(sockaddr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(sockaddr)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sa_len) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(sockaddr), + "::", + stringify!(sa_len) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sa_family) as usize - ptr as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(sockaddr), + "::", + stringify!(sa_family) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sa_data) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(sockaddr), + "::", + stringify!(sa_data) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_storage { + pub ss_len: __uint8_t, + pub ss_family: sa_family_t, + pub __ss_pad1: [::std::os::raw::c_uchar; 6usize], + pub __ss_pad2: __uint64_t, + pub __ss_pad3: [::std::os::raw::c_uchar; 240usize], +} +#[test] +fn bindgen_test_layout_sockaddr_storage() { + 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!(sockaddr_storage)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(sockaddr_storage)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ss_len) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_storage), + "::", + stringify!(ss_len) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ss_family) as usize - ptr as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_storage), + "::", + stringify!(ss_family) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__ss_pad1) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_storage), + "::", + stringify!(__ss_pad1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__ss_pad2) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_storage), + "::", + stringify!(__ss_pad2) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__ss_pad3) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_storage), + "::", + stringify!(__ss_pad3) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockpeercred { + pub uid: uid_t, + pub gid: gid_t, + pub pid: pid_t, +} +#[test] +fn bindgen_test_layout_sockpeercred() { + 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!(sockpeercred)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(sockpeercred)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).uid) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(sockpeercred), + "::", + stringify!(uid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).gid) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(sockpeercred), + "::", + stringify!(gid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pid) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(sockpeercred), + "::", + stringify!(pid) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct msghdr { + pub msg_name: *mut ::std::os::raw::c_void, + pub msg_namelen: socklen_t, + pub msg_iov: *mut iovec, + pub msg_iovlen: ::std::os::raw::c_uint, + pub msg_control: *mut ::std::os::raw::c_void, + pub msg_controllen: socklen_t, + pub msg_flags: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_msghdr() { + 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!(msghdr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(msghdr)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).msg_name) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(msghdr), + "::", + stringify!(msg_name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).msg_namelen) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(msghdr), + "::", + stringify!(msg_namelen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).msg_iov) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(msghdr), + "::", + stringify!(msg_iov) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).msg_iovlen) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(msghdr), + "::", + stringify!(msg_iovlen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).msg_control) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(msghdr), + "::", + stringify!(msg_control) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).msg_controllen) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(msghdr), + "::", + stringify!(msg_controllen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).msg_flags) as usize - ptr as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(msghdr), + "::", + stringify!(msg_flags) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mmsghdr { + pub msg_hdr: msghdr, + pub msg_len: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout_mmsghdr() { + 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!(mmsghdr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(mmsghdr)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).msg_hdr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(mmsghdr), + "::", + stringify!(msg_hdr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).msg_len) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(mmsghdr), + "::", + stringify!(msg_len) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct cmsghdr { + pub cmsg_len: socklen_t, + pub cmsg_level: ::std::os::raw::c_int, + pub cmsg_type: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_cmsghdr() { + 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!(cmsghdr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(cmsghdr)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cmsg_len) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(cmsghdr), + "::", + stringify!(cmsg_len) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cmsg_level) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(cmsghdr), + "::", + stringify!(cmsg_level) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cmsg_type) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(cmsghdr), + "::", + stringify!(cmsg_type) + ) + ); +} +extern "C" { + pub fn accept( + arg1: ::std::os::raw::c_int, + arg2: *mut sockaddr, + arg3: *mut socklen_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn bind( + arg1: ::std::os::raw::c_int, + arg2: *const sockaddr, + arg3: socklen_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn connect( + arg1: ::std::os::raw::c_int, + arg2: *const sockaddr, + arg3: socklen_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getpeername( + arg1: ::std::os::raw::c_int, + arg2: *mut sockaddr, + arg3: *mut socklen_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getsockname( + arg1: ::std::os::raw::c_int, + arg2: *mut sockaddr, + arg3: *mut socklen_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getsockopt( + arg1: ::std::os::raw::c_int, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + arg4: *mut ::std::os::raw::c_void, + arg5: *mut socklen_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn listen( + arg1: ::std::os::raw::c_int, + arg2: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn recv( + arg1: ::std::os::raw::c_int, + arg2: *mut ::std::os::raw::c_void, + arg3: usize, + arg4: ::std::os::raw::c_int, + ) -> isize; +} +extern "C" { + pub fn recvfrom( + arg1: ::std::os::raw::c_int, + arg2: *mut ::std::os::raw::c_void, + arg3: usize, + arg4: ::std::os::raw::c_int, + arg5: *mut sockaddr, + arg6: *mut socklen_t, + ) -> isize; +} +extern "C" { + pub fn recvmsg( + arg1: ::std::os::raw::c_int, + arg2: *mut msghdr, + arg3: ::std::os::raw::c_int, + ) -> isize; +} +extern "C" { + pub fn recvmmsg( + arg1: ::std::os::raw::c_int, + arg2: *mut mmsghdr, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_int, + arg5: *mut timespec, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn send( + arg1: ::std::os::raw::c_int, + arg2: *const ::std::os::raw::c_void, + arg3: usize, + arg4: ::std::os::raw::c_int, + ) -> isize; +} +extern "C" { + pub fn sendto( + arg1: ::std::os::raw::c_int, + arg2: *const ::std::os::raw::c_void, + arg3: usize, + arg4: ::std::os::raw::c_int, + arg5: *const sockaddr, + arg6: socklen_t, + ) -> isize; +} +extern "C" { + pub fn sendmsg( + arg1: ::std::os::raw::c_int, + arg2: *const msghdr, + arg3: ::std::os::raw::c_int, + ) -> isize; +} +extern "C" { + pub fn sendmmsg( + arg1: ::std::os::raw::c_int, + arg2: *mut mmsghdr, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn setsockopt( + arg1: ::std::os::raw::c_int, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + arg4: *const ::std::os::raw::c_void, + arg5: socklen_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn shutdown( + arg1: ::std::os::raw::c_int, + arg2: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sockatmark(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn socket( + arg1: ::std::os::raw::c_int, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn socketpair( + arg1: ::std::os::raw::c_int, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + arg4: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn accept4( + arg1: ::std::os::raw::c_int, + arg2: *mut sockaddr, + arg3: *mut socklen_t, + arg4: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getpeereid( + arg1: ::std::os::raw::c_int, + arg2: *mut uid_t, + arg3: *mut gid_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getrtable() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn setrtable(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct if_nameindex { + pub if_index: ::std::os::raw::c_uint, + pub if_name: *mut ::std::os::raw::c_char, +} +#[test] +fn bindgen_test_layout_if_nameindex() { + 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!(if_nameindex)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(if_nameindex)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).if_index) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(if_nameindex), + "::", + stringify!(if_index) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).if_name) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(if_nameindex), + "::", + stringify!(if_name) + ) + ); +} +extern "C" { + pub fn if_nametoindex(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_uint; +} +extern "C" { + pub fn if_indextoname( + arg1: ::std::os::raw::c_uint, + arg2: *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn if_nameindex() -> *mut if_nameindex; +} +extern "C" { + pub fn if_freenameindex(arg1: *mut if_nameindex); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct timespec { + pub tv_sec: time_t, + pub tv_nsec: ::std::os::raw::c_long, +} +#[test] +fn bindgen_test_layout_timespec() { + 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!(timespec)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(timespec)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(timespec), + "::", + stringify!(tv_sec) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(timespec), + "::", + stringify!(tv_nsec) + ) + ); +} +pub type __fd_mask = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fd_set { + pub fds_bits: [__fd_mask; 32usize], +} +#[test] +fn bindgen_test_layout_fd_set() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 128usize, + concat!("Size of: ", stringify!(fd_set)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(fd_set)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(fd_set), + "::", + stringify!(fds_bits) + ) + ); +} +pub type sigset_t = ::std::os::raw::c_uint; +extern "C" { + pub fn select( + arg1: ::std::os::raw::c_int, + arg2: *mut fd_set, + arg3: *mut fd_set, + arg4: *mut fd_set, + arg5: *mut timeval, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn pselect( + arg1: ::std::os::raw::c_int, + arg2: *mut fd_set, + arg3: *mut fd_set, + arg4: *mut fd_set, + arg5: *const timespec, + arg6: *const sigset_t, + ) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct timezone { + pub tz_minuteswest: ::std::os::raw::c_int, + pub tz_dsttime: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_timezone() { + 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!(timezone)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(timezone)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tz_minuteswest) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(timezone), + "::", + stringify!(tz_minuteswest) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tz_dsttime) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(timezone), + "::", + stringify!(tz_dsttime) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct itimerval { + pub it_interval: timeval, + pub it_value: timeval, +} +#[test] +fn bindgen_test_layout_itimerval() { + 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!(itimerval)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(itimerval)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(itimerval), + "::", + stringify!(it_interval) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(itimerval), + "::", + stringify!(it_value) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct clockinfo { + pub hz: ::std::os::raw::c_int, + pub tick: ::std::os::raw::c_int, + pub stathz: ::std::os::raw::c_int, + pub profhz: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_clockinfo() { + 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!(clockinfo)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(clockinfo)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hz) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(clockinfo), + "::", + stringify!(hz) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tick) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(clockinfo), + "::", + stringify!(tick) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).stathz) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(clockinfo), + "::", + stringify!(stathz) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).profhz) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(clockinfo), + "::", + stringify!(profhz) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct itimerspec { + pub it_interval: timespec, + pub it_value: timespec, +} +#[test] +fn bindgen_test_layout_itimerspec() { + 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!(itimerspec)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(itimerspec)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(itimerspec), + "::", + stringify!(it_interval) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(itimerspec), + "::", + stringify!(it_value) + ) + ); +} +pub type locale_t = *mut ::std::os::raw::c_void; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tm { + pub tm_sec: ::std::os::raw::c_int, + pub tm_min: ::std::os::raw::c_int, + pub tm_hour: ::std::os::raw::c_int, + pub tm_mday: ::std::os::raw::c_int, + pub tm_mon: ::std::os::raw::c_int, + pub tm_year: ::std::os::raw::c_int, + pub tm_wday: ::std::os::raw::c_int, + pub tm_yday: ::std::os::raw::c_int, + pub tm_isdst: ::std::os::raw::c_int, + pub tm_gmtoff: ::std::os::raw::c_long, + pub tm_zone: *mut ::std::os::raw::c_char, +} +#[test] +fn bindgen_test_layout_tm() { + 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!(tm)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(tm)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tm_sec) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_sec) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tm_min) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_min) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tm_hour) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_hour) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tm_mday) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_mday) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tm_mon) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_mon) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tm_year) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_year) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tm_wday) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_wday) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tm_yday) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_yday) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tm_isdst) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_isdst) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tm_gmtoff) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_gmtoff) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tm_zone) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_zone) + ) + ); +} +extern "C" { + pub fn asctime(arg1: *const tm) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn clock() -> clock_t; +} +extern "C" { + pub fn ctime(arg1: *const time_t) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn difftime(arg1: time_t, arg2: time_t) -> f64; +} +extern "C" { + pub fn gmtime(arg1: *const time_t) -> *mut tm; +} +extern "C" { + pub fn localtime(arg1: *const time_t) -> *mut tm; +} +extern "C" { + pub fn mktime(arg1: *mut tm) -> time_t; +} +extern "C" { + pub fn strftime( + arg1: *mut ::std::os::raw::c_char, + arg2: usize, + arg3: *const ::std::os::raw::c_char, + arg4: *const tm, + ) -> usize; +} +extern "C" { + pub fn time(arg1: *mut time_t) -> time_t; +} +extern "C" { + pub static mut daylight: ::std::os::raw::c_int; +} +extern "C" { + pub static mut timezone: ::std::os::raw::c_long; +} +extern "C" { + pub fn strptime( + arg1: *const ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + arg3: *mut tm, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn asctime_r( + arg1: *const tm, + arg2: *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn ctime_r( + arg1: *const time_t, + arg2: *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn gmtime_r(arg1: *const time_t, arg2: *mut tm) -> *mut tm; +} +extern "C" { + pub fn localtime_r(arg1: *const time_t, arg2: *mut tm) -> *mut tm; +} +extern "C" { + pub static mut tzname: [*mut ::std::os::raw::c_char; 2usize]; +} +extern "C" { + pub fn tzset(); +} +extern "C" { + pub fn clock_getres(arg1: clockid_t, arg2: *mut timespec) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn clock_gettime(arg1: clockid_t, arg2: *mut timespec) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn clock_settime(arg1: clockid_t, arg2: *const timespec) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn nanosleep(arg1: *const timespec, arg2: *mut timespec) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn clock_getcpuclockid(arg1: pid_t, arg2: *mut clockid_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn strftime_l( + arg1: *mut ::std::os::raw::c_char, + arg2: usize, + arg3: *const ::std::os::raw::c_char, + arg4: *const tm, + arg5: locale_t, + ) -> usize; +} +extern "C" { + pub fn timespec_get(_ts: *mut timespec, _base: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn tzsetwall(); +} +extern "C" { + pub fn timelocal(arg1: *mut tm) -> time_t; +} +extern "C" { + pub fn timegm(arg1: *mut tm) -> time_t; +} +extern "C" { + pub fn timeoff(arg1: *mut tm, arg2: ::std::os::raw::c_long) -> time_t; +} +extern "C" { + pub fn adjtime(arg1: *const timeval, arg2: *mut timeval) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn adjfreq(arg1: *const i64, arg2: *mut i64) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn futimes(arg1: ::std::os::raw::c_int, arg2: *const timeval) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getitimer(arg1: ::std::os::raw::c_int, arg2: *mut itimerval) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn gettimeofday(arg1: *mut timeval, arg2: *mut timezone) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn setitimer( + arg1: ::std::os::raw::c_int, + arg2: *const itimerval, + arg3: *mut itimerval, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn settimeofday(arg1: *const timeval, arg2: *const timezone) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn utimes( + arg1: *const ::std::os::raw::c_char, + arg2: *const timeval, + ) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct if_clonereq { + pub ifcr_total: ::std::os::raw::c_int, + pub ifcr_count: ::std::os::raw::c_int, + pub ifcr_buffer: *mut ::std::os::raw::c_char, +} +#[test] +fn bindgen_test_layout_if_clonereq() { + 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!(if_clonereq)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(if_clonereq)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifcr_total) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(if_clonereq), + "::", + stringify!(ifcr_total) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifcr_count) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(if_clonereq), + "::", + stringify!(ifcr_count) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifcr_buffer) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(if_clonereq), + "::", + stringify!(ifcr_buffer) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct if_rxring { + pub rxr_adjusted: ::std::os::raw::c_int, + pub rxr_alive: u_int, + pub rxr_cwm: u_int, + pub rxr_lwm: u_int, + pub rxr_hwm: u_int, +} +#[test] +fn bindgen_test_layout_if_rxring() { + 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!(if_rxring)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(if_rxring)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rxr_adjusted) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(if_rxring), + "::", + stringify!(rxr_adjusted) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rxr_alive) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(if_rxring), + "::", + stringify!(rxr_alive) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rxr_cwm) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(if_rxring), + "::", + stringify!(rxr_cwm) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rxr_lwm) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(if_rxring), + "::", + stringify!(rxr_lwm) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rxr_hwm) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(if_rxring), + "::", + stringify!(rxr_hwm) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct if_rxring_info { + pub ifr_name: [::std::os::raw::c_char; 16usize], + pub ifr_size: u_int, + pub ifr_info: if_rxring, +} +#[test] +fn bindgen_test_layout_if_rxring_info() { + 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!(if_rxring_info)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(if_rxring_info)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifr_name) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(if_rxring_info), + "::", + stringify!(ifr_name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifr_size) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(if_rxring_info), + "::", + stringify!(ifr_size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifr_info) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(if_rxring_info), + "::", + stringify!(ifr_info) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct if_rxrinfo { + pub ifri_total: u_int, + pub ifri_entries: *mut if_rxring_info, +} +#[test] +fn bindgen_test_layout_if_rxrinfo() { + 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!(if_rxrinfo)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(if_rxrinfo)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifri_total) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(if_rxrinfo), + "::", + stringify!(ifri_total) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifri_entries) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(if_rxrinfo), + "::", + stringify!(ifri_entries) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct if_data { + pub ifi_type: u_char, + pub ifi_addrlen: u_char, + pub ifi_hdrlen: u_char, + pub ifi_link_state: u_char, + pub ifi_mtu: u_int32_t, + pub ifi_metric: u_int32_t, + pub ifi_rdomain: u_int32_t, + pub ifi_baudrate: u_int64_t, + pub ifi_ipackets: u_int64_t, + pub ifi_ierrors: u_int64_t, + pub ifi_opackets: u_int64_t, + pub ifi_oerrors: u_int64_t, + pub ifi_collisions: u_int64_t, + pub ifi_ibytes: u_int64_t, + pub ifi_obytes: u_int64_t, + pub ifi_imcasts: u_int64_t, + pub ifi_omcasts: u_int64_t, + pub ifi_iqdrops: u_int64_t, + pub ifi_oqdrops: u_int64_t, + pub ifi_noproto: u_int64_t, + pub ifi_capabilities: u_int32_t, + pub ifi_lastchange: timeval, +} +#[test] +fn bindgen_test_layout_if_data() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 144usize, + concat!("Size of: ", stringify!(if_data)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(if_data)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifi_type) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(if_data), + "::", + stringify!(ifi_type) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifi_addrlen) as usize - ptr as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(if_data), + "::", + stringify!(ifi_addrlen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifi_hdrlen) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(if_data), + "::", + stringify!(ifi_hdrlen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifi_link_state) as usize - ptr as usize }, + 3usize, + concat!( + "Offset of field: ", + stringify!(if_data), + "::", + stringify!(ifi_link_state) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifi_mtu) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(if_data), + "::", + stringify!(ifi_mtu) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifi_metric) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(if_data), + "::", + stringify!(ifi_metric) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifi_rdomain) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(if_data), + "::", + stringify!(ifi_rdomain) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifi_baudrate) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(if_data), + "::", + stringify!(ifi_baudrate) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifi_ipackets) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(if_data), + "::", + stringify!(ifi_ipackets) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifi_ierrors) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(if_data), + "::", + stringify!(ifi_ierrors) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifi_opackets) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(if_data), + "::", + stringify!(ifi_opackets) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifi_oerrors) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(if_data), + "::", + stringify!(ifi_oerrors) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifi_collisions) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(if_data), + "::", + stringify!(ifi_collisions) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifi_ibytes) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(if_data), + "::", + stringify!(ifi_ibytes) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifi_obytes) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(if_data), + "::", + stringify!(ifi_obytes) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifi_imcasts) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(if_data), + "::", + stringify!(ifi_imcasts) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifi_omcasts) as usize - ptr as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(if_data), + "::", + stringify!(ifi_omcasts) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifi_iqdrops) as usize - ptr as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(if_data), + "::", + stringify!(ifi_iqdrops) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifi_oqdrops) as usize - ptr as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(if_data), + "::", + stringify!(ifi_oqdrops) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifi_noproto) as usize - ptr as usize }, + 112usize, + concat!( + "Offset of field: ", + stringify!(if_data), + "::", + stringify!(ifi_noproto) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifi_capabilities) as usize - ptr as usize }, + 120usize, + concat!( + "Offset of field: ", + stringify!(if_data), + "::", + stringify!(ifi_capabilities) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifi_lastchange) as usize - ptr as usize }, + 128usize, + concat!( + "Offset of field: ", + stringify!(if_data), + "::", + stringify!(ifi_lastchange) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct if_status_description { + pub ifs_type: u_char, + pub ifs_state: u_char, + pub ifs_string: *const ::std::os::raw::c_char, +} +#[test] +fn bindgen_test_layout_if_status_description() { + 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!(if_status_description)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(if_status_description)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifs_type) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(if_status_description), + "::", + stringify!(ifs_type) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifs_state) as usize - ptr as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(if_status_description), + "::", + stringify!(ifs_state) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifs_string) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(if_status_description), + "::", + stringify!(ifs_string) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct if_msghdr { + pub ifm_msglen: u_short, + pub ifm_version: u_char, + pub ifm_type: u_char, + pub ifm_hdrlen: u_short, + pub ifm_index: u_short, + pub ifm_tableid: u_short, + pub ifm_pad1: u_char, + pub ifm_pad2: u_char, + pub ifm_addrs: ::std::os::raw::c_int, + pub ifm_flags: ::std::os::raw::c_int, + pub ifm_xflags: ::std::os::raw::c_int, + pub ifm_data: if_data, +} +#[test] +fn bindgen_test_layout_if_msghdr() { + 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!(if_msghdr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(if_msghdr)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifm_msglen) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(if_msghdr), + "::", + stringify!(ifm_msglen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifm_version) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(if_msghdr), + "::", + stringify!(ifm_version) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifm_type) as usize - ptr as usize }, + 3usize, + concat!( + "Offset of field: ", + stringify!(if_msghdr), + "::", + stringify!(ifm_type) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifm_hdrlen) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(if_msghdr), + "::", + stringify!(ifm_hdrlen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifm_index) as usize - ptr as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(if_msghdr), + "::", + stringify!(ifm_index) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifm_tableid) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(if_msghdr), + "::", + stringify!(ifm_tableid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifm_pad1) as usize - ptr as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(if_msghdr), + "::", + stringify!(ifm_pad1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifm_pad2) as usize - ptr as usize }, + 11usize, + concat!( + "Offset of field: ", + stringify!(if_msghdr), + "::", + stringify!(ifm_pad2) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifm_addrs) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(if_msghdr), + "::", + stringify!(ifm_addrs) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifm_flags) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(if_msghdr), + "::", + stringify!(ifm_flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifm_xflags) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(if_msghdr), + "::", + stringify!(ifm_xflags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifm_data) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(if_msghdr), + "::", + stringify!(ifm_data) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ifa_msghdr { + pub ifam_msglen: u_short, + pub ifam_version: u_char, + pub ifam_type: u_char, + pub ifam_hdrlen: u_short, + pub ifam_index: u_short, + pub ifam_tableid: u_short, + pub ifam_pad1: u_char, + pub ifam_pad2: u_char, + pub ifam_addrs: ::std::os::raw::c_int, + pub ifam_flags: ::std::os::raw::c_int, + pub ifam_metric: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_ifa_msghdr() { + 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!(ifa_msghdr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(ifa_msghdr)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifam_msglen) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifa_msghdr), + "::", + stringify!(ifam_msglen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifam_version) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(ifa_msghdr), + "::", + stringify!(ifam_version) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifam_type) as usize - ptr as usize }, + 3usize, + concat!( + "Offset of field: ", + stringify!(ifa_msghdr), + "::", + stringify!(ifam_type) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifam_hdrlen) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(ifa_msghdr), + "::", + stringify!(ifam_hdrlen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifam_index) as usize - ptr as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(ifa_msghdr), + "::", + stringify!(ifam_index) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifam_tableid) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(ifa_msghdr), + "::", + stringify!(ifam_tableid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifam_pad1) as usize - ptr as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(ifa_msghdr), + "::", + stringify!(ifam_pad1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifam_pad2) as usize - ptr as usize }, + 11usize, + concat!( + "Offset of field: ", + stringify!(ifa_msghdr), + "::", + stringify!(ifam_pad2) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifam_addrs) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(ifa_msghdr), + "::", + stringify!(ifam_addrs) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifam_flags) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(ifa_msghdr), + "::", + stringify!(ifam_flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifam_metric) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(ifa_msghdr), + "::", + stringify!(ifam_metric) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct if_announcemsghdr { + pub ifan_msglen: u_short, + pub ifan_version: u_char, + pub ifan_type: u_char, + pub ifan_hdrlen: u_short, + pub ifan_index: u_short, + pub ifan_what: u_short, + pub ifan_name: [::std::os::raw::c_char; 16usize], +} +#[test] +fn bindgen_test_layout_if_announcemsghdr() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 26usize, + concat!("Size of: ", stringify!(if_announcemsghdr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + concat!("Alignment of ", stringify!(if_announcemsghdr)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifan_msglen) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(if_announcemsghdr), + "::", + stringify!(ifan_msglen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifan_version) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(if_announcemsghdr), + "::", + stringify!(ifan_version) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifan_type) as usize - ptr as usize }, + 3usize, + concat!( + "Offset of field: ", + stringify!(if_announcemsghdr), + "::", + stringify!(ifan_type) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifan_hdrlen) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(if_announcemsghdr), + "::", + stringify!(ifan_hdrlen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifan_index) as usize - ptr as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(if_announcemsghdr), + "::", + stringify!(ifan_index) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifan_what) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(if_announcemsghdr), + "::", + stringify!(ifan_what) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifan_name) as usize - ptr as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(if_announcemsghdr), + "::", + stringify!(ifan_name) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct if_ieee80211_data { + pub ifie_channel: u8, + pub ifie_nwid_len: u8, + pub ifie_flags: u32, + pub ifie_xflags: u32, + pub ifie_nwid: [u8; 32usize], + pub ifie_addr: [u8; 6usize], +} +#[test] +fn bindgen_test_layout_if_ieee80211_data() { + 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!(if_ieee80211_data)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(if_ieee80211_data)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifie_channel) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(if_ieee80211_data), + "::", + stringify!(ifie_channel) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifie_nwid_len) as usize - ptr as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(if_ieee80211_data), + "::", + stringify!(ifie_nwid_len) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifie_flags) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(if_ieee80211_data), + "::", + stringify!(ifie_flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifie_xflags) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(if_ieee80211_data), + "::", + stringify!(ifie_xflags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifie_nwid) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(if_ieee80211_data), + "::", + stringify!(ifie_nwid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifie_addr) as usize - ptr as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(if_ieee80211_data), + "::", + stringify!(ifie_addr) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct if_ieee80211_msghdr { + pub ifim_msglen: u16, + pub ifim_version: u8, + pub ifim_type: u8, + pub ifim_hdrlen: u16, + pub ifim_index: u16, + pub ifim_tableid: u16, + pub ifim_ifie: if_ieee80211_data, +} +#[test] +fn bindgen_test_layout_if_ieee80211_msghdr() { + 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!(if_ieee80211_msghdr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(if_ieee80211_msghdr)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifim_msglen) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(if_ieee80211_msghdr), + "::", + stringify!(ifim_msglen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifim_version) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(if_ieee80211_msghdr), + "::", + stringify!(ifim_version) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifim_type) as usize - ptr as usize }, + 3usize, + concat!( + "Offset of field: ", + stringify!(if_ieee80211_msghdr), + "::", + stringify!(ifim_type) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifim_hdrlen) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(if_ieee80211_msghdr), + "::", + stringify!(ifim_hdrlen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifim_index) as usize - ptr as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(if_ieee80211_msghdr), + "::", + stringify!(ifim_index) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifim_tableid) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(if_ieee80211_msghdr), + "::", + stringify!(ifim_tableid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifim_ifie) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(if_ieee80211_msghdr), + "::", + stringify!(ifim_ifie) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct if_nameindex_msg { + pub if_index: ::std::os::raw::c_uint, + pub if_name: [::std::os::raw::c_char; 16usize], +} +#[test] +fn bindgen_test_layout_if_nameindex_msg() { + 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!(if_nameindex_msg)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(if_nameindex_msg)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).if_index) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(if_nameindex_msg), + "::", + stringify!(if_index) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).if_name) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(if_nameindex_msg), + "::", + stringify!(if_name) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct ifg_req { + pub ifgrq_ifgrqu: ifg_req__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union ifg_req__bindgen_ty_1 { + pub ifgrqu_group: [::std::os::raw::c_char; 16usize], + pub ifgrqu_member: [::std::os::raw::c_char; 16usize], +} +#[test] +fn bindgen_test_layout_ifg_req__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!(ifg_req__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(ifg_req__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifgrqu_group) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifg_req__bindgen_ty_1), + "::", + stringify!(ifgrqu_group) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifgrqu_member) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifg_req__bindgen_ty_1), + "::", + stringify!(ifgrqu_member) + ) + ); +} +#[test] +fn bindgen_test_layout_ifg_req() { + 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!(ifg_req)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(ifg_req)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifgrq_ifgrqu) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifg_req), + "::", + stringify!(ifgrq_ifgrqu) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ifg_attrib { + pub ifg_carp_demoted: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_ifg_attrib() { + 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!(ifg_attrib)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(ifg_attrib)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifg_carp_demoted) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifg_attrib), + "::", + stringify!(ifg_carp_demoted) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct ifgroupreq { + pub ifgr_name: [::std::os::raw::c_char; 16usize], + pub ifgr_len: u_int, + pub ifgr_ifgru: ifgroupreq__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union ifgroupreq__bindgen_ty_1 { + pub ifgru_group: [::std::os::raw::c_char; 16usize], + pub ifgru_groups: *mut ifg_req, + pub ifgru_attrib: ifg_attrib, +} +#[test] +fn bindgen_test_layout_ifgroupreq__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!(ifgroupreq__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(ifgroupreq__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifgru_group) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifgroupreq__bindgen_ty_1), + "::", + stringify!(ifgru_group) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifgru_groups) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifgroupreq__bindgen_ty_1), + "::", + stringify!(ifgru_groups) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifgru_attrib) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifgroupreq__bindgen_ty_1), + "::", + stringify!(ifgru_attrib) + ) + ); +} +#[test] +fn bindgen_test_layout_ifgroupreq() { + 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!(ifgroupreq)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(ifgroupreq)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifgr_name) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifgroupreq), + "::", + stringify!(ifgr_name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifgr_len) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(ifgroupreq), + "::", + stringify!(ifgr_len) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifgr_ifgru) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(ifgroupreq), + "::", + stringify!(ifgr_ifgru) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct ifreq { + pub ifr_name: [::std::os::raw::c_char; 16usize], + pub ifr_ifru: ifreq__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union ifreq__bindgen_ty_1 { + pub ifru_addr: sockaddr, + pub ifru_dstaddr: sockaddr, + pub ifru_broadaddr: sockaddr, + pub ifru_flags: ::std::os::raw::c_short, + pub ifru_metric: ::std::os::raw::c_int, + pub ifru_vnetid: i64, + pub ifru_media: u64, + pub ifru_data: caddr_t, + pub ifru_index: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout_ifreq__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!(ifreq__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(ifreq__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifru_addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifreq__bindgen_ty_1), + "::", + stringify!(ifru_addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifru_dstaddr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifreq__bindgen_ty_1), + "::", + stringify!(ifru_dstaddr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifru_broadaddr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifreq__bindgen_ty_1), + "::", + stringify!(ifru_broadaddr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifru_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifreq__bindgen_ty_1), + "::", + stringify!(ifru_flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifru_metric) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifreq__bindgen_ty_1), + "::", + stringify!(ifru_metric) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifru_vnetid) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifreq__bindgen_ty_1), + "::", + stringify!(ifru_vnetid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifru_media) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifreq__bindgen_ty_1), + "::", + stringify!(ifru_media) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifru_data) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifreq__bindgen_ty_1), + "::", + stringify!(ifru_data) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifru_index) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifreq__bindgen_ty_1), + "::", + stringify!(ifru_index) + ) + ); +} +#[test] +fn bindgen_test_layout_ifreq() { + 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!(ifreq)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(ifreq)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifr_name) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifreq), + "::", + stringify!(ifr_name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifr_ifru) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(ifreq), + "::", + stringify!(ifr_ifru) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct ifaliasreq { + pub ifra_name: [::std::os::raw::c_char; 16usize], + pub ifra_ifrau: ifaliasreq__bindgen_ty_1, + pub ifra_dstaddr: sockaddr, + pub ifra_mask: sockaddr, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union ifaliasreq__bindgen_ty_1 { + pub ifrau_addr: sockaddr, + pub ifrau_align: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_ifaliasreq__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!(ifaliasreq__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(ifaliasreq__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifrau_addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifaliasreq__bindgen_ty_1), + "::", + stringify!(ifrau_addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifrau_align) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifaliasreq__bindgen_ty_1), + "::", + stringify!(ifrau_align) + ) + ); +} +#[test] +fn bindgen_test_layout_ifaliasreq() { + 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!(ifaliasreq)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(ifaliasreq)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifra_name) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifaliasreq), + "::", + stringify!(ifra_name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifra_ifrau) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(ifaliasreq), + "::", + stringify!(ifra_ifrau) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifra_dstaddr) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(ifaliasreq), + "::", + stringify!(ifra_dstaddr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifra_mask) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(ifaliasreq), + "::", + stringify!(ifra_mask) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ifmediareq { + pub ifm_name: [::std::os::raw::c_char; 16usize], + pub ifm_current: u64, + pub ifm_mask: u64, + pub ifm_status: u64, + pub ifm_active: u64, + pub ifm_count: ::std::os::raw::c_int, + pub ifm_ulist: *mut u64, +} +#[test] +fn bindgen_test_layout_ifmediareq() { + 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!(ifmediareq)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(ifmediareq)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifm_name) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifmediareq), + "::", + stringify!(ifm_name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifm_current) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(ifmediareq), + "::", + stringify!(ifm_current) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifm_mask) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(ifmediareq), + "::", + stringify!(ifm_mask) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifm_status) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(ifmediareq), + "::", + stringify!(ifm_status) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifm_active) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(ifmediareq), + "::", + stringify!(ifm_active) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifm_count) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(ifmediareq), + "::", + stringify!(ifm_count) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifm_ulist) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(ifmediareq), + "::", + stringify!(ifm_ulist) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ifkalivereq { + pub ikar_name: [::std::os::raw::c_char; 16usize], + pub ikar_timeo: ::std::os::raw::c_int, + pub ikar_cnt: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_ifkalivereq() { + 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!(ifkalivereq)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(ifkalivereq)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ikar_name) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifkalivereq), + "::", + stringify!(ikar_name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ikar_timeo) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(ifkalivereq), + "::", + stringify!(ikar_timeo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ikar_cnt) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(ifkalivereq), + "::", + stringify!(ikar_cnt) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct ifconf { + pub ifc_len: ::std::os::raw::c_int, + pub ifc_ifcu: ifconf__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union ifconf__bindgen_ty_1 { + pub ifcu_buf: caddr_t, + pub ifcu_req: *mut ifreq, +} +#[test] +fn bindgen_test_layout_ifconf__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!(ifconf__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(ifconf__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifcu_buf) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifconf__bindgen_ty_1), + "::", + stringify!(ifcu_buf) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifcu_req) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifconf__bindgen_ty_1), + "::", + stringify!(ifcu_req) + ) + ); +} +#[test] +fn bindgen_test_layout_ifconf() { + 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!(ifconf)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(ifconf)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifc_len) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ifconf), + "::", + stringify!(ifc_len) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifc_ifcu) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(ifconf), + "::", + stringify!(ifc_ifcu) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct if_laddrreq { + pub iflr_name: [::std::os::raw::c_char; 16usize], + pub flags: ::std::os::raw::c_uint, + pub prefixlen: ::std::os::raw::c_uint, + pub addr: sockaddr_storage, + pub dstaddr: sockaddr_storage, +} +#[test] +fn bindgen_test_layout_if_laddrreq() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 536usize, + concat!("Size of: ", stringify!(if_laddrreq)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(if_laddrreq)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).iflr_name) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(if_laddrreq), + "::", + stringify!(iflr_name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(if_laddrreq), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).prefixlen) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(if_laddrreq), + "::", + stringify!(prefixlen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(if_laddrreq), + "::", + stringify!(addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).dstaddr) as usize - ptr as usize }, + 280usize, + concat!( + "Offset of field: ", + stringify!(if_laddrreq), + "::", + stringify!(dstaddr) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct if_afreq { + pub ifar_name: [::std::os::raw::c_char; 16usize], + pub ifar_af: sa_family_t, +} +#[test] +fn bindgen_test_layout_if_afreq() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 17usize, + concat!("Size of: ", stringify!(if_afreq)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(if_afreq)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifar_name) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(if_afreq), + "::", + stringify!(ifar_name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifar_af) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(if_afreq), + "::", + stringify!(ifar_af) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct if_parent { + pub ifp_name: [::std::os::raw::c_char; 16usize], + pub ifp_parent: [::std::os::raw::c_char; 16usize], +} +#[test] +fn bindgen_test_layout_if_parent() { + 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!(if_parent)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(if_parent)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifp_name) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(if_parent), + "::", + stringify!(ifp_name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifp_parent) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(if_parent), + "::", + stringify!(ifp_parent) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct if_sffpage { + pub sff_ifname: [::std::os::raw::c_char; 16usize], + pub sff_addr: u8, + pub sff_page: u8, + pub sff_data: [u8; 256usize], +} +#[test] +fn bindgen_test_layout_if_sffpage() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 274usize, + concat!("Size of: ", stringify!(if_sffpage)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(if_sffpage)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sff_ifname) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(if_sffpage), + "::", + stringify!(sff_ifname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sff_addr) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(if_sffpage), + "::", + stringify!(sff_addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sff_page) as usize - ptr as usize }, + 17usize, + concat!( + "Offset of field: ", + stringify!(if_sffpage), + "::", + stringify!(sff_page) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sff_data) as usize - ptr as usize }, + 18usize, + concat!( + "Offset of field: ", + stringify!(if_sffpage), + "::", + stringify!(sff_data) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct arphdr { + pub ar_hrd: u_int16_t, + pub ar_pro: u_int16_t, + pub ar_hln: u_int8_t, + pub ar_pln: u_int8_t, + pub ar_op: u_int16_t, +} +#[test] +fn bindgen_test_layout_arphdr() { + 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!(arphdr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + concat!("Alignment of ", stringify!(arphdr)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ar_hrd) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(arphdr), + "::", + stringify!(ar_hrd) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ar_pro) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(arphdr), + "::", + stringify!(ar_pro) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ar_hln) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(arphdr), + "::", + stringify!(ar_hln) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ar_pln) as usize - ptr as usize }, + 5usize, + concat!( + "Offset of field: ", + stringify!(arphdr), + "::", + stringify!(ar_pln) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ar_op) as usize - ptr as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(arphdr), + "::", + stringify!(ar_op) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct arpreq { + pub arp_pa: sockaddr, + pub arp_ha: sockaddr, + pub arp_flags: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_arpreq() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 36usize, + concat!("Size of: ", stringify!(arpreq)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(arpreq)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).arp_pa) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(arpreq), + "::", + stringify!(arp_pa) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).arp_ha) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(arpreq), + "::", + stringify!(arp_ha) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).arp_flags) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(arpreq), + "::", + stringify!(arp_flags) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct rb_type { + pub t_compare: ::std::option::Option< + unsafe extern "C" fn( + arg1: *const ::std::os::raw::c_void, + arg2: *const ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int, + >, + pub t_augment: ::std::option::Option, + pub t_offset: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout_rb_type() { + 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!(rb_type)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(rb_type)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).t_compare) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(rb_type), + "::", + stringify!(t_compare) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).t_augment) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(rb_type), + "::", + stringify!(t_augment) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).t_offset) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(rb_type), + "::", + stringify!(t_offset) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct rb_tree { + pub rbt_root: *mut rb_entry, +} +#[test] +fn bindgen_test_layout_rb_tree() { + 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!(rb_tree)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(rb_tree)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbt_root) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(rb_tree), + "::", + stringify!(rbt_root) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct rb_entry { + pub rbt_parent: *mut rb_entry, + pub rbt_left: *mut rb_entry, + pub rbt_right: *mut rb_entry, + pub rbt_color: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout_rb_entry() { + 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!(rb_entry)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(rb_entry)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbt_parent) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(rb_entry), + "::", + stringify!(rbt_parent) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbt_left) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(rb_entry), + "::", + stringify!(rbt_left) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbt_right) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(rb_entry), + "::", + stringify!(rbt_right) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbt_color) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(rb_entry), + "::", + stringify!(rbt_color) + ) + ); +} +extern "C" { + pub fn _rb_insert( + arg1: *const rb_type, + arg2: *mut rb_tree, + arg3: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _rb_remove( + arg1: *const rb_type, + arg2: *mut rb_tree, + arg3: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _rb_find( + arg1: *const rb_type, + arg2: *mut rb_tree, + arg3: *const ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _rb_nfind( + arg1: *const rb_type, + arg2: *mut rb_tree, + arg3: *const ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _rb_root(arg1: *const rb_type, arg2: *mut rb_tree) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _rb_min(arg1: *const rb_type, arg2: *mut rb_tree) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _rb_max(arg1: *const rb_type, arg2: *mut rb_tree) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _rb_next( + arg1: *const rb_type, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _rb_prev( + arg1: *const rb_type, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _rb_left( + arg1: *const rb_type, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _rb_right( + arg1: *const rb_type, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _rb_parent( + arg1: *const rb_type, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _rb_set_left( + arg1: *const rb_type, + arg2: *mut ::std::os::raw::c_void, + arg3: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn _rb_set_right( + arg1: *const rb_type, + arg2: *mut ::std::os::raw::c_void, + arg3: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn _rb_set_parent( + arg1: *const rb_type, + arg2: *mut ::std::os::raw::c_void, + arg3: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn _rb_poison( + arg1: *const rb_type, + arg2: *mut ::std::os::raw::c_void, + arg3: ::std::os::raw::c_ulong, + ); +} +extern "C" { + pub fn _rb_check( + arg1: *const rb_type, + arg2: *mut ::std::os::raw::c_void, + arg3: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +pub const lock_class_index_LO_CLASS_KERNEL_LOCK: lock_class_index = 0; +pub const lock_class_index_LO_CLASS_SCHED_LOCK: lock_class_index = 1; +pub const lock_class_index_LO_CLASS_MUTEX: lock_class_index = 2; +pub const lock_class_index_LO_CLASS_RWLOCK: lock_class_index = 3; +pub const lock_class_index_LO_CLASS_RRWLOCK: lock_class_index = 4; +pub type lock_class_index = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct lock_object { + pub lo_type: *const lock_type, + pub lo_name: *const ::std::os::raw::c_char, + pub lo_witness: *mut witness, + pub lo_flags: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout_lock_object() { + 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!(lock_object)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(lock_object)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lo_type) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(lock_object), + "::", + stringify!(lo_type) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lo_name) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(lock_object), + "::", + stringify!(lo_name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lo_witness) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(lock_object), + "::", + stringify!(lo_witness) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lo_flags) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(lock_object), + "::", + stringify!(lo_flags) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct lock_type { + pub lt_name: *const ::std::os::raw::c_char, +} +#[test] +fn bindgen_test_layout_lock_type() { + 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!(lock_type)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(lock_type)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lt_name) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(lock_type), + "::", + stringify!(lt_name) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct proc_ { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct rwlock { + pub rwl_owner: ::std::os::raw::c_ulong, + pub rwl_name: *const ::std::os::raw::c_char, +} +#[test] +fn bindgen_test_layout_rwlock() { + 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!(rwlock)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(rwlock)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rwl_owner) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(rwlock), + "::", + stringify!(rwl_owner) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rwl_name) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(rwlock), + "::", + stringify!(rwl_name) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct rrwlock { + pub rrwl_lock: rwlock, + pub rrwl_wcnt: u32, +} +#[test] +fn bindgen_test_layout_rrwlock() { + 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!(rrwlock)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(rrwlock)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rrwl_lock) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(rrwlock), + "::", + stringify!(rrwl_lock) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rrwl_wcnt) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(rrwlock), + "::", + stringify!(rrwl_wcnt) + ) + ); +} +#[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) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct circq { + pub next: *mut circq, + pub prev: *mut circq, +} +#[test] +fn bindgen_test_layout_circq() { + 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!(circq)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(circq)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(circq), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(circq), + "::", + stringify!(prev) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct timeout { + pub to_list: circq, + pub to_abstime: timespec, + pub to_func: ::std::option::Option, + pub to_arg: *mut ::std::os::raw::c_void, + pub to_process: *mut process, + pub to_time: ::std::os::raw::c_int, + pub to_flags: ::std::os::raw::c_int, + pub to_kclock: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_timeout() { + 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!(timeout)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(timeout)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).to_list) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(timeout), + "::", + stringify!(to_list) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).to_abstime) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(timeout), + "::", + stringify!(to_abstime) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).to_func) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(timeout), + "::", + stringify!(to_func) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).to_arg) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(timeout), + "::", + stringify!(to_arg) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).to_process) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(timeout), + "::", + stringify!(to_process) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).to_time) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(timeout), + "::", + stringify!(to_time) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).to_flags) as usize - ptr as usize }, + 60usize, + concat!( + "Offset of field: ", + stringify!(timeout), + "::", + stringify!(to_flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).to_kclock) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(timeout), + "::", + stringify!(to_kclock) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct timeoutstat { + pub tos_added: u64, + pub tos_cancelled: u64, + pub tos_deleted: u64, + pub tos_late: u64, + pub tos_pending: u64, + pub tos_readded: u64, + pub tos_rescheduled: u64, + pub tos_run_softclock: u64, + pub tos_run_thread: u64, + pub tos_scheduled: u64, + pub tos_softclocks: u64, + pub tos_thread_wakeups: u64, +} +#[test] +fn bindgen_test_layout_timeoutstat() { + 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!(timeoutstat)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(timeoutstat)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tos_added) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(timeoutstat), + "::", + stringify!(tos_added) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tos_cancelled) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(timeoutstat), + "::", + stringify!(tos_cancelled) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tos_deleted) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(timeoutstat), + "::", + stringify!(tos_deleted) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tos_late) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(timeoutstat), + "::", + stringify!(tos_late) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tos_pending) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(timeoutstat), + "::", + stringify!(tos_pending) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tos_readded) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(timeoutstat), + "::", + stringify!(tos_readded) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tos_rescheduled) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(timeoutstat), + "::", + stringify!(tos_rescheduled) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tos_run_softclock) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(timeoutstat), + "::", + stringify!(tos_run_softclock) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tos_run_thread) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(timeoutstat), + "::", + stringify!(tos_run_thread) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tos_scheduled) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(timeoutstat), + "::", + stringify!(tos_scheduled) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tos_softclocks) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(timeoutstat), + "::", + stringify!(tos_softclocks) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tos_thread_wakeups) as usize - ptr as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(timeoutstat), + "::", + stringify!(tos_thread_wakeups) + ) + ); +} +pub type in_addr_t = __in_addr_t; +pub type in_port_t = __in_port_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(Debug, Copy, Clone)] +pub struct sockaddr_in { + pub sin_len: u_int8_t, + pub sin_family: sa_family_t, + pub sin_port: in_port_t, + pub sin_addr: in_addr, + pub sin_zero: [i8; 8usize], +} +#[test] +fn bindgen_test_layout_sockaddr_in() { + 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!(sockaddr_in)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(sockaddr_in)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sin_len) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_in), + "::", + stringify!(sin_len) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sin_family) as usize - ptr as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_in), + "::", + stringify!(sin_family) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sin_port) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_in), + "::", + stringify!(sin_port) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sin_addr) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_in), + "::", + stringify!(sin_addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sin_zero) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_in), + "::", + stringify!(sin_zero) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ip_opts { + pub ip_dst: in_addr, + pub ip_opts: [i8; 40usize], +} +#[test] +fn bindgen_test_layout_ip_opts() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 44usize, + concat!("Size of: ", stringify!(ip_opts)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(ip_opts)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ip_dst) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ip_opts), + "::", + stringify!(ip_dst) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ip_opts) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(ip_opts), + "::", + stringify!(ip_opts) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ip_mreq { + pub imr_multiaddr: in_addr, + pub imr_interface: in_addr, +} +#[test] +fn bindgen_test_layout_ip_mreq() { + 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!(ip_mreq)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(ip_mreq)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).imr_multiaddr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ip_mreq), + "::", + stringify!(imr_multiaddr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).imr_interface) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(ip_mreq), + "::", + stringify!(imr_interface) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ip_mreqn { + pub imr_multiaddr: in_addr, + pub imr_address: in_addr, + pub imr_ifindex: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_ip_mreqn() { + 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!(ip_mreqn)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(ip_mreqn)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).imr_multiaddr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ip_mreqn), + "::", + stringify!(imr_multiaddr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).imr_address) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(ip_mreqn), + "::", + stringify!(imr_address) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).imr_ifindex) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(ip_mreqn), + "::", + stringify!(imr_ifindex) + ) + ); +} +#[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 sockaddr_in6 { + pub sin6_len: u_int8_t, + pub sin6_family: sa_family_t, + pub sin6_port: in_port_t, + pub sin6_flowinfo: u_int32_t, + pub sin6_addr: in6_addr, + pub sin6_scope_id: u_int32_t, +} +#[test] +fn bindgen_test_layout_sockaddr_in6() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 28usize, + concat!("Size of: ", stringify!(sockaddr_in6)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(sockaddr_in6)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sin6_len) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_in6), + "::", + stringify!(sin6_len) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sin6_family) as usize - ptr as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_in6), + "::", + stringify!(sin6_family) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sin6_port) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_in6), + "::", + stringify!(sin6_port) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sin6_flowinfo) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_in6), + "::", + stringify!(sin6_flowinfo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sin6_addr) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_in6), + "::", + stringify!(sin6_addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sin6_scope_id) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_in6), + "::", + stringify!(sin6_scope_id) + ) + ); +} +extern "C" { + pub static in6addr_any: in6_addr; +} +extern "C" { + pub static in6addr_loopback: in6_addr; +} +extern "C" { + pub static in6addr_intfacelocal_allnodes: in6_addr; +} +extern "C" { + pub static in6addr_linklocal_allnodes: in6_addr; +} +extern "C" { + pub static in6addr_linklocal_allrouters: in6_addr; +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct ipv6_mreq { + pub ipv6mr_multiaddr: in6_addr, + pub ipv6mr_interface: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout_ipv6_mreq() { + 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!(ipv6_mreq)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(ipv6_mreq)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ipv6mr_multiaddr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ipv6_mreq), + "::", + stringify!(ipv6mr_multiaddr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ipv6mr_interface) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(ipv6_mreq), + "::", + stringify!(ipv6mr_interface) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct in6_pktinfo { + pub ipi6_addr: in6_addr, + pub ipi6_ifindex: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout_in6_pktinfo() { + 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!(in6_pktinfo)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(in6_pktinfo)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ipi6_addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(in6_pktinfo), + "::", + stringify!(ipi6_addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ipi6_ifindex) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(in6_pktinfo), + "::", + stringify!(ipi6_ifindex) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct ip6_mtuinfo { + pub ip6m_addr: sockaddr_in6, + pub ip6m_mtu: u_int32_t, +} +#[test] +fn bindgen_test_layout_ip6_mtuinfo() { + 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!(ip6_mtuinfo)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(ip6_mtuinfo)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ip6m_addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ip6_mtuinfo), + "::", + stringify!(ip6m_addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ip6m_mtu) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(ip6_mtuinfo), + "::", + stringify!(ip6m_mtu) + ) + ); +} +extern "C" { + pub fn inet6_opt_init( + arg1: *mut ::std::os::raw::c_void, + arg2: socklen_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn inet6_opt_append( + arg1: *mut ::std::os::raw::c_void, + arg2: socklen_t, + arg3: ::std::os::raw::c_int, + arg4: u_int8_t, + arg5: socklen_t, + arg6: u_int8_t, + arg7: *mut *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn inet6_opt_finish( + arg1: *mut ::std::os::raw::c_void, + arg2: socklen_t, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn inet6_opt_set_val( + arg1: *mut ::std::os::raw::c_void, + arg2: ::std::os::raw::c_int, + arg3: *mut ::std::os::raw::c_void, + arg4: socklen_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn inet6_opt_next( + arg1: *mut ::std::os::raw::c_void, + arg2: socklen_t, + arg3: ::std::os::raw::c_int, + arg4: *mut u_int8_t, + arg5: *mut socklen_t, + arg6: *mut *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn inet6_opt_find( + arg1: *mut ::std::os::raw::c_void, + arg2: socklen_t, + arg3: ::std::os::raw::c_int, + arg4: u_int8_t, + arg5: *mut socklen_t, + arg6: *mut *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn inet6_opt_get_val( + arg1: *mut ::std::os::raw::c_void, + arg2: ::std::os::raw::c_int, + arg3: *mut ::std::os::raw::c_void, + arg4: socklen_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn inet6_rth_space(arg1: ::std::os::raw::c_int, arg2: ::std::os::raw::c_int) -> socklen_t; +} +extern "C" { + pub fn inet6_rth_init( + arg1: *mut ::std::os::raw::c_void, + arg2: socklen_t, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn inet6_rth_add( + arg1: *mut ::std::os::raw::c_void, + arg2: *const in6_addr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn inet6_rth_reverse( + arg1: *const ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn inet6_rth_segments(arg1: *const ::std::os::raw::c_void) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn inet6_rth_getaddr( + arg1: *const ::std::os::raw::c_void, + arg2: ::std::os::raw::c_int, + ) -> *mut in6_addr; +} +extern "C" { + pub fn bindresvport( + arg1: ::std::os::raw::c_int, + arg2: *mut sockaddr_in, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn bindresvport_sa( + arg1: ::std::os::raw::c_int, + arg2: *mut sockaddr, + ) -> ::std::os::raw::c_int; +} +#[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) + ) + ); +} +extern "C" { + pub fn rn_init(arg1: ::std::os::raw::c_uint); +} +extern "C" { + pub fn rn_inithead( + arg1: *mut *mut ::std::os::raw::c_void, + arg2: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn rn_walktree( + arg1: *mut radix_node_head, + arg2: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut radix_node, + arg2: *mut ::std::os::raw::c_void, + arg3: u_int, + ) -> ::std::os::raw::c_int, + >, + arg3: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn rn_addroute( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_void, + arg3: *mut radix_node_head, + arg4: *mut radix_node, + arg5: u_int8_t, + ) -> *mut radix_node; +} +extern "C" { + pub fn rn_delete( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_void, + arg3: *mut radix_node_head, + arg4: *mut radix_node, + ) -> *mut radix_node; +} +extern "C" { + pub fn rn_lookup( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_void, + arg3: *mut radix_node_head, + ) -> *mut radix_node; +} +extern "C" { + pub fn rn_match( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut radix_node_head, + ) -> *mut radix_node; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct rt_metrics { + pub rmx_pksent: u_int64_t, + pub rmx_expire: i64, + pub rmx_locks: u_int, + pub rmx_mtu: u_int, + pub rmx_refcnt: u_int, + pub rmx_hopcount: u_int, + pub rmx_recvpipe: u_int, + pub rmx_sendpipe: u_int, + pub rmx_ssthresh: u_int, + pub rmx_rtt: u_int, + pub rmx_rttvar: u_int, + pub rmx_pad: u_int, +} +#[test] +fn bindgen_test_layout_rt_metrics() { + 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!(rt_metrics)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(rt_metrics)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rmx_pksent) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(rt_metrics), + "::", + stringify!(rmx_pksent) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rmx_expire) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(rt_metrics), + "::", + stringify!(rmx_expire) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rmx_locks) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(rt_metrics), + "::", + stringify!(rmx_locks) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rmx_mtu) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(rt_metrics), + "::", + stringify!(rmx_mtu) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rmx_refcnt) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(rt_metrics), + "::", + stringify!(rmx_refcnt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rmx_hopcount) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(rt_metrics), + "::", + stringify!(rmx_hopcount) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rmx_recvpipe) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(rt_metrics), + "::", + stringify!(rmx_recvpipe) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rmx_sendpipe) as usize - ptr as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(rt_metrics), + "::", + stringify!(rmx_sendpipe) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rmx_ssthresh) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(rt_metrics), + "::", + stringify!(rmx_ssthresh) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rmx_rtt) as usize - ptr as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(rt_metrics), + "::", + stringify!(rmx_rtt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rmx_rttvar) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(rt_metrics), + "::", + stringify!(rmx_rttvar) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rmx_pad) as usize - ptr as usize }, + 52usize, + concat!( + "Offset of field: ", + stringify!(rt_metrics), + "::", + stringify!(rmx_pad) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct rtstat { + pub rts_badredirect: u_int32_t, + pub rts_dynamic: u_int32_t, + pub rts_newgateway: u_int32_t, + pub rts_unreach: u_int32_t, + pub rts_wildcard: u_int32_t, +} +#[test] +fn bindgen_test_layout_rtstat() { + 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!(rtstat)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(rtstat)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rts_badredirect) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(rtstat), + "::", + stringify!(rts_badredirect) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rts_dynamic) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(rtstat), + "::", + stringify!(rts_dynamic) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rts_newgateway) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(rtstat), + "::", + stringify!(rts_newgateway) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rts_unreach) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(rtstat), + "::", + stringify!(rts_unreach) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rts_wildcard) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(rtstat), + "::", + stringify!(rts_wildcard) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct rt_tableinfo { + pub rti_tableid: u_short, + pub rti_domainid: u_short, +} +#[test] +fn bindgen_test_layout_rt_tableinfo() { + 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!(rt_tableinfo)) + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + concat!("Alignment of ", stringify!(rt_tableinfo)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rti_tableid) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(rt_tableinfo), + "::", + stringify!(rti_tableid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rti_domainid) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(rt_tableinfo), + "::", + stringify!(rti_domainid) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct rt_msghdr { + pub rtm_msglen: u_short, + pub rtm_version: u_char, + pub rtm_type: u_char, + pub rtm_hdrlen: u_short, + pub rtm_index: u_short, + pub rtm_tableid: u_short, + pub rtm_priority: u_char, + pub rtm_mpls: u_char, + pub rtm_addrs: ::std::os::raw::c_int, + pub rtm_flags: ::std::os::raw::c_int, + pub rtm_fmask: ::std::os::raw::c_int, + pub rtm_pid: pid_t, + pub rtm_seq: ::std::os::raw::c_int, + pub rtm_errno: ::std::os::raw::c_int, + pub rtm_inits: u_int, + pub rtm_rmx: rt_metrics, +} +#[test] +fn bindgen_test_layout_rt_msghdr() { + 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!(rt_msghdr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(rt_msghdr)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtm_msglen) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(rt_msghdr), + "::", + stringify!(rtm_msglen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtm_version) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(rt_msghdr), + "::", + stringify!(rtm_version) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtm_type) as usize - ptr as usize }, + 3usize, + concat!( + "Offset of field: ", + stringify!(rt_msghdr), + "::", + stringify!(rtm_type) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtm_hdrlen) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(rt_msghdr), + "::", + stringify!(rtm_hdrlen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtm_index) as usize - ptr as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(rt_msghdr), + "::", + stringify!(rtm_index) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtm_tableid) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(rt_msghdr), + "::", + stringify!(rtm_tableid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtm_priority) as usize - ptr as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(rt_msghdr), + "::", + stringify!(rtm_priority) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtm_mpls) as usize - ptr as usize }, + 11usize, + concat!( + "Offset of field: ", + stringify!(rt_msghdr), + "::", + stringify!(rtm_mpls) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtm_addrs) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(rt_msghdr), + "::", + stringify!(rtm_addrs) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtm_flags) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(rt_msghdr), + "::", + stringify!(rtm_flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtm_fmask) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(rt_msghdr), + "::", + stringify!(rtm_fmask) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtm_pid) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(rt_msghdr), + "::", + stringify!(rtm_pid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtm_seq) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(rt_msghdr), + "::", + stringify!(rtm_seq) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtm_errno) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(rt_msghdr), + "::", + stringify!(rtm_errno) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtm_inits) as usize - ptr as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(rt_msghdr), + "::", + stringify!(rtm_inits) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtm_rmx) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(rt_msghdr), + "::", + stringify!(rtm_rmx) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_rtlabel { + pub sr_len: u_int8_t, + pub sr_family: sa_family_t, + pub sr_label: [::std::os::raw::c_char; 32usize], +} +#[test] +fn bindgen_test_layout_sockaddr_rtlabel() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 34usize, + concat!("Size of: ", stringify!(sockaddr_rtlabel)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(sockaddr_rtlabel)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sr_len) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_rtlabel), + "::", + stringify!(sr_len) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sr_family) as usize - ptr as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_rtlabel), + "::", + stringify!(sr_family) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sr_label) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_rtlabel), + "::", + stringify!(sr_label) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_rtdns { + pub sr_len: u_int8_t, + pub sr_family: sa_family_t, + pub sr_dns: [::std::os::raw::c_char; 128usize], +} +#[test] +fn bindgen_test_layout_sockaddr_rtdns() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 130usize, + concat!("Size of: ", stringify!(sockaddr_rtdns)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(sockaddr_rtdns)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sr_len) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_rtdns), + "::", + stringify!(sr_len) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sr_family) as usize - ptr as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_rtdns), + "::", + stringify!(sr_family) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sr_dns) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_rtdns), + "::", + stringify!(sr_dns) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_rtstatic { + pub sr_len: u_int8_t, + pub sr_family: sa_family_t, + pub sr_static: [::std::os::raw::c_char; 128usize], +} +#[test] +fn bindgen_test_layout_sockaddr_rtstatic() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 130usize, + concat!("Size of: ", stringify!(sockaddr_rtstatic)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(sockaddr_rtstatic)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sr_len) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_rtstatic), + "::", + stringify!(sr_len) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sr_family) as usize - ptr as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_rtstatic), + "::", + stringify!(sr_family) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sr_static) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_rtstatic), + "::", + stringify!(sr_static) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_rtsearch { + pub sr_len: u_int8_t, + pub sr_family: sa_family_t, + pub sr_search: [::std::os::raw::c_char; 128usize], +} +#[test] +fn bindgen_test_layout_sockaddr_rtsearch() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 130usize, + concat!("Size of: ", stringify!(sockaddr_rtsearch)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(sockaddr_rtsearch)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sr_len) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_rtsearch), + "::", + stringify!(sr_len) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sr_family) as usize - ptr as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_rtsearch), + "::", + stringify!(sr_family) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sr_search) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(sockaddr_rtsearch), + "::", + stringify!(sr_search) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct rt_addrinfo { + pub rti_addrs: ::std::os::raw::c_int, + pub rti_info: [*const sockaddr; 15usize], + pub rti_flags: ::std::os::raw::c_int, + pub rti_ifa: *mut ifaddr, + pub rti_rtm: *mut rt_msghdr, + pub rti_mpls: u_char, +} +#[test] +fn bindgen_test_layout_rt_addrinfo() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 160usize, + concat!("Size of: ", stringify!(rt_addrinfo)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(rt_addrinfo)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rti_addrs) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(rt_addrinfo), + "::", + stringify!(rti_addrs) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rti_info) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(rt_addrinfo), + "::", + stringify!(rti_info) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rti_flags) as usize - ptr as usize }, + 128usize, + concat!( + "Offset of field: ", + stringify!(rt_addrinfo), + "::", + stringify!(rti_flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rti_ifa) as usize - ptr as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(rt_addrinfo), + "::", + stringify!(rti_ifa) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rti_rtm) as usize - ptr as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(rt_addrinfo), + "::", + stringify!(rti_rtm) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rti_mpls) as usize - ptr as usize }, + 152usize, + concat!( + "Offset of field: ", + stringify!(rt_addrinfo), + "::", + stringify!(rti_mpls) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct route { + pub ro_rt: *mut rtentry, + pub ro_generation: u_long, + pub ro_tableid: u_long, + pub __bindgen_anon_1: route__bindgen_ty_1, + pub __bindgen_anon_2: route__bindgen_ty_2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union route__bindgen_ty_1 { + pub ro_dstsa: sockaddr, + pub ro_dstsin: sockaddr_in, + pub ro_dstsin6: sockaddr_in6, +} +#[test] +fn bindgen_test_layout_route__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 28usize, + concat!("Size of: ", stringify!(route__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(route__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ro_dstsa) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(route__bindgen_ty_1), + "::", + stringify!(ro_dstsa) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ro_dstsin) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(route__bindgen_ty_1), + "::", + stringify!(ro_dstsin) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ro_dstsin6) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(route__bindgen_ty_1), + "::", + stringify!(ro_dstsin6) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union route__bindgen_ty_2 { + pub ro_srcin: in_addr, + pub ro_srcin6: in6_addr, +} +#[test] +fn bindgen_test_layout_route__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!(route__bindgen_ty_2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(route__bindgen_ty_2)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ro_srcin) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(route__bindgen_ty_2), + "::", + stringify!(ro_srcin) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ro_srcin6) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(route__bindgen_ty_2), + "::", + stringify!(ro_srcin6) + ) + ); +} +#[test] +fn bindgen_test_layout_route() { + 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!(route)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(route)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ro_rt) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(route), + "::", + stringify!(ro_rt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ro_generation) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(route), + "::", + stringify!(ro_generation) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ro_tableid) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(route), + "::", + stringify!(ro_tableid) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ip { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ip6_hdr { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mbuf_list { + _unused: [u8; 0], +} +pub type pf_refcnt_t = refcnt; +pub const PF_INOUT: _bindgen_ty_1 = 0; +pub const PF_IN: _bindgen_ty_1 = 1; +pub const PF_OUT: _bindgen_ty_1 = 2; +pub const PF_FWD: _bindgen_ty_1 = 3; +pub type _bindgen_ty_1 = ::std::os::raw::c_uint; +pub const PF_PASS: _bindgen_ty_2 = 0; +pub const PF_DROP: _bindgen_ty_2 = 1; +pub const PF_SCRUB: _bindgen_ty_2 = 2; +pub const PF_NOSCRUB: _bindgen_ty_2 = 3; +pub const PF_NAT: _bindgen_ty_2 = 4; +pub const PF_NONAT: _bindgen_ty_2 = 5; +pub const PF_BINAT: _bindgen_ty_2 = 6; +pub const PF_NOBINAT: _bindgen_ty_2 = 7; +pub const PF_RDR: _bindgen_ty_2 = 8; +pub const PF_NORDR: _bindgen_ty_2 = 9; +pub const PF_SYNPROXY_DROP: _bindgen_ty_2 = 10; +pub const PF_DEFER: _bindgen_ty_2 = 11; +pub const PF_MATCH: _bindgen_ty_2 = 12; +pub const PF_DIVERT: _bindgen_ty_2 = 13; +pub const PF_RT: _bindgen_ty_2 = 14; +pub const PF_AFRT: _bindgen_ty_2 = 15; +pub type _bindgen_ty_2 = ::std::os::raw::c_uint; +pub const PF_TRANS_RULESET: _bindgen_ty_3 = 0; +pub const PF_TRANS_TABLE: _bindgen_ty_3 = 1; +pub type _bindgen_ty_3 = ::std::os::raw::c_uint; +pub const PF_OP_NONE: _bindgen_ty_4 = 0; +pub const PF_OP_IRG: _bindgen_ty_4 = 1; +pub const PF_OP_EQ: _bindgen_ty_4 = 2; +pub const PF_OP_NE: _bindgen_ty_4 = 3; +pub const PF_OP_LT: _bindgen_ty_4 = 4; +pub const PF_OP_LE: _bindgen_ty_4 = 5; +pub const PF_OP_GT: _bindgen_ty_4 = 6; +pub const PF_OP_GE: _bindgen_ty_4 = 7; +pub const PF_OP_XRG: _bindgen_ty_4 = 8; +pub const PF_OP_RRG: _bindgen_ty_4 = 9; +pub type _bindgen_ty_4 = ::std::os::raw::c_uint; +pub const PF_CHANGE_NONE: _bindgen_ty_5 = 0; +pub const PF_CHANGE_ADD_HEAD: _bindgen_ty_5 = 1; +pub const PF_CHANGE_ADD_TAIL: _bindgen_ty_5 = 2; +pub const PF_CHANGE_ADD_BEFORE: _bindgen_ty_5 = 3; +pub const PF_CHANGE_ADD_AFTER: _bindgen_ty_5 = 4; +pub const PF_CHANGE_REMOVE: _bindgen_ty_5 = 5; +pub const PF_CHANGE_GET_TICKET: _bindgen_ty_5 = 6; +pub type _bindgen_ty_5 = ::std::os::raw::c_uint; +pub const PF_GET_NONE: _bindgen_ty_6 = 0; +pub const PF_GET_CLR_CNTR: _bindgen_ty_6 = 1; +pub type _bindgen_ty_6 = ::std::os::raw::c_uint; +pub const PF_SK_WIRE: _bindgen_ty_7 = 0; +pub const PF_SK_STACK: _bindgen_ty_7 = 1; +pub const PF_SK_BOTH: _bindgen_ty_7 = 2; +pub type _bindgen_ty_7 = ::std::os::raw::c_uint; +pub const PF_PEER_SRC: _bindgen_ty_8 = 0; +pub const PF_PEER_DST: _bindgen_ty_8 = 1; +pub const PF_PEER_BOTH: _bindgen_ty_8 = 2; +pub type _bindgen_ty_8 = ::std::os::raw::c_uint; +pub const PFTM_TCP_FIRST_PACKET: _bindgen_ty_9 = 0; +pub const PFTM_TCP_OPENING: _bindgen_ty_9 = 1; +pub const PFTM_TCP_ESTABLISHED: _bindgen_ty_9 = 2; +pub const PFTM_TCP_CLOSING: _bindgen_ty_9 = 3; +pub const PFTM_TCP_FIN_WAIT: _bindgen_ty_9 = 4; +pub const PFTM_TCP_CLOSED: _bindgen_ty_9 = 5; +pub const PFTM_UDP_FIRST_PACKET: _bindgen_ty_9 = 6; +pub const PFTM_UDP_SINGLE: _bindgen_ty_9 = 7; +pub const PFTM_UDP_MULTIPLE: _bindgen_ty_9 = 8; +pub const PFTM_ICMP_FIRST_PACKET: _bindgen_ty_9 = 9; +pub const PFTM_ICMP_ERROR_REPLY: _bindgen_ty_9 = 10; +pub const PFTM_OTHER_FIRST_PACKET: _bindgen_ty_9 = 11; +pub const PFTM_OTHER_SINGLE: _bindgen_ty_9 = 12; +pub const PFTM_OTHER_MULTIPLE: _bindgen_ty_9 = 13; +pub const PFTM_FRAG: _bindgen_ty_9 = 14; +pub const PFTM_INTERVAL: _bindgen_ty_9 = 15; +pub const PFTM_ADAPTIVE_START: _bindgen_ty_9 = 16; +pub const PFTM_ADAPTIVE_END: _bindgen_ty_9 = 17; +pub const PFTM_SRC_NODE: _bindgen_ty_9 = 18; +pub const PFTM_TS_DIFF: _bindgen_ty_9 = 19; +pub const PFTM_MAX: _bindgen_ty_9 = 20; +pub const PFTM_PURGE: _bindgen_ty_9 = 21; +pub const PFTM_UNLINKED: _bindgen_ty_9 = 22; +pub type _bindgen_ty_9 = ::std::os::raw::c_uint; +pub const PF_NOPFROUTE: _bindgen_ty_10 = 0; +pub const PF_ROUTETO: _bindgen_ty_10 = 1; +pub const PF_DUPTO: _bindgen_ty_10 = 2; +pub const PF_REPLYTO: _bindgen_ty_10 = 3; +pub type _bindgen_ty_10 = ::std::os::raw::c_uint; +pub const PF_LIMIT_STATES: _bindgen_ty_11 = 0; +pub const PF_LIMIT_SRC_NODES: _bindgen_ty_11 = 1; +pub const PF_LIMIT_FRAGS: _bindgen_ty_11 = 2; +pub const PF_LIMIT_TABLES: _bindgen_ty_11 = 3; +pub const PF_LIMIT_TABLE_ENTRIES: _bindgen_ty_11 = 4; +pub const PF_LIMIT_PKTDELAY_PKTS: _bindgen_ty_11 = 5; +pub const PF_LIMIT_ANCHORS: _bindgen_ty_11 = 6; +pub const PF_LIMIT_MAX: _bindgen_ty_11 = 7; +pub type _bindgen_ty_11 = ::std::os::raw::c_uint; +pub const PF_POOL_NONE: _bindgen_ty_12 = 0; +pub const PF_POOL_BITMASK: _bindgen_ty_12 = 1; +pub const PF_POOL_RANDOM: _bindgen_ty_12 = 2; +pub const PF_POOL_SRCHASH: _bindgen_ty_12 = 3; +pub const PF_POOL_ROUNDROBIN: _bindgen_ty_12 = 4; +pub const PF_POOL_LEASTSTATES: _bindgen_ty_12 = 5; +pub type _bindgen_ty_12 = ::std::os::raw::c_uint; +pub const PF_ADDR_ADDRMASK: _bindgen_ty_13 = 0; +pub const PF_ADDR_NOROUTE: _bindgen_ty_13 = 1; +pub const PF_ADDR_DYNIFTL: _bindgen_ty_13 = 2; +pub const PF_ADDR_TABLE: _bindgen_ty_13 = 3; +pub const PF_ADDR_RTLABEL: _bindgen_ty_13 = 4; +pub const PF_ADDR_URPFFAILED: _bindgen_ty_13 = 5; +pub const PF_ADDR_RANGE: _bindgen_ty_13 = 6; +pub const PF_ADDR_NONE: _bindgen_ty_13 = 7; +pub type _bindgen_ty_13 = ::std::os::raw::c_uint; +#[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(Debug, Copy, Clone)] +pub struct pf_osfp_entry { + pub fp_entry: pf_osfp_entry__bindgen_ty_1, + pub fp_os: pf_osfp_t, + pub fp_enflags: ::std::os::raw::c_int, + pub fp_class_nm: [u_char; 32usize], + pub fp_version_nm: [u_char; 32usize], + pub fp_subtype_nm: [u_char; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_osfp_entry__bindgen_ty_1 { + pub sle_next: *mut pf_osfp_entry, +} +#[test] +fn bindgen_test_layout_pf_osfp_entry__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!(pf_osfp_entry__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_osfp_entry__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sle_next) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_osfp_entry__bindgen_ty_1), + "::", + stringify!(sle_next) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_osfp_entry() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 112usize, + concat!("Size of: ", stringify!(pf_osfp_entry)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_osfp_entry)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_entry) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_osfp_entry), + "::", + stringify!(fp_entry) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_os) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_osfp_entry), + "::", + stringify!(fp_os) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_enflags) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(pf_osfp_entry), + "::", + stringify!(fp_enflags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_class_nm) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pf_osfp_entry), + "::", + stringify!(fp_class_nm) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_version_nm) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(pf_osfp_entry), + "::", + stringify!(fp_version_nm) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_subtype_nm) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(pf_osfp_entry), + "::", + stringify!(fp_subtype_nm) + ) + ); +} +pub type pf_tcpopts_t = u_int64_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_os_fingerprint { + pub fp_oses: pf_os_fingerprint_pf_osfp_enlist, + pub fp_tcpopts: pf_tcpopts_t, + pub fp_wsize: u_int16_t, + pub fp_psize: u_int16_t, + pub fp_mss: u_int16_t, + pub fp_flags: u_int16_t, + pub fp_optcnt: u_int8_t, + pub fp_wscale: u_int8_t, + pub fp_ttl: u_int8_t, + pub fp_next: pf_os_fingerprint__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_os_fingerprint_pf_osfp_enlist { + pub slh_first: *mut pf_osfp_entry, +} +#[test] +fn bindgen_test_layout_pf_os_fingerprint_pf_osfp_enlist() { + 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_os_fingerprint_pf_osfp_enlist)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(pf_os_fingerprint_pf_osfp_enlist) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).slh_first) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_os_fingerprint_pf_osfp_enlist), + "::", + stringify!(slh_first) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_os_fingerprint__bindgen_ty_1 { + pub sle_next: *mut pf_os_fingerprint, +} +#[test] +fn bindgen_test_layout_pf_os_fingerprint__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!(pf_os_fingerprint__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_os_fingerprint__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sle_next) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_os_fingerprint__bindgen_ty_1), + "::", + stringify!(sle_next) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_os_fingerprint() { + 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!(pf_os_fingerprint)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_os_fingerprint)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_oses) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_os_fingerprint), + "::", + stringify!(fp_oses) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_tcpopts) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_os_fingerprint), + "::", + stringify!(fp_tcpopts) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_wsize) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pf_os_fingerprint), + "::", + stringify!(fp_wsize) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_psize) as usize - ptr as usize }, + 18usize, + concat!( + "Offset of field: ", + stringify!(pf_os_fingerprint), + "::", + stringify!(fp_psize) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_mss) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(pf_os_fingerprint), + "::", + stringify!(fp_mss) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_flags) as usize - ptr as usize }, + 22usize, + concat!( + "Offset of field: ", + stringify!(pf_os_fingerprint), + "::", + stringify!(fp_flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_optcnt) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(pf_os_fingerprint), + "::", + stringify!(fp_optcnt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_wscale) as usize - ptr as usize }, + 25usize, + concat!( + "Offset of field: ", + stringify!(pf_os_fingerprint), + "::", + stringify!(fp_wscale) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_ttl) as usize - ptr as usize }, + 26usize, + concat!( + "Offset of field: ", + stringify!(pf_os_fingerprint), + "::", + stringify!(fp_ttl) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_next) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(pf_os_fingerprint), + "::", + stringify!(fp_next) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_osfp_ioctl { + pub fp_os: pf_osfp_entry, + pub fp_tcpopts: pf_tcpopts_t, + pub fp_wsize: u_int16_t, + pub fp_psize: u_int16_t, + pub fp_mss: u_int16_t, + pub fp_flags: u_int16_t, + pub fp_optcnt: u_int8_t, + pub fp_wscale: u_int8_t, + pub fp_ttl: u_int8_t, + pub fp_getnum: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_pf_osfp_ioctl() { + 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_osfp_ioctl)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_osfp_ioctl)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_os) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_osfp_ioctl), + "::", + stringify!(fp_os) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_tcpopts) as usize - ptr as usize }, + 112usize, + concat!( + "Offset of field: ", + stringify!(pf_osfp_ioctl), + "::", + stringify!(fp_tcpopts) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_wsize) as usize - ptr as usize }, + 120usize, + concat!( + "Offset of field: ", + stringify!(pf_osfp_ioctl), + "::", + stringify!(fp_wsize) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_psize) as usize - ptr as usize }, + 122usize, + concat!( + "Offset of field: ", + stringify!(pf_osfp_ioctl), + "::", + stringify!(fp_psize) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_mss) as usize - ptr as usize }, + 124usize, + concat!( + "Offset of field: ", + stringify!(pf_osfp_ioctl), + "::", + stringify!(fp_mss) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_flags) as usize - ptr as usize }, + 126usize, + concat!( + "Offset of field: ", + stringify!(pf_osfp_ioctl), + "::", + stringify!(fp_flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_optcnt) as usize - ptr as usize }, + 128usize, + concat!( + "Offset of field: ", + stringify!(pf_osfp_ioctl), + "::", + stringify!(fp_optcnt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_wscale) as usize - ptr as usize }, + 129usize, + concat!( + "Offset of field: ", + stringify!(pf_osfp_ioctl), + "::", + stringify!(fp_wscale) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_ttl) as usize - ptr as usize }, + 130usize, + concat!( + "Offset of field: ", + stringify!(pf_osfp_ioctl), + "::", + stringify!(fp_ttl) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_getnum) as usize - ptr as usize }, + 132usize, + concat!( + "Offset of field: ", + stringify!(pf_osfp_ioctl), + "::", + stringify!(fp_getnum) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_rule_actions { + pub rtableid: ::std::os::raw::c_int, + pub qid: u_int16_t, + pub pqid: u_int16_t, + pub max_mss: u_int16_t, + pub flags: u_int16_t, + pub delay: u_int16_t, + pub log: u_int8_t, + pub set_tos: u_int8_t, + pub min_ttl: u_int8_t, + pub set_prio: [u_int8_t; 2usize], + pub pad: [u_int8_t; 1usize], +} +#[test] +fn bindgen_test_layout_pf_rule_actions() { + 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_actions)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_rule_actions)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtableid) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_actions), + "::", + stringify!(rtableid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).qid) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_actions), + "::", + stringify!(qid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pqid) as usize - ptr as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_actions), + "::", + stringify!(pqid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).max_mss) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_actions), + "::", + stringify!(max_mss) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_actions), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).delay) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_actions), + "::", + stringify!(delay) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).log) as usize - ptr as usize }, + 14usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_actions), + "::", + stringify!(log) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).set_tos) as usize - ptr as usize }, + 15usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_actions), + "::", + stringify!(set_tos) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).min_ttl) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_actions), + "::", + stringify!(min_ttl) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).set_prio) as usize - ptr as usize }, + 17usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_actions), + "::", + stringify!(set_prio) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, + 19usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_actions), + "::", + stringify!(pad) + ) + ); +} +#[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_rule_item { + pub entry: pf_rule_item__bindgen_ty_1, + pub r: *mut pf_rule, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_rule_item__bindgen_ty_1 { + pub sle_next: *mut pf_rule_item, +} +#[test] +fn bindgen_test_layout_pf_rule_item__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!(pf_rule_item__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_rule_item__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sle_next) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_item__bindgen_ty_1), + "::", + stringify!(sle_next) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_rule_item() { + 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_item)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_rule_item)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).entry) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_item), + "::", + stringify!(entry) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).r) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_item), + "::", + stringify!(r) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_rule_slist { + pub slh_first: *mut pf_rule_item, +} +#[test] +fn bindgen_test_layout_pf_rule_slist() { + 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_slist)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_rule_slist)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).slh_first) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_rule_slist), + "::", + stringify!(slh_first) + ) + ); +} +pub const pf_sn_types_PF_SN_NONE: pf_sn_types = 0; +pub const pf_sn_types_PF_SN_NAT: pf_sn_types = 1; +pub const pf_sn_types_PF_SN_RDR: pf_sn_types = 2; +pub const pf_sn_types_PF_SN_ROUTE: pf_sn_types = 3; +pub const pf_sn_types_PF_SN_MAX: pf_sn_types = 4; +pub type pf_sn_types = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_src_node { + pub entry: pf_src_node__bindgen_ty_1, + pub addr: pf_addr, + pub raddr: pf_addr, + pub rule: pf_rule_ptr, + pub kif: *mut pfi_kif, + pub bytes: [u_int64_t; 2usize], + pub packets: [u_int64_t; 2usize], + pub states: u_int32_t, + pub conn: u_int32_t, + pub conn_rate: pf_threshold, + pub creation: i32, + pub expire: i32, + pub af: sa_family_t, + pub naf: sa_family_t, + pub type_: u_int8_t, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_src_node__bindgen_ty_1 { + pub rbe_left: *mut pf_src_node, + pub rbe_right: *mut pf_src_node, + pub rbe_parent: *mut pf_src_node, + pub rbe_color: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_pf_src_node__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_src_node__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_src_node__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_src_node__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_src_node__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_src_node__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_src_node__bindgen_ty_1), + "::", + stringify!(rbe_color) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_src_node() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 152usize, + concat!("Size of: ", stringify!(pf_src_node)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_src_node)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).entry) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_src_node), + "::", + stringify!(entry) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(pf_src_node), + "::", + stringify!(addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).raddr) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(pf_src_node), + "::", + stringify!(raddr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rule) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(pf_src_node), + "::", + stringify!(rule) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).kif) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(pf_src_node), + "::", + stringify!(kif) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).bytes) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(pf_src_node), + "::", + stringify!(bytes) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).packets) as usize - ptr as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(pf_src_node), + "::", + stringify!(packets) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).states) as usize - ptr as usize }, + 112usize, + concat!( + "Offset of field: ", + stringify!(pf_src_node), + "::", + stringify!(states) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).conn) as usize - ptr as usize }, + 116usize, + concat!( + "Offset of field: ", + stringify!(pf_src_node), + "::", + stringify!(conn) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).conn_rate) as usize - ptr as usize }, + 120usize, + concat!( + "Offset of field: ", + stringify!(pf_src_node), + "::", + stringify!(conn_rate) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).creation) as usize - ptr as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(pf_src_node), + "::", + stringify!(creation) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).expire) as usize - ptr as usize }, + 140usize, + concat!( + "Offset of field: ", + stringify!(pf_src_node), + "::", + stringify!(expire) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).af) as usize - ptr as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(pf_src_node), + "::", + stringify!(af) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).naf) as usize - ptr as usize }, + 145usize, + concat!( + "Offset of field: ", + stringify!(pf_src_node), + "::", + stringify!(naf) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + 146usize, + concat!( + "Offset of field: ", + stringify!(pf_src_node), + "::", + stringify!(type_) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_sn_item { + pub next: pf_sn_item__bindgen_ty_1, + pub sn: *mut pf_src_node, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_sn_item__bindgen_ty_1 { + pub sle_next: *mut pf_sn_item, +} +#[test] +fn bindgen_test_layout_pf_sn_item__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!(pf_sn_item__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_sn_item__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sle_next) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_sn_item__bindgen_ty_1), + "::", + stringify!(sle_next) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_sn_item() { + 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_sn_item)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_sn_item)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_sn_item), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sn) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_sn_item), + "::", + stringify!(sn) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_sn_head { + pub slh_first: *mut pf_sn_item, +} +#[test] +fn bindgen_test_layout_pf_sn_head() { + 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_sn_head)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_sn_head)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).slh_first) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_sn_head), + "::", + stringify!(slh_first) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_state_scrub { + pub pfss_last: timeval, + pub pfss_tsecr: u_int32_t, + pub pfss_tsval: u_int32_t, + pub pfss_tsval0: u_int32_t, + pub pfss_flags: u_int16_t, + pub pfss_ttl: u_int8_t, + pub pad: u_int8_t, + pub pfss_ts_mod: u_int32_t, +} +#[test] +fn bindgen_test_layout_pf_state_scrub() { + 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!(pf_state_scrub)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_state_scrub)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfss_last) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_state_scrub), + "::", + stringify!(pfss_last) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfss_tsecr) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pf_state_scrub), + "::", + stringify!(pfss_tsecr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfss_tsval) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(pf_state_scrub), + "::", + stringify!(pfss_tsval) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfss_tsval0) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(pf_state_scrub), + "::", + stringify!(pfss_tsval0) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfss_flags) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(pf_state_scrub), + "::", + stringify!(pfss_flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfss_ttl) as usize - ptr as usize }, + 30usize, + concat!( + "Offset of field: ", + stringify!(pf_state_scrub), + "::", + stringify!(pfss_ttl) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, + 31usize, + concat!( + "Offset of field: ", + stringify!(pf_state_scrub), + "::", + stringify!(pad) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfss_ts_mod) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(pf_state_scrub), + "::", + stringify!(pfss_ts_mod) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_state_host { + pub addr: pf_addr, + pub port: u_int16_t, + pub pad: u_int16_t, +} +#[test] +fn bindgen_test_layout_pf_state_host() { + 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_state_host)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_state_host)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_state_host), + "::", + stringify!(addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).port) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pf_state_host), + "::", + stringify!(port) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, + 18usize, + concat!( + "Offset of field: ", + stringify!(pf_state_host), + "::", + stringify!(pad) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_state_peer { + pub scrub: *mut pf_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 tcp_est: u_int8_t, + pub pad: [u_int8_t; 1usize], +} +#[test] +fn bindgen_test_layout_pf_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!(pf_state_peer)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_state_peer)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).scrub) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_state_peer), + "::", + stringify!(scrub) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).seqlo) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_state_peer), + "::", + stringify!(seqlo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).seqhi) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(pf_state_peer), + "::", + stringify!(seqhi) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).seqdiff) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pf_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!(pf_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!(pf_state_peer), + "::", + stringify!(mss) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(pf_state_peer), + "::", + stringify!(state) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).wscale) as usize - ptr as usize }, + 25usize, + concat!( + "Offset of field: ", + stringify!(pf_state_peer), + "::", + stringify!(wscale) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tcp_est) as usize - ptr as usize }, + 26usize, + concat!( + "Offset of field: ", + stringify!(pf_state_peer), + "::", + stringify!(tcp_est) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, + 27usize, + concat!( + "Offset of field: ", + stringify!(pf_state_peer), + "::", + stringify!(pad) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_state_queue { + pub tqh_first: *mut pf_state, + pub tqh_last: *mut *mut pf_state, +} +#[test] +fn bindgen_test_layout_pf_state_queue() { + 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_queue)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_state_queue)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tqh_first) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_state_queue), + "::", + 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_state_queue), + "::", + stringify!(tqh_last) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_state_key_cmp { + pub addr: [pf_addr; 2usize], + pub port: [u_int16_t; 2usize], + pub rdomain: u_int16_t, + pub hash: u_int16_t, + pub af: sa_family_t, + pub proto: u_int8_t, +} +#[test] +fn bindgen_test_layout_pf_state_key_cmp() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 44usize, + concat!("Size of: ", stringify!(pf_state_key_cmp)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_state_key_cmp)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_state_key_cmp), + "::", + stringify!(addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).port) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(pf_state_key_cmp), + "::", + stringify!(port) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rdomain) as usize - ptr as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(pf_state_key_cmp), + "::", + stringify!(rdomain) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hash) as usize - ptr as usize }, + 38usize, + concat!( + "Offset of field: ", + stringify!(pf_state_key_cmp), + "::", + stringify!(hash) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).af) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(pf_state_key_cmp), + "::", + stringify!(af) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).proto) as usize - ptr as usize }, + 41usize, + concat!( + "Offset of field: ", + stringify!(pf_state_key_cmp), + "::", + stringify!(proto) + ) + ); +} +#[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_global { + pub rbh_root: *mut pf_anchor, +} +#[test] +fn bindgen_test_layout_pf_anchor_global() { + 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_global)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_anchor_global)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbh_root) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_anchor_global), + "::", + stringify!(rbh_root) + ) + ); +} +#[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_) + ) + ); +} +extern "C" { + pub fn pf_anchor_global_RB_INSERT_COLOR(arg1: *mut pf_anchor_global, arg2: *mut pf_anchor); +} +extern "C" { + pub fn pf_anchor_global_RB_REMOVE_COLOR( + arg1: *mut pf_anchor_global, + arg2: *mut pf_anchor, + arg3: *mut pf_anchor, + ); +} +extern "C" { + pub fn pf_anchor_global_RB_REMOVE( + arg1: *mut pf_anchor_global, + arg2: *mut pf_anchor, + ) -> *mut pf_anchor; +} +extern "C" { + pub fn pf_anchor_global_RB_INSERT( + arg1: *mut pf_anchor_global, + arg2: *mut pf_anchor, + ) -> *mut pf_anchor; +} +extern "C" { + pub fn pf_anchor_global_RB_FIND( + arg1: *mut pf_anchor_global, + arg2: *mut pf_anchor, + ) -> *mut pf_anchor; +} +extern "C" { + pub fn pf_anchor_global_RB_NFIND( + arg1: *mut pf_anchor_global, + arg2: *mut pf_anchor, + ) -> *mut pf_anchor; +} +extern "C" { + pub fn pf_anchor_global_RB_NEXT(arg1: *mut pf_anchor) -> *mut pf_anchor; +} +extern "C" { + pub fn pf_anchor_global_RB_PREV(arg1: *mut pf_anchor) -> *mut pf_anchor; +} +extern "C" { + pub fn pf_anchor_global_RB_MINMAX( + arg1: *mut pf_anchor_global, + arg2: ::std::os::raw::c_int, + ) -> *mut pf_anchor; +} +extern "C" { + pub fn pf_anchor_node_RB_INSERT_COLOR(arg1: *mut pf_anchor_node, arg2: *mut pf_anchor); +} +extern "C" { + pub fn pf_anchor_node_RB_REMOVE_COLOR( + arg1: *mut pf_anchor_node, + arg2: *mut pf_anchor, + arg3: *mut pf_anchor, + ); +} +extern "C" { + pub fn pf_anchor_node_RB_REMOVE( + arg1: *mut pf_anchor_node, + arg2: *mut pf_anchor, + ) -> *mut pf_anchor; +} +extern "C" { + pub fn pf_anchor_node_RB_INSERT( + arg1: *mut pf_anchor_node, + arg2: *mut pf_anchor, + ) -> *mut pf_anchor; +} +extern "C" { + pub fn pf_anchor_node_RB_FIND( + arg1: *mut pf_anchor_node, + arg2: *mut pf_anchor, + ) -> *mut pf_anchor; +} +extern "C" { + pub fn pf_anchor_node_RB_NFIND( + arg1: *mut pf_anchor_node, + arg2: *mut pf_anchor, + ) -> *mut pf_anchor; +} +extern "C" { + pub fn pf_anchor_node_RB_NEXT(arg1: *mut pf_anchor) -> *mut pf_anchor; +} +extern "C" { + pub fn pf_anchor_node_RB_PREV(arg1: *mut pf_anchor) -> *mut pf_anchor; +} +extern "C" { + pub fn pf_anchor_node_RB_MINMAX( + arg1: *mut pf_anchor_node, + arg2: ::std::os::raw::c_int, + ) -> *mut pf_anchor; +} +#[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) + ) + ); +} +pub const PFR_FB_NONE: _bindgen_ty_14 = 0; +pub const PFR_FB_MATCH: _bindgen_ty_14 = 1; +pub const PFR_FB_ADDED: _bindgen_ty_14 = 2; +pub const PFR_FB_DELETED: _bindgen_ty_14 = 3; +pub const PFR_FB_CHANGED: _bindgen_ty_14 = 4; +pub const PFR_FB_CLEARED: _bindgen_ty_14 = 5; +pub const PFR_FB_DUPLICATE: _bindgen_ty_14 = 6; +pub const PFR_FB_NOTMATCH: _bindgen_ty_14 = 7; +pub const PFR_FB_CONFLICT: _bindgen_ty_14 = 8; +pub const PFR_FB_NOCOUNT: _bindgen_ty_14 = 9; +pub const PFR_FB_MAX: _bindgen_ty_14 = 10; +pub type _bindgen_ty_14 = ::std::os::raw::c_uint; +#[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 = 0; +pub const PFR_DIR_OUT: _bindgen_ty_15 = 1; +pub const PFR_DIR_MAX: _bindgen_ty_15 = 2; +pub type _bindgen_ty_15 = ::std::os::raw::c_uint; +pub const PFR_OP_BLOCK: _bindgen_ty_16 = 0; +pub const PFR_OP_MATCH: _bindgen_ty_16 = 1; +pub const PFR_OP_PASS: _bindgen_ty_16 = 2; +pub const PFR_OP_ADDR_MAX: _bindgen_ty_16 = 3; +pub const PFR_OP_TABLE_MAX: _bindgen_ty_16 = 4; +pub type _bindgen_ty_16 = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pfr_astats { + pub pfras_a: pfr_addr, + pub pfras_packets: [[u_int64_t; 3usize]; 2usize], + pub pfras_bytes: [[u_int64_t; 3usize]; 2usize], + pub pfras_tzero: time_t, +} +#[test] +fn bindgen_test_layout_pfr_astats() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 160usize, + concat!("Size of: ", stringify!(pfr_astats)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfr_astats)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfras_a) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfr_astats), + "::", + stringify!(pfras_a) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfras_packets) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(pfr_astats), + "::", + stringify!(pfras_packets) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfras_bytes) as usize - ptr as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(pfr_astats), + "::", + stringify!(pfras_bytes) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfras_tzero) as usize - ptr as usize }, + 152usize, + concat!( + "Offset of field: ", + stringify!(pfr_astats), + "::", + stringify!(pfras_tzero) + ) + ); +} +pub const PFR_REFCNT_RULE: _bindgen_ty_17 = 0; +pub const PFR_REFCNT_ANCHOR: _bindgen_ty_17 = 1; +pub const PFR_REFCNT_MAX: _bindgen_ty_17 = 2; +pub type _bindgen_ty_17 = ::std::os::raw::c_uint; +#[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_kcounters { + pub pfrkc_packets: [[u_int64_t; 3usize]; 2usize], + pub pfrkc_bytes: [[u_int64_t; 3usize]; 2usize], + pub states: u_int64_t, +} +#[test] +fn bindgen_test_layout_pfr_kcounters() { + 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!(pfr_kcounters)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfr_kcounters)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrkc_packets) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfr_kcounters), + "::", + stringify!(pfrkc_packets) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfrkc_bytes) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(pfr_kcounters), + "::", + stringify!(pfrkc_bytes) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).states) as usize - ptr as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(pfr_kcounters), + "::", + stringify!(states) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pfsockaddr_union { + pub sa: sockaddr, + pub sin: sockaddr_in, + pub sin6: sockaddr_in6, +} +#[test] +fn bindgen_test_layout_pfsockaddr_union() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 28usize, + concat!("Size of: ", stringify!(pfsockaddr_union)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pfsockaddr_union)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sa) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfsockaddr_union), + "::", + stringify!(sa) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sin) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfsockaddr_union), + "::", + stringify!(sin) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sin6) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfsockaddr_union), + "::", + stringify!(sin6) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfr_kentryworkq { + pub slh_first: *mut pfr_kentry, +} +#[test] +fn bindgen_test_layout_pfr_kentryworkq() { + 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_kentryworkq)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfr_kentryworkq)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).slh_first) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfr_kentryworkq), + "::", + stringify!(slh_first) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _pfr_kentry { + pub _pfrke_node: [radix_node; 2usize], + pub _pfrke_sa: pfsockaddr_union, + pub _pfrke_workq: _pfr_kentry__bindgen_ty_1, + pub _pfrke_ioq: _pfr_kentry__bindgen_ty_2, + pub _pfrke_counters: *mut pfr_kcounters, + pub _pfrke_tzero: time_t, + pub _pfrke_af: u_int8_t, + pub _pfrke_net: u_int8_t, + pub _pfrke_flags: u_int8_t, + pub _pfrke_type: u_int8_t, + pub _pfrke_fb: u_int8_t, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _pfr_kentry__bindgen_ty_1 { + pub sle_next: *mut pfr_kentry, +} +#[test] +fn bindgen_test_layout__pfr_kentry__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit<_pfr_kentry__bindgen_ty_1> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<_pfr_kentry__bindgen_ty_1>(), + 8usize, + concat!("Size of: ", stringify!(_pfr_kentry__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::<_pfr_kentry__bindgen_ty_1>(), + 8usize, + concat!("Alignment of ", stringify!(_pfr_kentry__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sle_next) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_pfr_kentry__bindgen_ty_1), + "::", + stringify!(sle_next) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _pfr_kentry__bindgen_ty_2 { + pub sle_next: *mut pfr_kentry, +} +#[test] +fn bindgen_test_layout__pfr_kentry__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit<_pfr_kentry__bindgen_ty_2> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<_pfr_kentry__bindgen_ty_2>(), + 8usize, + concat!("Size of: ", stringify!(_pfr_kentry__bindgen_ty_2)) + ); + assert_eq!( + ::std::mem::align_of::<_pfr_kentry__bindgen_ty_2>(), + 8usize, + concat!("Alignment of ", stringify!(_pfr_kentry__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_kentry__bindgen_ty_2), + "::", + stringify!(sle_next) + ) + ); +} +#[test] +fn bindgen_test_layout__pfr_kentry() { + const UNINIT: ::std::mem::MaybeUninit<_pfr_kentry> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<_pfr_kentry>(), + 168usize, + concat!("Size of: ", stringify!(_pfr_kentry)) + ); + assert_eq!( + ::std::mem::align_of::<_pfr_kentry>(), + 8usize, + concat!("Alignment of ", stringify!(_pfr_kentry)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._pfrke_node) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_pfr_kentry), + "::", + stringify!(_pfrke_node) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._pfrke_sa) as usize - ptr as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(_pfr_kentry), + "::", + stringify!(_pfrke_sa) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._pfrke_workq) as usize - ptr as usize }, + 128usize, + concat!( + "Offset of field: ", + stringify!(_pfr_kentry), + "::", + stringify!(_pfrke_workq) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._pfrke_ioq) as usize - ptr as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(_pfr_kentry), + "::", + stringify!(_pfrke_ioq) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._pfrke_counters) as usize - ptr as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(_pfr_kentry), + "::", + stringify!(_pfrke_counters) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._pfrke_tzero) as usize - ptr as usize }, + 152usize, + concat!( + "Offset of field: ", + stringify!(_pfr_kentry), + "::", + stringify!(_pfrke_tzero) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._pfrke_af) as usize - ptr as usize }, + 160usize, + concat!( + "Offset of field: ", + stringify!(_pfr_kentry), + "::", + stringify!(_pfrke_af) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._pfrke_net) as usize - ptr as usize }, + 161usize, + concat!( + "Offset of field: ", + stringify!(_pfr_kentry), + "::", + stringify!(_pfrke_net) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._pfrke_flags) as usize - ptr as usize }, + 162usize, + concat!( + "Offset of field: ", + stringify!(_pfr_kentry), + "::", + stringify!(_pfrke_flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._pfrke_type) as usize - ptr as usize }, + 163usize, + concat!( + "Offset of field: ", + stringify!(_pfr_kentry), + "::", + stringify!(_pfrke_type) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._pfrke_fb) as usize - ptr as usize }, + 164usize, + concat!( + "Offset of field: ", + stringify!(_pfr_kentry), + "::", + stringify!(_pfrke_fb) + ) + ); +} +pub const PFRKE_PLAIN: _bindgen_ty_18 = 0; +pub const PFRKE_ROUTE: _bindgen_ty_18 = 1; +pub const PFRKE_COST: _bindgen_ty_18 = 2; +pub const PFRKE_MAX: _bindgen_ty_18 = 3; +pub type _bindgen_ty_18 = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pfr_kentry { + pub u: pfr_kentry__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pfr_kentry__bindgen_ty_1 { + pub _ke: _pfr_kentry, +} +#[test] +fn bindgen_test_layout_pfr_kentry__bindgen_ty_1() { + 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!(pfr_kentry__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfr_kentry__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._ke) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfr_kentry__bindgen_ty_1), + "::", + stringify!(_ke) + ) + ); +} +#[test] +fn bindgen_test_layout_pfr_kentry() { + 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!(pfr_kentry)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfr_kentry)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).u) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfr_kentry), + "::", + stringify!(u) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pfr_kentry_route { + pub u: pfr_kentry_route__bindgen_ty_1, + pub kif: *mut pfi_kif, + pub ifname: [::std::os::raw::c_char; 16usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pfr_kentry_route__bindgen_ty_1 { + pub _ke: _pfr_kentry, +} +#[test] +fn bindgen_test_layout_pfr_kentry_route__bindgen_ty_1() { + 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!(pfr_kentry_route__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfr_kentry_route__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._ke) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfr_kentry_route__bindgen_ty_1), + "::", + stringify!(_ke) + ) + ); +} +#[test] +fn bindgen_test_layout_pfr_kentry_route() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 192usize, + concat!("Size of: ", stringify!(pfr_kentry_route)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfr_kentry_route)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).u) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfr_kentry_route), + "::", + stringify!(u) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).kif) as usize - ptr as usize }, + 168usize, + concat!( + "Offset of field: ", + stringify!(pfr_kentry_route), + "::", + stringify!(kif) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, + 176usize, + concat!( + "Offset of field: ", + stringify!(pfr_kentry_route), + "::", + stringify!(ifname) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pfr_kentry_cost { + pub u: pfr_kentry_cost__bindgen_ty_1, + pub kif: *mut pfi_kif, + pub ifname: [::std::os::raw::c_char; 16usize], + pub weight: u_int16_t, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pfr_kentry_cost__bindgen_ty_1 { + pub _ke: _pfr_kentry, +} +#[test] +fn bindgen_test_layout_pfr_kentry_cost__bindgen_ty_1() { + 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!(pfr_kentry_cost__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfr_kentry_cost__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._ke) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfr_kentry_cost__bindgen_ty_1), + "::", + stringify!(_ke) + ) + ); +} +#[test] +fn bindgen_test_layout_pfr_kentry_cost() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 200usize, + concat!("Size of: ", stringify!(pfr_kentry_cost)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfr_kentry_cost)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).u) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfr_kentry_cost), + "::", + stringify!(u) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).kif) as usize - ptr as usize }, + 168usize, + concat!( + "Offset of field: ", + stringify!(pfr_kentry_cost), + "::", + stringify!(kif) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, + 176usize, + concat!( + "Offset of field: ", + stringify!(pfr_kentry_cost), + "::", + stringify!(ifname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).weight) as usize - ptr as usize }, + 192usize, + concat!( + "Offset of field: ", + stringify!(pfr_kentry_cost), + "::", + stringify!(weight) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pfr_kentry_all { + pub u: pfr_kentry_all__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pfr_kentry_all__bindgen_ty_1 { + pub _ke: _pfr_kentry, + pub kr: pfr_kentry_route, + pub kc: pfr_kentry_cost, +} +#[test] +fn bindgen_test_layout_pfr_kentry_all__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 200usize, + concat!("Size of: ", stringify!(pfr_kentry_all__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfr_kentry_all__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._ke) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfr_kentry_all__bindgen_ty_1), + "::", + stringify!(_ke) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).kr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfr_kentry_all__bindgen_ty_1), + "::", + stringify!(kr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).kc) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfr_kentry_all__bindgen_ty_1), + "::", + stringify!(kc) + ) + ); +} +#[test] +fn bindgen_test_layout_pfr_kentry_all() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 200usize, + concat!("Size of: ", stringify!(pfr_kentry_all)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfr_kentry_all)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).u) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfr_kentry_all), + "::", + stringify!(u) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfr_ktableworkq { + pub slh_first: *mut pfr_ktable, +} +#[test] +fn bindgen_test_layout_pfr_ktableworkq() { + 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_ktableworkq)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfr_ktableworkq)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).slh_first) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfr_ktableworkq), + "::", + stringify!(slh_first) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfr_ktablehead { + pub rbh_root: *mut pfr_ktable, +} +#[test] +fn bindgen_test_layout_pfr_ktablehead() { + 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_ktablehead)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfr_ktablehead)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbh_root) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfr_ktablehead), + "::", + stringify!(rbh_root) + ) + ); +} +#[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 pf_state_tree_ext_gwy { + pub rbh_root: *mut pf_state_key, +} +#[test] +fn bindgen_test_layout_pf_state_tree_ext_gwy() { + 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_state_tree_ext_gwy)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_state_tree_ext_gwy)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbh_root) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_state_tree_ext_gwy), + "::", + stringify!(rbh_root) + ) + ); +} +extern "C" { + pub fn pf_state_tree_ext_gwy_RB_INSERT_COLOR( + arg1: *mut pf_state_tree_ext_gwy, + arg2: *mut pf_state_key, + ); +} +extern "C" { + pub fn pf_state_tree_ext_gwy_RB_REMOVE_COLOR( + arg1: *mut pf_state_tree_ext_gwy, + arg2: *mut pf_state_key, + arg3: *mut pf_state_key, + ); +} +extern "C" { + pub fn pf_state_tree_ext_gwy_RB_REMOVE( + arg1: *mut pf_state_tree_ext_gwy, + arg2: *mut pf_state_key, + ) -> *mut pf_state_key; +} +extern "C" { + pub fn pf_state_tree_ext_gwy_RB_INSERT( + arg1: *mut pf_state_tree_ext_gwy, + arg2: *mut pf_state_key, + ) -> *mut pf_state_key; +} +extern "C" { + pub fn pf_state_tree_ext_gwy_RB_FIND( + arg1: *mut pf_state_tree_ext_gwy, + arg2: *mut pf_state_key, + ) -> *mut pf_state_key; +} +extern "C" { + pub fn pf_state_tree_ext_gwy_RB_NFIND( + arg1: *mut pf_state_tree_ext_gwy, + arg2: *mut pf_state_key, + ) -> *mut pf_state_key; +} +extern "C" { + pub fn pf_state_tree_ext_gwy_RB_NEXT(arg1: *mut pf_state_key) -> *mut pf_state_key; +} +extern "C" { + pub fn pf_state_tree_ext_gwy_RB_PREV(arg1: *mut pf_state_key) -> *mut pf_state_key; +} +extern "C" { + pub fn pf_state_tree_ext_gwy_RB_MINMAX( + arg1: *mut pf_state_tree_ext_gwy, + arg2: ::std::os::raw::c_int, + ) -> *mut pf_state_key; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfi_ifhead { + pub rbh_root: *mut pfi_kif, +} +#[test] +fn bindgen_test_layout_pfi_ifhead() { + 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!(pfi_ifhead)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfi_ifhead)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rbh_root) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfi_ifhead), + "::", + stringify!(rbh_root) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_state_tree { + _unused: [u8; 0], +} +extern "C" { + pub static mut pf_statetbl: pf_state_tree; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfi_kif_cmp { + pub pfik_name: [::std::os::raw::c_char; 16usize], +} +#[test] +fn bindgen_test_layout_pfi_kif_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!(pfi_kif_cmp)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(pfi_kif_cmp)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfik_name) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfi_kif_cmp), + "::", + stringify!(pfik_name) + ) + ); +} +#[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) + ) + ); +} +pub const pfi_kif_refs_PFI_KIF_REF_NONE: pfi_kif_refs = 0; +pub const pfi_kif_refs_PFI_KIF_REF_STATE: pfi_kif_refs = 1; +pub const pfi_kif_refs_PFI_KIF_REF_RULE: pfi_kif_refs = 2; +pub const pfi_kif_refs_PFI_KIF_REF_ROUTE: pfi_kif_refs = 3; +pub const pfi_kif_refs_PFI_KIF_REF_SRCNODE: pfi_kif_refs = 4; +pub const pfi_kif_refs_PFI_KIF_REF_FLAG: pfi_kif_refs = 5; +pub type pfi_kif_refs = ::std::os::raw::c_uint; +#[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(Debug, Copy, Clone)] +pub struct pf_queue_bwspec { + pub absolute: u_int, + pub percent: u_int, +} +#[test] +fn bindgen_test_layout_pf_queue_bwspec() { + 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_queue_bwspec)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_queue_bwspec)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).absolute) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_queue_bwspec), + "::", + stringify!(absolute) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).percent) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(pf_queue_bwspec), + "::", + stringify!(percent) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_queue_scspec { + pub m1: pf_queue_bwspec, + pub m2: pf_queue_bwspec, + pub d: u_int, +} +#[test] +fn bindgen_test_layout_pf_queue_scspec() { + 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_queue_scspec)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_queue_scspec)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).m1) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_queue_scspec), + "::", + stringify!(m1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).m2) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_queue_scspec), + "::", + stringify!(m2) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).d) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pf_queue_scspec), + "::", + stringify!(d) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_queue_fqspec { + pub flows: u_int, + pub quantum: u_int, + pub target: u_int, + pub interval: u_int, +} +#[test] +fn bindgen_test_layout_pf_queue_fqspec() { + 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_queue_fqspec)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_queue_fqspec)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).flows) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_queue_fqspec), + "::", + stringify!(flows) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).quantum) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(pf_queue_fqspec), + "::", + stringify!(quantum) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).target) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pf_queue_fqspec), + "::", + stringify!(target) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).interval) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(pf_queue_fqspec), + "::", + stringify!(interval) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_queuespec { + pub entries: pf_queuespec__bindgen_ty_1, + pub qname: [::std::os::raw::c_char; 64usize], + pub parent: [::std::os::raw::c_char; 64usize], + pub ifname: [::std::os::raw::c_char; 16usize], + pub realtime: pf_queue_scspec, + pub linkshare: pf_queue_scspec, + pub upperlimit: pf_queue_scspec, + pub flowqueue: pf_queue_fqspec, + pub kif: *mut pfi_kif, + pub flags: u_int, + pub qlimit: u_int, + pub qid: u_int32_t, + pub parent_qid: u_int32_t, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_queuespec__bindgen_ty_1 { + pub tqe_next: *mut pf_queuespec, + pub tqe_prev: *mut *mut pf_queuespec, +} +#[test] +fn bindgen_test_layout_pf_queuespec__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_queuespec__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_queuespec__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_queuespec__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_queuespec__bindgen_ty_1), + "::", + stringify!(tqe_prev) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_queuespec() { + 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!(pf_queuespec)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_queuespec)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).entries) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_queuespec), + "::", + stringify!(entries) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).qname) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pf_queuespec), + "::", + stringify!(qname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).parent) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(pf_queuespec), + "::", + stringify!(parent) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifname) as usize - ptr as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(pf_queuespec), + "::", + stringify!(ifname) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).realtime) as usize - ptr as usize }, + 160usize, + concat!( + "Offset of field: ", + stringify!(pf_queuespec), + "::", + stringify!(realtime) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).linkshare) as usize - ptr as usize }, + 180usize, + concat!( + "Offset of field: ", + stringify!(pf_queuespec), + "::", + stringify!(linkshare) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).upperlimit) as usize - ptr as usize }, + 200usize, + concat!( + "Offset of field: ", + stringify!(pf_queuespec), + "::", + stringify!(upperlimit) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).flowqueue) as usize - ptr as usize }, + 220usize, + concat!( + "Offset of field: ", + stringify!(pf_queuespec), + "::", + stringify!(flowqueue) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).kif) as usize - ptr as usize }, + 240usize, + concat!( + "Offset of field: ", + stringify!(pf_queuespec), + "::", + stringify!(kif) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 248usize, + concat!( + "Offset of field: ", + stringify!(pf_queuespec), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).qlimit) as usize - ptr as usize }, + 252usize, + concat!( + "Offset of field: ", + stringify!(pf_queuespec), + "::", + stringify!(qlimit) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).qid) as usize - ptr as usize }, + 256usize, + concat!( + "Offset of field: ", + stringify!(pf_queuespec), + "::", + stringify!(qid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).parent_qid) as usize - ptr as usize }, + 260usize, + concat!( + "Offset of field: ", + stringify!(pf_queuespec), + "::", + stringify!(parent_qid) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct priq_opts { + pub flags: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_priq_opts() { + 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!(priq_opts)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(priq_opts)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(priq_opts), + "::", + stringify!(flags) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct hfsc_opts { + pub rtsc_m1: u_int, + pub rtsc_d: u_int, + pub rtsc_m2: u_int, + pub lssc_m1: u_int, + pub lssc_d: u_int, + pub lssc_m2: u_int, + pub ulsc_m1: u_int, + pub ulsc_d: u_int, + pub ulsc_m2: u_int, + pub flags: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_hfsc_opts() { + 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!(hfsc_opts)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(hfsc_opts)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtsc_m1) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hfsc_opts), + "::", + stringify!(rtsc_m1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtsc_d) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hfsc_opts), + "::", + stringify!(rtsc_d) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rtsc_m2) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hfsc_opts), + "::", + stringify!(rtsc_m2) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lssc_m1) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(hfsc_opts), + "::", + stringify!(lssc_m1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lssc_d) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(hfsc_opts), + "::", + stringify!(lssc_d) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lssc_m2) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(hfsc_opts), + "::", + stringify!(lssc_m2) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulsc_m1) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(hfsc_opts), + "::", + stringify!(ulsc_m1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulsc_d) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(hfsc_opts), + "::", + stringify!(ulsc_d) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulsc_m2) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(hfsc_opts), + "::", + stringify!(ulsc_m2) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(hfsc_opts), + "::", + stringify!(flags) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfq_ops { + pub pfq_alloc: ::std::option::Option< + unsafe extern "C" fn(arg1: *mut ifnet) -> *mut ::std::os::raw::c_void, + >, + pub pfq_addqueue: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut pf_queuespec, + ) -> ::std::os::raw::c_int, + >, + pub pfq_free: ::std::option::Option, + pub pfq_qstats: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut pf_queuespec, + arg2: *mut ::std::os::raw::c_void, + arg3: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, + >, + pub pfq_qlength: ::std::option::Option< + unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_uint, + >, + pub pfq_enqueue: ::std::option::Option< + unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void, arg2: *mut mbuf) -> *mut mbuf, + >, + pub pfq_deq_begin: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut *mut ::std::os::raw::c_void, + arg3: *mut mbuf_list, + ) -> *mut mbuf, + >, + pub pfq_deq_commit: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut mbuf, + arg3: *mut ::std::os::raw::c_void, + ), + >, + pub pfq_purge: ::std::option::Option< + unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void, arg2: *mut mbuf_list), + >, +} +#[test] +fn bindgen_test_layout_pfq_ops() { + 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!(pfq_ops)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfq_ops)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfq_alloc) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfq_ops), + "::", + stringify!(pfq_alloc) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfq_addqueue) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pfq_ops), + "::", + stringify!(pfq_addqueue) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfq_free) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pfq_ops), + "::", + stringify!(pfq_free) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfq_qstats) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(pfq_ops), + "::", + stringify!(pfq_qstats) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfq_qlength) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(pfq_ops), + "::", + stringify!(pfq_qlength) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfq_enqueue) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(pfq_ops), + "::", + stringify!(pfq_enqueue) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfq_deq_begin) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(pfq_ops), + "::", + stringify!(pfq_deq_begin) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfq_deq_commit) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(pfq_ops), + "::", + stringify!(pfq_deq_commit) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfq_purge) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(pfq_ops), + "::", + stringify!(pfq_purge) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_tagname { + pub entries: pf_tagname__bindgen_ty_1, + pub name: [::std::os::raw::c_char; 64usize], + pub tag: u_int16_t, + pub ref_: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_tagname__bindgen_ty_1 { + pub tqe_next: *mut pf_tagname, + pub tqe_prev: *mut *mut pf_tagname, +} +#[test] +fn bindgen_test_layout_pf_tagname__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_tagname__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_tagname__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_tagname__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_tagname__bindgen_ty_1), + "::", + stringify!(tqe_prev) + ) + ); +} +#[test] +fn bindgen_test_layout_pf_tagname() { + 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_tagname)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_tagname)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).entries) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_tagname), + "::", + stringify!(entries) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pf_tagname), + "::", + stringify!(name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(pf_tagname), + "::", + stringify!(tag) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ref_) as usize - ptr as usize }, + 84usize, + concat!( + "Offset of field: ", + stringify!(pf_tagname), + "::", + stringify!(ref_) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pf_divert { + pub addr: pf_addr, + pub port: u_int16_t, + pub rdomain: u_int16_t, + pub type_: u_int8_t, +} +#[test] +fn bindgen_test_layout_pf_divert() { + 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_divert)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pf_divert)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_divert), + "::", + stringify!(addr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).port) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pf_divert), + "::", + stringify!(port) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rdomain) as usize - ptr as usize }, + 18usize, + concat!( + "Offset of field: ", + stringify!(pf_divert), + "::", + stringify!(rdomain) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(pf_divert), + "::", + stringify!(type_) + ) + ); +} +pub const pf_divert_types_PF_DIVERT_NONE: pf_divert_types = 0; +pub const pf_divert_types_PF_DIVERT_TO: pf_divert_types = 1; +pub const pf_divert_types_PF_DIVERT_REPLY: pf_divert_types = 2; +pub const pf_divert_types_PF_DIVERT_PACKET: pf_divert_types = 3; +pub type pf_divert_types = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_pktdelay { + pub to: timeout, + pub m: *mut mbuf, + pub ifidx: u_int, +} +#[test] +fn bindgen_test_layout_pf_pktdelay() { + 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_pktdelay)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pf_pktdelay)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).to) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pf_pktdelay), + "::", + stringify!(to) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).m) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(pf_pktdelay), + "::", + stringify!(m) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ifidx) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(pf_pktdelay), + "::", + stringify!(ifidx) + ) + ); +} +#[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_natlook { + pub saddr: pf_addr, + pub daddr: pf_addr, + pub rsaddr: pf_addr, + pub rdaddr: pf_addr, + pub rdomain: u_int16_t, + pub rrdomain: u_int16_t, + pub sport: u_int16_t, + pub dport: u_int16_t, + pub rsport: u_int16_t, + pub rdport: u_int16_t, + pub af: sa_family_t, + pub proto: u_int8_t, + pub direction: u_int8_t, +} +#[test] +fn bindgen_test_layout_pfioc_natlook() { + 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!(pfioc_natlook)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pfioc_natlook)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).saddr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_natlook), + "::", + stringify!(saddr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).daddr) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pfioc_natlook), + "::", + stringify!(daddr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rsaddr) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(pfioc_natlook), + "::", + stringify!(rsaddr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rdaddr) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(pfioc_natlook), + "::", + stringify!(rdaddr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rdomain) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(pfioc_natlook), + "::", + stringify!(rdomain) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rrdomain) as usize - ptr as usize }, + 66usize, + concat!( + "Offset of field: ", + stringify!(pfioc_natlook), + "::", + stringify!(rrdomain) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sport) as usize - ptr as usize }, + 68usize, + concat!( + "Offset of field: ", + stringify!(pfioc_natlook), + "::", + stringify!(sport) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).dport) as usize - ptr as usize }, + 70usize, + concat!( + "Offset of field: ", + stringify!(pfioc_natlook), + "::", + stringify!(dport) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rsport) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(pfioc_natlook), + "::", + stringify!(rsport) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rdport) as usize - ptr as usize }, + 74usize, + concat!( + "Offset of field: ", + stringify!(pfioc_natlook), + "::", + stringify!(rdport) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).af) as usize - ptr as usize }, + 76usize, + concat!( + "Offset of field: ", + stringify!(pfioc_natlook), + "::", + stringify!(af) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).proto) as usize - ptr as usize }, + 77usize, + concat!( + "Offset of field: ", + stringify!(pfioc_natlook), + "::", + stringify!(proto) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).direction) as usize - ptr as usize }, + 78usize, + concat!( + "Offset of field: ", + stringify!(pfioc_natlook), + "::", + stringify!(direction) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pfioc_state { + pub state: pfsync_state, +} +#[test] +fn bindgen_test_layout_pfioc_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!(pfioc_state)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(pfioc_state)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_state), + "::", + stringify!(state) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pfioc_src_node_kill { + pub psnk_af: sa_family_t, + pub psnk_src: pf_rule_addr, + pub psnk_dst: pf_rule_addr, + pub psnk_killed: u_int, +} +#[test] +fn bindgen_test_layout_pfioc_src_node_kill() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 128usize, + concat!("Size of: ", stringify!(pfioc_src_node_kill)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfioc_src_node_kill)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psnk_af) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_src_node_kill), + "::", + stringify!(psnk_af) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psnk_src) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pfioc_src_node_kill), + "::", + stringify!(psnk_src) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psnk_dst) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(pfioc_src_node_kill), + "::", + stringify!(psnk_dst) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psnk_killed) as usize - ptr as usize }, + 120usize, + concat!( + "Offset of field: ", + stringify!(pfioc_src_node_kill), + "::", + stringify!(psnk_killed) + ) + ); +} +#[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(Copy, Clone)] +pub struct pfioc_src_nodes { + pub psn_len: usize, + pub psn_u: pfioc_src_nodes__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pfioc_src_nodes__bindgen_ty_1 { + pub psu_buf: caddr_t, + pub psu_src_nodes: *mut pf_src_node, +} +#[test] +fn bindgen_test_layout_pfioc_src_nodes__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_src_nodes__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfioc_src_nodes__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_src_nodes__bindgen_ty_1), + "::", + stringify!(psu_buf) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psu_src_nodes) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_src_nodes__bindgen_ty_1), + "::", + stringify!(psu_src_nodes) + ) + ); +} +#[test] +fn bindgen_test_layout_pfioc_src_nodes() { + 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_src_nodes)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfioc_src_nodes)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psn_len) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_src_nodes), + "::", + stringify!(psn_len) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).psn_u) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pfioc_src_nodes), + "::", + stringify!(psn_u) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfioc_tm { + pub timeout: ::std::os::raw::c_int, + pub seconds: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_pfioc_tm() { + 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_tm)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pfioc_tm)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).timeout) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_tm), + "::", + stringify!(timeout) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).seconds) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(pfioc_tm), + "::", + stringify!(seconds) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfioc_limit { + pub index: ::std::os::raw::c_int, + pub limit: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout_pfioc_limit() { + 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_limit)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pfioc_limit)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).index) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_limit), + "::", + stringify!(index) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).limit) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(pfioc_limit), + "::", + stringify!(limit) + ) + ); +} +#[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, + 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 pfioc_queue { + pub ticket: u_int32_t, + pub nr: u_int, + pub queue: pf_queuespec, +} +#[test] +fn bindgen_test_layout_pfioc_queue() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 272usize, + concat!("Size of: ", stringify!(pfioc_queue)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfioc_queue)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ticket) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_queue), + "::", + stringify!(ticket) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nr) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(pfioc_queue), + "::", + stringify!(nr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).queue) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pfioc_queue), + "::", + stringify!(queue) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfioc_qstats { + pub ticket: u_int32_t, + pub nr: u_int32_t, + pub queue: pf_queuespec, + pub buf: *mut ::std::os::raw::c_void, + pub nbytes: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_pfioc_qstats() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 288usize, + concat!("Size of: ", stringify!(pfioc_qstats)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfioc_qstats)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ticket) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_qstats), + "::", + stringify!(ticket) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nr) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(pfioc_qstats), + "::", + stringify!(nr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).queue) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(pfioc_qstats), + "::", + stringify!(queue) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).buf) as usize - ptr as usize }, + 272usize, + concat!( + "Offset of field: ", + stringify!(pfioc_qstats), + "::", + stringify!(buf) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nbytes) as usize - ptr as usize }, + 280usize, + concat!( + "Offset of field: ", + stringify!(pfioc_qstats), + "::", + stringify!(nbytes) + ) + ); +} +#[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 pfioc_iface { + pub pfiio_name: [::std::os::raw::c_char; 16usize], + pub pfiio_buffer: *mut ::std::os::raw::c_void, + pub pfiio_esize: ::std::os::raw::c_int, + pub pfiio_size: ::std::os::raw::c_int, + pub pfiio_nzero: ::std::os::raw::c_int, + pub pfiio_flags: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_pfioc_iface() { + 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!(pfioc_iface)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pfioc_iface)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfiio_name) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_iface), + "::", + stringify!(pfiio_name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfiio_buffer) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(pfioc_iface), + "::", + stringify!(pfiio_buffer) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfiio_esize) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(pfioc_iface), + "::", + stringify!(pfiio_esize) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfiio_size) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(pfioc_iface), + "::", + stringify!(pfiio_size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfiio_nzero) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(pfioc_iface), + "::", + stringify!(pfiio_nzero) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfiio_flags) as usize - ptr as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(pfioc_iface), + "::", + stringify!(pfiio_flags) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfioc_synflwats { + pub hiwat: u_int32_t, + pub lowat: u_int32_t, +} +#[test] +fn bindgen_test_layout_pfioc_synflwats() { + 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_synflwats)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pfioc_synflwats)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hiwat) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pfioc_synflwats), + "::", + stringify!(hiwat) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lowat) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(pfioc_synflwats), + "::", + stringify!(lowat) + ) + ); +} +extern "C" { + pub static mut pf_anchors: pf_anchor_global; +} +extern "C" { + pub static mut pf_main_anchor: pf_anchor; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tcphdr { + _unused: [u8; 0], +} +extern "C" { + pub fn pf_init_ruleset(arg1: *mut pf_ruleset); +} +extern "C" { + pub fn pf_anchor_setup( + arg1: *mut pf_rule, + arg2: *const pf_ruleset, + arg3: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn pf_anchor_copyout( + arg1: *const pf_ruleset, + arg2: *const pf_rule, + arg3: *mut pfioc_rule, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn pf_remove_anchor(arg1: *mut pf_rule); +} +extern "C" { + pub fn pf_remove_if_empty_ruleset(arg1: *mut pf_ruleset); +} +extern "C" { + pub fn pf_find_anchor(arg1: *const ::std::os::raw::c_char) -> *mut pf_anchor; +} +extern "C" { + pub fn pf_find_ruleset(arg1: *const ::std::os::raw::c_char) -> *mut pf_ruleset; +} +extern "C" { + pub fn pf_get_leaf_ruleset( + arg1: *mut ::std::os::raw::c_char, + arg2: *mut *mut ::std::os::raw::c_char, + ) -> *mut pf_ruleset; +} +extern "C" { + pub fn pf_create_anchor( + arg1: *mut pf_anchor, + arg2: *const ::std::os::raw::c_char, + ) -> *mut pf_anchor; +} +extern "C" { + pub fn pf_find_or_create_ruleset(arg1: *const ::std::os::raw::c_char) -> *mut pf_ruleset; +} +extern "C" { + pub fn pf_rs_initialize(); +} +extern "C" { + pub fn pf_anchor_rele(arg1: *mut pf_anchor); +} +extern "C" { + pub fn pf_anchor_take(arg1: *mut pf_anchor) -> *mut pf_anchor; +} +extern "C" { + pub fn pf_osfp_add(arg1: *mut pf_osfp_ioctl) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn pf_osfp_fingerprint_hdr( + arg1: *const ip, + arg2: *const ip6_hdr, + arg3: *const tcphdr, + ) -> *mut pf_os_fingerprint_pf_osfp_enlist; +} +extern "C" { + pub fn pf_osfp_flush(); +} +extern "C" { + pub fn pf_osfp_get(arg1: *mut pf_osfp_ioctl) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn pf_osfp_initialize(); +} +extern "C" { + pub fn pf_osfp_match( + arg1: *mut pf_os_fingerprint_pf_osfp_enlist, + arg2: pf_osfp_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn pf_osfp_validate() -> *mut pf_os_fingerprint; +} +pub type __builtin_va_list = [__va_list_tag; 1usize]; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __va_list_tag { + pub gp_offset: ::std::os::raw::c_uint, + pub fp_offset: ::std::os::raw::c_uint, + pub overflow_arg_area: *mut ::std::os::raw::c_void, + pub reg_save_area: *mut ::std::os::raw::c_void, +} +#[test] +fn bindgen_test_layout___va_list_tag() { + const UNINIT: ::std::mem::MaybeUninit<__va_list_tag> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<__va_list_tag>(), + 24usize, + concat!("Size of: ", stringify!(__va_list_tag)) + ); + assert_eq!( + ::std::mem::align_of::<__va_list_tag>(), + 8usize, + concat!("Alignment of ", stringify!(__va_list_tag)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).gp_offset) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__va_list_tag), + "::", + stringify!(gp_offset) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_offset) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(__va_list_tag), + "::", + stringify!(fp_offset) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).overflow_arg_area) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__va_list_tag), + "::", + stringify!(overflow_arg_area) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).reg_save_area) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(__va_list_tag), + "::", + stringify!(reg_save_area) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct witness { + pub _address: u8, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct process { + pub _address: u8, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ifaddr { + pub _address: u8, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct rtentry { + pub _address: u8, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pfi_dynaddr { + pub _address: u8, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_state { + pub _address: u8, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pf_state_key { + pub _address: u8, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mbuf { + _unused: [u8; 0], +} diff --git a/crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/bsd.rs b/crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/bsd.rs index 1c57302798ef..1c011f425160 100644 --- a/crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/bsd.rs +++ b/crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/bsd.rs @@ -21,7 +21,7 @@ use crate::{ impl TcpListenerRedirExt for TcpListener { async fn bind_redir(ty: RedirType, addr: SocketAddr, accept_opts: AcceptOpts) -> io::Result { match ty { - #[cfg(any(target_os = "freebsd", target_os = "macos", target_os = "ios"))] + #[cfg(any(target_os = "freebsd", target_os = "openbsd", target_os = "macos", target_os = "ios"))] RedirType::PacketFilter => {} #[cfg(any(target_os = "freebsd", target_os = "macos", target_os = "ios"))] @@ -108,6 +108,8 @@ impl TcpStreamRedirExt for TcpStream { PF.natlook(&bind_addr, &peer_addr, Protocol::TCP) } + #[cfg(target_os = "openbsd")] //in OpenBSD, we can get TCP destination address with getsockname() + RedirType::PacketFilter => self.local_addr(), #[cfg(any(target_os = "freebsd", target_os = "macos", target_os = "ios"))] RedirType::IpFirewall => { // ## IPFW diff --git a/crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/mod.rs b/crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/mod.rs index bb679c4822bb..5f9e7c10f6b4 100644 --- a/crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/mod.rs +++ b/crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/mod.rs @@ -6,7 +6,8 @@ cfg_if! { pub use self::linux::*; } else if #[cfg(any(target_os = "macos", target_os = "ios", - target_os = "freebsd"))] { + target_os = "freebsd", + target_os = "openbsd"))] { mod bsd; pub use self::bsd::*; } diff --git a/crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/bsd.rs b/crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs similarity index 94% rename from crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/bsd.rs rename to crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs index 2ac63c636ce2..f4d1baceb374 100644 --- a/crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/bsd.rs +++ b/crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs @@ -159,7 +159,6 @@ impl UdpSocketRedir for UdpRedirSocket { } } -#[cfg(target_os = "freebsd")] fn set_bindany(level: libc::c_int, socket: &Socket) -> io::Result<()> { let fd = socket.as_raw_fd(); @@ -188,29 +187,6 @@ fn set_bindany(level: libc::c_int, socket: &Socket) -> io::Result<()> { Ok(()) } -// #[cfg(target_os = "openbsd")] -// fn set_bindany(_level: libc::c_int, socket: &Socket) -> io::Result<()> { -// let fd = socket.as_raw_fd(); -// -// let enable: libc::c_int = 1; -// -// // https://man.openbsd.org/getsockopt.2 -// unsafe { -// let ret = libc::setsockopt( -// fd, -// libc::SOL_SOCKET, -// libc::SO_BINDANY, -// &enable as *const _ as *const _, -// mem::size_of_val(&enable) as libc::socklen_t, -// ); -// if ret != 0 { -// return Err(Error::last_os_error()); -// } -// } -// -// Ok(()) -// } - fn set_ip_origdstaddr(level: libc::c_int, socket: &Socket) -> io::Result<()> { // https://www.freebsd.org/cgi/man.cgi?query=ip&sektion=4&manpath=FreeBSD+9.0-RELEASE diff --git a/crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/mod.rs b/crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/mod.rs index a0bfe2202dc0..cc0f0749d260 100644 --- a/crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/mod.rs +++ b/crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/mod.rs @@ -8,8 +8,11 @@ cfg_if! { mod macos; pub use self::macos::*; } else if #[cfg(any(target_os = "freebsd"))] { - mod bsd; - pub use self::bsd::*; + mod freebsd; + pub use self::freebsd::*; + } else if #[cfg(target_os = "openbsd")] { + mod openbsd; + pub use self::openbsd::*; } else { mod not_supported; pub use self::not_supported::*; diff --git a/crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/openbsd.rs b/crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/openbsd.rs new file mode 100644 index 000000000000..2bd7f47e6418 --- /dev/null +++ b/crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/openbsd.rs @@ -0,0 +1,360 @@ +use std::{ + io::{self, Error, ErrorKind}, + mem, + net::{SocketAddr, UdpSocket}, + os::unix::io::AsRawFd, + ptr, + task::{Context, Poll}, +}; + +use futures::{future::poll_fn, ready}; +use log::{error, trace, warn}; +use shadowsocks::net::is_dual_stack_addr; +use socket2::{Domain, Protocol, SockAddr, Socket, Type}; +use tokio::io::unix::AsyncFd; + +use crate::{ + config::RedirType, + local::redir::{ + redir_ext::{RedirSocketOpts, UdpSocketRedir}, + sys::set_ipv6_only, + }, +}; +const IP_RECVDSTPORT: i32 = 33; //Temporary workaround until libc supports this +const IPV6_RECVDSTPORT: i32 = 64; //Temporary workaround until libc supports this + +pub struct UdpRedirSocket { + io: AsyncFd, +} + +impl UdpRedirSocket { + /// Create a new UDP socket binded to `addr` + /// + /// This will allow listening to `addr` that is not in local host + pub fn listen(ty: RedirType, addr: SocketAddr) -> io::Result { + UdpRedirSocket::bind(ty, addr, false) + } + + /// Create a new UDP socket binded to `addr` + /// + /// This will allow binding to `addr` that is not in local host + pub fn bind_nonlocal(ty: RedirType, addr: SocketAddr, _: &RedirSocketOpts) -> io::Result { + UdpRedirSocket::bind(ty, addr, true) + } + + fn bind(ty: RedirType, addr: SocketAddr, reuse_port: bool) -> io::Result { + if ty == RedirType::NotSupported { + return Err(Error::new( + ErrorKind::InvalidInput, + "not supported udp transparent proxy type", + )); + } + + let socket = Socket::new(Domain::for_address(addr), Type::DGRAM, Some(Protocol::UDP))?; + set_socket_before_bind(&addr, &socket)?; + + socket.set_nonblocking(true)?; + socket.set_reuse_address(true)?; + if reuse_port { + if let Err(err) = socket.set_reuse_port(true) { + if let Some(errno) = err.raw_os_error() { + match errno { + libc::ENOPROTOOPT => { + trace!("failed to set SO_REUSEPORT, error: {}", err); + } + _ => { + error!("failed to set SO_REUSEPORT, error: {}", err); + return Err(err); + } + } + } else { + error!("failed to set SO_REUSEPORT, error: {}", err); + return Err(err); + } + } + } + + let sock_addr = SockAddr::from(addr); + + if is_dual_stack_addr(&addr) { + // set IP_ORIGDSTADDR before bind() + + // NOTE: FreeBSD doesn't allow setting IPPROTO_IP level on an IPv6 socket + // + // set_ip_origdstaddr(libc::IPPROTO_IP, &socket)?; + // set_disable_ip_fragmentation(libc::IPPROTO_IP, &socket)?; + + match set_ipv6_only(&socket, false) { + Ok(..) => { + if let Err(err) = socket.bind(&sock_addr) { + warn!( + "bind() dual-stack address {} failed, error: {}, fallback to IPV6_V6ONLY=true", + addr, err + ); + + if let Err(err) = set_ipv6_only(&socket, true) { + warn!( + "set IPV6_V6ONLY=true failed, error: {}, bind() to {} directly", + err, addr + ); + } + + socket.bind(&sock_addr)?; + } + } + Err(err) => { + warn!( + "set IPV6_V6ONLY=false failed, error: {}, bind() to {} directly", + err, addr + ); + socket.bind(&sock_addr)?; + } + } + } else { + socket.bind(&sock_addr)?; + } + + let io = AsyncFd::new(socket.into())?; + Ok(UdpRedirSocket { io }) + } + + /// Send data to the socket to the given target address + pub async fn send_to(&self, buf: &[u8], target: SocketAddr) -> io::Result { + poll_fn(|cx| self.poll_send_to(cx, buf, target)).await + } + + fn poll_send_to(&self, cx: &mut Context<'_>, buf: &[u8], target: SocketAddr) -> Poll> { + loop { + let mut write_guard = ready!(self.io.poll_write_ready(cx))?; + + match self.io.get_ref().send_to(buf, target) { + Err(ref e) if e.kind() == ErrorKind::WouldBlock => { + write_guard.clear_ready(); + } + x => return Poll::Ready(x), + } + } + } + + /// Returns the local address that this socket is bound to. + pub fn local_addr(&self) -> io::Result { + self.io.get_ref().local_addr() + } +} + +impl UdpSocketRedir for UdpRedirSocket { + fn poll_recv_dest_from( + &self, + cx: &mut Context<'_>, + buf: &mut [u8], + ) -> Poll> { + loop { + let mut read_guard = ready!(self.io.poll_read_ready(cx))?; + + match recv_dest_from(self.io.get_ref(), buf) { + Err(ref e) if e.kind() == ErrorKind::WouldBlock => { + read_guard.clear_ready(); + } + x => return Poll::Ready(x), + } + } + } +} + +fn set_bindany(_level: libc::c_int, socket: &Socket) -> io::Result<()> { + let fd = socket.as_raw_fd(); + + let enable: libc::c_int = 1; + + // https://man.openbsd.org/getsockopt.2 + unsafe { + let ret = libc::setsockopt( + fd, + libc::SOL_SOCKET, + libc::SO_BINDANY, + &enable as *const _ as *const _, + mem::size_of_val(&enable) as libc::socklen_t, + ); + if ret != 0 { + return Err(Error::last_os_error()); + } + } + + Ok(()) +} + +fn set_ip_origdstaddr(level: libc::c_int, socket: &Socket) -> io::Result<()> { + // https://man.openbsd.org/pf.conf + let fd = socket.as_raw_fd(); + + let enable: libc::c_int = 1; + + let opt = match level { + libc::IPPROTO_IP => libc::IP_RECVDSTADDR, + libc::IPPROTO_IPV6 => libc::IPV6_RECVPKTINFO, + _ => unreachable!("level can only be IPPROTO_IP or IPPROTO_IPV6"), + }; + + unsafe { + let ret = libc::setsockopt( + fd, + level, + opt, + &enable as *const _ as *const _, + mem::size_of_val(&enable) as libc::socklen_t, + ); + if ret != 0 { + return Err(Error::last_os_error()); + } + } + + let opt2 = match level { + libc::IPPROTO_IP => IP_RECVDSTPORT, + libc::IPPROTO_IPV6 => IPV6_RECVDSTPORT, + _ => unreachable!("level can only be IPPROTO_IP or IPPROTO_IPV6"), + }; + unsafe { + let ret = libc::setsockopt( + fd, + level, + opt2, + &enable as *const _ as *const _, + mem::size_of_val(&enable) as libc::socklen_t, + ); + if ret != 0 { + return Err(Error::last_os_error()); + } + } + Ok(()) +} + +fn set_socket_before_bind(addr: &SocketAddr, socket: &Socket) -> io::Result<()> { + // https://www.freebsd.org/cgi/man.cgi?query=ip&sektion=4&manpath=FreeBSD+9.0-RELEASE + let level = match *addr { + SocketAddr::V4(..) => libc::IPPROTO_IP, + SocketAddr::V6(..) => libc::IPPROTO_IPV6, + }; + + // 1. BINDANY + set_bindany(level, socket)?; + + // 2. set ORIGDSTADDR for retrieving original destination address + set_ip_origdstaddr(level, socket)?; + + Ok(()) +} + +fn get_destination_addr(msg: &libc::msghdr) -> io::Result { + unsafe { + let (_, addr) = SockAddr::try_init(|dst_addr, dst_addr_len| { + let mut cmsg: *mut libc::cmsghdr = libc::CMSG_FIRSTHDR(msg); + let mut addr_or_port_received = false; //The address should come first and then the port, but we use a flag just in case. https://github.com/openbsd/src/blob/3d310523b415eeee9db46a5b67eecf8f9fdd5c8f/sys/netinet/udp_usrreq.c#L662-L687 + while !cmsg.is_null() { + let rcmsg = &*cmsg; + match (rcmsg.cmsg_level, rcmsg.cmsg_type) { + (libc::IPPROTO_IP, libc::IP_RECVDSTADDR) => { + let toaddr_in = &mut *(dst_addr as *mut libc::sockaddr_in); + ptr::copy_nonoverlapping( + libc::CMSG_DATA(cmsg), + &(*toaddr_in).sin_addr as *const _ as *mut _, + mem::size_of::(), + ); + toaddr_in.sin_family = libc::AF_INET as u8; + *dst_addr_len = mem::size_of::() as libc::socklen_t; + if addr_or_port_received { + return Ok(()); + } else { + addr_or_port_received = true + } + } + (libc::IPPROTO_IP, IP_RECVDSTPORT) => { + let toaddr_in = &mut *(dst_addr as *mut libc::sockaddr_in); + ptr::copy_nonoverlapping( + libc::CMSG_DATA(cmsg), + &(*toaddr_in).sin_port as *const _ as *mut _, + mem::size_of::(), + ); + if addr_or_port_received { + return Ok(()); + } else { + addr_or_port_received = true + } + } + (libc::IPPROTO_IPV6, libc::IPV6_PKTINFO) => { + let toaddr_in = &mut *(dst_addr as *mut libc::sockaddr_in6); + ptr::copy_nonoverlapping( + libc::CMSG_DATA(cmsg), + &(*toaddr_in).sin6_addr as *const _ as *mut _, + mem::size_of::(), + ); + toaddr_in.sin6_family = libc::AF_INET6 as u8; + *dst_addr_len = mem::size_of::() as libc::socklen_t; + if addr_or_port_received { + return Ok(()); + } else { + addr_or_port_received = true + } + } + (libc::IPPROTO_IPV6, IPV6_RECVDSTPORT) => { + let toaddr_in = &mut *(dst_addr as *mut libc::sockaddr_in6); + ptr::copy_nonoverlapping( + libc::CMSG_DATA(cmsg), + &(*toaddr_in).sin6_port as *const _ as *mut _, + mem::size_of::(), + ); + if addr_or_port_received { + return Ok(()); + } else { + addr_or_port_received = true + } + } + _ => {} + } + cmsg = libc::CMSG_NXTHDR(msg, cmsg); + } + let err = Error::new(ErrorKind::InvalidData, "missing destination address in msghdr"); + Err(err) + })?; + + Ok(addr.as_socket().expect("SocketAddr")) + } +} + +fn recv_dest_from(socket: &UdpSocket, buf: &mut [u8]) -> io::Result<(usize, SocketAddr, SocketAddr)> { + unsafe { + let mut control_buf = [0u8; 64]; + let mut src_addr: libc::sockaddr_storage = mem::zeroed(); + + let mut msg: libc::msghdr = mem::zeroed(); + msg.msg_name = &mut src_addr as *mut _ as *mut _; + msg.msg_namelen = mem::size_of_val(&src_addr) as libc::socklen_t; + + let mut iov = libc::iovec { + iov_base: buf.as_mut_ptr() as *mut _, + iov_len: buf.len() as libc::size_t, + }; + msg.msg_iov = &mut iov; + msg.msg_iovlen = 1; + + msg.msg_control = control_buf.as_mut_ptr() as *mut _; + msg.msg_controllen = control_buf.len() as libc::socklen_t; + + let fd = socket.as_raw_fd(); + let ret = libc::recvmsg(fd, &mut msg, 0); + if ret < 0 { + return Err(Error::last_os_error()); + } + + let (_, src_saddr) = SockAddr::try_init(|a, l| { + ptr::copy_nonoverlapping(msg.msg_name, a as *mut _, msg.msg_namelen as usize); + *l = msg.msg_namelen; + Ok(()) + })?; + + Ok(( + ret as usize, + src_saddr.as_socket().expect("SocketAddr"), + get_destination_addr(&msg)?, + )) + } +} From 4e295818e5910e1e29421877cd1eea178ee65922 Mon Sep 17 00:00:00 2001 From: Yuwei Ba Date: Sat, 21 Sep 2024 02:02:55 +1000 Subject: [PATCH 02/18] take arbitrary IO for udp proxy (#1641) * udp relay * refact * reset * Update crates/shadowsocks/src/relay/udprelay/proxy_socket.rs * export trait --- .../shadowsocks-service/src/net/mon_socket.rs | 7 +- crates/shadowsocks/src/net/udp.rs | 4 +- .../shadowsocks/src/relay/udprelay/compat.rs | 88 +++++++++++++++++ crates/shadowsocks/src/relay/udprelay/mod.rs | 2 + .../src/relay/udprelay/proxy_socket.rs | 94 ++++++++++++------- 5 files changed, 154 insertions(+), 41 deletions(-) create mode 100644 crates/shadowsocks/src/relay/udprelay/compat.rs diff --git a/crates/shadowsocks-service/src/net/mon_socket.rs b/crates/shadowsocks-service/src/net/mon_socket.rs index 7bf541d2fe13..8b2bebdfca2f 100644 --- a/crates/shadowsocks-service/src/net/mon_socket.rs +++ b/crates/shadowsocks-service/src/net/mon_socket.rs @@ -6,7 +6,6 @@ use shadowsocks::{ relay::{socks5::Address, udprelay::options::UdpSocketControlData}, ProxySocket, }; -use tokio::net::ToSocketAddrs; use super::flow::FlowStat; @@ -47,7 +46,7 @@ impl MonProxySocket { /// Send a UDP packet to target from proxy #[inline] - pub async fn send_to(&self, target: A, addr: &Address, payload: &[u8]) -> io::Result<()> { + pub async fn send_to(&self, target: SocketAddr, addr: &Address, payload: &[u8]) -> io::Result<()> { let n = self.socket.send_to(target, addr, payload).await?; self.flow_stat.incr_tx(n as u64); @@ -56,9 +55,9 @@ impl MonProxySocket { /// Send a UDP packet to target from proxy #[inline] - pub async fn send_to_with_ctrl( + pub async fn send_to_with_ctrl( &self, - target: A, + target: SocketAddr, addr: &Address, control: &UdpSocketControlData, payload: &[u8], diff --git a/crates/shadowsocks/src/net/udp.rs b/crates/shadowsocks/src/net/udp.rs index 3a8acc2d44b4..d1b788d658cb 100644 --- a/crates/shadowsocks/src/net/udp.rs +++ b/crates/shadowsocks/src/net/udp.rs @@ -24,7 +24,7 @@ use std::{ ))] use futures::future; use futures::ready; -use pin_project::pin_project; + #[cfg(any( target_os = "linux", target_os = "android", @@ -86,9 +86,7 @@ fn make_mtu_error(packet_size: usize, mtu: usize) -> io::Error { /// Wrappers for outbound `UdpSocket` #[derive(Debug)] -#[pin_project] pub struct UdpSocket { - #[pin] socket: tokio::net::UdpSocket, mtu: Option, } diff --git a/crates/shadowsocks/src/relay/udprelay/compat.rs b/crates/shadowsocks/src/relay/udprelay/compat.rs new file mode 100644 index 000000000000..7245ae0e31ba --- /dev/null +++ b/crates/shadowsocks/src/relay/udprelay/compat.rs @@ -0,0 +1,88 @@ +use async_trait::async_trait; +use std::{ + io::Result, + net::SocketAddr, + ops::Deref, + task::{Context, Poll}, +}; +use tokio::io::ReadBuf; + +use crate::net::UdpSocket; + +/// a trait for datagram transport that wraps around a tokio `UdpSocket` +#[async_trait] +pub trait DatagramTransport: Send + Sync + std::fmt::Debug { + async fn recv(&self, buf: &mut [u8]) -> Result; + async fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>; + + async fn send(&self, buf: &[u8]) -> Result; + async fn send_to(&self, buf: &[u8], target: SocketAddr) -> Result; + + fn poll_recv(&self, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll>; + fn poll_recv_from(&self, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll>; + fn poll_recv_ready(&self, cx: &mut Context<'_>) -> Poll>; + + fn poll_send(&self, cx: &mut Context<'_>, buf: &[u8]) -> Poll>; + fn poll_send_to(&self, cx: &mut Context<'_>, buf: &[u8], target: SocketAddr) -> Poll>; + fn poll_send_ready(&self, cx: &mut Context<'_>) -> Poll>; + + fn local_addr(&self) -> Result; + + #[cfg(unix)] + fn as_raw_fd(&self) -> std::os::fd::RawFd; +} + +#[async_trait] +impl DatagramTransport for UdpSocket { + async fn recv(&self, buf: &mut [u8]) -> Result { + UdpSocket::recv(self, buf).await + } + + async fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)> { + UdpSocket::recv_from(self, buf).await + } + + async fn send(&self, buf: &[u8]) -> Result { + UdpSocket::send(self, buf).await + } + + async fn send_to(&self, buf: &[u8], target: SocketAddr) -> Result { + UdpSocket::send_to(self, buf, target).await + } + + fn poll_recv(&self, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll> { + UdpSocket::poll_recv(self, cx, buf) + } + + fn poll_recv_from(&self, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll> { + UdpSocket::poll_recv_from(self, cx, buf) + } + + fn poll_recv_ready(&self, cx: &mut Context<'_>) -> Poll> { + self.deref().poll_recv_ready(cx) + } + + fn poll_send(&self, cx: &mut Context<'_>, buf: &[u8]) -> Poll> { + UdpSocket::poll_send(self, cx, buf) + } + + fn poll_send_to(&self, cx: &mut Context<'_>, buf: &[u8], target: SocketAddr) -> Poll> { + UdpSocket::poll_send_to(self, cx, buf, target) + } + + fn poll_send_ready(&self, cx: &mut Context<'_>) -> Poll> { + self.deref().poll_send_ready(cx) + } + + fn local_addr(&self) -> Result { + self.deref().local_addr() + } + + #[cfg(unix)] + fn as_raw_fd(&self) -> std::os::fd::RawFd { + use std::ops::Deref; + use std::os::fd::AsRawFd; + + self.deref().as_raw_fd() + } +} diff --git a/crates/shadowsocks/src/relay/udprelay/mod.rs b/crates/shadowsocks/src/relay/udprelay/mod.rs index dc22d0d39784..c445d77f29e8 100644 --- a/crates/shadowsocks/src/relay/udprelay/mod.rs +++ b/crates/shadowsocks/src/relay/udprelay/mod.rs @@ -50,10 +50,12 @@ use std::time::Duration; pub use self::proxy_socket::ProxySocket; +pub use compat::DatagramTransport; mod aead; #[cfg(feature = "aead-cipher-2022")] mod aead_2022; +mod compat; pub mod crypto_io; pub mod options; pub mod proxy_socket; diff --git a/crates/shadowsocks/src/relay/udprelay/proxy_socket.rs b/crates/shadowsocks/src/relay/udprelay/proxy_socket.rs index 5fdc647d85fa..431719713a0d 100644 --- a/crates/shadowsocks/src/relay/udprelay/proxy_socket.rs +++ b/crates/shadowsocks/src/relay/udprelay/proxy_socket.rs @@ -12,7 +12,7 @@ use byte_string::ByteStr; use bytes::{Bytes, BytesMut}; use log::{info, trace, warn}; use once_cell::sync::Lazy; -use tokio::{io::ReadBuf, net::ToSocketAddrs, time}; +use tokio::{io::ReadBuf, time}; use crate::{ config::{ServerAddr, ServerConfig, ServerUserManager}, @@ -22,9 +22,12 @@ use crate::{ relay::{socks5::Address, udprelay::options::UdpSocketControlData}, }; -use super::crypto_io::{ - decrypt_client_payload, decrypt_server_payload, encrypt_client_payload, encrypt_server_payload, ProtocolError, - ProtocolResult, +use super::{ + compat::DatagramTransport, + crypto_io::{ + decrypt_client_payload, decrypt_server_payload, encrypt_client_payload, encrypt_server_payload, ProtocolError, + ProtocolResult, + }, }; #[cfg(unix)] @@ -72,7 +75,7 @@ pub type ProxySocketResult = Result; #[derive(Debug)] pub struct ProxySocket { socket_type: UdpSocketType, - socket: ShadowUdpSocket, + io: Box, method: CipherKind, key: Box<[u8]>, send_timeout: Option, @@ -128,11 +131,40 @@ impl ProxySocket { let key = svr_cfg.key().to_vec().into_boxed_slice(); let method = svr_cfg.method(); + // NOTE: svr_cfg.timeout() is not for this socket, but for associations. + ProxySocket { + socket_type, + io: Box::new(socket.into()), + method, + key, + send_timeout: None, + recv_timeout: None, + context, + identity_keys: match socket_type { + UdpSocketType::Client => svr_cfg.clone_identity_keys(), + UdpSocketType::Server => Arc::new(Vec::new()), + }, + user_manager: match socket_type { + UdpSocketType::Client => None, + UdpSocketType::Server => svr_cfg.clone_user_manager(), + }, + } + } + + pub fn from_io( + socket_type: UdpSocketType, + context: SharedContext, + svr_cfg: &ServerConfig, + io: Box, + ) -> ProxySocket { + let key = svr_cfg.key().to_vec().into_boxed_slice(); + let method = svr_cfg.method(); + // NOTE: svr_cfg.timeout() is not for this socket, but for associations. ProxySocket { socket_type, - socket: socket.into(), + io, method, key, send_timeout: None, @@ -241,8 +273,8 @@ impl ProxySocket { ); let send_len = match self.send_timeout { - None => self.socket.send(&send_buf).await?, - Some(d) => match time::timeout(d, self.socket.send(&send_buf)).await { + None => self.io.send(&send_buf).await?, + Some(d) => match time::timeout(d, self.io.send(&send_buf)).await { Ok(Ok(l)) => l, Ok(Err(err)) => return Err(err.into()), Err(..) => return Err(io::Error::from(ErrorKind::TimedOut).into()), @@ -295,7 +327,7 @@ impl ProxySocket { let n_send_buf = send_buf.len(); - match self.socket.poll_send(cx, &send_buf).map_err(|x| x.into()) { + match self.io.poll_send(cx, &send_buf).map_err(|x| x.into()) { Poll::Ready(Ok(l)) => { if l == n_send_buf { Poll::Ready(Ok(payload.len())) @@ -340,14 +372,14 @@ impl ProxySocket { self.encrypt_send_buffer(addr, control, &self.identity_keys, payload, &mut send_buf)?; info!( - "UDP server client send to {}, payload length {} bytes, packet length {} bytes", + "UDP server client poll_send_to to {}, payload length {} bytes, packet length {} bytes", target, payload.len(), send_buf.len() ); let n_send_buf = send_buf.len(); - match self.socket.poll_send_to(cx, &send_buf, target).map_err(|x| x.into()) { + match self.io.poll_send_to(cx, &send_buf, target).map_err(|x| x.into()) { Poll::Ready(Ok(l)) => { if l == n_send_buf { Poll::Ready(Ok(payload.len())) @@ -363,25 +395,20 @@ impl ProxySocket { /// /// Check if socket is ready to `send`, or writable. pub fn poll_send_ready(&self, cx: &mut Context<'_>) -> Poll> { - self.socket.poll_send_ready(cx).map_err(|x| x.into()) + self.io.poll_send_ready(cx).map_err(|x| x.into()) } /// Send a UDP packet to target through proxy `target` - pub async fn send_to( - &self, - target: A, - addr: &Address, - payload: &[u8], - ) -> ProxySocketResult { + pub async fn send_to(&self, target: SocketAddr, addr: &Address, payload: &[u8]) -> ProxySocketResult { self.send_to_with_ctrl(target, addr, &DEFAULT_SOCKET_CONTROL, payload) .await .map_err(Into::into) } /// Send a UDP packet to target through proxy `target` - pub async fn send_to_with_ctrl( + pub async fn send_to_with_ctrl( &self, - target: A, + target: SocketAddr, addr: &Address, control: &UdpSocketControlData, payload: &[u8], @@ -390,7 +417,7 @@ impl ProxySocket { self.encrypt_send_buffer(addr, control, &self.identity_keys, payload, &mut send_buf)?; trace!( - "UDP server client send to, addr {}, control: {:?}, payload length {} bytes, packet length {} bytes", + "UDP server client send_to to, addr {}, control: {:?}, payload length {} bytes, packet length {} bytes", addr, control, payload.len(), @@ -398,8 +425,8 @@ impl ProxySocket { ); let send_len = match self.send_timeout { - None => self.socket.send_to(&send_buf, target).await?, - Some(d) => match time::timeout(d, self.socket.send_to(&send_buf, target)).await { + None => self.io.send_to(&send_buf, target).await?, + Some(d) => match time::timeout(d, self.io.send_to(&send_buf, target)).await { Ok(Ok(l)) => l, Ok(Err(err)) => return Err(err.into()), Err(..) => return Err(io::Error::from(ErrorKind::TimedOut).into()), @@ -408,7 +435,7 @@ impl ProxySocket { if send_buf.len() != send_len { warn!( - "UDP server client send {} bytes, but actually sent {} bytes", + "UDP server client send_to {} bytes, but actually sent {} bytes", send_buf.len(), send_len ); @@ -448,10 +475,9 @@ impl ProxySocket { &self, recv_buf: &mut [u8], ) -> ProxySocketResult<(usize, Address, usize, Option)> { - // Waiting for response from server SERVER -> CLIENT let recv_n = match self.recv_timeout { - None => self.socket.recv(recv_buf).await?, - Some(d) => match time::timeout(d, self.socket.recv(recv_buf)).await { + None => self.io.recv(recv_buf).await?, + Some(d) => match time::timeout(d, self.io.recv(recv_buf)).await { Ok(Ok(l)) => l, Ok(Err(err)) => return Err(err.into()), Err(..) => return Err(io::Error::from(ErrorKind::TimedOut).into()), @@ -498,8 +524,8 @@ impl ProxySocket { ) -> ProxySocketResult<(usize, SocketAddr, Address, usize, Option)> { // Waiting for response from server SERVER -> CLIENT let (recv_n, target_addr) = match self.recv_timeout { - None => self.socket.recv_from(recv_buf).await?, - Some(d) => match time::timeout(d, self.socket.recv_from(recv_buf)).await { + None => self.io.recv_from(recv_buf).await?, + Some(d) => match time::timeout(d, self.io.recv_from(recv_buf)).await { Ok(Ok(l)) => l, Ok(Err(err)) => return Err(err.into()), Err(..) => return Err(io::Error::from(ErrorKind::TimedOut).into()), @@ -542,7 +568,7 @@ impl ProxySocket { cx: &mut Context<'_>, recv_buf: &mut ReadBuf, ) -> Poll)>> { - ready!(self.socket.poll_recv(cx, recv_buf))?; + ready!(self.io.poll_recv(cx, recv_buf))?; let n_recv = recv_buf.filled().len(); @@ -570,7 +596,7 @@ impl ProxySocket { cx: &mut Context<'_>, recv_buf: &mut ReadBuf, ) -> Poll)>> { - let src = ready!(self.socket.poll_recv_from(cx, recv_buf))?; + let src = ready!(self.io.poll_recv_from(cx, recv_buf))?; let n_recv = recv_buf.filled().len(); match self.decrypt_recv_buffer(recv_buf.filled_mut(), self.user_manager.as_deref()) { @@ -581,12 +607,12 @@ impl ProxySocket { /// poll family functions pub fn poll_recv_ready(&self, cx: &mut Context<'_>) -> Poll> { - self.socket.poll_recv_ready(cx).map_err(|x| x.into()) + self.io.poll_recv_ready(cx).map_err(|x| x.into()) } /// Get local addr of socket pub fn local_addr(&self) -> io::Result { - self.socket.local_addr() + self.io.local_addr() } /// Set `send` timeout, `None` will clear timeout @@ -604,6 +630,6 @@ impl ProxySocket { impl AsRawFd for ProxySocket { /// Retrieve raw fd of the outbound socket fn as_raw_fd(&self) -> RawFd { - self.socket.as_raw_fd() + self.io.as_raw_fd() } } From 60d0576b2677a92c227ebb90e0f6a28cfb951fe2 Mon Sep 17 00:00:00 2001 From: zonyitoo Date: Fri, 20 Sep 2024 00:56:13 +0800 Subject: [PATCH 03/18] feat(shadowsocks): DatagramTransport & DatagramTransportExt ProxySocket and MonProxySocket accepts socket as a generic type that implements DatagramTransport. --- .../src/local/dns/upstream.rs | 2 +- .../src/local/net/udp/association.rs | 4 +- .../shadowsocks-service/src/net/mon_socket.rs | 40 ++-- .../src/server/udprelay.rs | 19 +- .../shadowsocks/src/relay/udprelay/compat.rs | 200 ++++++++++++++---- crates/shadowsocks/src/relay/udprelay/mod.rs | 2 +- .../src/relay/udprelay/proxy_socket.rs | 121 +++++------ crates/shadowsocks/tests/udp.rs | 3 +- 8 files changed, 246 insertions(+), 145 deletions(-) diff --git a/crates/shadowsocks-service/src/local/dns/upstream.rs b/crates/shadowsocks-service/src/local/dns/upstream.rs index 161f5d62cbe3..981f22e94404 100644 --- a/crates/shadowsocks-service/src/local/dns/upstream.rs +++ b/crates/shadowsocks-service/src/local/dns/upstream.rs @@ -61,7 +61,7 @@ pub enum DnsClient { stream: ProxyClientStream>, }, UdpRemote { - socket: MonProxySocket, + socket: MonProxySocket, ns: Address, control: UdpSocketControlData, server_windows: LruCache, diff --git a/crates/shadowsocks-service/src/local/net/udp/association.rs b/crates/shadowsocks-service/src/local/net/udp/association.rs index 210d23213126..5ca4da94c6cb 100644 --- a/crates/shadowsocks-service/src/local/net/udp/association.rs +++ b/crates/shadowsocks-service/src/local/net/udp/association.rs @@ -217,7 +217,7 @@ where peer_addr: SocketAddr, bypassed_ipv4_socket: Option, bypassed_ipv6_socket: Option, - proxied_socket: Option, + proxied_socket: Option>, keepalive_tx: mpsc::Sender, keepalive_flag: bool, balancer: PingBalancer, @@ -409,7 +409,7 @@ where #[inline] async fn receive_from_proxied_opt( - socket: &Option, + socket: &Option>, buf: &mut Vec, ) -> io::Result<(usize, Address, Option)> { match *socket { diff --git a/crates/shadowsocks-service/src/net/mon_socket.rs b/crates/shadowsocks-service/src/net/mon_socket.rs index 8b2bebdfca2f..00da5c7f81c7 100644 --- a/crates/shadowsocks-service/src/net/mon_socket.rs +++ b/crates/shadowsocks-service/src/net/mon_socket.rs @@ -3,24 +3,44 @@ use std::{io, net::SocketAddr, sync::Arc}; use shadowsocks::{ - relay::{socks5::Address, udprelay::options::UdpSocketControlData}, + relay::{ + socks5::Address, + udprelay::{options::UdpSocketControlData, DatagramTransport}, + }, ProxySocket, }; use super::flow::FlowStat; /// Monitored `ProxySocket` -pub struct MonProxySocket { - socket: ProxySocket, +pub struct MonProxySocket { + socket: ProxySocket, flow_stat: Arc, } -impl MonProxySocket { +impl MonProxySocket { /// Create a new socket with flow monitor - pub fn from_socket(socket: ProxySocket, flow_stat: Arc) -> MonProxySocket { + pub fn from_socket(socket: ProxySocket, flow_stat: Arc) -> MonProxySocket { MonProxySocket { socket, flow_stat } } + /// Get the underlying `ProxySocket` immutable reference + #[inline] + pub fn get_ref(&self) -> &ProxySocket { + &self.socket + } + + /// Get the flow statistic data + #[inline] + pub fn flow_stat(&self) -> &FlowStat { + &self.flow_stat + } +} + +impl MonProxySocket +where + S: DatagramTransport, +{ /// Send a UDP packet to addr through proxy #[inline] pub async fn send(&self, addr: &Address, payload: &[u8]) -> io::Result<()> { @@ -125,14 +145,4 @@ impl MonProxySocket { Ok((n, peer_addr, addr, control)) } - - #[inline] - pub fn get_ref(&self) -> &ProxySocket { - &self.socket - } - - #[inline] - pub fn flow_stat(&self) -> &FlowStat { - &self.flow_stat - } } diff --git a/crates/shadowsocks-service/src/server/udprelay.rs b/crates/shadowsocks-service/src/server/udprelay.rs index 32ec296468a4..5d64343b3f70 100644 --- a/crates/shadowsocks-service/src/server/udprelay.rs +++ b/crates/shadowsocks-service/src/server/udprelay.rs @@ -17,7 +17,10 @@ use shadowsocks::{ config::ServerUser, crypto::CipherCategory, lookup_then, - net::{get_ip_stack_capabilities, AcceptOpts, AddrFamily, UdpSocket as OutboundUdpSocket}, + net::{ + get_ip_stack_capabilities, AcceptOpts, AddrFamily, UdpSocket as OutboundUdpSocket, + UdpSocket as InboundUdpSocket, + }, relay::{ socks5::Address, udprelay::{options::UdpSocketControlData, ProxySocket, MAXIMUM_UDP_PAYLOAD_SIZE}, @@ -87,7 +90,7 @@ pub struct UdpServer { keepalive_tx: mpsc::Sender, keepalive_rx: mpsc::Receiver, time_to_live: Duration, - listener: Arc, + listener: Arc>, svr_cfg: ServerConfig, } @@ -276,7 +279,7 @@ impl UdpServer { async fn recv_one_packet( context: &ServiceContext, - l: &MonProxySocket, + l: &MonProxySocket, buffer: &mut [u8], ) -> Option<(usize, SocketAddr, Address, Option)> { let (n, peer_addr, target_addr, control) = match l.recv_from_with_ctrl(buffer).await { @@ -316,7 +319,7 @@ impl UdpServer { async fn send_packet( &mut self, - listener: &Arc, + listener: &Arc>, peer_addr: SocketAddr, target_addr: Address, control: Option, @@ -394,7 +397,7 @@ impl Drop for UdpAssociation { impl UdpAssociation { fn new_association( context: Arc, - inbound: Arc, + inbound: Arc>, peer_addr: SocketAddr, keepalive_tx: mpsc::Sender, ) -> UdpAssociation { @@ -405,7 +408,7 @@ impl UdpAssociation { #[cfg(feature = "aead-cipher-2022")] fn new_session( context: Arc, - inbound: Arc, + inbound: Arc>, peer_addr: SocketAddr, keepalive_tx: mpsc::Sender, client_session_id: u64, @@ -447,7 +450,7 @@ struct UdpAssociationContext { outbound_ipv6_socket: Option, keepalive_tx: mpsc::Sender, keepalive_flag: bool, - inbound: Arc, + inbound: Arc>, // AEAD 2022 client_session: Option, server_session_id: u64, @@ -472,7 +475,7 @@ fn generate_server_session_id() -> u64 { impl UdpAssociationContext { fn create( context: Arc, - inbound: Arc, + inbound: Arc>, peer_addr: SocketAddr, keepalive_tx: mpsc::Sender, client_session_id: Option, diff --git a/crates/shadowsocks/src/relay/udprelay/compat.rs b/crates/shadowsocks/src/relay/udprelay/compat.rs index 7245ae0e31ba..4e5a2736c3bb 100644 --- a/crates/shadowsocks/src/relay/udprelay/compat.rs +++ b/crates/shadowsocks/src/relay/udprelay/compat.rs @@ -1,88 +1,194 @@ -use async_trait::async_trait; use std::{ - io::Result, + future::Future, + io, net::SocketAddr, ops::Deref, + pin::Pin, task::{Context, Poll}, }; + +use futures::ready; +use pin_project::pin_project; use tokio::io::ReadBuf; use crate::net::UdpSocket; /// a trait for datagram transport that wraps around a tokio `UdpSocket` -#[async_trait] -pub trait DatagramTransport: Send + Sync + std::fmt::Debug { - async fn recv(&self, buf: &mut [u8]) -> Result; - async fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>; +pub trait DatagramTransport { + /// Local binded address + fn local_addr(&self) -> io::Result; + + /// `recv` data into `buf` + fn poll_recv(&self, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll>; + /// `recv` data into `buf` with source address + fn poll_recv_from(&self, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll>; + /// Check if the underlying I/O object is ready for `recv` + fn poll_recv_ready(&self, cx: &mut Context<'_>) -> Poll>; + + /// `send` data with `buf`, returning the sent bytes + fn poll_send(&self, cx: &mut Context<'_>, buf: &[u8]) -> Poll>; + /// `send` data with `buf` to `target`, returning the sent bytes + fn poll_send_to(&self, cx: &mut Context<'_>, buf: &[u8], target: SocketAddr) -> Poll>; + /// Check if the underlying I/O object is ready for `send` + fn poll_send_ready(&self, cx: &mut Context<'_>) -> Poll>; +} - async fn send(&self, buf: &[u8]) -> Result; - async fn send_to(&self, buf: &[u8], target: SocketAddr) -> Result; +impl DatagramTransport for UdpSocket { + fn poll_recv(&self, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll> { + UdpSocket::poll_recv(self, cx, buf) + } - fn poll_recv(&self, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll>; - fn poll_recv_from(&self, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll>; - fn poll_recv_ready(&self, cx: &mut Context<'_>) -> Poll>; + fn poll_recv_from(&self, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll> { + UdpSocket::poll_recv_from(self, cx, buf) + } - fn poll_send(&self, cx: &mut Context<'_>, buf: &[u8]) -> Poll>; - fn poll_send_to(&self, cx: &mut Context<'_>, buf: &[u8], target: SocketAddr) -> Poll>; - fn poll_send_ready(&self, cx: &mut Context<'_>) -> Poll>; + fn poll_recv_ready(&self, cx: &mut Context<'_>) -> Poll> { + self.deref().poll_recv_ready(cx) + } - fn local_addr(&self) -> Result; + fn poll_send(&self, cx: &mut Context<'_>, buf: &[u8]) -> Poll> { + UdpSocket::poll_send(self, cx, buf) + } - #[cfg(unix)] - fn as_raw_fd(&self) -> std::os::fd::RawFd; -} + fn poll_send_to(&self, cx: &mut Context<'_>, buf: &[u8], target: SocketAddr) -> Poll> { + UdpSocket::poll_send_to(self, cx, buf, target) + } -#[async_trait] -impl DatagramTransport for UdpSocket { - async fn recv(&self, buf: &mut [u8]) -> Result { - UdpSocket::recv(self, buf).await + fn poll_send_ready(&self, cx: &mut Context<'_>) -> Poll> { + self.deref().poll_send_ready(cx) } - async fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)> { - UdpSocket::recv_from(self, buf).await + fn local_addr(&self) -> io::Result { + self.deref().local_addr() } +} + +/// Future for `recv` +#[pin_project] +pub struct RecvFut<'a, S: DatagramTransport + ?Sized> { + #[pin] + io: &'a S, + buf: &'a mut [u8], +} + +impl<'a, S: DatagramTransport + ?Sized> Future for RecvFut<'a, S> { + type Output = io::Result; - async fn send(&self, buf: &[u8]) -> Result { - UdpSocket::send(self, buf).await + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + let this = self.project(); + + let mut read_buf = ReadBuf::new(this.buf); + ready!(this.io.poll_recv(cx, &mut read_buf))?; + Ok(read_buf.filled().len()).into() } +} + +/// Future for `recv_from` +#[pin_project] +pub struct RecvFromFut<'a, S: DatagramTransport + ?Sized> { + #[pin] + io: &'a S, + buf: &'a mut [u8], +} - async fn send_to(&self, buf: &[u8], target: SocketAddr) -> Result { - UdpSocket::send_to(self, buf, target).await +impl<'a, S: DatagramTransport + ?Sized> Future for RecvFromFut<'a, S> { + type Output = io::Result<(usize, SocketAddr)>; + + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + let this = self.project(); + + let mut read_buf = ReadBuf::new(this.buf); + let src_addr = ready!(this.io.poll_recv_from(cx, &mut read_buf))?; + Ok((read_buf.filled().len(), src_addr)).into() } +} - fn poll_recv(&self, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll> { - UdpSocket::poll_recv(self, cx, buf) +/// Future for `recv_ready` +pub struct RecvReadyFut<'a, S: DatagramTransport + ?Sized> { + io: &'a S, +} + +impl<'a, S: DatagramTransport + ?Sized> Future for RecvReadyFut<'a, S> { + type Output = io::Result<()>; + + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + self.io.poll_recv_ready(cx) } +} - fn poll_recv_from(&self, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll> { - UdpSocket::poll_recv_from(self, cx, buf) +/// Future for `send` +pub struct SendFut<'a, S: DatagramTransport + ?Sized> { + io: &'a S, + buf: &'a [u8], +} + +impl<'a, S: DatagramTransport + ?Sized> Future for SendFut<'a, S> { + type Output = io::Result; + + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + self.io.poll_send(cx, self.buf) } +} - fn poll_recv_ready(&self, cx: &mut Context<'_>) -> Poll> { - self.deref().poll_recv_ready(cx) +/// Future for `send_to` +pub struct SendToFut<'a, S: DatagramTransport + ?Sized> { + io: &'a S, + target: SocketAddr, + buf: &'a [u8], +} + +impl<'a, S: DatagramTransport + ?Sized> Future for SendToFut<'a, S> { + type Output = io::Result; + + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + self.io.poll_send_to(cx, self.buf, self.target) } +} - fn poll_send(&self, cx: &mut Context<'_>, buf: &[u8]) -> Poll> { - UdpSocket::poll_send(self, cx, buf) +/// Future for `recv_ready` +pub struct SendReadyFut<'a, S: DatagramTransport + ?Sized> { + io: &'a S, +} + +impl<'a, S: DatagramTransport + ?Sized> Future for SendReadyFut<'a, S> { + type Output = io::Result<()>; + + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + self.io.poll_recv_ready(cx) } +} - fn poll_send_to(&self, cx: &mut Context<'_>, buf: &[u8], target: SocketAddr) -> Poll> { - UdpSocket::poll_send_to(self, cx, buf, target) +/// Extension methods for `DatagramTransport` +pub trait DatagramTransportExt: DatagramTransport { + /// Async method for `poll_recv` + fn recv<'a, 'b>(&'a self, buf: &'a mut [u8]) -> RecvFut<'a, Self> { + RecvFut { io: self, buf } } - fn poll_send_ready(&self, cx: &mut Context<'_>) -> Poll> { - self.deref().poll_send_ready(cx) + /// Async method for `poll_recv_from` + fn recv_from<'a, 'b>(&'a self, buf: &'a mut [u8]) -> RecvFromFut<'a, Self> { + RecvFromFut { io: self, buf } } - fn local_addr(&self) -> Result { - self.deref().local_addr() + /// Async method for `poll_recv_ready` + fn recv_ready<'a>(&'a self) -> RecvReadyFut<'a, Self> { + RecvReadyFut { io: self } + } + + /// Async method for `poll_send` + fn send<'a>(&'a self, buf: &'a [u8]) -> SendFut<'a, Self> { + SendFut { io: self, buf } } - #[cfg(unix)] - fn as_raw_fd(&self) -> std::os::fd::RawFd { - use std::ops::Deref; - use std::os::fd::AsRawFd; + /// Async method for `poll_send_to` + fn send_to<'a>(&'a self, buf: &'a [u8], target: SocketAddr) -> SendToFut<'a, Self> { + SendToFut { io: self, target, buf } + } - self.deref().as_raw_fd() + /// Async method for `poll_send_ready` + fn send_ready<'a>(&'a self) -> SendReadyFut<'a, Self> { + SendReadyFut { io: self } } } + +impl DatagramTransportExt for S {} diff --git a/crates/shadowsocks/src/relay/udprelay/mod.rs b/crates/shadowsocks/src/relay/udprelay/mod.rs index c445d77f29e8..85d6eeafe365 100644 --- a/crates/shadowsocks/src/relay/udprelay/mod.rs +++ b/crates/shadowsocks/src/relay/udprelay/mod.rs @@ -50,7 +50,7 @@ use std::time::Duration; pub use self::proxy_socket::ProxySocket; -pub use compat::DatagramTransport; +pub use compat::{DatagramTransport, DatagramTransportExt}; mod aead; #[cfg(feature = "aead-cipher-2022")] diff --git a/crates/shadowsocks/src/relay/udprelay/proxy_socket.rs b/crates/shadowsocks/src/relay/udprelay/proxy_socket.rs index 431719713a0d..55b31fbd3351 100644 --- a/crates/shadowsocks/src/relay/udprelay/proxy_socket.rs +++ b/crates/shadowsocks/src/relay/udprelay/proxy_socket.rs @@ -23,7 +23,7 @@ use crate::{ }; use super::{ - compat::DatagramTransport, + compat::{DatagramTransport, DatagramTransportExt}, crypto_io::{ decrypt_client_payload, decrypt_server_payload, encrypt_client_payload, encrypt_server_payload, ProtocolError, ProtocolResult, @@ -73,9 +73,9 @@ pub type ProxySocketResult = Result; /// UDP client for communicating with ShadowSocks' server #[derive(Debug)] -pub struct ProxySocket { +pub struct ProxySocket { socket_type: UdpSocketType, - io: Box, + io: S, method: CipherKind, key: Box<[u8]>, send_timeout: Option, @@ -85,9 +85,12 @@ pub struct ProxySocket { user_manager: Option>, } -impl ProxySocket { +impl ProxySocket { /// Create a client to communicate with Shadowsocks' UDP server (outbound) - pub async fn connect(context: SharedContext, svr_cfg: &ServerConfig) -> ProxySocketResult { + pub async fn connect( + context: SharedContext, + svr_cfg: &ServerConfig, + ) -> ProxySocketResult> { ProxySocket::connect_with_opts(context, svr_cfg, &DEFAULT_CONNECT_OPTS) .await .map_err(Into::into) @@ -98,7 +101,7 @@ impl ProxySocket { context: SharedContext, svr_cfg: &ServerConfig, opts: &ConnectOpts, - ) -> ProxySocketResult { + ) -> ProxySocketResult> { // Note: Plugins doesn't support UDP relay let socket = ShadowUdpSocket::connect_server_with_opts(&context, svr_cfg.udp_external_addr(), opts).await?; @@ -118,53 +121,59 @@ impl ProxySocket { )) } - /// Create a `ProxySocket` from a `UdpSocket` - pub fn from_socket( - socket_type: UdpSocketType, + /// Create a `ProxySocket` binding to a specific address (inbound) + pub async fn bind( context: SharedContext, svr_cfg: &ServerConfig, - socket: S, - ) -> ProxySocket - where - S: Into, - { - let key = svr_cfg.key().to_vec().into_boxed_slice(); - let method = svr_cfg.method(); + ) -> ProxySocketResult> { + ProxySocket::bind_with_opts(context, svr_cfg, AcceptOpts::default()) + .await + .map_err(Into::into) + } - // NOTE: svr_cfg.timeout() is not for this socket, but for associations. - ProxySocket { - socket_type, - io: Box::new(socket.into()), - method, - key, - send_timeout: None, - recv_timeout: None, + /// Create a `ProxySocket` binding to a specific address (inbound) + pub async fn bind_with_opts( + context: SharedContext, + svr_cfg: &ServerConfig, + opts: AcceptOpts, + ) -> ProxySocketResult> { + // Plugins doesn't support UDP + let socket = match svr_cfg.udp_external_addr() { + ServerAddr::SocketAddr(sa) => ShadowUdpSocket::listen_with_opts(sa, opts).await?, + ServerAddr::DomainName(domain, port) => { + lookup_then!(&context, domain, *port, |addr| { + ShadowUdpSocket::listen_with_opts(&addr, opts.clone()).await + })? + .1 + } + }; + Ok(ProxySocket::from_socket( + UdpSocketType::Server, context, - identity_keys: match socket_type { - UdpSocketType::Client => svr_cfg.clone_identity_keys(), - UdpSocketType::Server => Arc::new(Vec::new()), - }, - user_manager: match socket_type { - UdpSocketType::Client => None, - UdpSocketType::Server => svr_cfg.clone_user_manager(), - }, - } + svr_cfg, + socket, + )) } +} - pub fn from_io( +impl ProxySocket +where + S: DatagramTransport, +{ + /// Create a `ProxySocket` from a I/O object that impls `DatagramTransport` + pub fn from_socket( socket_type: UdpSocketType, context: SharedContext, svr_cfg: &ServerConfig, - io: Box, - ) -> ProxySocket { + socket: S, + ) -> ProxySocket { let key = svr_cfg.key().to_vec().into_boxed_slice(); let method = svr_cfg.method(); // NOTE: svr_cfg.timeout() is not for this socket, but for associations. - ProxySocket { socket_type, - io, + io: socket, method, key, send_timeout: None, @@ -181,37 +190,6 @@ impl ProxySocket { } } - /// Create a `ProxySocket` binding to a specific address (inbound) - pub async fn bind(context: SharedContext, svr_cfg: &ServerConfig) -> ProxySocketResult { - ProxySocket::bind_with_opts(context, svr_cfg, AcceptOpts::default()) - .await - .map_err(Into::into) - } - - /// Create a `ProxySocket` binding to a specific address (inbound) - pub async fn bind_with_opts( - context: SharedContext, - svr_cfg: &ServerConfig, - opts: AcceptOpts, - ) -> ProxySocketResult { - // Plugins doesn't support UDP - let socket = match svr_cfg.udp_external_addr() { - ServerAddr::SocketAddr(sa) => ShadowUdpSocket::listen_with_opts(sa, opts).await?, - ServerAddr::DomainName(domain, port) => { - lookup_then!(&context, domain, *port, |addr| { - ShadowUdpSocket::listen_with_opts(&addr, opts.clone()).await - })? - .1 - } - }; - Ok(ProxySocket::from_socket( - UdpSocketType::Server, - context, - svr_cfg, - socket, - )) - } - fn encrypt_send_buffer( &self, addr: &Address, @@ -627,7 +605,10 @@ impl ProxySocket { } #[cfg(unix)] -impl AsRawFd for ProxySocket { +impl AsRawFd for ProxySocket +where + S: AsRawFd, +{ /// Retrieve raw fd of the outbound socket fn as_raw_fd(&self) -> RawFd { self.io.as_raw_fd() diff --git a/crates/shadowsocks/tests/udp.rs b/crates/shadowsocks/tests/udp.rs index 1895215d5f39..732af6bc44d2 100644 --- a/crates/shadowsocks/tests/udp.rs +++ b/crates/shadowsocks/tests/udp.rs @@ -8,6 +8,7 @@ use shadowsocks::{ config::{ServerConfig, ServerType}, context::{Context, SharedContext}, crypto::CipherKind, + net::UdpSocket as ShadowUdpSocket, relay::{socks5::Address, udprelay::ProxySocket}, }; @@ -15,7 +16,7 @@ async fn handle_udp_server_client( peer_addr: SocketAddr, remote_addr: Address, payload: &[u8], - socket: &ProxySocket, + socket: &ProxySocket, ) -> io::Result<()> { let remote_socket = UdpSocket::bind("0.0.0.0:0").await?; From 0ce6cb333bd559f4d99cd2f336c0db6e5035401b Mon Sep 17 00:00:00 2001 From: zonyitoo Date: Sat, 21 Sep 2024 00:20:31 +0800 Subject: [PATCH 04/18] feat(shadowsocks): splits DatagramTransport into DatagramSocket, DatagramSend, DatagramReceive --- .../shadowsocks-service/src/net/mon_socket.rs | 9 ++- .../shadowsocks/src/relay/udprelay/compat.rs | 61 ++++++++++++------- crates/shadowsocks/src/relay/udprelay/mod.rs | 2 +- .../src/relay/udprelay/proxy_socket.rs | 42 ++++++++----- 4 files changed, 73 insertions(+), 41 deletions(-) diff --git a/crates/shadowsocks-service/src/net/mon_socket.rs b/crates/shadowsocks-service/src/net/mon_socket.rs index 00da5c7f81c7..3ba055a4db1e 100644 --- a/crates/shadowsocks-service/src/net/mon_socket.rs +++ b/crates/shadowsocks-service/src/net/mon_socket.rs @@ -5,7 +5,7 @@ use std::{io, net::SocketAddr, sync::Arc}; use shadowsocks::{ relay::{ socks5::Address, - udprelay::{options::UdpSocketControlData, DatagramTransport}, + udprelay::{options::UdpSocketControlData, DatagramReceive, DatagramSend}, }, ProxySocket, }; @@ -39,7 +39,7 @@ impl MonProxySocket { impl MonProxySocket where - S: DatagramTransport, + S: DatagramSend, { /// Send a UDP packet to addr through proxy #[inline] @@ -87,7 +87,12 @@ where Ok(()) } +} +impl MonProxySocket +where + S: DatagramReceive, +{ /// Receive packet from Shadowsocks' UDP server /// /// This function will use `recv_buf` to store intermediate data, so it has to be big enough to store the whole shadowsocks' packet diff --git a/crates/shadowsocks/src/relay/udprelay/compat.rs b/crates/shadowsocks/src/relay/udprelay/compat.rs index 4e5a2736c3bb..1d9914dfb957 100644 --- a/crates/shadowsocks/src/relay/udprelay/compat.rs +++ b/crates/shadowsocks/src/relay/udprelay/compat.rs @@ -13,18 +13,24 @@ use tokio::io::ReadBuf; use crate::net::UdpSocket; -/// a trait for datagram transport that wraps around a tokio `UdpSocket` -pub trait DatagramTransport { +/// A socket I/O object that can transport datagram +pub trait DatagramSocket { /// Local binded address fn local_addr(&self) -> io::Result; +} +/// A socket I/O object that can receive datagram +pub trait DatagramReceive { /// `recv` data into `buf` fn poll_recv(&self, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll>; /// `recv` data into `buf` with source address fn poll_recv_from(&self, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll>; /// Check if the underlying I/O object is ready for `recv` fn poll_recv_ready(&self, cx: &mut Context<'_>) -> Poll>; +} +/// A socket I/O object that can send datagram +pub trait DatagramSend { /// `send` data with `buf`, returning the sent bytes fn poll_send(&self, cx: &mut Context<'_>, buf: &[u8]) -> Poll>; /// `send` data with `buf` to `target`, returning the sent bytes @@ -33,7 +39,13 @@ pub trait DatagramTransport { fn poll_send_ready(&self, cx: &mut Context<'_>) -> Poll>; } -impl DatagramTransport for UdpSocket { +impl DatagramSocket for UdpSocket { + fn local_addr(&self) -> io::Result { + self.deref().local_addr() + } +} + +impl DatagramReceive for UdpSocket { fn poll_recv(&self, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll> { UdpSocket::poll_recv(self, cx, buf) } @@ -45,7 +57,9 @@ impl DatagramTransport for UdpSocket { fn poll_recv_ready(&self, cx: &mut Context<'_>) -> Poll> { self.deref().poll_recv_ready(cx) } +} +impl DatagramSend for UdpSocket { fn poll_send(&self, cx: &mut Context<'_>, buf: &[u8]) -> Poll> { UdpSocket::poll_send(self, cx, buf) } @@ -57,21 +71,17 @@ impl DatagramTransport for UdpSocket { fn poll_send_ready(&self, cx: &mut Context<'_>) -> Poll> { self.deref().poll_send_ready(cx) } - - fn local_addr(&self) -> io::Result { - self.deref().local_addr() - } } /// Future for `recv` #[pin_project] -pub struct RecvFut<'a, S: DatagramTransport + ?Sized> { +pub struct RecvFut<'a, S: DatagramReceive + ?Sized> { #[pin] io: &'a S, buf: &'a mut [u8], } -impl<'a, S: DatagramTransport + ?Sized> Future for RecvFut<'a, S> { +impl<'a, S: DatagramReceive + ?Sized> Future for RecvFut<'a, S> { type Output = io::Result; fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { @@ -85,13 +95,13 @@ impl<'a, S: DatagramTransport + ?Sized> Future for RecvFut<'a, S> { /// Future for `recv_from` #[pin_project] -pub struct RecvFromFut<'a, S: DatagramTransport + ?Sized> { +pub struct RecvFromFut<'a, S: DatagramReceive + ?Sized> { #[pin] io: &'a S, buf: &'a mut [u8], } -impl<'a, S: DatagramTransport + ?Sized> Future for RecvFromFut<'a, S> { +impl<'a, S: DatagramReceive + ?Sized> Future for RecvFromFut<'a, S> { type Output = io::Result<(usize, SocketAddr)>; fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { @@ -104,11 +114,11 @@ impl<'a, S: DatagramTransport + ?Sized> Future for RecvFromFut<'a, S> { } /// Future for `recv_ready` -pub struct RecvReadyFut<'a, S: DatagramTransport + ?Sized> { +pub struct RecvReadyFut<'a, S: DatagramReceive + ?Sized> { io: &'a S, } -impl<'a, S: DatagramTransport + ?Sized> Future for RecvReadyFut<'a, S> { +impl<'a, S: DatagramReceive + ?Sized> Future for RecvReadyFut<'a, S> { type Output = io::Result<()>; fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { @@ -117,12 +127,12 @@ impl<'a, S: DatagramTransport + ?Sized> Future for RecvReadyFut<'a, S> { } /// Future for `send` -pub struct SendFut<'a, S: DatagramTransport + ?Sized> { +pub struct SendFut<'a, S: DatagramSend + ?Sized> { io: &'a S, buf: &'a [u8], } -impl<'a, S: DatagramTransport + ?Sized> Future for SendFut<'a, S> { +impl<'a, S: DatagramSend + ?Sized> Future for SendFut<'a, S> { type Output = io::Result; fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { @@ -131,13 +141,13 @@ impl<'a, S: DatagramTransport + ?Sized> Future for SendFut<'a, S> { } /// Future for `send_to` -pub struct SendToFut<'a, S: DatagramTransport + ?Sized> { +pub struct SendToFut<'a, S: DatagramSend + ?Sized> { io: &'a S, target: SocketAddr, buf: &'a [u8], } -impl<'a, S: DatagramTransport + ?Sized> Future for SendToFut<'a, S> { +impl<'a, S: DatagramSend + ?Sized> Future for SendToFut<'a, S> { type Output = io::Result; fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { @@ -146,20 +156,20 @@ impl<'a, S: DatagramTransport + ?Sized> Future for SendToFut<'a, S> { } /// Future for `recv_ready` -pub struct SendReadyFut<'a, S: DatagramTransport + ?Sized> { +pub struct SendReadyFut<'a, S: DatagramSend + ?Sized> { io: &'a S, } -impl<'a, S: DatagramTransport + ?Sized> Future for SendReadyFut<'a, S> { +impl<'a, S: DatagramSend + ?Sized> Future for SendReadyFut<'a, S> { type Output = io::Result<()>; fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - self.io.poll_recv_ready(cx) + self.io.poll_send_ready(cx) } } -/// Extension methods for `DatagramTransport` -pub trait DatagramTransportExt: DatagramTransport { +/// Extension methods for `DatagramReceive` +pub trait DatagramReceiveExt: DatagramReceive { /// Async method for `poll_recv` fn recv<'a, 'b>(&'a self, buf: &'a mut [u8]) -> RecvFut<'a, Self> { RecvFut { io: self, buf } @@ -174,7 +184,12 @@ pub trait DatagramTransportExt: DatagramTransport { fn recv_ready<'a>(&'a self) -> RecvReadyFut<'a, Self> { RecvReadyFut { io: self } } +} + +impl DatagramReceiveExt for S {} +/// Extension methods for `DatagramSend` +pub trait DatagramSendExt: DatagramSend { /// Async method for `poll_send` fn send<'a>(&'a self, buf: &'a [u8]) -> SendFut<'a, Self> { SendFut { io: self, buf } @@ -191,4 +206,4 @@ pub trait DatagramTransportExt: DatagramTransport { } } -impl DatagramTransportExt for S {} +impl DatagramSendExt for S {} diff --git a/crates/shadowsocks/src/relay/udprelay/mod.rs b/crates/shadowsocks/src/relay/udprelay/mod.rs index 85d6eeafe365..e7700e7ecff1 100644 --- a/crates/shadowsocks/src/relay/udprelay/mod.rs +++ b/crates/shadowsocks/src/relay/udprelay/mod.rs @@ -50,7 +50,7 @@ use std::time::Duration; pub use self::proxy_socket::ProxySocket; -pub use compat::{DatagramTransport, DatagramTransportExt}; +pub use compat::{DatagramReceive, DatagramReceiveExt, DatagramSend, DatagramSendExt, DatagramSocket}; mod aead; #[cfg(feature = "aead-cipher-2022")] diff --git a/crates/shadowsocks/src/relay/udprelay/proxy_socket.rs b/crates/shadowsocks/src/relay/udprelay/proxy_socket.rs index 55b31fbd3351..2e69b647ba28 100644 --- a/crates/shadowsocks/src/relay/udprelay/proxy_socket.rs +++ b/crates/shadowsocks/src/relay/udprelay/proxy_socket.rs @@ -23,7 +23,7 @@ use crate::{ }; use super::{ - compat::{DatagramTransport, DatagramTransportExt}, + compat::{DatagramReceive, DatagramReceiveExt, DatagramSend, DatagramSendExt, DatagramSocket}, crypto_io::{ decrypt_client_payload, decrypt_server_payload, encrypt_client_payload, encrypt_server_payload, ProtocolError, ProtocolResult, @@ -156,10 +156,7 @@ impl ProxySocket { } } -impl ProxySocket -where - S: DatagramTransport, -{ +impl ProxySocket { /// Create a `ProxySocket` from a I/O object that impls `DatagramTransport` pub fn from_socket( socket_type: UdpSocketType, @@ -190,6 +187,21 @@ where } } + /// Set `send` timeout, `None` will clear timeout + pub fn set_send_timeout(&mut self, t: Option) { + self.send_timeout = t; + } + + /// Set `recv` timeout, `None` will clear timeout + pub fn set_recv_timeout(&mut self, t: Option) { + self.recv_timeout = t; + } +} + +impl ProxySocket +where + S: DatagramSend, +{ fn encrypt_send_buffer( &self, addr: &Address, @@ -421,7 +433,12 @@ where Ok(send_len) } +} +impl ProxySocket +where + S: DatagramReceive, +{ fn decrypt_recv_buffer( &self, recv_buf: &mut [u8], @@ -587,21 +604,16 @@ where pub fn poll_recv_ready(&self, cx: &mut Context<'_>) -> Poll> { self.io.poll_recv_ready(cx).map_err(|x| x.into()) } +} +impl ProxySocket +where + S: DatagramSocket, +{ /// Get local addr of socket pub fn local_addr(&self) -> io::Result { self.io.local_addr() } - - /// Set `send` timeout, `None` will clear timeout - pub fn set_send_timeout(&mut self, t: Option) { - self.send_timeout = t; - } - - /// Set `recv` timeout, `None` will clear timeout - pub fn set_recv_timeout(&mut self, t: Option) { - self.recv_timeout = t; - } } #[cfg(unix)] From 8c95ada0f7b288e0f1083348e98d40fec9a976e5 Mon Sep 17 00:00:00 2001 From: zonyitoo Date: Sun, 22 Sep 2024 08:29:19 +0800 Subject: [PATCH 05/18] feat(shadowsocks): impls As*Fd As*Socket for ProxySocket --- .../src/relay/udprelay/proxy_socket.rs | 57 ++++++++++++++++++- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/crates/shadowsocks/src/relay/udprelay/proxy_socket.rs b/crates/shadowsocks/src/relay/udprelay/proxy_socket.rs index 2e69b647ba28..5c1563ed7df7 100644 --- a/crates/shadowsocks/src/relay/udprelay/proxy_socket.rs +++ b/crates/shadowsocks/src/relay/udprelay/proxy_socket.rs @@ -1,5 +1,9 @@ //! UDP socket for communicating with shadowsocks' proxy server +#[cfg(unix)] +use std::os::fd::{AsFd, AsRawFd, BorrowedFd, IntoRawFd, RawFd}; +#[cfg(windows)] +use std::os::windows::io::{AsRawSocket, AsSocket, BorrowedSocket, IntoRawSocket, RawSocket}; use std::{ io::{self, ErrorKind}, net::SocketAddr, @@ -30,9 +34,6 @@ use super::{ }, }; -#[cfg(unix)] -use std::os::fd::{AsRawFd, RawFd}; - static DEFAULT_CONNECT_OPTS: Lazy = Lazy::new(Default::default); static DEFAULT_SOCKET_CONTROL: Lazy = Lazy::new(UdpSocketControlData::default); @@ -626,3 +627,53 @@ where self.io.as_raw_fd() } } + +#[cfg(unix)] +impl AsFd for ProxySocket +where + S: AsFd, +{ + fn as_fd(&self) -> BorrowedFd<'_> { + self.io.as_fd() + } +} + +#[cfg(unix)] +impl IntoRawFd for ProxySocket +where + S: IntoRawFd, +{ + fn into_raw_fd(self) -> RawFd { + self.io.into_raw_fd() + } +} + +#[cfg(windows)] +impl AsRawSocket for ProxySocket +where + S: AsRawSocket, +{ + fn as_raw_socket(&self) -> RawSocket { + self.io.as_raw_socket() + } +} + +#[cfg(windows)] +impl AsSocket for ProxySocket +where + S: AsSocket, +{ + fn as_socket(&self) -> BorrowedSocket<'_> { + self.io.as_socket() + } +} + +#[cfg(windows)] +impl IntoRawSocket for ProxySocket +where + S: IntoRawSocket, +{ + fn into_raw_socket(self) -> RawSocket { + self.io.into_raw_socket() + } +} From bf798a5922b2158b9ca55f78efbdf43893a1d5f5 Mon Sep 17 00:00:00 2001 From: ty Date: Sun, 22 Sep 2024 08:41:53 +0800 Subject: [PATCH 06/18] chore: dependabot checks daily --- .github/dependabot.yml | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e9c9a377f58e..df4f01e8a72f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,24 +3,4 @@ updates: - package-ecosystem: cargo directory: "/" schedule: - interval: weekly - open-pull-requests-limit: 10 - ignore: - - dependency-name: libc - versions: - - 0.2.92 - - dependency-name: tokio - versions: - - 1.4.0 - - dependency-name: bloomfilter - versions: - - 1.0.5 - - dependency-name: regex - versions: - - 1.4.5 - - dependency-name: serde - versions: - - 1.0.124 - - dependency-name: tower - versions: - - 0.4.6 + interval: daily From d722c306e415505e1a2a921b54e4147ea2299bca Mon Sep 17 00:00:00 2001 From: ty Date: Sun, 22 Sep 2024 08:48:30 +0800 Subject: [PATCH 07/18] feat: dependabot allow opening 50 PRs --- .github/dependabot.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index df4f01e8a72f..42e736cdfb38 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,3 +4,4 @@ updates: directory: "/" schedule: interval: daily + open-pull-requests-limit: 50 From 9814195b9e5907c91b11392db4758b6a1030c6c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Sep 2024 01:14:15 +0000 Subject: [PATCH 08/18] chore(deps): bump bytes from 1.7.1 to 1.7.2 (#1664) --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 35c1692e0e7e..dc09a09a1bc5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -451,9 +451,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.1" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" [[package]] name = "c2rust-bitfields" From 7426a461d1be22d56f900aa9490305d99da2c300 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Sep 2024 01:30:49 +0000 Subject: [PATCH 09/18] chore(deps): bump serde from 1.0.209 to 1.0.210 (#1659) --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dc09a09a1bc5..f3accf66b416 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3181,9 +3181,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.209" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] @@ -3209,9 +3209,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.209" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", From 5e2bbece1980a003d10d26fda04c747c9899cd17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Sep 2024 01:49:38 +0000 Subject: [PATCH 10/18] chore(deps): bump etherparse from 0.15.0 to 0.16.0 (#1660) --- Cargo.lock | 4 ++-- crates/shadowsocks-service/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f3accf66b416..24c6f6423cce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -948,9 +948,9 @@ dependencies = [ [[package]] name = "etherparse" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21696e6dfe1057a166a042c6d27b89a46aad2ee1003e6e1e03c49d54fd3270d7" +checksum = "b8d8a704b617484e9d867a0423cd45f7577f008c4068e2e33378f8d3860a6d73" dependencies = [ "arrayvec", ] diff --git a/crates/shadowsocks-service/Cargo.toml b/crates/shadowsocks-service/Cargo.toml index 44f2654bd846..2ba5d66ae1ce 100644 --- a/crates/shadowsocks-service/Cargo.toml +++ b/crates/shadowsocks-service/Cargo.toml @@ -189,7 +189,7 @@ zstd = { version = "0.13", optional = true } tun2 = { version = "3.1.4", optional = true, default-features = false, features = [ "async", ] } -etherparse = { version = "0.15", optional = true } +etherparse = { version = "0.16", optional = true } smoltcp = { version = "0.11", optional = true, default-features = false, features = [ "std", "log", From d0c117353d2cabf37a08d1a9c766f61ebd413815 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Sep 2024 02:07:16 +0000 Subject: [PATCH 11/18] chore(deps): bump webpki-roots from 0.26.5 to 0.26.6 (#1662) --- Cargo.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 24c6f6423cce..64688c6c89e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1540,7 +1540,7 @@ dependencies = [ "tokio", "tokio-rustls 0.26.0", "tower-service", - "webpki-roots 0.26.5", + "webpki-roots 0.26.6", ] [[package]] @@ -2847,7 +2847,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.26.5", + "webpki-roots 0.26.6", "windows-registry", ] @@ -3432,7 +3432,7 @@ dependencies = [ "tokio-native-tls", "tokio-rustls 0.26.0", "tun2", - "webpki-roots 0.26.5", + "webpki-roots 0.26.6", "windows-sys 0.59.0", "zstd", ] @@ -4267,9 +4267,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.26.5" +version = "0.26.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" dependencies = [ "rustls-pki-types", ] From 609a238ab39a95a0729ffc08d99fe8268dc8bd33 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Sep 2024 02:25:00 +0000 Subject: [PATCH 12/18] chore(deps): bump bson from 2.12.0 to 2.13.0 (#1658) --- Cargo.lock | 4 ++-- crates/shadowsocks-service/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 64688c6c89e2..6ecf11df6e03 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -399,9 +399,9 @@ dependencies = [ [[package]] name = "bson" -version = "2.12.0" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80cf6f7806607bd58ad490bab34bf60e25455ea4aaf995f897a13324d41ea580" +checksum = "068208f2b6fcfa27a7f1ee37488d2bb8ba2640f68f5475d08e1d9130696aba59" dependencies = [ "ahash", "base64 0.13.1", diff --git a/crates/shadowsocks-service/Cargo.toml b/crates/shadowsocks-service/Cargo.toml index 2ba5d66ae1ce..7dff7bdd6be4 100644 --- a/crates/shadowsocks-service/Cargo.toml +++ b/crates/shadowsocks-service/Cargo.toml @@ -203,7 +203,7 @@ smoltcp = { version = "0.11", optional = true, default-features = false, feature serde = { version = "1.0", features = ["derive"] } json5 = "0.4" -bson = { version = "2.12.0", optional = true } +bson = { version = "2.13.0", optional = true } shadowsocks = { version = "1.20.2", path = "../shadowsocks", default-features = false } From 6e83a2e81ea6affda0afcdf361449a0f9c57b37d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Sep 2024 02:42:40 +0000 Subject: [PATCH 13/18] chore(deps): bump clap from 4.5.17 to 4.5.18 (#1661) --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6ecf11df6e03..c1856e219b30 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -569,18 +569,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.17" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" +checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.17" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" +checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" dependencies = [ "anstream", "anstyle", From bd4efaaa7d4f036299783f6cccd41e277026d7f8 Mon Sep 17 00:00:00 2001 From: zonyitoo Date: Sun, 22 Sep 2024 22:39:20 +0800 Subject: [PATCH 14/18] chore: release v1.21.0 --- Cargo.lock | 145 ++++++++++++-------------- Cargo.toml | 4 +- crates/shadowsocks-service/Cargo.toml | 4 +- crates/shadowsocks/Cargo.toml | 2 +- debian/changelog | 7 ++ 5 files changed, 77 insertions(+), 85 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c1856e219b30..75b66d6876ec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,19 +4,13 @@ version = 3 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" dependencies = [ "gimli", ] -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - [[package]] name = "adler2" version = "2.0.0" @@ -176,9 +170,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "arc-swap" @@ -188,9 +182,9 @@ checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" [[package]] name = "arrayref" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" @@ -257,17 +251,17 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", - "miniz_oxide 0.7.4", + "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -487,9 +481,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.16" +version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9d013ecb737093c0e86b151a7b837993cf9ec6c502946cfb44bedc392421e0b" +checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" dependencies = [ "jobserver", "libc", @@ -649,9 +643,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -897,9 +891,9 @@ dependencies = [ [[package]] name = "enum-as-inner" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" dependencies = [ "heck", "proc-macro2", @@ -1020,7 +1014,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", - "miniz_oxide 0.8.0", + "miniz_oxide", ] [[package]] @@ -1222,9 +1216,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" [[package]] name = "group" @@ -1330,9 +1324,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" @@ -1534,7 +1528,7 @@ dependencies = [ "http 1.1.0", "hyper", "hyper-util", - "rustls 0.23.12", + "rustls 0.23.13", "rustls-native-certs 0.8.0", "rustls-pki-types", "tokio", @@ -1561,9 +1555,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" +checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" dependencies = [ "bytes", "futures-channel", @@ -1581,9 +1575,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1948,7 +1942,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", - "redox_syscall 0.5.3", + "redox_syscall 0.5.4", ] [[package]] @@ -2089,15 +2083,6 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - [[package]] name = "miniz_oxide" version = "0.8.0" @@ -2332,9 +2317,9 @@ dependencies = [ [[package]] name = "parking" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" @@ -2379,7 +2364,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.3", + "redox_syscall 0.5.4", "smallvec", "windows-targets 0.52.6", ] @@ -2392,9 +2377,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.11" +version = "2.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" +checksum = "fdbef9d1d47087a895abd220ed25eb4ad973a5e26f6a4367b038c25e28dfc2d9" dependencies = [ "memchr", "thiserror", @@ -2403,9 +2388,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.11" +version = "2.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a" +checksum = "4d3a6e3394ec80feb3b6393c725571754c6188490265c61aaf260810d6b95aa0" dependencies = [ "pest", "pest_generator", @@ -2413,9 +2398,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.11" +version = "2.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183" +checksum = "94429506bde1ca69d1b5601962c73f4172ab4726571a59ea95931218cb0e930e" dependencies = [ "pest", "pest_meta", @@ -2426,9 +2411,9 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.7.11" +version = "2.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f" +checksum = "ac8a071862e93690b6e34e9a5fb8e33ff3734473ac0245b27232222c4906a33f" dependencies = [ "once_cell", "pest", @@ -2614,7 +2599,7 @@ dependencies = [ "quinn-proto 0.11.8", "quinn-udp 0.5.5", "rustc-hash 2.0.0", - "rustls 0.23.12", + "rustls 0.23.13", "socket2", "thiserror", "tokio", @@ -2648,7 +2633,7 @@ dependencies = [ "rand", "ring 0.17.8", "rustc-hash 2.0.0", - "rustls 0.23.12", + "rustls 0.23.13", "slab", "thiserror", "tinyvec", @@ -2737,9 +2722,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" dependencies = [ "bitflags 2.6.0", ] @@ -2829,7 +2814,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn 0.11.5", - "rustls 0.23.12", + "rustls 0.23.13", "rustls-native-certs 0.7.3", "rustls-pemfile 2.1.3", "rustls-pki-types", @@ -2971,9 +2956,9 @@ checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustix" -version = "0.38.36" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f55e80d50763938498dd5ebb18647174e0c76dc38c5505294bb224624f30f36" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags 2.6.0", "errno", @@ -2996,15 +2981,15 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.12" +version = "0.23.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" +checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ "log", "once_cell", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.7", + "rustls-webpki 0.102.8", "subtle", "zeroize", ] @@ -3084,9 +3069,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.7" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84678086bd54edf2b415183ed7a94d0efb049f1b646a33e22a36f3794be6ae56" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -3110,11 +3095,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3161,9 +3146,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ "core-foundation-sys", "libc", @@ -3280,7 +3265,7 @@ dependencies = [ [[package]] name = "shadowsocks" -version = "1.20.3" +version = "1.21.0" dependencies = [ "aes", "arc-swap", @@ -3346,7 +3331,7 @@ dependencies = [ [[package]] name = "shadowsocks-rust" -version = "1.20.4" +version = "1.21.0" dependencies = [ "base64 0.22.1", "build-time", @@ -3387,7 +3372,7 @@ dependencies = [ [[package]] name = "shadowsocks-service" -version = "1.20.4" +version = "1.21.0" dependencies = [ "arc-swap", "async-trait", @@ -3646,9 +3631,9 @@ dependencies = [ [[package]] name = "sysexits" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4008983d29e823b1415f5f12732d5c9a44059795fb6218262cc0185668851e2" +checksum = "c5649c51a0a23b49261cc66a328925546beaf86d7c9af801b3993732deccec7a" [[package]] name = "system-configuration" @@ -3868,7 +3853,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.12", + "rustls 0.23.13", "rustls-pki-types", "tokio", ] @@ -4049,15 +4034,15 @@ checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] diff --git a/Cargo.toml b/Cargo.toml index 22b930eaff43..736feee3dd5d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shadowsocks-rust" -version = "1.20.4" +version = "1.21.0" authors = ["Shadowsocks Contributors"] description = "shadowsocks is a fast tunnel proxy that helps you bypass firewalls." repository = "https://github.com/shadowsocks/shadowsocks-rust" @@ -248,7 +248,7 @@ jemallocator = { version = "0.5", optional = true } snmalloc-rs = { version = "0.3", optional = true } rpmalloc = { version = "0.2", optional = true } -shadowsocks-service = { version = "1.20.4", path = "./crates/shadowsocks-service" } +shadowsocks-service = { version = "1.21.0", path = "./crates/shadowsocks-service" } windows-service = { version = "0.7", optional = true } diff --git a/crates/shadowsocks-service/Cargo.toml b/crates/shadowsocks-service/Cargo.toml index 7dff7bdd6be4..6a699f49a1af 100644 --- a/crates/shadowsocks-service/Cargo.toml +++ b/crates/shadowsocks-service/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shadowsocks-service" -version = "1.20.4" +version = "1.21.0" authors = ["Shadowsocks Contributors"] description = "shadowsocks is a fast tunnel proxy that helps you bypass firewalls." repository = "https://github.com/shadowsocks/shadowsocks-rust" @@ -205,7 +205,7 @@ serde = { version = "1.0", features = ["derive"] } json5 = "0.4" bson = { version = "2.13.0", optional = true } -shadowsocks = { version = "1.20.2", path = "../shadowsocks", default-features = false } +shadowsocks = { version = "1.21.0", path = "../shadowsocks", default-features = false } # Just for the ioctl call macro [target.'cfg(any(target_os = "macos", target_os = "ios", target_os = "freebsd", target_os = "openbsd"))'.dependencies] diff --git a/crates/shadowsocks/Cargo.toml b/crates/shadowsocks/Cargo.toml index 3bd03e8f6752..c948bca62154 100644 --- a/crates/shadowsocks/Cargo.toml +++ b/crates/shadowsocks/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shadowsocks" -version = "1.20.3" +version = "1.21.0" authors = ["Shadowsocks Contributors"] description = "shadowsocks is a fast tunnel proxy that helps you bypass firewalls." repository = "https://github.com/shadowsocks/shadowsocks-rust" diff --git a/debian/changelog b/debian/changelog index adbcd06a0ffb..7856e1d17c80 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +shadowsocks-rust (1.21.0) unstable; urgency=medium + + ## Features + + - #1641 `shadowsocks`: `ProxySocket` supports generic I/O socket type + - #1567 `shadowsocks-service`: Support OpenBSD Packet-Filter (pf) + shadowsocks-rust (1.20.4) unstable; urgency=medium ## Features From 217cc424a7a1f0f03b9766b265e6a6c1128fac68 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 15:13:00 +0000 Subject: [PATCH 15/18] chore(deps): bump thiserror from 1.0.63 to 1.0.64 (#1666) --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 75b66d6876ec..495cd2814d66 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3702,18 +3702,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", From 14f02a38fec127006e8929dc7e1baeb3b8138e71 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 16:08:18 +0000 Subject: [PATCH 16/18] chore(deps): bump libc from 0.2.158 to 0.2.159 (#1669) --- Cargo.lock | 4 ++-- crates/shadowsocks-service/Cargo.toml | 2 +- crates/shadowsocks/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 495cd2814d66..a834f23e569d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1910,9 +1910,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "libloading" diff --git a/crates/shadowsocks-service/Cargo.toml b/crates/shadowsocks-service/Cargo.toml index 6a699f49a1af..32153ca03a45 100644 --- a/crates/shadowsocks-service/Cargo.toml +++ b/crates/shadowsocks-service/Cargo.toml @@ -165,7 +165,7 @@ rustls-native-certs = { version = "0.8", optional = true } async-trait = "0.1" socket2 = { version = "0.5", features = ["all"] } -libc = "0.2.141" +libc = "0.2.159" hyper = { version = "1.4", optional = true, features = ["full"] } http-body-util = { version = "0.1", optional = true } diff --git a/crates/shadowsocks/Cargo.toml b/crates/shadowsocks/Cargo.toml index c948bca62154..35b3a4cc344c 100644 --- a/crates/shadowsocks/Cargo.toml +++ b/crates/shadowsocks/Cargo.toml @@ -48,7 +48,7 @@ security-replay-attack-detect = ["bloomfilter"] [dependencies] log = "0.4" -libc = "0.2.141" +libc = "0.2.159" bytes = "1.7" cfg-if = "1" byte_string = "1.0" From fef1ec59fe404dcf328c50edd959deced54b1fb4 Mon Sep 17 00:00:00 2001 From: zonyitoo Date: Fri, 27 Sep 2024 00:12:57 +0800 Subject: [PATCH 17/18] chore: libc version compatbile from 0.2.141 --- crates/shadowsocks-service/Cargo.toml | 2 +- crates/shadowsocks/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/shadowsocks-service/Cargo.toml b/crates/shadowsocks-service/Cargo.toml index 32153ca03a45..965844756981 100644 --- a/crates/shadowsocks-service/Cargo.toml +++ b/crates/shadowsocks-service/Cargo.toml @@ -165,7 +165,7 @@ rustls-native-certs = { version = "0.8", optional = true } async-trait = "0.1" socket2 = { version = "0.5", features = ["all"] } -libc = "0.2.159" +libc = "~0.2.141" hyper = { version = "1.4", optional = true, features = ["full"] } http-body-util = { version = "0.1", optional = true } diff --git a/crates/shadowsocks/Cargo.toml b/crates/shadowsocks/Cargo.toml index 35b3a4cc344c..a63c4f211c58 100644 --- a/crates/shadowsocks/Cargo.toml +++ b/crates/shadowsocks/Cargo.toml @@ -48,7 +48,7 @@ security-replay-attack-detect = ["bloomfilter"] [dependencies] log = "0.4" -libc = "0.2.159" +libc = "~0.2.141" bytes = "1.7" cfg-if = "1" byte_string = "1.0" From 03d8c31e468705ceec87d7eec19b02a3e89beb88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 00:13:21 +0800 Subject: [PATCH 18/18] chore(deps): bump async-trait from 0.1.82 to 0.1.83 (#1668) Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.82 to 0.1.83. - [Release notes](https://github.com/dtolnay/async-trait/releases) - [Commits](https://github.com/dtolnay/async-trait/compare/0.1.82...0.1.83) --- updated-dependencies: - dependency-name: async-trait dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a834f23e569d..7146cbc1d1a2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -228,9 +228,9 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.82" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote",