Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 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 */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 44 | BPF_REG_0 = 0, |
| 45 | BPF_REG_1, |
| 46 | BPF_REG_2, |
| 47 | BPF_REG_3, |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 48 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 49 | BPF_REG_4, |
| 50 | BPF_REG_5, |
| 51 | BPF_REG_6, |
| 52 | BPF_REG_7, |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 53 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 54 | BPF_REG_8, |
| 55 | BPF_REG_9, |
| 56 | BPF_REG_10, |
| 57 | __MAX_BPF_REG, |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 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 { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 62 | __u8 code; |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 63 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 64 | __u8 dst_reg : 4; |
| 65 | __u8 src_reg : 4; |
| 66 | __s16 off; |
| 67 | __s32 imm; |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 68 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 69 | }; |
| 70 | enum bpf_cmd { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 71 | BPF_MAP_CREATE, |
| 72 | BPF_MAP_LOOKUP_ELEM, |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 73 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 74 | BPF_MAP_UPDATE_ELEM, |
| 75 | BPF_MAP_DELETE_ELEM, |
| 76 | BPF_MAP_GET_NEXT_KEY, |
| 77 | BPF_PROG_LOAD, |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 78 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame^] | 79 | BPF_OBJ_PIN, |
| 80 | BPF_OBJ_GET, |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 81 | }; |
| 82 | enum bpf_map_type { |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 83 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame^] | 84 | BPF_MAP_TYPE_UNSPEC, |
| 85 | BPF_MAP_TYPE_HASH, |
| 86 | BPF_MAP_TYPE_ARRAY, |
| 87 | BPF_MAP_TYPE_PROG_ARRAY, |
| 88 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 89 | BPF_MAP_TYPE_PERF_EVENT_ARRAY, |
| 90 | }; |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 91 | enum bpf_prog_type { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 92 | BPF_PROG_TYPE_UNSPEC, |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 93 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame^] | 94 | BPF_PROG_TYPE_SOCKET_FILTER, |
| 95 | BPF_PROG_TYPE_KPROBE, |
| 96 | BPF_PROG_TYPE_SCHED_CLS, |
| 97 | BPF_PROG_TYPE_SCHED_ACT, |
| 98 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 99 | }; |
| 100 | #define BPF_PSEUDO_MAP_FD 1 |
| 101 | #define BPF_ANY 0 |
| 102 | #define BPF_NOEXIST 1 |
| 103 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 104 | #define BPF_EXIST 2 |
| 105 | union bpf_attr { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 106 | struct { |
| 107 | __u32 map_type; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame^] | 108 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 109 | __u32 key_size; |
| 110 | __u32 value_size; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 111 | __u32 max_entries; |
| 112 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame^] | 113 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 114 | struct { |
| 115 | __u32 map_fd; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 116 | __aligned_u64 key; |
| 117 | union { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame^] | 118 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 119 | __aligned_u64 value; |
| 120 | __aligned_u64 next_key; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 121 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame^] | 122 | __u64 flags; |
| 123 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 124 | }; |
| 125 | struct { |
| 126 | __u32 prog_type; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 127 | __u32 insn_cnt; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame^] | 128 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 129 | __aligned_u64 insns; |
| 130 | __aligned_u64 license; |
| 131 | __u32 log_level; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 132 | __u32 log_size; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame^] | 133 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 134 | __aligned_u64 log_buf; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame^] | 135 | __u32 kern_version; |
| 136 | }; |
| 137 | struct { |
| 138 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 139 | __aligned_u64 pathname; |
| 140 | __u32 bpf_fd; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 141 | }; |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 142 | } __attribute__((aligned(8))); |
| 143 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 144 | enum bpf_func_id { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 145 | BPF_FUNC_unspec, |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame^] | 146 | BPF_FUNC_map_lookup_elem, |
| 147 | BPF_FUNC_map_update_elem, |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 148 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame^] | 149 | BPF_FUNC_map_delete_elem, |
| 150 | BPF_FUNC_probe_read, |
| 151 | BPF_FUNC_ktime_get_ns, |
| 152 | BPF_FUNC_trace_printk, |
| 153 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 154 | BPF_FUNC_get_prandom_u32, |
| 155 | BPF_FUNC_get_smp_processor_id, |
| 156 | BPF_FUNC_skb_store_bytes, |
| 157 | BPF_FUNC_l3_csum_replace, |
| 158 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 159 | BPF_FUNC_l4_csum_replace, |
| 160 | BPF_FUNC_tail_call, |
| 161 | BPF_FUNC_clone_redirect, |
| 162 | BPF_FUNC_get_current_pid_tgid, |
| 163 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 164 | BPF_FUNC_get_current_uid_gid, |
| 165 | BPF_FUNC_get_current_comm, |
| 166 | BPF_FUNC_get_cgroup_classid, |
| 167 | BPF_FUNC_skb_vlan_push, |
| 168 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 169 | BPF_FUNC_skb_vlan_pop, |
| 170 | BPF_FUNC_skb_get_tunnel_key, |
| 171 | BPF_FUNC_skb_set_tunnel_key, |
| 172 | BPF_FUNC_perf_event_read, |
| 173 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 174 | BPF_FUNC_redirect, |
| 175 | BPF_FUNC_get_route_realm, |
| 176 | BPF_FUNC_perf_event_output, |
| 177 | __BPF_FUNC_MAX_ID, |
| 178 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 179 | }; |
| 180 | struct __sk_buff { |
| 181 | __u32 len; |
| 182 | __u32 pkt_type; |
| 183 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 184 | __u32 mark; |
| 185 | __u32 queue_mapping; |
| 186 | __u32 protocol; |
| 187 | __u32 vlan_present; |
| 188 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 189 | __u32 vlan_tci; |
| 190 | __u32 vlan_proto; |
| 191 | __u32 priority; |
| 192 | __u32 ingress_ifindex; |
| 193 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 194 | __u32 ifindex; |
| 195 | __u32 tc_index; |
| 196 | __u32 cb[5]; |
| 197 | __u32 hash; |
| 198 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 199 | __u32 tc_classid; |
| 200 | }; |
| 201 | struct bpf_tunnel_key { |
| 202 | __u32 tunnel_id; |
| 203 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 204 | __u32 remote_ipv4; |
| 205 | }; |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 206 | #endif |