Where Online Learning is simpler!
The C and C++ Include Header Files
cat -n /usr/include/linux/io_uring/bpf_filter.h
1 /* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR MIT */ 2 /* 3 * Header file for the io_uring BPF filters. 4 */ 5 #ifndef LINUX_IO_URING_BPF_FILTER_H 6 #define LINUX_IO_URING_BPF_FILTER_H 7 8 #include <linux/types.h> 9 10 /* 11 * Struct passed to filters. 12 */ 13 struct io_uring_bpf_ctx { 14 __u64 user_data; 15 __u8 opcode; 16 __u8 sqe_flags; 17 __u8 pdu_size; /* size of aux data for filter */ 18 __u8 pad[5]; 19 union { 20 struct { 21 __u32 family; 22 __u32 type; 23 __u32 protocol; 24 } socket; 25 struct { 26 __u64 flags; 27 __u64 mode; 28 __u64 resolve; 29 } open; 30 }; 31 }; 32 33 enum { 34 /* 35 * If set, any currently unset opcode will have a deny filter attached 36 */ 37 IO_URING_BPF_FILTER_DENY_REST = 1, 38 /* 39 * If set, if kernel and application don't agree on pdu_size for 40 * the given opcode, fail the registration of the filter. 41 */ 42 IO_URING_BPF_FILTER_SZ_STRICT = 2, 43 }; 44 45 struct io_uring_bpf_filter { 46 __u32 opcode; /* io_uring opcode to filter */ 47 __u32 flags; 48 __u32 filter_len; /* number of BPF instructions */ 49 __u8 pdu_size; /* expected pdu size for opcode */ 50 __u8 resv[3]; 51 __u64 filter_ptr; /* pointer to BPF filter */ 52 __u64 resv2[5]; 53 }; 54 55 enum { 56 IO_URING_BPF_CMD_FILTER = 1, 57 }; 58 59 struct io_uring_bpf { 60 __u16 cmd_type; /* IO_URING_BPF_* values */ 61 __u16 cmd_flags; /* none so far */ 62 __u32 resv; 63 union { 64 struct io_uring_bpf_filter filter; 65 }; 66 }; 67 68 #endif