linux_raw_sys/x86_64/
if_packet.rs

1/* automatically generated by rust-bindgen 0.72.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_pkt {
56pub spkt_family: crate::ctypes::c_ushort,
57pub spkt_device: [crate::ctypes::c_uchar; 14usize],
58pub spkt_protocol: __be16,
59}
60#[repr(C)]
61#[derive(Debug, Copy, Clone)]
62pub struct sockaddr_ll {
63pub sll_family: crate::ctypes::c_ushort,
64pub sll_protocol: __be16,
65pub sll_ifindex: crate::ctypes::c_int,
66pub sll_hatype: crate::ctypes::c_ushort,
67pub sll_pkttype: crate::ctypes::c_uchar,
68pub sll_halen: crate::ctypes::c_uchar,
69pub sll_addr: [crate::ctypes::c_uchar; 8usize],
70}
71#[repr(C)]
72#[derive(Debug, Copy, Clone)]
73pub struct tpacket_stats {
74pub tp_packets: crate::ctypes::c_uint,
75pub tp_drops: crate::ctypes::c_uint,
76}
77#[repr(C)]
78#[derive(Debug, Copy, Clone)]
79pub struct tpacket_stats_v3 {
80pub tp_packets: crate::ctypes::c_uint,
81pub tp_drops: crate::ctypes::c_uint,
82pub tp_freeze_q_cnt: crate::ctypes::c_uint,
83}
84#[repr(C)]
85#[derive(Debug, Copy, Clone)]
86pub struct tpacket_rollover_stats {
87pub tp_all: __u64,
88pub tp_huge: __u64,
89pub tp_failed: __u64,
90}
91#[repr(C)]
92#[derive(Debug, Copy, Clone)]
93pub struct tpacket_auxdata {
94pub tp_status: __u32,
95pub tp_len: __u32,
96pub tp_snaplen: __u32,
97pub tp_mac: __u16,
98pub tp_net: __u16,
99pub tp_vlan_tci: __u16,
100pub tp_vlan_tpid: __u16,
101}
102#[repr(C)]
103#[derive(Debug, Copy, Clone)]
104pub struct tpacket_hdr {
105pub tp_status: crate::ctypes::c_ulong,
106pub tp_len: crate::ctypes::c_uint,
107pub tp_snaplen: crate::ctypes::c_uint,
108pub tp_mac: crate::ctypes::c_ushort,
109pub tp_net: crate::ctypes::c_ushort,
110pub tp_sec: crate::ctypes::c_uint,
111pub tp_usec: crate::ctypes::c_uint,
112}
113#[repr(C)]
114#[derive(Debug, Copy, Clone)]
115pub struct tpacket2_hdr {
116pub tp_status: __u32,
117pub tp_len: __u32,
118pub tp_snaplen: __u32,
119pub tp_mac: __u16,
120pub tp_net: __u16,
121pub tp_sec: __u32,
122pub tp_nsec: __u32,
123pub tp_vlan_tci: __u16,
124pub tp_vlan_tpid: __u16,
125pub tp_padding: [__u8; 4usize],
126}
127#[repr(C)]
128#[derive(Debug, Copy, Clone)]
129pub struct tpacket_hdr_variant1 {
130pub tp_rxhash: __u32,
131pub tp_vlan_tci: __u32,
132pub tp_vlan_tpid: __u16,
133pub tp_padding: __u16,
134}
135#[repr(C)]
136#[derive(Copy, Clone)]
137pub struct tpacket3_hdr {
138pub tp_next_offset: __u32,
139pub tp_sec: __u32,
140pub tp_nsec: __u32,
141pub tp_snaplen: __u32,
142pub tp_len: __u32,
143pub tp_status: __u32,
144pub tp_mac: __u16,
145pub tp_net: __u16,
146pub __bindgen_anon_1: tpacket3_hdr__bindgen_ty_1,
147pub tp_padding: [__u8; 8usize],
148}
149#[repr(C)]
150#[derive(Copy, Clone)]
151pub struct tpacket_bd_ts {
152pub ts_sec: crate::ctypes::c_uint,
153pub __bindgen_anon_1: tpacket_bd_ts__bindgen_ty_1,
154}
155#[repr(C)]
156#[derive(Copy, Clone)]
157pub struct tpacket_hdr_v1 {
158pub block_status: __u32,
159pub num_pkts: __u32,
160pub offset_to_first_pkt: __u32,
161pub blk_len: __u32,
162pub seq_num: __u64,
163pub ts_first_pkt: tpacket_bd_ts,
164pub ts_last_pkt: tpacket_bd_ts,
165}
166#[repr(C)]
167#[derive(Copy, Clone)]
168pub struct tpacket_block_desc {
169pub version: __u32,
170pub offset_to_priv: __u32,
171pub hdr: tpacket_bd_header_u,
172}
173#[repr(C)]
174#[derive(Debug, Copy, Clone)]
175pub struct tpacket_req {
176pub tp_block_size: crate::ctypes::c_uint,
177pub tp_block_nr: crate::ctypes::c_uint,
178pub tp_frame_size: crate::ctypes::c_uint,
179pub tp_frame_nr: crate::ctypes::c_uint,
180}
181#[repr(C)]
182#[derive(Debug, Copy, Clone)]
183pub struct tpacket_req3 {
184pub tp_block_size: crate::ctypes::c_uint,
185pub tp_block_nr: crate::ctypes::c_uint,
186pub tp_frame_size: crate::ctypes::c_uint,
187pub tp_frame_nr: crate::ctypes::c_uint,
188pub tp_retire_blk_tov: crate::ctypes::c_uint,
189pub tp_sizeof_priv: crate::ctypes::c_uint,
190pub tp_feature_req_word: crate::ctypes::c_uint,
191}
192#[repr(C)]
193#[derive(Debug, Copy, Clone)]
194pub struct packet_mreq {
195pub mr_ifindex: crate::ctypes::c_int,
196pub mr_type: crate::ctypes::c_ushort,
197pub mr_alen: crate::ctypes::c_ushort,
198pub mr_address: [crate::ctypes::c_uchar; 8usize],
199}
200#[repr(C)]
201#[derive(Debug, Copy, Clone)]
202pub struct fanout_args {
203pub id: __u16,
204pub type_flags: __u16,
205pub max_num_members: __u32,
206}
207pub const __LITTLE_ENDIAN: u32 = 1234;
208pub const __BITS_PER_LONG_LONG: u32 = 64;
209pub const PACKET_HOST: u32 = 0;
210pub const PACKET_BROADCAST: u32 = 1;
211pub const PACKET_MULTICAST: u32 = 2;
212pub const PACKET_OTHERHOST: u32 = 3;
213pub const PACKET_OUTGOING: u32 = 4;
214pub const PACKET_LOOPBACK: u32 = 5;
215pub const PACKET_USER: u32 = 6;
216pub const PACKET_KERNEL: u32 = 7;
217pub const PACKET_FASTROUTE: u32 = 6;
218pub const PACKET_ADD_MEMBERSHIP: u32 = 1;
219pub const PACKET_DROP_MEMBERSHIP: u32 = 2;
220pub const PACKET_RECV_OUTPUT: u32 = 3;
221pub const PACKET_RX_RING: u32 = 5;
222pub const PACKET_STATISTICS: u32 = 6;
223pub const PACKET_COPY_THRESH: u32 = 7;
224pub const PACKET_AUXDATA: u32 = 8;
225pub const PACKET_ORIGDEV: u32 = 9;
226pub const PACKET_VERSION: u32 = 10;
227pub const PACKET_HDRLEN: u32 = 11;
228pub const PACKET_RESERVE: u32 = 12;
229pub const PACKET_TX_RING: u32 = 13;
230pub const PACKET_LOSS: u32 = 14;
231pub const PACKET_VNET_HDR: u32 = 15;
232pub const PACKET_TX_TIMESTAMP: u32 = 16;
233pub const PACKET_TIMESTAMP: u32 = 17;
234pub const PACKET_FANOUT: u32 = 18;
235pub const PACKET_TX_HAS_OFF: u32 = 19;
236pub const PACKET_QDISC_BYPASS: u32 = 20;
237pub const PACKET_ROLLOVER_STATS: u32 = 21;
238pub const PACKET_FANOUT_DATA: u32 = 22;
239pub const PACKET_IGNORE_OUTGOING: u32 = 23;
240pub const PACKET_VNET_HDR_SZ: u32 = 24;
241pub const PACKET_FANOUT_HASH: u32 = 0;
242pub const PACKET_FANOUT_LB: u32 = 1;
243pub const PACKET_FANOUT_CPU: u32 = 2;
244pub const PACKET_FANOUT_ROLLOVER: u32 = 3;
245pub const PACKET_FANOUT_RND: u32 = 4;
246pub const PACKET_FANOUT_QM: u32 = 5;
247pub const PACKET_FANOUT_CBPF: u32 = 6;
248pub const PACKET_FANOUT_EBPF: u32 = 7;
249pub const PACKET_FANOUT_FLAG_ROLLOVER: u32 = 4096;
250pub const PACKET_FANOUT_FLAG_UNIQUEID: u32 = 8192;
251pub const PACKET_FANOUT_FLAG_IGNORE_OUTGOING: u32 = 16384;
252pub const PACKET_FANOUT_FLAG_DEFRAG: u32 = 32768;
253pub const TP_STATUS_KERNEL: u32 = 0;
254pub const TP_STATUS_USER: u32 = 1;
255pub const TP_STATUS_COPY: u32 = 2;
256pub const TP_STATUS_LOSING: u32 = 4;
257pub const TP_STATUS_CSUMNOTREADY: u32 = 8;
258pub const TP_STATUS_VLAN_VALID: u32 = 16;
259pub const TP_STATUS_BLK_TMO: u32 = 32;
260pub const TP_STATUS_VLAN_TPID_VALID: u32 = 64;
261pub const TP_STATUS_CSUM_VALID: u32 = 128;
262pub const TP_STATUS_GSO_TCP: u32 = 256;
263pub const TP_STATUS_AVAILABLE: u32 = 0;
264pub const TP_STATUS_SEND_REQUEST: u32 = 1;
265pub const TP_STATUS_SENDING: u32 = 2;
266pub const TP_STATUS_WRONG_FORMAT: u32 = 4;
267pub const TP_STATUS_TS_SOFTWARE: u32 = 536870912;
268pub const TP_STATUS_TS_SYS_HARDWARE: u32 = 1073741824;
269pub const TP_STATUS_TS_RAW_HARDWARE: u32 = 2147483648;
270pub const TP_FT_REQ_FILL_RXHASH: u32 = 1;
271pub const TPACKET_ALIGNMENT: u32 = 16;
272pub const PACKET_MR_MULTICAST: u32 = 0;
273pub const PACKET_MR_PROMISC: u32 = 1;
274pub const PACKET_MR_ALLMULTI: u32 = 2;
275pub const PACKET_MR_UNICAST: u32 = 3;
276#[repr(u32)]
277#[non_exhaustive]
278#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
279pub enum tpacket_versions {
280TPACKET_V1 = 0,
281TPACKET_V2 = 1,
282TPACKET_V3 = 2,
283}
284#[repr(C)]
285#[derive(Copy, Clone)]
286pub union tpacket_stats_u {
287pub stats1: tpacket_stats,
288pub stats3: tpacket_stats_v3,
289}
290#[repr(C)]
291#[derive(Copy, Clone)]
292pub union tpacket3_hdr__bindgen_ty_1 {
293pub hv1: tpacket_hdr_variant1,
294}
295#[repr(C)]
296#[derive(Copy, Clone)]
297pub union tpacket_bd_ts__bindgen_ty_1 {
298pub ts_usec: crate::ctypes::c_uint,
299pub ts_nsec: crate::ctypes::c_uint,
300}
301#[repr(C)]
302#[derive(Copy, Clone)]
303pub union tpacket_bd_header_u {
304pub bh1: tpacket_hdr_v1,
305}
306#[repr(C)]
307#[derive(Copy, Clone)]
308pub union tpacket_req_u {
309pub req: tpacket_req,
310pub req3: tpacket_req3,
311}