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