linux_raw_sys/x86_64/
xdp.rs

1/* automatically generated by rust-bindgen 0.71.1 */
2
3pub type __s8 = crate::ctypes::c_schar;
4pub type __u8 = crate::ctypes::c_uchar;
5pub type __s16 = crate::ctypes::c_short;
6pub type __u16 = crate::ctypes::c_ushort;
7pub type __s32 = crate::ctypes::c_int;
8pub type __u32 = crate::ctypes::c_uint;
9pub type __s64 = crate::ctypes::c_longlong;
10pub type __u64 = crate::ctypes::c_ulonglong;
11pub type __kernel_key_t = crate::ctypes::c_int;
12pub type __kernel_mqd_t = crate::ctypes::c_int;
13pub type __kernel_old_uid_t = crate::ctypes::c_ushort;
14pub type __kernel_old_gid_t = crate::ctypes::c_ushort;
15pub type __kernel_old_dev_t = crate::ctypes::c_ulong;
16pub type __kernel_long_t = crate::ctypes::c_long;
17pub type __kernel_ulong_t = crate::ctypes::c_ulong;
18pub type __kernel_ino_t = __kernel_ulong_t;
19pub type __kernel_mode_t = crate::ctypes::c_uint;
20pub type __kernel_pid_t = crate::ctypes::c_int;
21pub type __kernel_ipc_pid_t = crate::ctypes::c_int;
22pub type __kernel_uid_t = crate::ctypes::c_uint;
23pub type __kernel_gid_t = crate::ctypes::c_uint;
24pub type __kernel_suseconds_t = __kernel_long_t;
25pub type __kernel_daddr_t = crate::ctypes::c_int;
26pub type __kernel_uid32_t = crate::ctypes::c_uint;
27pub type __kernel_gid32_t = crate::ctypes::c_uint;
28pub type __kernel_size_t = __kernel_ulong_t;
29pub type __kernel_ssize_t = __kernel_long_t;
30pub type __kernel_ptrdiff_t = __kernel_long_t;
31pub type __kernel_off_t = __kernel_long_t;
32pub type __kernel_loff_t = crate::ctypes::c_longlong;
33pub type __kernel_old_time_t = __kernel_long_t;
34pub type __kernel_time_t = __kernel_long_t;
35pub type __kernel_time64_t = crate::ctypes::c_longlong;
36pub type __kernel_clock_t = __kernel_long_t;
37pub type __kernel_timer_t = crate::ctypes::c_int;
38pub type __kernel_clockid_t = crate::ctypes::c_int;
39pub type __kernel_caddr_t = *mut crate::ctypes::c_char;
40pub type __kernel_uid16_t = crate::ctypes::c_ushort;
41pub type __kernel_gid16_t = crate::ctypes::c_ushort;
42pub type __s128 = i128;
43pub type __u128 = u128;
44pub type __le16 = __u16;
45pub type __be16 = __u16;
46pub type __le32 = __u32;
47pub type __be32 = __u32;
48pub type __le64 = __u64;
49pub type __be64 = __u64;
50pub type __sum16 = __u16;
51pub type __wsum = __u32;
52pub type __poll_t = crate::ctypes::c_uint;
53#[repr(C)]
54#[derive(Debug, Copy, Clone)]
55pub struct sockaddr_xdp {
56pub sxdp_family: __u16,
57pub sxdp_flags: __u16,
58pub sxdp_ifindex: __u32,
59pub sxdp_queue_id: __u32,
60pub sxdp_shared_umem_fd: __u32,
61}
62#[repr(C)]
63#[derive(Debug, Copy, Clone)]
64pub struct xdp_ring_offset {
65pub producer: __u64,
66pub consumer: __u64,
67pub desc: __u64,
68pub flags: __u64,
69}
70#[repr(C)]
71#[derive(Debug, Copy, Clone)]
72pub struct xdp_mmap_offsets {
73pub rx: xdp_ring_offset,
74pub tx: xdp_ring_offset,
75pub fr: xdp_ring_offset,
76pub cr: xdp_ring_offset,
77}
78#[repr(C)]
79#[derive(Debug, Copy, Clone)]
80pub struct xdp_umem_reg {
81pub addr: __u64,
82pub len: __u64,
83pub chunk_size: __u32,
84pub headroom: __u32,
85pub flags: __u32,
86pub tx_metadata_len: __u32,
87}
88#[repr(C)]
89#[derive(Debug, Copy, Clone)]
90pub struct xdp_statistics {
91pub rx_dropped: __u64,
92pub rx_invalid_descs: __u64,
93pub tx_invalid_descs: __u64,
94pub rx_ring_full: __u64,
95pub rx_fill_ring_empty_descs: __u64,
96pub tx_ring_empty_descs: __u64,
97}
98#[repr(C)]
99#[derive(Debug, Copy, Clone)]
100pub struct xdp_options {
101pub flags: __u32,
102}
103#[repr(C)]
104#[derive(Copy, Clone)]
105pub struct xsk_tx_metadata {
106pub flags: __u64,
107pub __bindgen_anon_1: xsk_tx_metadata__bindgen_ty_1,
108}
109#[repr(C)]
110#[derive(Debug, Copy, Clone)]
111pub struct xsk_tx_metadata__bindgen_ty_1__bindgen_ty_1 {
112pub csum_start: __u16,
113pub csum_offset: __u16,
114}
115#[repr(C)]
116#[derive(Debug, Copy, Clone)]
117pub struct xsk_tx_metadata__bindgen_ty_1__bindgen_ty_2 {
118pub tx_timestamp: __u64,
119}
120#[repr(C)]
121#[derive(Debug, Copy, Clone)]
122pub struct xdp_desc {
123pub addr: __u64,
124pub len: __u32,
125pub options: __u32,
126}
127#[repr(C)]
128#[derive(Debug, Copy, Clone)]
129pub struct xdp_ring_offset_v1 {
130pub producer: __u64,
131pub consumer: __u64,
132pub desc: __u64,
133}
134#[repr(C)]
135#[derive(Debug, Copy, Clone)]
136pub struct xdp_mmap_offsets_v1 {
137pub rx: xdp_ring_offset_v1,
138pub tx: xdp_ring_offset_v1,
139pub fr: xdp_ring_offset_v1,
140pub cr: xdp_ring_offset_v1,
141}
142#[repr(C)]
143#[derive(Debug, Copy, Clone)]
144pub struct xdp_umem_reg_v1 {
145pub addr: __u64,
146pub len: __u64,
147pub chunk_size: __u32,
148pub headroom: __u32,
149}
150#[repr(C)]
151#[derive(Debug, Copy, Clone)]
152pub struct xdp_statistics_v1 {
153pub rx_dropped: __u64,
154pub rx_invalid_descs: __u64,
155pub tx_invalid_descs: __u64,
156}
157pub const __BITS_PER_LONG_LONG: u32 = 64;
158pub const XDP_SHARED_UMEM: u32 = 1;
159pub const XDP_COPY: u32 = 2;
160pub const XDP_ZEROCOPY: u32 = 4;
161pub const XDP_USE_NEED_WAKEUP: u32 = 8;
162pub const XDP_USE_SG: u32 = 16;
163pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: u32 = 1;
164pub const XDP_UMEM_TX_SW_CSUM: u32 = 2;
165pub const XDP_UMEM_TX_METADATA_LEN: u32 = 4;
166pub const XDP_RING_NEED_WAKEUP: u32 = 1;
167pub const XDP_MMAP_OFFSETS: u32 = 1;
168pub const XDP_RX_RING: u32 = 2;
169pub const XDP_TX_RING: u32 = 3;
170pub const XDP_UMEM_REG: u32 = 4;
171pub const XDP_UMEM_FILL_RING: u32 = 5;
172pub const XDP_UMEM_COMPLETION_RING: u32 = 6;
173pub const XDP_STATISTICS: u32 = 7;
174pub const XDP_OPTIONS: u32 = 8;
175pub const XDP_OPTIONS_ZEROCOPY: u32 = 1;
176pub const XDP_PGOFF_RX_RING: u32 = 0;
177pub const XDP_PGOFF_TX_RING: u32 = 2147483648;
178pub const XDP_UMEM_PGOFF_FILL_RING: u64 = 4294967296;
179pub const XDP_UMEM_PGOFF_COMPLETION_RING: u64 = 6442450944;
180pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: u32 = 48;
181pub const XSK_UNALIGNED_BUF_ADDR_MASK: u64 = 281474976710655;
182pub const XDP_TXMD_FLAGS_TIMESTAMP: u32 = 1;
183pub const XDP_TXMD_FLAGS_CHECKSUM: u32 = 2;
184pub const XDP_PKT_CONTD: u32 = 1;
185pub const XDP_TX_METADATA: u32 = 2;
186#[repr(C)]
187#[derive(Copy, Clone)]
188pub union xsk_tx_metadata__bindgen_ty_1 {
189pub request: xsk_tx_metadata__bindgen_ty_1__bindgen_ty_1,
190pub completion: xsk_tx_metadata__bindgen_ty_1__bindgen_ty_2,
191}