1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef _UAPI__LINUX_BPF_H__ 20 #define _UAPI__LINUX_BPF_H__ 21 #include <linux/types.h> 22 #include <linux/bpf_common.h> 23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 24 #define BPF_ALU64 0x07 25 #define BPF_DW 0x18 26 #define BPF_XADD 0xc0 27 #define BPF_MOV 0xb0 28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 29 #define BPF_ARSH 0xc0 30 #define BPF_END 0xd0 31 #define BPF_TO_LE 0x00 32 #define BPF_TO_BE 0x08 33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 34 #define BPF_FROM_LE BPF_TO_LE 35 #define BPF_FROM_BE BPF_TO_BE 36 #define BPF_JNE 0x50 37 #define BPF_JSGT 0x60 38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 39 #define BPF_JSGE 0x70 40 #define BPF_CALL 0x80 41 #define BPF_EXIT 0x90 42 enum { 43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 44 BPF_REG_0 = 0, 45 BPF_REG_1, 46 BPF_REG_2, 47 BPF_REG_3, 48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 49 BPF_REG_4, 50 BPF_REG_5, 51 BPF_REG_6, 52 BPF_REG_7, 53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 54 BPF_REG_8, 55 BPF_REG_9, 56 BPF_REG_10, 57 __MAX_BPF_REG, 58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 59 }; 60 #define MAX_BPF_REG __MAX_BPF_REG 61 struct bpf_insn { 62 __u8 code; 63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 64 __u8 dst_reg : 4; 65 __u8 src_reg : 4; 66 __s16 off; 67 __s32 imm; 68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 69 }; 70 enum bpf_cmd { 71 BPF_MAP_CREATE, 72 BPF_MAP_LOOKUP_ELEM, 73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 74 BPF_MAP_UPDATE_ELEM, 75 BPF_MAP_DELETE_ELEM, 76 BPF_MAP_GET_NEXT_KEY, 77 BPF_PROG_LOAD, 78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 79 }; 80 enum bpf_map_type { 81 BPF_MAP_TYPE_UNSPEC, 82 }; 83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 84 enum bpf_prog_type { 85 BPF_PROG_TYPE_UNSPEC, 86 }; 87 union bpf_attr { 88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 89 struct { 90 __u32 map_type; 91 __u32 key_size; 92 __u32 value_size; 93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 94 __u32 max_entries; 95 }; 96 struct { 97 __u32 map_fd; 98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 99 __aligned_u64 key; 100 union { 101 __aligned_u64 value; 102 __aligned_u64 next_key; 103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 104 }; 105 }; 106 struct { 107 __u32 prog_type; 108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 109 __u32 insn_cnt; 110 __aligned_u64 insns; 111 __aligned_u64 license; 112 __u32 log_level; 113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 114 __u32 log_size; 115 __aligned_u64 log_buf; 116 }; 117 } __attribute__((aligned(8))); 118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 119 enum bpf_func_id { 120 BPF_FUNC_unspec, 121 __BPF_FUNC_MAX_ID, 122 }; 123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 124 #endif 125