1#![allow(clippy::missing_safety_doc)]
4#![allow(clippy::ptr_offset_with_cast)] #![allow(clippy::undocumented_unsafe_blocks)]
6#![allow(clippy::upper_case_acronyms)]
7#![allow(non_upper_case_globals)]
8#![allow(non_camel_case_types)]
9#![allow(non_snake_case)]
10#![allow(dead_code)]
11
12pub const TUN_READQ_SIZE: u32 = 500;
13pub const TUN_TYPE_MASK: u32 = 15;
14pub const IFF_TAP: u32 = 2;
15pub const IFF_NO_PI: u32 = 4096;
16pub const IFF_VNET_HDR: u32 = 16384;
17pub const IFF_MULTI_QUEUE: u32 = 256;
18pub const TUN_TX_TIMESTAMP: u32 = 1;
19pub const TUN_F_CSUM: u32 = 1;
20pub const TUN_F_TSO4: u32 = 2;
21pub const TUN_F_TSO6: u32 = 4;
22pub const TUN_F_TSO_ECN: u32 = 8;
23pub const TUN_F_UFO: u32 = 16;
24pub const TUN_F_USO4: u32 = 32;
25pub const TUN_F_USO6: u32 = 64;
26pub const TUN_PKT_STRIP: u32 = 1;
27pub const TUN_FLT_ALLMULTI: u32 = 1;
28#[repr(C)]
29#[derive(Debug, Default, Copy, Clone)]
30pub struct sock_filter {
31 pub code: u16,
32 pub jt: u8,
33 pub jf: u8,
34 pub k: u32,
35}
36#[repr(C)]
37#[derive(Debug, Copy, Clone)]
38pub struct sock_fprog {
39 pub len: ::std::os::raw::c_ushort,
40 pub filter: *mut sock_filter,
41}
42impl Default for sock_fprog {
43 fn default() -> Self {
44 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
45 unsafe {
46 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
47 s.assume_init()
48 }
49 }
50}