aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / vendor / libc / src / new / apple / xnu / net / bpf.rs
| 1 | //! Header: `net/bpf.h` |
| 2 | //! |
| 3 | //! <https://github.com/apple-oss-distributions/xnu/blob/main/bsd/net/bpf.h> |
| 4 | |
| 5 | use crate::prelude::*; |
| 6 | use crate::sys::ioccom::*; |
| 7 | |
| 8 | s! { |
| 9 | pub struct bpf_insn { |
| 10 | pub code: c_ushort, |
| 11 | pub jt: c_uchar, |
| 12 | pub jf: c_uchar, |
| 13 | pub k: u32, |
| 14 | } |
| 15 | |
| 16 | pub struct bpf_program { |
| 17 | pub bf_len: c_uint, |
| 18 | pub bf_insns: *mut bpf_insn, |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | s_no_extra_traits! { |
| 23 | #[repr(packed(4))] |
| 24 | pub struct bpf_dltlist { |
| 25 | pub bfl_len: u32, |
| 26 | pub bfl_u: __c_anonymous_bfl_u, |
| 27 | } |
| 28 | |
| 29 | pub union __c_anonymous_bfl_u { |
| 30 | pub bflu_list: *mut u32, |
| 31 | pub bflu_pad: u64, |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | pub const DLT_NULL: c_uint = 0; // no link-layer encapsulation |
| 36 | pub const DLT_EN10MB: c_uint = 1; // Ethernet (10Mb) |
| 37 | pub const DLT_EN3MB: c_uint = 2; // Experimental Ethernet (3Mb) |
| 38 | pub const DLT_AX25: c_uint = 3; // Amateur Radio AX.25 |
| 39 | pub const DLT_PRONET: c_uint = 4; // Proteon ProNET Token Ring |
| 40 | pub const DLT_CHAOS: c_uint = 5; // Chaos |
| 41 | pub const DLT_IEEE802: c_uint = 6; // IEEE 802 Networks |
| 42 | pub const DLT_ARCNET: c_uint = 7; // ARCNET |
| 43 | pub const DLT_SLIP: c_uint = 8; // Serial Line IP |
| 44 | pub const DLT_PPP: c_uint = 9; // Point-to-point Protocol |
| 45 | pub const DLT_FDDI: c_uint = 10; // FDDI |
| 46 | pub const DLT_ATM_RFC1483: c_uint = 11; // LLC/SNAP encapsulated atm |
| 47 | pub const DLT_RAW: c_uint = 12; // raw IP |
| 48 | pub const DLT_LOOP: c_uint = 108; |
| 49 | |
| 50 | pub const BPF_ALIGNMENT: c_int = size_of::<i32>() as c_int; |
| 51 | |
| 52 | pub const BIOCGRSIG: c_ulong = _IOR::<c_uint>('B' as c_ulong, 114); |
| 53 | pub const BIOCSRSIG: c_ulong = _IOW::<c_uint>('B' as c_ulong, 115); |
| 54 | pub const BIOCGSEESENT: c_ulong = _IOR::<c_uint>('B' as c_ulong, 118); |
| 55 | pub const BIOCSSEESENT: c_ulong = _IOW::<c_uint>('B' as c_ulong, 119); |
| 56 | pub const BIOCSDLT: c_ulong = _IOW::<c_uint>('B' as c_ulong, 120); |
| 57 | pub const BIOCGDLTLIST: c_ulong = _IOWR::<bpf_dltlist>('B' as c_ulong, 121); |