From 20f094fa231417c10cf52e825809d58bbd99f95f Mon Sep 17 00:00:00 2001 From: arctic-alpaca <67190338+arctic-alpaca@users.noreply.github.com> Date: Thu, 30 Nov 2023 17:55:02 +0100 Subject: [PATCH] Add missing `AF_*` definitions and AF_XDP header and structs to v0.4.11 (#98) * Add missing `AF_*` definitions * Add AF_XDP header and structs --- Cargo.toml | 1 + gen/modules/net.h | 11 ++- gen/modules/xdp.h | 54 +++++++++++++ src/aarch64/net.rs | 11 ++- src/aarch64/xdp.rs | 159 ++++++++++++++++++++++++++++++++++++ src/arm/net.rs | 11 ++- src/arm/xdp.rs | 159 ++++++++++++++++++++++++++++++++++++ src/csky/net.rs | 11 ++- src/csky/xdp.rs | 159 ++++++++++++++++++++++++++++++++++++ src/lib.rs | 72 +++++++++++++++++ src/loongarch64/net.rs | 11 ++- src/loongarch64/xdp.rs | 159 ++++++++++++++++++++++++++++++++++++ src/mips/net.rs | 11 ++- src/mips/xdp.rs | 169 ++++++++++++++++++++++++++++++++++++++ src/mips32r6/net.rs | 11 ++- src/mips32r6/xdp.rs | 169 ++++++++++++++++++++++++++++++++++++++ src/mips64/net.rs | 11 ++- src/mips64/xdp.rs | 169 ++++++++++++++++++++++++++++++++++++++ src/mips64r6/net.rs | 11 ++- src/mips64r6/xdp.rs | 169 ++++++++++++++++++++++++++++++++++++++ src/powerpc/net.rs | 11 ++- src/powerpc/xdp.rs | 165 +++++++++++++++++++++++++++++++++++++ src/powerpc64/net.rs | 11 ++- src/powerpc64/xdp.rs | 165 +++++++++++++++++++++++++++++++++++++ src/riscv32/net.rs | 11 ++- src/riscv32/xdp.rs | 159 ++++++++++++++++++++++++++++++++++++ src/riscv64/net.rs | 11 ++- src/riscv64/xdp.rs | 159 ++++++++++++++++++++++++++++++++++++ src/s390x/net.rs | 11 ++- src/s390x/xdp.rs | 179 +++++++++++++++++++++++++++++++++++++++++ src/sparc/net.rs | 11 ++- src/sparc/xdp.rs | 159 ++++++++++++++++++++++++++++++++++++ src/sparc64/net.rs | 11 ++- src/sparc64/xdp.rs | 165 +++++++++++++++++++++++++++++++++++++ src/x32/net.rs | 11 ++- src/x32/xdp.rs | 159 ++++++++++++++++++++++++++++++++++++ src/x86/net.rs | 11 ++- src/x86/xdp.rs | 159 ++++++++++++++++++++++++++++++++++++ src/x86_64/net.rs | 11 ++- src/x86_64/xdp.rs | 159 ++++++++++++++++++++++++++++++++++++ 40 files changed, 3257 insertions(+), 19 deletions(-) create mode 100644 gen/modules/xdp.h create mode 100644 src/aarch64/xdp.rs create mode 100644 src/arm/xdp.rs create mode 100644 src/csky/xdp.rs create mode 100644 src/loongarch64/xdp.rs create mode 100644 src/mips/xdp.rs create mode 100644 src/mips32r6/xdp.rs create mode 100644 src/mips64/xdp.rs create mode 100644 src/mips64r6/xdp.rs create mode 100644 src/powerpc/xdp.rs create mode 100644 src/powerpc64/xdp.rs create mode 100644 src/riscv32/xdp.rs create mode 100644 src/riscv64/xdp.rs create mode 100644 src/s390x/xdp.rs create mode 100644 src/sparc/xdp.rs create mode 100644 src/sparc64/xdp.rs create mode 100644 src/x32/xdp.rs create mode 100644 src/x86/xdp.rs create mode 100644 src/x86_64/xdp.rs diff --git a/Cargo.toml b/Cargo.toml index 4933c75a..3ac3ea16 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,6 +35,7 @@ net = [] netlink = [] prctl = [] system = [] +xdp = [] default = ["std", "general", "errno"] std = [] no_std = [] diff --git a/gen/modules/net.h b/gen/modules/net.h index 8439e08b..621d34e1 100644 --- a/gen/modules/net.h +++ b/gen/modules/net.h @@ -92,7 +92,16 @@ typedef __UINT32_TYPE__ socklen_t; #define AF_ISDN 34 #define AF_PHONET 35 #define AF_IEEE802154 36 -#define AF_MAX 37 +#define AF_CAIF 37 +#define AF_ALG 38 +#define AF_NFC 39 +#define AF_VSOCK 40 +#define AF_KCM 41 +#define AF_QIPCRTR 42 +#define AF_SMC 43 +#define AF_XDP 44 +#define AF_MCTP 45 +#define AF_MAX 46 #define MSG_OOB 0x1 #define MSG_PEEK 0x2 diff --git a/gen/modules/xdp.h b/gen/modules/xdp.h new file mode 100644 index 00000000..da401033 --- /dev/null +++ b/gen/modules/xdp.h @@ -0,0 +1,54 @@ +// This file includes selected Linux header files, and supplementary +// definitions, needed for AF_XDP code. + +#include "support.h" + +// Selected Linux headers. + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0) +#include + +// v1 versions of xdp structs. They are defined in linux/net/xdp/xsk.c and +// don't appear in header files, so they are defined here for backwards compatibility. + +// https://github.com/torvalds/linux/blob/v6.6/net/xdp/xsk.h#L14-L18 +struct xdp_ring_offset_v1 { + __u64 producer; + __u64 consumer; + __u64 desc; +}; + +// https://github.com/torvalds/linux/blob/v6.6/net/xdp/xsk.h#L20-L25 +struct xdp_mmap_offsets_v1 { + struct xdp_ring_offset_v1 rx; + struct xdp_ring_offset_v1 tx; + struct xdp_ring_offset_v1 fr; + struct xdp_ring_offset_v1 cr; +}; + +// https://github.com/torvalds/linux/blob/v6.6/net/xdp/xsk.c#L1251-L1256 +struct xdp_umem_reg_v1 { + __u64 addr; + __u64 len; + __u32 chunk_size; + __u32 headroom; +}; + +// https://github.com/torvalds/linux/blob/v6.6/net/xdp/xsk.c#L1367-L1371 +struct xdp_statistics_v1 { + __u64 rx_dropped; + __u64 rx_invalid_descs; + __u64 tx_invalid_descs; +}; + +// The following two definitions were added in kernel version 6.6 and can be removed +// when the crate is updated to kernel version 6.6. + +// https://github.com/torvalds/linux/blob/master/include/uapi/linux/if_xdp.h#L33 +#define XDP_USE_SG (1 << 4) + +// https://github.com/torvalds/linux/blob/master/include/uapi/linux/if_xdp.h#L122 +#define XDP_PKT_CONTD (1 << 0) + +#endif + diff --git a/src/aarch64/net.rs b/src/aarch64/net.rs index cebaaeae..ffdccd33 100644 --- a/src/aarch64/net.rs +++ b/src/aarch64/net.rs @@ -1367,7 +1367,16 @@ pub const AF_RXRPC: u32 = 33; pub const AF_ISDN: u32 = 34; pub const AF_PHONET: u32 = 35; pub const AF_IEEE802154: u32 = 36; -pub const AF_MAX: u32 = 37; +pub const AF_CAIF: u32 = 37; +pub const AF_ALG: u32 = 38; +pub const AF_NFC: u32 = 39; +pub const AF_VSOCK: u32 = 40; +pub const AF_KCM: u32 = 41; +pub const AF_QIPCRTR: u32 = 42; +pub const AF_SMC: u32 = 43; +pub const AF_XDP: u32 = 44; +pub const AF_MCTP: u32 = 45; +pub const AF_MAX: u32 = 46; pub const MSG_OOB: u32 = 1; pub const MSG_PEEK: u32 = 2; pub const MSG_DONTROUTE: u32 = 4; diff --git a/src/aarch64/xdp.rs b/src/aarch64/xdp.rs new file mode 100644 index 00000000..aaabc75b --- /dev/null +++ b/src/aarch64/xdp.rs @@ -0,0 +1,159 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_old_uid_t = crate::ctypes::c_ushort; +pub type __kernel_old_gid_t = crate::ctypes::c_ushort; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_xdp { +pub sxdp_family: __u16, +pub sxdp_flags: __u16, +pub sxdp_ifindex: __u32, +pub sxdp_queue_id: __u32, +pub sxdp_shared_umem_fd: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +pub flags: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets { +pub rx: xdp_ring_offset, +pub tx: xdp_ring_offset, +pub fr: xdp_ring_offset, +pub cr: xdp_ring_offset, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +pub rx_ring_full: __u64, +pub rx_fill_ring_empty_descs: __u64, +pub tx_ring_empty_descs: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_options { +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_desc { +pub addr: __u64, +pub len: __u32, +pub options: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset_v1 { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets_v1 { +pub rx: xdp_ring_offset_v1, +pub tx: xdp_ring_offset_v1, +pub fr: xdp_ring_offset_v1, +pub cr: xdp_ring_offset_v1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg_v1 { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics_v1 { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +} +pub const XDP_SHARED_UMEM: u32 = 1; +pub const XDP_COPY: u32 = 2; +pub const XDP_ZEROCOPY: u32 = 4; +pub const XDP_USE_NEED_WAKEUP: u32 = 8; +pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: u32 = 1; +pub const XDP_RING_NEED_WAKEUP: u32 = 1; +pub const XDP_MMAP_OFFSETS: u32 = 1; +pub const XDP_RX_RING: u32 = 2; +pub const XDP_TX_RING: u32 = 3; +pub const XDP_UMEM_REG: u32 = 4; +pub const XDP_UMEM_FILL_RING: u32 = 5; +pub const XDP_UMEM_COMPLETION_RING: u32 = 6; +pub const XDP_STATISTICS: u32 = 7; +pub const XDP_OPTIONS: u32 = 8; +pub const XDP_OPTIONS_ZEROCOPY: u32 = 1; +pub const XDP_PGOFF_RX_RING: u32 = 0; +pub const XDP_PGOFF_TX_RING: u32 = 2147483648; +pub const XDP_UMEM_PGOFF_FILL_RING: u64 = 4294967296; +pub const XDP_UMEM_PGOFF_COMPLETION_RING: u64 = 6442450944; +pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: u32 = 48; +pub const XSK_UNALIGNED_BUF_ADDR_MASK: u64 = 281474976710655; +pub const XDP_USE_SG: u32 = 16; +pub const XDP_PKT_CONTD: u32 = 1; diff --git a/src/arm/net.rs b/src/arm/net.rs index 56302127..1e7ad270 100644 --- a/src/arm/net.rs +++ b/src/arm/net.rs @@ -1359,7 +1359,16 @@ pub const AF_RXRPC: u32 = 33; pub const AF_ISDN: u32 = 34; pub const AF_PHONET: u32 = 35; pub const AF_IEEE802154: u32 = 36; -pub const AF_MAX: u32 = 37; +pub const AF_CAIF: u32 = 37; +pub const AF_ALG: u32 = 38; +pub const AF_NFC: u32 = 39; +pub const AF_VSOCK: u32 = 40; +pub const AF_KCM: u32 = 41; +pub const AF_QIPCRTR: u32 = 42; +pub const AF_SMC: u32 = 43; +pub const AF_XDP: u32 = 44; +pub const AF_MCTP: u32 = 45; +pub const AF_MAX: u32 = 46; pub const MSG_OOB: u32 = 1; pub const MSG_PEEK: u32 = 2; pub const MSG_DONTROUTE: u32 = 4; diff --git a/src/arm/xdp.rs b/src/arm/xdp.rs new file mode 100644 index 00000000..12920735 --- /dev/null +++ b/src/arm/xdp.rs @@ -0,0 +1,159 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_mode_t = crate::ctypes::c_ushort; +pub type __kernel_ipc_pid_t = crate::ctypes::c_ushort; +pub type __kernel_uid_t = crate::ctypes::c_ushort; +pub type __kernel_gid_t = crate::ctypes::c_ushort; +pub type __kernel_old_dev_t = crate::ctypes::c_ushort; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_xdp { +pub sxdp_family: __u16, +pub sxdp_flags: __u16, +pub sxdp_ifindex: __u32, +pub sxdp_queue_id: __u32, +pub sxdp_shared_umem_fd: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +pub flags: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets { +pub rx: xdp_ring_offset, +pub tx: xdp_ring_offset, +pub fr: xdp_ring_offset, +pub cr: xdp_ring_offset, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +pub rx_ring_full: __u64, +pub rx_fill_ring_empty_descs: __u64, +pub tx_ring_empty_descs: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_options { +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_desc { +pub addr: __u64, +pub len: __u32, +pub options: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset_v1 { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets_v1 { +pub rx: xdp_ring_offset_v1, +pub tx: xdp_ring_offset_v1, +pub fr: xdp_ring_offset_v1, +pub cr: xdp_ring_offset_v1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg_v1 { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics_v1 { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +} +pub const XDP_SHARED_UMEM: u32 = 1; +pub const XDP_COPY: u32 = 2; +pub const XDP_ZEROCOPY: u32 = 4; +pub const XDP_USE_NEED_WAKEUP: u32 = 8; +pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: u32 = 1; +pub const XDP_RING_NEED_WAKEUP: u32 = 1; +pub const XDP_MMAP_OFFSETS: u32 = 1; +pub const XDP_RX_RING: u32 = 2; +pub const XDP_TX_RING: u32 = 3; +pub const XDP_UMEM_REG: u32 = 4; +pub const XDP_UMEM_FILL_RING: u32 = 5; +pub const XDP_UMEM_COMPLETION_RING: u32 = 6; +pub const XDP_STATISTICS: u32 = 7; +pub const XDP_OPTIONS: u32 = 8; +pub const XDP_OPTIONS_ZEROCOPY: u32 = 1; +pub const XDP_PGOFF_RX_RING: u32 = 0; +pub const XDP_PGOFF_TX_RING: u32 = 2147483648; +pub const XDP_UMEM_PGOFF_FILL_RING: u64 = 4294967296; +pub const XDP_UMEM_PGOFF_COMPLETION_RING: u64 = 6442450944; +pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: u32 = 48; +pub const XSK_UNALIGNED_BUF_ADDR_MASK: u64 = 281474976710655; +pub const XDP_USE_SG: u32 = 16; +pub const XDP_PKT_CONTD: u32 = 1; diff --git a/src/csky/net.rs b/src/csky/net.rs index 8f1f2a85..91a4d560 100644 --- a/src/csky/net.rs +++ b/src/csky/net.rs @@ -1359,7 +1359,16 @@ pub const AF_RXRPC: u32 = 33; pub const AF_ISDN: u32 = 34; pub const AF_PHONET: u32 = 35; pub const AF_IEEE802154: u32 = 36; -pub const AF_MAX: u32 = 37; +pub const AF_CAIF: u32 = 37; +pub const AF_ALG: u32 = 38; +pub const AF_NFC: u32 = 39; +pub const AF_VSOCK: u32 = 40; +pub const AF_KCM: u32 = 41; +pub const AF_QIPCRTR: u32 = 42; +pub const AF_SMC: u32 = 43; +pub const AF_XDP: u32 = 44; +pub const AF_MCTP: u32 = 45; +pub const AF_MAX: u32 = 46; pub const MSG_OOB: u32 = 1; pub const MSG_PEEK: u32 = 2; pub const MSG_DONTROUTE: u32 = 4; diff --git a/src/csky/xdp.rs b/src/csky/xdp.rs new file mode 100644 index 00000000..56bc9c27 --- /dev/null +++ b/src/csky/xdp.rs @@ -0,0 +1,159 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_xdp { +pub sxdp_family: __u16, +pub sxdp_flags: __u16, +pub sxdp_ifindex: __u32, +pub sxdp_queue_id: __u32, +pub sxdp_shared_umem_fd: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +pub flags: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets { +pub rx: xdp_ring_offset, +pub tx: xdp_ring_offset, +pub fr: xdp_ring_offset, +pub cr: xdp_ring_offset, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +pub rx_ring_full: __u64, +pub rx_fill_ring_empty_descs: __u64, +pub tx_ring_empty_descs: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_options { +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_desc { +pub addr: __u64, +pub len: __u32, +pub options: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset_v1 { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets_v1 { +pub rx: xdp_ring_offset_v1, +pub tx: xdp_ring_offset_v1, +pub fr: xdp_ring_offset_v1, +pub cr: xdp_ring_offset_v1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg_v1 { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics_v1 { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +} +pub const XDP_SHARED_UMEM: u32 = 1; +pub const XDP_COPY: u32 = 2; +pub const XDP_ZEROCOPY: u32 = 4; +pub const XDP_USE_NEED_WAKEUP: u32 = 8; +pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: u32 = 1; +pub const XDP_RING_NEED_WAKEUP: u32 = 1; +pub const XDP_MMAP_OFFSETS: u32 = 1; +pub const XDP_RX_RING: u32 = 2; +pub const XDP_TX_RING: u32 = 3; +pub const XDP_UMEM_REG: u32 = 4; +pub const XDP_UMEM_FILL_RING: u32 = 5; +pub const XDP_UMEM_COMPLETION_RING: u32 = 6; +pub const XDP_STATISTICS: u32 = 7; +pub const XDP_OPTIONS: u32 = 8; +pub const XDP_OPTIONS_ZEROCOPY: u32 = 1; +pub const XDP_PGOFF_RX_RING: u32 = 0; +pub const XDP_PGOFF_TX_RING: u32 = 2147483648; +pub const XDP_UMEM_PGOFF_FILL_RING: u64 = 4294967296; +pub const XDP_UMEM_PGOFF_COMPLETION_RING: u64 = 6442450944; +pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: u32 = 48; +pub const XSK_UNALIGNED_BUF_ADDR_MASK: u64 = 281474976710655; +pub const XDP_USE_SG: u32 = 16; +pub const XDP_PKT_CONTD: u32 = 1; diff --git a/src/lib.rs b/src/lib.rs index 02588d94..663b7c4b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -226,6 +226,10 @@ pub mod prctl; #[cfg(target_arch = "arm")] #[path = "arm/system.rs"] pub mod system; +#[cfg(feature = "xdp")] +#[cfg(target_arch = "arm")] +#[path = "arm/xdp.rs"] +pub mod xdp; #[cfg(feature = "errno")] #[cfg(target_arch = "aarch64")] #[path = "aarch64/errno.rs"] @@ -262,6 +266,10 @@ pub mod prctl; #[cfg(target_arch = "aarch64")] #[path = "aarch64/system.rs"] pub mod system; +#[cfg(feature = "xdp")] +#[cfg(target_arch = "aarch64")] +#[path = "aarch64/xdp.rs"] +pub mod xdp; #[cfg(feature = "errno")] #[cfg(target_arch = "csky")] #[path = "csky/errno.rs"] @@ -298,6 +306,10 @@ pub mod prctl; #[cfg(target_arch = "csky")] #[path = "csky/system.rs"] pub mod system; +#[cfg(feature = "xdp")] +#[cfg(target_arch = "csky")] +#[path = "csky/xdp.rs"] +pub mod xdp; #[cfg(feature = "errno")] #[cfg(target_arch = "loongarch64")] #[path = "loongarch64/errno.rs"] @@ -334,6 +346,10 @@ pub mod prctl; #[cfg(target_arch = "loongarch64")] #[path = "loongarch64/system.rs"] pub mod system; +#[cfg(feature = "xdp")] +#[cfg(target_arch = "loongarch64")] +#[path = "loongarch64/xdp.rs"] +pub mod xdp; #[cfg(feature = "errno")] #[cfg(target_arch = "mips")] #[path = "mips/errno.rs"] @@ -370,6 +386,10 @@ pub mod prctl; #[cfg(target_arch = "mips")] #[path = "mips/system.rs"] pub mod system; +#[cfg(feature = "xdp")] +#[cfg(target_arch = "mips")] +#[path = "mips/xdp.rs"] +pub mod xdp; #[cfg(feature = "errno")] #[cfg(target_arch = "mips64")] #[path = "mips64/errno.rs"] @@ -406,6 +426,10 @@ pub mod prctl; #[cfg(target_arch = "mips64")] #[path = "mips64/system.rs"] pub mod system; +#[cfg(feature = "xdp")] +#[cfg(target_arch = "mips64")] +#[path = "mips64/xdp.rs"] +pub mod xdp; #[cfg(feature = "errno")] #[cfg(target_arch = "mips32r6")] #[path = "mips32r6/errno.rs"] @@ -442,6 +466,10 @@ pub mod prctl; #[cfg(target_arch = "mips32r6")] #[path = "mips32r6/system.rs"] pub mod system; +#[cfg(feature = "xdp")] +#[cfg(target_arch = "mips32r6")] +#[path = "mips32r6/xdp.rs"] +pub mod xdp; #[cfg(feature = "errno")] #[cfg(target_arch = "mips64r6")] #[path = "mips64r6/errno.rs"] @@ -478,6 +506,10 @@ pub mod prctl; #[cfg(target_arch = "mips64r6")] #[path = "mips64r6/system.rs"] pub mod system; +#[cfg(feature = "xdp")] +#[cfg(target_arch = "mips64r6")] +#[path = "mips64r6/xdp.rs"] +pub mod xdp; #[cfg(feature = "errno")] #[cfg(target_arch = "powerpc")] #[path = "powerpc/errno.rs"] @@ -514,6 +546,10 @@ pub mod prctl; #[cfg(target_arch = "powerpc")] #[path = "powerpc/system.rs"] pub mod system; +#[cfg(feature = "xdp")] +#[cfg(target_arch = "powerpc")] +#[path = "powerpc/xdp.rs"] +pub mod xdp; #[cfg(feature = "errno")] #[cfg(target_arch = "powerpc64")] #[path = "powerpc64/errno.rs"] @@ -550,6 +586,10 @@ pub mod prctl; #[cfg(target_arch = "powerpc64")] #[path = "powerpc64/system.rs"] pub mod system; +#[cfg(feature = "xdp")] +#[cfg(target_arch = "powerpc64")] +#[path = "powerpc64/xdp.rs"] +pub mod xdp; #[cfg(feature = "errno")] #[cfg(target_arch = "riscv32")] #[path = "riscv32/errno.rs"] @@ -586,6 +626,10 @@ pub mod prctl; #[cfg(target_arch = "riscv32")] #[path = "riscv32/system.rs"] pub mod system; +#[cfg(feature = "xdp")] +#[cfg(target_arch = "riscv32")] +#[path = "riscv32/xdp.rs"] +pub mod xdp; #[cfg(feature = "errno")] #[cfg(target_arch = "riscv64")] #[path = "riscv64/errno.rs"] @@ -622,6 +666,10 @@ pub mod prctl; #[cfg(target_arch = "riscv64")] #[path = "riscv64/system.rs"] pub mod system; +#[cfg(feature = "xdp")] +#[cfg(target_arch = "riscv64")] +#[path = "riscv64/xdp.rs"] +pub mod xdp; #[cfg(feature = "errno")] #[cfg(target_arch = "s390x")] #[path = "s390x/errno.rs"] @@ -658,6 +706,10 @@ pub mod prctl; #[cfg(target_arch = "s390x")] #[path = "s390x/system.rs"] pub mod system; +#[cfg(feature = "xdp")] +#[cfg(target_arch = "s390x")] +#[path = "s390x/xdp.rs"] +pub mod xdp; #[cfg(feature = "errno")] #[cfg(target_arch = "sparc")] #[path = "sparc/errno.rs"] @@ -694,6 +746,10 @@ pub mod prctl; #[cfg(target_arch = "sparc")] #[path = "sparc/system.rs"] pub mod system; +#[cfg(feature = "xdp")] +#[cfg(target_arch = "sparc")] +#[path = "sparc/xdp.rs"] +pub mod xdp; #[cfg(feature = "errno")] #[cfg(target_arch = "sparc64")] #[path = "sparc64/errno.rs"] @@ -730,6 +786,10 @@ pub mod prctl; #[cfg(target_arch = "sparc64")] #[path = "sparc64/system.rs"] pub mod system; +#[cfg(feature = "xdp")] +#[cfg(target_arch = "sparc64")] +#[path = "sparc64/xdp.rs"] +pub mod xdp; #[cfg(feature = "errno")] #[cfg(target_arch = "x86")] #[path = "x86/errno.rs"] @@ -766,6 +826,10 @@ pub mod prctl; #[cfg(target_arch = "x86")] #[path = "x86/system.rs"] pub mod system; +#[cfg(feature = "xdp")] +#[cfg(target_arch = "x86")] +#[path = "x86/xdp.rs"] +pub mod xdp; #[cfg(feature = "errno")] #[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] #[path = "x86_64/errno.rs"] @@ -802,6 +866,10 @@ pub mod prctl; #[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] #[path = "x86_64/system.rs"] pub mod system; +#[cfg(feature = "xdp")] +#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] +#[path = "x86_64/xdp.rs"] +pub mod xdp; #[cfg(feature = "errno")] #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] #[path = "x32/errno.rs"] @@ -838,3 +906,7 @@ pub mod prctl; #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] #[path = "x32/system.rs"] pub mod system; +#[cfg(feature = "xdp")] +#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] +#[path = "x32/xdp.rs"] +pub mod xdp; diff --git a/src/loongarch64/net.rs b/src/loongarch64/net.rs index 8a340740..212c8717 100644 --- a/src/loongarch64/net.rs +++ b/src/loongarch64/net.rs @@ -1367,7 +1367,16 @@ pub const AF_RXRPC: u32 = 33; pub const AF_ISDN: u32 = 34; pub const AF_PHONET: u32 = 35; pub const AF_IEEE802154: u32 = 36; -pub const AF_MAX: u32 = 37; +pub const AF_CAIF: u32 = 37; +pub const AF_ALG: u32 = 38; +pub const AF_NFC: u32 = 39; +pub const AF_VSOCK: u32 = 40; +pub const AF_KCM: u32 = 41; +pub const AF_QIPCRTR: u32 = 42; +pub const AF_SMC: u32 = 43; +pub const AF_XDP: u32 = 44; +pub const AF_MCTP: u32 = 45; +pub const AF_MAX: u32 = 46; pub const MSG_OOB: u32 = 1; pub const MSG_PEEK: u32 = 2; pub const MSG_DONTROUTE: u32 = 4; diff --git a/src/loongarch64/xdp.rs b/src/loongarch64/xdp.rs new file mode 100644 index 00000000..a85ecd33 --- /dev/null +++ b/src/loongarch64/xdp.rs @@ -0,0 +1,159 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_xdp { +pub sxdp_family: __u16, +pub sxdp_flags: __u16, +pub sxdp_ifindex: __u32, +pub sxdp_queue_id: __u32, +pub sxdp_shared_umem_fd: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +pub flags: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets { +pub rx: xdp_ring_offset, +pub tx: xdp_ring_offset, +pub fr: xdp_ring_offset, +pub cr: xdp_ring_offset, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +pub rx_ring_full: __u64, +pub rx_fill_ring_empty_descs: __u64, +pub tx_ring_empty_descs: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_options { +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_desc { +pub addr: __u64, +pub len: __u32, +pub options: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset_v1 { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets_v1 { +pub rx: xdp_ring_offset_v1, +pub tx: xdp_ring_offset_v1, +pub fr: xdp_ring_offset_v1, +pub cr: xdp_ring_offset_v1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg_v1 { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics_v1 { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +} +pub const XDP_SHARED_UMEM: u32 = 1; +pub const XDP_COPY: u32 = 2; +pub const XDP_ZEROCOPY: u32 = 4; +pub const XDP_USE_NEED_WAKEUP: u32 = 8; +pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: u32 = 1; +pub const XDP_RING_NEED_WAKEUP: u32 = 1; +pub const XDP_MMAP_OFFSETS: u32 = 1; +pub const XDP_RX_RING: u32 = 2; +pub const XDP_TX_RING: u32 = 3; +pub const XDP_UMEM_REG: u32 = 4; +pub const XDP_UMEM_FILL_RING: u32 = 5; +pub const XDP_UMEM_COMPLETION_RING: u32 = 6; +pub const XDP_STATISTICS: u32 = 7; +pub const XDP_OPTIONS: u32 = 8; +pub const XDP_OPTIONS_ZEROCOPY: u32 = 1; +pub const XDP_PGOFF_RX_RING: u32 = 0; +pub const XDP_PGOFF_TX_RING: u32 = 2147483648; +pub const XDP_UMEM_PGOFF_FILL_RING: u64 = 4294967296; +pub const XDP_UMEM_PGOFF_COMPLETION_RING: u64 = 6442450944; +pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: u32 = 48; +pub const XSK_UNALIGNED_BUF_ADDR_MASK: u64 = 281474976710655; +pub const XDP_USE_SG: u32 = 16; +pub const XDP_PKT_CONTD: u32 = 1; diff --git a/src/mips/net.rs b/src/mips/net.rs index 2490e520..7178bb7f 100644 --- a/src/mips/net.rs +++ b/src/mips/net.rs @@ -1390,7 +1390,16 @@ pub const AF_RXRPC: u32 = 33; pub const AF_ISDN: u32 = 34; pub const AF_PHONET: u32 = 35; pub const AF_IEEE802154: u32 = 36; -pub const AF_MAX: u32 = 37; +pub const AF_CAIF: u32 = 37; +pub const AF_ALG: u32 = 38; +pub const AF_NFC: u32 = 39; +pub const AF_VSOCK: u32 = 40; +pub const AF_KCM: u32 = 41; +pub const AF_QIPCRTR: u32 = 42; +pub const AF_SMC: u32 = 43; +pub const AF_XDP: u32 = 44; +pub const AF_MCTP: u32 = 45; +pub const AF_MAX: u32 = 46; pub const MSG_OOB: u32 = 1; pub const MSG_PEEK: u32 = 2; pub const MSG_DONTROUTE: u32 = 4; diff --git a/src/mips/xdp.rs b/src/mips/xdp.rs new file mode 100644 index 00000000..2a22498c --- /dev/null +++ b/src/mips/xdp.rs @@ -0,0 +1,169 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_daddr_t = crate::ctypes::c_long; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_xdp { +pub sxdp_family: __u16, +pub sxdp_flags: __u16, +pub sxdp_ifindex: __u32, +pub sxdp_queue_id: __u32, +pub sxdp_shared_umem_fd: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +pub flags: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets { +pub rx: xdp_ring_offset, +pub tx: xdp_ring_offset, +pub fr: xdp_ring_offset, +pub cr: xdp_ring_offset, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +pub rx_ring_full: __u64, +pub rx_fill_ring_empty_descs: __u64, +pub tx_ring_empty_descs: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_options { +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_desc { +pub addr: __u64, +pub len: __u32, +pub options: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset_v1 { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets_v1 { +pub rx: xdp_ring_offset_v1, +pub tx: xdp_ring_offset_v1, +pub fr: xdp_ring_offset_v1, +pub cr: xdp_ring_offset_v1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg_v1 { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics_v1 { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +} +pub const _MIPS_ISA_MIPS1: u32 = 1; +pub const _MIPS_ISA_MIPS2: u32 = 2; +pub const _MIPS_ISA_MIPS3: u32 = 3; +pub const _MIPS_ISA_MIPS4: u32 = 4; +pub const _MIPS_ISA_MIPS5: u32 = 5; +pub const _MIPS_ISA_MIPS32: u32 = 6; +pub const _MIPS_ISA_MIPS64: u32 = 7; +pub const _MIPS_SIM_ABI32: u32 = 1; +pub const _MIPS_SIM_NABI32: u32 = 2; +pub const _MIPS_SIM_ABI64: u32 = 3; +pub const XDP_SHARED_UMEM: u32 = 1; +pub const XDP_COPY: u32 = 2; +pub const XDP_ZEROCOPY: u32 = 4; +pub const XDP_USE_NEED_WAKEUP: u32 = 8; +pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: u32 = 1; +pub const XDP_RING_NEED_WAKEUP: u32 = 1; +pub const XDP_MMAP_OFFSETS: u32 = 1; +pub const XDP_RX_RING: u32 = 2; +pub const XDP_TX_RING: u32 = 3; +pub const XDP_UMEM_REG: u32 = 4; +pub const XDP_UMEM_FILL_RING: u32 = 5; +pub const XDP_UMEM_COMPLETION_RING: u32 = 6; +pub const XDP_STATISTICS: u32 = 7; +pub const XDP_OPTIONS: u32 = 8; +pub const XDP_OPTIONS_ZEROCOPY: u32 = 1; +pub const XDP_PGOFF_RX_RING: u32 = 0; +pub const XDP_PGOFF_TX_RING: u32 = 2147483648; +pub const XDP_UMEM_PGOFF_FILL_RING: u64 = 4294967296; +pub const XDP_UMEM_PGOFF_COMPLETION_RING: u64 = 6442450944; +pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: u32 = 48; +pub const XSK_UNALIGNED_BUF_ADDR_MASK: u64 = 281474976710655; +pub const XDP_USE_SG: u32 = 16; +pub const XDP_PKT_CONTD: u32 = 1; diff --git a/src/mips32r6/net.rs b/src/mips32r6/net.rs index 2490e520..7178bb7f 100644 --- a/src/mips32r6/net.rs +++ b/src/mips32r6/net.rs @@ -1390,7 +1390,16 @@ pub const AF_RXRPC: u32 = 33; pub const AF_ISDN: u32 = 34; pub const AF_PHONET: u32 = 35; pub const AF_IEEE802154: u32 = 36; -pub const AF_MAX: u32 = 37; +pub const AF_CAIF: u32 = 37; +pub const AF_ALG: u32 = 38; +pub const AF_NFC: u32 = 39; +pub const AF_VSOCK: u32 = 40; +pub const AF_KCM: u32 = 41; +pub const AF_QIPCRTR: u32 = 42; +pub const AF_SMC: u32 = 43; +pub const AF_XDP: u32 = 44; +pub const AF_MCTP: u32 = 45; +pub const AF_MAX: u32 = 46; pub const MSG_OOB: u32 = 1; pub const MSG_PEEK: u32 = 2; pub const MSG_DONTROUTE: u32 = 4; diff --git a/src/mips32r6/xdp.rs b/src/mips32r6/xdp.rs new file mode 100644 index 00000000..2a22498c --- /dev/null +++ b/src/mips32r6/xdp.rs @@ -0,0 +1,169 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_daddr_t = crate::ctypes::c_long; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_xdp { +pub sxdp_family: __u16, +pub sxdp_flags: __u16, +pub sxdp_ifindex: __u32, +pub sxdp_queue_id: __u32, +pub sxdp_shared_umem_fd: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +pub flags: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets { +pub rx: xdp_ring_offset, +pub tx: xdp_ring_offset, +pub fr: xdp_ring_offset, +pub cr: xdp_ring_offset, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +pub rx_ring_full: __u64, +pub rx_fill_ring_empty_descs: __u64, +pub tx_ring_empty_descs: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_options { +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_desc { +pub addr: __u64, +pub len: __u32, +pub options: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset_v1 { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets_v1 { +pub rx: xdp_ring_offset_v1, +pub tx: xdp_ring_offset_v1, +pub fr: xdp_ring_offset_v1, +pub cr: xdp_ring_offset_v1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg_v1 { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics_v1 { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +} +pub const _MIPS_ISA_MIPS1: u32 = 1; +pub const _MIPS_ISA_MIPS2: u32 = 2; +pub const _MIPS_ISA_MIPS3: u32 = 3; +pub const _MIPS_ISA_MIPS4: u32 = 4; +pub const _MIPS_ISA_MIPS5: u32 = 5; +pub const _MIPS_ISA_MIPS32: u32 = 6; +pub const _MIPS_ISA_MIPS64: u32 = 7; +pub const _MIPS_SIM_ABI32: u32 = 1; +pub const _MIPS_SIM_NABI32: u32 = 2; +pub const _MIPS_SIM_ABI64: u32 = 3; +pub const XDP_SHARED_UMEM: u32 = 1; +pub const XDP_COPY: u32 = 2; +pub const XDP_ZEROCOPY: u32 = 4; +pub const XDP_USE_NEED_WAKEUP: u32 = 8; +pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: u32 = 1; +pub const XDP_RING_NEED_WAKEUP: u32 = 1; +pub const XDP_MMAP_OFFSETS: u32 = 1; +pub const XDP_RX_RING: u32 = 2; +pub const XDP_TX_RING: u32 = 3; +pub const XDP_UMEM_REG: u32 = 4; +pub const XDP_UMEM_FILL_RING: u32 = 5; +pub const XDP_UMEM_COMPLETION_RING: u32 = 6; +pub const XDP_STATISTICS: u32 = 7; +pub const XDP_OPTIONS: u32 = 8; +pub const XDP_OPTIONS_ZEROCOPY: u32 = 1; +pub const XDP_PGOFF_RX_RING: u32 = 0; +pub const XDP_PGOFF_TX_RING: u32 = 2147483648; +pub const XDP_UMEM_PGOFF_FILL_RING: u64 = 4294967296; +pub const XDP_UMEM_PGOFF_COMPLETION_RING: u64 = 6442450944; +pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: u32 = 48; +pub const XSK_UNALIGNED_BUF_ADDR_MASK: u64 = 281474976710655; +pub const XDP_USE_SG: u32 = 16; +pub const XDP_PKT_CONTD: u32 = 1; diff --git a/src/mips64/net.rs b/src/mips64/net.rs index 92ed6226..d7de5b49 100644 --- a/src/mips64/net.rs +++ b/src/mips64/net.rs @@ -1398,7 +1398,16 @@ pub const AF_RXRPC: u32 = 33; pub const AF_ISDN: u32 = 34; pub const AF_PHONET: u32 = 35; pub const AF_IEEE802154: u32 = 36; -pub const AF_MAX: u32 = 37; +pub const AF_CAIF: u32 = 37; +pub const AF_ALG: u32 = 38; +pub const AF_NFC: u32 = 39; +pub const AF_VSOCK: u32 = 40; +pub const AF_KCM: u32 = 41; +pub const AF_QIPCRTR: u32 = 42; +pub const AF_SMC: u32 = 43; +pub const AF_XDP: u32 = 44; +pub const AF_MCTP: u32 = 45; +pub const AF_MAX: u32 = 46; pub const MSG_OOB: u32 = 1; pub const MSG_PEEK: u32 = 2; pub const MSG_DONTROUTE: u32 = 4; diff --git a/src/mips64/xdp.rs b/src/mips64/xdp.rs new file mode 100644 index 00000000..d210d09a --- /dev/null +++ b/src/mips64/xdp.rs @@ -0,0 +1,169 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_long; +pub type __u64 = crate::ctypes::c_ulong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_daddr_t = crate::ctypes::c_long; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_xdp { +pub sxdp_family: __u16, +pub sxdp_flags: __u16, +pub sxdp_ifindex: __u32, +pub sxdp_queue_id: __u32, +pub sxdp_shared_umem_fd: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +pub flags: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets { +pub rx: xdp_ring_offset, +pub tx: xdp_ring_offset, +pub fr: xdp_ring_offset, +pub cr: xdp_ring_offset, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +pub rx_ring_full: __u64, +pub rx_fill_ring_empty_descs: __u64, +pub tx_ring_empty_descs: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_options { +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_desc { +pub addr: __u64, +pub len: __u32, +pub options: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset_v1 { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets_v1 { +pub rx: xdp_ring_offset_v1, +pub tx: xdp_ring_offset_v1, +pub fr: xdp_ring_offset_v1, +pub cr: xdp_ring_offset_v1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg_v1 { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics_v1 { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +} +pub const _MIPS_ISA_MIPS1: u32 = 1; +pub const _MIPS_ISA_MIPS2: u32 = 2; +pub const _MIPS_ISA_MIPS3: u32 = 3; +pub const _MIPS_ISA_MIPS4: u32 = 4; +pub const _MIPS_ISA_MIPS5: u32 = 5; +pub const _MIPS_ISA_MIPS32: u32 = 6; +pub const _MIPS_ISA_MIPS64: u32 = 7; +pub const _MIPS_SIM_ABI32: u32 = 1; +pub const _MIPS_SIM_NABI32: u32 = 2; +pub const _MIPS_SIM_ABI64: u32 = 3; +pub const XDP_SHARED_UMEM: u32 = 1; +pub const XDP_COPY: u32 = 2; +pub const XDP_ZEROCOPY: u32 = 4; +pub const XDP_USE_NEED_WAKEUP: u32 = 8; +pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: u32 = 1; +pub const XDP_RING_NEED_WAKEUP: u32 = 1; +pub const XDP_MMAP_OFFSETS: u32 = 1; +pub const XDP_RX_RING: u32 = 2; +pub const XDP_TX_RING: u32 = 3; +pub const XDP_UMEM_REG: u32 = 4; +pub const XDP_UMEM_FILL_RING: u32 = 5; +pub const XDP_UMEM_COMPLETION_RING: u32 = 6; +pub const XDP_STATISTICS: u32 = 7; +pub const XDP_OPTIONS: u32 = 8; +pub const XDP_OPTIONS_ZEROCOPY: u32 = 1; +pub const XDP_PGOFF_RX_RING: u32 = 0; +pub const XDP_PGOFF_TX_RING: u32 = 2147483648; +pub const XDP_UMEM_PGOFF_FILL_RING: u64 = 4294967296; +pub const XDP_UMEM_PGOFF_COMPLETION_RING: u64 = 6442450944; +pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: u32 = 48; +pub const XSK_UNALIGNED_BUF_ADDR_MASK: u64 = 281474976710655; +pub const XDP_USE_SG: u32 = 16; +pub const XDP_PKT_CONTD: u32 = 1; diff --git a/src/mips64r6/net.rs b/src/mips64r6/net.rs index 92ed6226..d7de5b49 100644 --- a/src/mips64r6/net.rs +++ b/src/mips64r6/net.rs @@ -1398,7 +1398,16 @@ pub const AF_RXRPC: u32 = 33; pub const AF_ISDN: u32 = 34; pub const AF_PHONET: u32 = 35; pub const AF_IEEE802154: u32 = 36; -pub const AF_MAX: u32 = 37; +pub const AF_CAIF: u32 = 37; +pub const AF_ALG: u32 = 38; +pub const AF_NFC: u32 = 39; +pub const AF_VSOCK: u32 = 40; +pub const AF_KCM: u32 = 41; +pub const AF_QIPCRTR: u32 = 42; +pub const AF_SMC: u32 = 43; +pub const AF_XDP: u32 = 44; +pub const AF_MCTP: u32 = 45; +pub const AF_MAX: u32 = 46; pub const MSG_OOB: u32 = 1; pub const MSG_PEEK: u32 = 2; pub const MSG_DONTROUTE: u32 = 4; diff --git a/src/mips64r6/xdp.rs b/src/mips64r6/xdp.rs new file mode 100644 index 00000000..d210d09a --- /dev/null +++ b/src/mips64r6/xdp.rs @@ -0,0 +1,169 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_long; +pub type __u64 = crate::ctypes::c_ulong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_daddr_t = crate::ctypes::c_long; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_xdp { +pub sxdp_family: __u16, +pub sxdp_flags: __u16, +pub sxdp_ifindex: __u32, +pub sxdp_queue_id: __u32, +pub sxdp_shared_umem_fd: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +pub flags: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets { +pub rx: xdp_ring_offset, +pub tx: xdp_ring_offset, +pub fr: xdp_ring_offset, +pub cr: xdp_ring_offset, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +pub rx_ring_full: __u64, +pub rx_fill_ring_empty_descs: __u64, +pub tx_ring_empty_descs: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_options { +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_desc { +pub addr: __u64, +pub len: __u32, +pub options: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset_v1 { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets_v1 { +pub rx: xdp_ring_offset_v1, +pub tx: xdp_ring_offset_v1, +pub fr: xdp_ring_offset_v1, +pub cr: xdp_ring_offset_v1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg_v1 { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics_v1 { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +} +pub const _MIPS_ISA_MIPS1: u32 = 1; +pub const _MIPS_ISA_MIPS2: u32 = 2; +pub const _MIPS_ISA_MIPS3: u32 = 3; +pub const _MIPS_ISA_MIPS4: u32 = 4; +pub const _MIPS_ISA_MIPS5: u32 = 5; +pub const _MIPS_ISA_MIPS32: u32 = 6; +pub const _MIPS_ISA_MIPS64: u32 = 7; +pub const _MIPS_SIM_ABI32: u32 = 1; +pub const _MIPS_SIM_NABI32: u32 = 2; +pub const _MIPS_SIM_ABI64: u32 = 3; +pub const XDP_SHARED_UMEM: u32 = 1; +pub const XDP_COPY: u32 = 2; +pub const XDP_ZEROCOPY: u32 = 4; +pub const XDP_USE_NEED_WAKEUP: u32 = 8; +pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: u32 = 1; +pub const XDP_RING_NEED_WAKEUP: u32 = 1; +pub const XDP_MMAP_OFFSETS: u32 = 1; +pub const XDP_RX_RING: u32 = 2; +pub const XDP_TX_RING: u32 = 3; +pub const XDP_UMEM_REG: u32 = 4; +pub const XDP_UMEM_FILL_RING: u32 = 5; +pub const XDP_UMEM_COMPLETION_RING: u32 = 6; +pub const XDP_STATISTICS: u32 = 7; +pub const XDP_OPTIONS: u32 = 8; +pub const XDP_OPTIONS_ZEROCOPY: u32 = 1; +pub const XDP_PGOFF_RX_RING: u32 = 0; +pub const XDP_PGOFF_TX_RING: u32 = 2147483648; +pub const XDP_UMEM_PGOFF_FILL_RING: u64 = 4294967296; +pub const XDP_UMEM_PGOFF_COMPLETION_RING: u64 = 6442450944; +pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: u32 = 48; +pub const XSK_UNALIGNED_BUF_ADDR_MASK: u64 = 281474976710655; +pub const XDP_USE_SG: u32 = 16; +pub const XDP_PKT_CONTD: u32 = 1; diff --git a/src/powerpc/net.rs b/src/powerpc/net.rs index 4a57559d..0b6ef11c 100644 --- a/src/powerpc/net.rs +++ b/src/powerpc/net.rs @@ -1365,7 +1365,16 @@ pub const AF_RXRPC: u32 = 33; pub const AF_ISDN: u32 = 34; pub const AF_PHONET: u32 = 35; pub const AF_IEEE802154: u32 = 36; -pub const AF_MAX: u32 = 37; +pub const AF_CAIF: u32 = 37; +pub const AF_ALG: u32 = 38; +pub const AF_NFC: u32 = 39; +pub const AF_VSOCK: u32 = 40; +pub const AF_KCM: u32 = 41; +pub const AF_QIPCRTR: u32 = 42; +pub const AF_SMC: u32 = 43; +pub const AF_XDP: u32 = 44; +pub const AF_MCTP: u32 = 45; +pub const AF_MAX: u32 = 46; pub const MSG_OOB: u32 = 1; pub const MSG_PEEK: u32 = 2; pub const MSG_DONTROUTE: u32 = 4; diff --git a/src/powerpc/xdp.rs b/src/powerpc/xdp.rs new file mode 100644 index 00000000..83c08791 --- /dev/null +++ b/src/powerpc/xdp.rs @@ -0,0 +1,165 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_short; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[repr(align(16))] +#[derive(Debug, Copy, Clone)] +pub struct __vector128 { +pub u: [__u32; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_xdp { +pub sxdp_family: __u16, +pub sxdp_flags: __u16, +pub sxdp_ifindex: __u32, +pub sxdp_queue_id: __u32, +pub sxdp_shared_umem_fd: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +pub flags: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets { +pub rx: xdp_ring_offset, +pub tx: xdp_ring_offset, +pub fr: xdp_ring_offset, +pub cr: xdp_ring_offset, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +pub rx_ring_full: __u64, +pub rx_fill_ring_empty_descs: __u64, +pub tx_ring_empty_descs: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_options { +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_desc { +pub addr: __u64, +pub len: __u32, +pub options: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset_v1 { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets_v1 { +pub rx: xdp_ring_offset_v1, +pub tx: xdp_ring_offset_v1, +pub fr: xdp_ring_offset_v1, +pub cr: xdp_ring_offset_v1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg_v1 { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics_v1 { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +} +pub const XDP_SHARED_UMEM: u32 = 1; +pub const XDP_COPY: u32 = 2; +pub const XDP_ZEROCOPY: u32 = 4; +pub const XDP_USE_NEED_WAKEUP: u32 = 8; +pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: u32 = 1; +pub const XDP_RING_NEED_WAKEUP: u32 = 1; +pub const XDP_MMAP_OFFSETS: u32 = 1; +pub const XDP_RX_RING: u32 = 2; +pub const XDP_TX_RING: u32 = 3; +pub const XDP_UMEM_REG: u32 = 4; +pub const XDP_UMEM_FILL_RING: u32 = 5; +pub const XDP_UMEM_COMPLETION_RING: u32 = 6; +pub const XDP_STATISTICS: u32 = 7; +pub const XDP_OPTIONS: u32 = 8; +pub const XDP_OPTIONS_ZEROCOPY: u32 = 1; +pub const XDP_PGOFF_RX_RING: u32 = 0; +pub const XDP_PGOFF_TX_RING: u32 = 2147483648; +pub const XDP_UMEM_PGOFF_FILL_RING: u64 = 4294967296; +pub const XDP_UMEM_PGOFF_COMPLETION_RING: u64 = 6442450944; +pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: u32 = 48; +pub const XSK_UNALIGNED_BUF_ADDR_MASK: u64 = 281474976710655; +pub const XDP_USE_SG: u32 = 16; +pub const XDP_PKT_CONTD: u32 = 1; diff --git a/src/powerpc64/net.rs b/src/powerpc64/net.rs index c1c88b7e..3760eb8c 100644 --- a/src/powerpc64/net.rs +++ b/src/powerpc64/net.rs @@ -1373,7 +1373,16 @@ pub const AF_RXRPC: u32 = 33; pub const AF_ISDN: u32 = 34; pub const AF_PHONET: u32 = 35; pub const AF_IEEE802154: u32 = 36; -pub const AF_MAX: u32 = 37; +pub const AF_CAIF: u32 = 37; +pub const AF_ALG: u32 = 38; +pub const AF_NFC: u32 = 39; +pub const AF_VSOCK: u32 = 40; +pub const AF_KCM: u32 = 41; +pub const AF_QIPCRTR: u32 = 42; +pub const AF_SMC: u32 = 43; +pub const AF_XDP: u32 = 44; +pub const AF_MCTP: u32 = 45; +pub const AF_MAX: u32 = 46; pub const MSG_OOB: u32 = 1; pub const MSG_PEEK: u32 = 2; pub const MSG_DONTROUTE: u32 = 4; diff --git a/src/powerpc64/xdp.rs b/src/powerpc64/xdp.rs new file mode 100644 index 00000000..b38cbb5a --- /dev/null +++ b/src/powerpc64/xdp.rs @@ -0,0 +1,165 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_long; +pub type __u64 = crate::ctypes::c_ulong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_old_dev_t = crate::ctypes::c_ulong; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[repr(align(16))] +#[derive(Debug, Copy, Clone)] +pub struct __vector128 { +pub u: [__u32; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_xdp { +pub sxdp_family: __u16, +pub sxdp_flags: __u16, +pub sxdp_ifindex: __u32, +pub sxdp_queue_id: __u32, +pub sxdp_shared_umem_fd: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +pub flags: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets { +pub rx: xdp_ring_offset, +pub tx: xdp_ring_offset, +pub fr: xdp_ring_offset, +pub cr: xdp_ring_offset, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +pub rx_ring_full: __u64, +pub rx_fill_ring_empty_descs: __u64, +pub tx_ring_empty_descs: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_options { +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_desc { +pub addr: __u64, +pub len: __u32, +pub options: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset_v1 { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets_v1 { +pub rx: xdp_ring_offset_v1, +pub tx: xdp_ring_offset_v1, +pub fr: xdp_ring_offset_v1, +pub cr: xdp_ring_offset_v1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg_v1 { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics_v1 { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +} +pub const XDP_SHARED_UMEM: u32 = 1; +pub const XDP_COPY: u32 = 2; +pub const XDP_ZEROCOPY: u32 = 4; +pub const XDP_USE_NEED_WAKEUP: u32 = 8; +pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: u32 = 1; +pub const XDP_RING_NEED_WAKEUP: u32 = 1; +pub const XDP_MMAP_OFFSETS: u32 = 1; +pub const XDP_RX_RING: u32 = 2; +pub const XDP_TX_RING: u32 = 3; +pub const XDP_UMEM_REG: u32 = 4; +pub const XDP_UMEM_FILL_RING: u32 = 5; +pub const XDP_UMEM_COMPLETION_RING: u32 = 6; +pub const XDP_STATISTICS: u32 = 7; +pub const XDP_OPTIONS: u32 = 8; +pub const XDP_OPTIONS_ZEROCOPY: u32 = 1; +pub const XDP_PGOFF_RX_RING: u32 = 0; +pub const XDP_PGOFF_TX_RING: u32 = 2147483648; +pub const XDP_UMEM_PGOFF_FILL_RING: u64 = 4294967296; +pub const XDP_UMEM_PGOFF_COMPLETION_RING: u64 = 6442450944; +pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: u32 = 48; +pub const XSK_UNALIGNED_BUF_ADDR_MASK: u64 = 281474976710655; +pub const XDP_USE_SG: u32 = 16; +pub const XDP_PKT_CONTD: u32 = 1; diff --git a/src/riscv32/net.rs b/src/riscv32/net.rs index 8f1f2a85..91a4d560 100644 --- a/src/riscv32/net.rs +++ b/src/riscv32/net.rs @@ -1359,7 +1359,16 @@ pub const AF_RXRPC: u32 = 33; pub const AF_ISDN: u32 = 34; pub const AF_PHONET: u32 = 35; pub const AF_IEEE802154: u32 = 36; -pub const AF_MAX: u32 = 37; +pub const AF_CAIF: u32 = 37; +pub const AF_ALG: u32 = 38; +pub const AF_NFC: u32 = 39; +pub const AF_VSOCK: u32 = 40; +pub const AF_KCM: u32 = 41; +pub const AF_QIPCRTR: u32 = 42; +pub const AF_SMC: u32 = 43; +pub const AF_XDP: u32 = 44; +pub const AF_MCTP: u32 = 45; +pub const AF_MAX: u32 = 46; pub const MSG_OOB: u32 = 1; pub const MSG_PEEK: u32 = 2; pub const MSG_DONTROUTE: u32 = 4; diff --git a/src/riscv32/xdp.rs b/src/riscv32/xdp.rs new file mode 100644 index 00000000..56bc9c27 --- /dev/null +++ b/src/riscv32/xdp.rs @@ -0,0 +1,159 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_xdp { +pub sxdp_family: __u16, +pub sxdp_flags: __u16, +pub sxdp_ifindex: __u32, +pub sxdp_queue_id: __u32, +pub sxdp_shared_umem_fd: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +pub flags: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets { +pub rx: xdp_ring_offset, +pub tx: xdp_ring_offset, +pub fr: xdp_ring_offset, +pub cr: xdp_ring_offset, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +pub rx_ring_full: __u64, +pub rx_fill_ring_empty_descs: __u64, +pub tx_ring_empty_descs: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_options { +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_desc { +pub addr: __u64, +pub len: __u32, +pub options: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset_v1 { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets_v1 { +pub rx: xdp_ring_offset_v1, +pub tx: xdp_ring_offset_v1, +pub fr: xdp_ring_offset_v1, +pub cr: xdp_ring_offset_v1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg_v1 { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics_v1 { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +} +pub const XDP_SHARED_UMEM: u32 = 1; +pub const XDP_COPY: u32 = 2; +pub const XDP_ZEROCOPY: u32 = 4; +pub const XDP_USE_NEED_WAKEUP: u32 = 8; +pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: u32 = 1; +pub const XDP_RING_NEED_WAKEUP: u32 = 1; +pub const XDP_MMAP_OFFSETS: u32 = 1; +pub const XDP_RX_RING: u32 = 2; +pub const XDP_TX_RING: u32 = 3; +pub const XDP_UMEM_REG: u32 = 4; +pub const XDP_UMEM_FILL_RING: u32 = 5; +pub const XDP_UMEM_COMPLETION_RING: u32 = 6; +pub const XDP_STATISTICS: u32 = 7; +pub const XDP_OPTIONS: u32 = 8; +pub const XDP_OPTIONS_ZEROCOPY: u32 = 1; +pub const XDP_PGOFF_RX_RING: u32 = 0; +pub const XDP_PGOFF_TX_RING: u32 = 2147483648; +pub const XDP_UMEM_PGOFF_FILL_RING: u64 = 4294967296; +pub const XDP_UMEM_PGOFF_COMPLETION_RING: u64 = 6442450944; +pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: u32 = 48; +pub const XSK_UNALIGNED_BUF_ADDR_MASK: u64 = 281474976710655; +pub const XDP_USE_SG: u32 = 16; +pub const XDP_PKT_CONTD: u32 = 1; diff --git a/src/riscv64/net.rs b/src/riscv64/net.rs index 8a340740..212c8717 100644 --- a/src/riscv64/net.rs +++ b/src/riscv64/net.rs @@ -1367,7 +1367,16 @@ pub const AF_RXRPC: u32 = 33; pub const AF_ISDN: u32 = 34; pub const AF_PHONET: u32 = 35; pub const AF_IEEE802154: u32 = 36; -pub const AF_MAX: u32 = 37; +pub const AF_CAIF: u32 = 37; +pub const AF_ALG: u32 = 38; +pub const AF_NFC: u32 = 39; +pub const AF_VSOCK: u32 = 40; +pub const AF_KCM: u32 = 41; +pub const AF_QIPCRTR: u32 = 42; +pub const AF_SMC: u32 = 43; +pub const AF_XDP: u32 = 44; +pub const AF_MCTP: u32 = 45; +pub const AF_MAX: u32 = 46; pub const MSG_OOB: u32 = 1; pub const MSG_PEEK: u32 = 2; pub const MSG_DONTROUTE: u32 = 4; diff --git a/src/riscv64/xdp.rs b/src/riscv64/xdp.rs new file mode 100644 index 00000000..a85ecd33 --- /dev/null +++ b/src/riscv64/xdp.rs @@ -0,0 +1,159 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_xdp { +pub sxdp_family: __u16, +pub sxdp_flags: __u16, +pub sxdp_ifindex: __u32, +pub sxdp_queue_id: __u32, +pub sxdp_shared_umem_fd: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +pub flags: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets { +pub rx: xdp_ring_offset, +pub tx: xdp_ring_offset, +pub fr: xdp_ring_offset, +pub cr: xdp_ring_offset, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +pub rx_ring_full: __u64, +pub rx_fill_ring_empty_descs: __u64, +pub tx_ring_empty_descs: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_options { +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_desc { +pub addr: __u64, +pub len: __u32, +pub options: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset_v1 { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets_v1 { +pub rx: xdp_ring_offset_v1, +pub tx: xdp_ring_offset_v1, +pub fr: xdp_ring_offset_v1, +pub cr: xdp_ring_offset_v1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg_v1 { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics_v1 { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +} +pub const XDP_SHARED_UMEM: u32 = 1; +pub const XDP_COPY: u32 = 2; +pub const XDP_ZEROCOPY: u32 = 4; +pub const XDP_USE_NEED_WAKEUP: u32 = 8; +pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: u32 = 1; +pub const XDP_RING_NEED_WAKEUP: u32 = 1; +pub const XDP_MMAP_OFFSETS: u32 = 1; +pub const XDP_RX_RING: u32 = 2; +pub const XDP_TX_RING: u32 = 3; +pub const XDP_UMEM_REG: u32 = 4; +pub const XDP_UMEM_FILL_RING: u32 = 5; +pub const XDP_UMEM_COMPLETION_RING: u32 = 6; +pub const XDP_STATISTICS: u32 = 7; +pub const XDP_OPTIONS: u32 = 8; +pub const XDP_OPTIONS_ZEROCOPY: u32 = 1; +pub const XDP_PGOFF_RX_RING: u32 = 0; +pub const XDP_PGOFF_TX_RING: u32 = 2147483648; +pub const XDP_UMEM_PGOFF_FILL_RING: u64 = 4294967296; +pub const XDP_UMEM_PGOFF_COMPLETION_RING: u64 = 6442450944; +pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: u32 = 48; +pub const XSK_UNALIGNED_BUF_ADDR_MASK: u64 = 281474976710655; +pub const XDP_USE_SG: u32 = 16; +pub const XDP_PKT_CONTD: u32 = 1; diff --git a/src/s390x/net.rs b/src/s390x/net.rs index 093de856..ca254d29 100644 --- a/src/s390x/net.rs +++ b/src/s390x/net.rs @@ -1381,7 +1381,16 @@ pub const AF_RXRPC: u32 = 33; pub const AF_ISDN: u32 = 34; pub const AF_PHONET: u32 = 35; pub const AF_IEEE802154: u32 = 36; -pub const AF_MAX: u32 = 37; +pub const AF_CAIF: u32 = 37; +pub const AF_ALG: u32 = 38; +pub const AF_NFC: u32 = 39; +pub const AF_VSOCK: u32 = 40; +pub const AF_KCM: u32 = 41; +pub const AF_QIPCRTR: u32 = 42; +pub const AF_SMC: u32 = 43; +pub const AF_XDP: u32 = 44; +pub const AF_MCTP: u32 = 45; +pub const AF_MAX: u32 = 46; pub const MSG_OOB: u32 = 1; pub const MSG_PEEK: u32 = 2; pub const MSG_DONTROUTE: u32 = 4; diff --git a/src/s390x/xdp.rs b/src/s390x/xdp.rs new file mode 100644 index 00000000..7e9f1e5d --- /dev/null +++ b/src/s390x/xdp.rs @@ -0,0 +1,179 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type addr_t = crate::ctypes::c_ulong; +pub type saddr_t = crate::ctypes::c_long; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_size_t = crate::ctypes::c_ulong; +pub type __kernel_ssize_t = crate::ctypes::c_long; +pub type __kernel_old_dev_t = crate::ctypes::c_ushort; +pub type __kernel_ino_t = crate::ctypes::c_uint; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_ptrdiff_t = crate::ctypes::c_long; +pub type __kernel_sigset_t = crate::ctypes::c_ulong; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C, packed(4))] +#[derive(Copy, Clone)] +pub struct __vector128 { +pub __bindgen_anon_1: __vector128__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __vector128__bindgen_ty_1__bindgen_ty_1 { +pub high: __u64, +pub low: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_xdp { +pub sxdp_family: __u16, +pub sxdp_flags: __u16, +pub sxdp_ifindex: __u32, +pub sxdp_queue_id: __u32, +pub sxdp_shared_umem_fd: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +pub flags: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets { +pub rx: xdp_ring_offset, +pub tx: xdp_ring_offset, +pub fr: xdp_ring_offset, +pub cr: xdp_ring_offset, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +pub rx_ring_full: __u64, +pub rx_fill_ring_empty_descs: __u64, +pub tx_ring_empty_descs: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_options { +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_desc { +pub addr: __u64, +pub len: __u32, +pub options: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset_v1 { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets_v1 { +pub rx: xdp_ring_offset_v1, +pub tx: xdp_ring_offset_v1, +pub fr: xdp_ring_offset_v1, +pub cr: xdp_ring_offset_v1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg_v1 { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics_v1 { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +} +pub const XDP_SHARED_UMEM: u32 = 1; +pub const XDP_COPY: u32 = 2; +pub const XDP_ZEROCOPY: u32 = 4; +pub const XDP_USE_NEED_WAKEUP: u32 = 8; +pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: u32 = 1; +pub const XDP_RING_NEED_WAKEUP: u32 = 1; +pub const XDP_MMAP_OFFSETS: u32 = 1; +pub const XDP_RX_RING: u32 = 2; +pub const XDP_TX_RING: u32 = 3; +pub const XDP_UMEM_REG: u32 = 4; +pub const XDP_UMEM_FILL_RING: u32 = 5; +pub const XDP_UMEM_COMPLETION_RING: u32 = 6; +pub const XDP_STATISTICS: u32 = 7; +pub const XDP_OPTIONS: u32 = 8; +pub const XDP_OPTIONS_ZEROCOPY: u32 = 1; +pub const XDP_PGOFF_RX_RING: u32 = 0; +pub const XDP_PGOFF_TX_RING: u32 = 2147483648; +pub const XDP_UMEM_PGOFF_FILL_RING: u64 = 4294967296; +pub const XDP_UMEM_PGOFF_COMPLETION_RING: u64 = 6442450944; +pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: u32 = 48; +pub const XSK_UNALIGNED_BUF_ADDR_MASK: u64 = 281474976710655; +pub const XDP_USE_SG: u32 = 16; +pub const XDP_PKT_CONTD: u32 = 1; +#[repr(C)] +#[derive(Copy, Clone)] +pub union __vector128__bindgen_ty_1 { +pub __bindgen_anon_1: __vector128__bindgen_ty_1__bindgen_ty_1, +pub u: [__u32; 4usize], +} diff --git a/src/sparc/net.rs b/src/sparc/net.rs index b4f273eb..93bb0665 100644 --- a/src/sparc/net.rs +++ b/src/sparc/net.rs @@ -1575,7 +1575,16 @@ pub const AF_RXRPC: u32 = 33; pub const AF_ISDN: u32 = 34; pub const AF_PHONET: u32 = 35; pub const AF_IEEE802154: u32 = 36; -pub const AF_MAX: u32 = 37; +pub const AF_CAIF: u32 = 37; +pub const AF_ALG: u32 = 38; +pub const AF_NFC: u32 = 39; +pub const AF_VSOCK: u32 = 40; +pub const AF_KCM: u32 = 41; +pub const AF_QIPCRTR: u32 = 42; +pub const AF_SMC: u32 = 43; +pub const AF_XDP: u32 = 44; +pub const AF_MCTP: u32 = 45; +pub const AF_MAX: u32 = 46; pub const MSG_OOB: u32 = 1; pub const MSG_PEEK: u32 = 2; pub const MSG_DONTROUTE: u32 = 4; diff --git a/src/sparc/xdp.rs b/src/sparc/xdp.rs new file mode 100644 index 00000000..d5550966 --- /dev/null +++ b/src/sparc/xdp.rs @@ -0,0 +1,159 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_long; +pub type __kernel_ipc_pid_t = crate::ctypes::c_ushort; +pub type __kernel_uid_t = crate::ctypes::c_ushort; +pub type __kernel_gid_t = crate::ctypes::c_ushort; +pub type __kernel_mode_t = crate::ctypes::c_ushort; +pub type __kernel_daddr_t = crate::ctypes::c_long; +pub type __kernel_old_dev_t = crate::ctypes::c_ushort; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_xdp { +pub sxdp_family: __u16, +pub sxdp_flags: __u16, +pub sxdp_ifindex: __u32, +pub sxdp_queue_id: __u32, +pub sxdp_shared_umem_fd: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +pub flags: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets { +pub rx: xdp_ring_offset, +pub tx: xdp_ring_offset, +pub fr: xdp_ring_offset, +pub cr: xdp_ring_offset, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +pub rx_ring_full: __u64, +pub rx_fill_ring_empty_descs: __u64, +pub tx_ring_empty_descs: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_options { +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_desc { +pub addr: __u64, +pub len: __u32, +pub options: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset_v1 { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets_v1 { +pub rx: xdp_ring_offset_v1, +pub tx: xdp_ring_offset_v1, +pub fr: xdp_ring_offset_v1, +pub cr: xdp_ring_offset_v1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg_v1 { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics_v1 { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +} +pub const XDP_SHARED_UMEM: u32 = 1; +pub const XDP_COPY: u32 = 2; +pub const XDP_ZEROCOPY: u32 = 4; +pub const XDP_USE_NEED_WAKEUP: u32 = 8; +pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: u32 = 1; +pub const XDP_RING_NEED_WAKEUP: u32 = 1; +pub const XDP_MMAP_OFFSETS: u32 = 1; +pub const XDP_RX_RING: u32 = 2; +pub const XDP_TX_RING: u32 = 3; +pub const XDP_UMEM_REG: u32 = 4; +pub const XDP_UMEM_FILL_RING: u32 = 5; +pub const XDP_UMEM_COMPLETION_RING: u32 = 6; +pub const XDP_STATISTICS: u32 = 7; +pub const XDP_OPTIONS: u32 = 8; +pub const XDP_OPTIONS_ZEROCOPY: u32 = 1; +pub const XDP_PGOFF_RX_RING: u32 = 0; +pub const XDP_PGOFF_TX_RING: u32 = 2147483648; +pub const XDP_UMEM_PGOFF_FILL_RING: u64 = 4294967296; +pub const XDP_UMEM_PGOFF_COMPLETION_RING: u64 = 6442450944; +pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: u32 = 48; +pub const XSK_UNALIGNED_BUF_ADDR_MASK: u64 = 281474976710655; +pub const XDP_USE_SG: u32 = 16; +pub const XDP_PKT_CONTD: u32 = 1; diff --git a/src/sparc64/net.rs b/src/sparc64/net.rs index 693e1a6e..a7edde90 100644 --- a/src/sparc64/net.rs +++ b/src/sparc64/net.rs @@ -1589,7 +1589,16 @@ pub const AF_RXRPC: u32 = 33; pub const AF_ISDN: u32 = 34; pub const AF_PHONET: u32 = 35; pub const AF_IEEE802154: u32 = 36; -pub const AF_MAX: u32 = 37; +pub const AF_CAIF: u32 = 37; +pub const AF_ALG: u32 = 38; +pub const AF_NFC: u32 = 39; +pub const AF_VSOCK: u32 = 40; +pub const AF_KCM: u32 = 41; +pub const AF_QIPCRTR: u32 = 42; +pub const AF_SMC: u32 = 43; +pub const AF_XDP: u32 = 44; +pub const AF_MCTP: u32 = 45; +pub const AF_MAX: u32 = 46; pub const MSG_OOB: u32 = 1; pub const MSG_PEEK: u32 = 2; pub const MSG_DONTROUTE: u32 = 4; diff --git a/src/sparc64/xdp.rs b/src/sparc64/xdp.rs new file mode 100644 index 00000000..e19e4b5b --- /dev/null +++ b/src/sparc64/xdp.rs @@ -0,0 +1,165 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_old_uid_t = crate::ctypes::c_ushort; +pub type __kernel_old_gid_t = crate::ctypes::c_ushort; +pub type __kernel_suseconds_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __kernel_old_timeval { +pub tv_sec: __kernel_long_t, +pub tv_usec: __kernel_suseconds_t, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_xdp { +pub sxdp_family: __u16, +pub sxdp_flags: __u16, +pub sxdp_ifindex: __u32, +pub sxdp_queue_id: __u32, +pub sxdp_shared_umem_fd: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +pub flags: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets { +pub rx: xdp_ring_offset, +pub tx: xdp_ring_offset, +pub fr: xdp_ring_offset, +pub cr: xdp_ring_offset, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +pub rx_ring_full: __u64, +pub rx_fill_ring_empty_descs: __u64, +pub tx_ring_empty_descs: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_options { +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_desc { +pub addr: __u64, +pub len: __u32, +pub options: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset_v1 { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets_v1 { +pub rx: xdp_ring_offset_v1, +pub tx: xdp_ring_offset_v1, +pub fr: xdp_ring_offset_v1, +pub cr: xdp_ring_offset_v1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg_v1 { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics_v1 { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +} +pub const XDP_SHARED_UMEM: u32 = 1; +pub const XDP_COPY: u32 = 2; +pub const XDP_ZEROCOPY: u32 = 4; +pub const XDP_USE_NEED_WAKEUP: u32 = 8; +pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: u32 = 1; +pub const XDP_RING_NEED_WAKEUP: u32 = 1; +pub const XDP_MMAP_OFFSETS: u32 = 1; +pub const XDP_RX_RING: u32 = 2; +pub const XDP_TX_RING: u32 = 3; +pub const XDP_UMEM_REG: u32 = 4; +pub const XDP_UMEM_FILL_RING: u32 = 5; +pub const XDP_UMEM_COMPLETION_RING: u32 = 6; +pub const XDP_STATISTICS: u32 = 7; +pub const XDP_OPTIONS: u32 = 8; +pub const XDP_OPTIONS_ZEROCOPY: u32 = 1; +pub const XDP_PGOFF_RX_RING: u32 = 0; +pub const XDP_PGOFF_TX_RING: u32 = 2147483648; +pub const XDP_UMEM_PGOFF_FILL_RING: u64 = 4294967296; +pub const XDP_UMEM_PGOFF_COMPLETION_RING: u64 = 6442450944; +pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: u32 = 48; +pub const XSK_UNALIGNED_BUF_ADDR_MASK: u64 = 281474976710655; +pub const XDP_USE_SG: u32 = 16; +pub const XDP_PKT_CONTD: u32 = 1; diff --git a/src/x32/net.rs b/src/x32/net.rs index 7aa06010..086d7573 100644 --- a/src/x32/net.rs +++ b/src/x32/net.rs @@ -1367,7 +1367,16 @@ pub const AF_RXRPC: u32 = 33; pub const AF_ISDN: u32 = 34; pub const AF_PHONET: u32 = 35; pub const AF_IEEE802154: u32 = 36; -pub const AF_MAX: u32 = 37; +pub const AF_CAIF: u32 = 37; +pub const AF_ALG: u32 = 38; +pub const AF_NFC: u32 = 39; +pub const AF_VSOCK: u32 = 40; +pub const AF_KCM: u32 = 41; +pub const AF_QIPCRTR: u32 = 42; +pub const AF_SMC: u32 = 43; +pub const AF_XDP: u32 = 44; +pub const AF_MCTP: u32 = 45; +pub const AF_MAX: u32 = 46; pub const MSG_OOB: u32 = 1; pub const MSG_PEEK: u32 = 2; pub const MSG_DONTROUTE: u32 = 4; diff --git a/src/x32/xdp.rs b/src/x32/xdp.rs new file mode 100644 index 00000000..94a9caa0 --- /dev/null +++ b/src/x32/xdp.rs @@ -0,0 +1,159 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_longlong; +pub type __kernel_ulong_t = crate::ctypes::c_ulonglong; +pub type __kernel_old_uid_t = crate::ctypes::c_ushort; +pub type __kernel_old_gid_t = crate::ctypes::c_ushort; +pub type __kernel_old_dev_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_xdp { +pub sxdp_family: __u16, +pub sxdp_flags: __u16, +pub sxdp_ifindex: __u32, +pub sxdp_queue_id: __u32, +pub sxdp_shared_umem_fd: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +pub flags: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets { +pub rx: xdp_ring_offset, +pub tx: xdp_ring_offset, +pub fr: xdp_ring_offset, +pub cr: xdp_ring_offset, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +pub rx_ring_full: __u64, +pub rx_fill_ring_empty_descs: __u64, +pub tx_ring_empty_descs: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_options { +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_desc { +pub addr: __u64, +pub len: __u32, +pub options: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset_v1 { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets_v1 { +pub rx: xdp_ring_offset_v1, +pub tx: xdp_ring_offset_v1, +pub fr: xdp_ring_offset_v1, +pub cr: xdp_ring_offset_v1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg_v1 { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics_v1 { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +} +pub const XDP_SHARED_UMEM: u32 = 1; +pub const XDP_COPY: u32 = 2; +pub const XDP_ZEROCOPY: u32 = 4; +pub const XDP_USE_NEED_WAKEUP: u32 = 8; +pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: u32 = 1; +pub const XDP_RING_NEED_WAKEUP: u32 = 1; +pub const XDP_MMAP_OFFSETS: u32 = 1; +pub const XDP_RX_RING: u32 = 2; +pub const XDP_TX_RING: u32 = 3; +pub const XDP_UMEM_REG: u32 = 4; +pub const XDP_UMEM_FILL_RING: u32 = 5; +pub const XDP_UMEM_COMPLETION_RING: u32 = 6; +pub const XDP_STATISTICS: u32 = 7; +pub const XDP_OPTIONS: u32 = 8; +pub const XDP_OPTIONS_ZEROCOPY: u32 = 1; +pub const XDP_PGOFF_RX_RING: u32 = 0; +pub const XDP_PGOFF_TX_RING: u32 = 2147483648; +pub const XDP_UMEM_PGOFF_FILL_RING: u64 = 4294967296; +pub const XDP_UMEM_PGOFF_COMPLETION_RING: u64 = 6442450944; +pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: u32 = 48; +pub const XSK_UNALIGNED_BUF_ADDR_MASK: u64 = 281474976710655; +pub const XDP_USE_SG: u32 = 16; +pub const XDP_PKT_CONTD: u32 = 1; diff --git a/src/x86/net.rs b/src/x86/net.rs index 56302127..1e7ad270 100644 --- a/src/x86/net.rs +++ b/src/x86/net.rs @@ -1359,7 +1359,16 @@ pub const AF_RXRPC: u32 = 33; pub const AF_ISDN: u32 = 34; pub const AF_PHONET: u32 = 35; pub const AF_IEEE802154: u32 = 36; -pub const AF_MAX: u32 = 37; +pub const AF_CAIF: u32 = 37; +pub const AF_ALG: u32 = 38; +pub const AF_NFC: u32 = 39; +pub const AF_VSOCK: u32 = 40; +pub const AF_KCM: u32 = 41; +pub const AF_QIPCRTR: u32 = 42; +pub const AF_SMC: u32 = 43; +pub const AF_XDP: u32 = 44; +pub const AF_MCTP: u32 = 45; +pub const AF_MAX: u32 = 46; pub const MSG_OOB: u32 = 1; pub const MSG_PEEK: u32 = 2; pub const MSG_DONTROUTE: u32 = 4; diff --git a/src/x86/xdp.rs b/src/x86/xdp.rs new file mode 100644 index 00000000..12920735 --- /dev/null +++ b/src/x86/xdp.rs @@ -0,0 +1,159 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_mode_t = crate::ctypes::c_ushort; +pub type __kernel_ipc_pid_t = crate::ctypes::c_ushort; +pub type __kernel_uid_t = crate::ctypes::c_ushort; +pub type __kernel_gid_t = crate::ctypes::c_ushort; +pub type __kernel_old_dev_t = crate::ctypes::c_ushort; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_xdp { +pub sxdp_family: __u16, +pub sxdp_flags: __u16, +pub sxdp_ifindex: __u32, +pub sxdp_queue_id: __u32, +pub sxdp_shared_umem_fd: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +pub flags: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets { +pub rx: xdp_ring_offset, +pub tx: xdp_ring_offset, +pub fr: xdp_ring_offset, +pub cr: xdp_ring_offset, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +pub rx_ring_full: __u64, +pub rx_fill_ring_empty_descs: __u64, +pub tx_ring_empty_descs: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_options { +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_desc { +pub addr: __u64, +pub len: __u32, +pub options: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset_v1 { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets_v1 { +pub rx: xdp_ring_offset_v1, +pub tx: xdp_ring_offset_v1, +pub fr: xdp_ring_offset_v1, +pub cr: xdp_ring_offset_v1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg_v1 { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics_v1 { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +} +pub const XDP_SHARED_UMEM: u32 = 1; +pub const XDP_COPY: u32 = 2; +pub const XDP_ZEROCOPY: u32 = 4; +pub const XDP_USE_NEED_WAKEUP: u32 = 8; +pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: u32 = 1; +pub const XDP_RING_NEED_WAKEUP: u32 = 1; +pub const XDP_MMAP_OFFSETS: u32 = 1; +pub const XDP_RX_RING: u32 = 2; +pub const XDP_TX_RING: u32 = 3; +pub const XDP_UMEM_REG: u32 = 4; +pub const XDP_UMEM_FILL_RING: u32 = 5; +pub const XDP_UMEM_COMPLETION_RING: u32 = 6; +pub const XDP_STATISTICS: u32 = 7; +pub const XDP_OPTIONS: u32 = 8; +pub const XDP_OPTIONS_ZEROCOPY: u32 = 1; +pub const XDP_PGOFF_RX_RING: u32 = 0; +pub const XDP_PGOFF_TX_RING: u32 = 2147483648; +pub const XDP_UMEM_PGOFF_FILL_RING: u64 = 4294967296; +pub const XDP_UMEM_PGOFF_COMPLETION_RING: u64 = 6442450944; +pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: u32 = 48; +pub const XSK_UNALIGNED_BUF_ADDR_MASK: u64 = 281474976710655; +pub const XDP_USE_SG: u32 = 16; +pub const XDP_PKT_CONTD: u32 = 1; diff --git a/src/x86_64/net.rs b/src/x86_64/net.rs index 41216c6a..cad9fdbe 100644 --- a/src/x86_64/net.rs +++ b/src/x86_64/net.rs @@ -1367,7 +1367,16 @@ pub const AF_RXRPC: u32 = 33; pub const AF_ISDN: u32 = 34; pub const AF_PHONET: u32 = 35; pub const AF_IEEE802154: u32 = 36; -pub const AF_MAX: u32 = 37; +pub const AF_CAIF: u32 = 37; +pub const AF_ALG: u32 = 38; +pub const AF_NFC: u32 = 39; +pub const AF_VSOCK: u32 = 40; +pub const AF_KCM: u32 = 41; +pub const AF_QIPCRTR: u32 = 42; +pub const AF_SMC: u32 = 43; +pub const AF_XDP: u32 = 44; +pub const AF_MCTP: u32 = 45; +pub const AF_MAX: u32 = 46; pub const MSG_OOB: u32 = 1; pub const MSG_PEEK: u32 = 2; pub const MSG_DONTROUTE: u32 = 4; diff --git a/src/x86_64/xdp.rs b/src/x86_64/xdp.rs new file mode 100644 index 00000000..3105f108 --- /dev/null +++ b/src/x86_64/xdp.rs @@ -0,0 +1,159 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_old_uid_t = crate::ctypes::c_ushort; +pub type __kernel_old_gid_t = crate::ctypes::c_ushort; +pub type __kernel_old_dev_t = crate::ctypes::c_ulong; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_xdp { +pub sxdp_family: __u16, +pub sxdp_flags: __u16, +pub sxdp_ifindex: __u32, +pub sxdp_queue_id: __u32, +pub sxdp_shared_umem_fd: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +pub flags: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets { +pub rx: xdp_ring_offset, +pub tx: xdp_ring_offset, +pub fr: xdp_ring_offset, +pub cr: xdp_ring_offset, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +pub rx_ring_full: __u64, +pub rx_fill_ring_empty_descs: __u64, +pub tx_ring_empty_descs: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_options { +pub flags: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_desc { +pub addr: __u64, +pub len: __u32, +pub options: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_ring_offset_v1 { +pub producer: __u64, +pub consumer: __u64, +pub desc: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_mmap_offsets_v1 { +pub rx: xdp_ring_offset_v1, +pub tx: xdp_ring_offset_v1, +pub fr: xdp_ring_offset_v1, +pub cr: xdp_ring_offset_v1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_umem_reg_v1 { +pub addr: __u64, +pub len: __u64, +pub chunk_size: __u32, +pub headroom: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xdp_statistics_v1 { +pub rx_dropped: __u64, +pub rx_invalid_descs: __u64, +pub tx_invalid_descs: __u64, +} +pub const XDP_SHARED_UMEM: u32 = 1; +pub const XDP_COPY: u32 = 2; +pub const XDP_ZEROCOPY: u32 = 4; +pub const XDP_USE_NEED_WAKEUP: u32 = 8; +pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: u32 = 1; +pub const XDP_RING_NEED_WAKEUP: u32 = 1; +pub const XDP_MMAP_OFFSETS: u32 = 1; +pub const XDP_RX_RING: u32 = 2; +pub const XDP_TX_RING: u32 = 3; +pub const XDP_UMEM_REG: u32 = 4; +pub const XDP_UMEM_FILL_RING: u32 = 5; +pub const XDP_UMEM_COMPLETION_RING: u32 = 6; +pub const XDP_STATISTICS: u32 = 7; +pub const XDP_OPTIONS: u32 = 8; +pub const XDP_OPTIONS_ZEROCOPY: u32 = 1; +pub const XDP_PGOFF_RX_RING: u32 = 0; +pub const XDP_PGOFF_TX_RING: u32 = 2147483648; +pub const XDP_UMEM_PGOFF_FILL_RING: u64 = 4294967296; +pub const XDP_UMEM_PGOFF_COMPLETION_RING: u64 = 6442450944; +pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: u32 = 48; +pub const XSK_UNALIGNED_BUF_ADDR_MASK: u64 = 281474976710655; +pub const XDP_USE_SG: u32 = 16; +pub const XDP_PKT_CONTD: u32 = 1;