blob: 8a2199693bdf9ef48e251e7d55283e6ebf702b04 [file] [log] [blame]
Christopher Ferris82d75042015-01-26 10:57:07 -08001/****************************************************************************
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
42enum {
43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080044 BPF_REG_0 = 0,
45 BPF_REG_1,
46 BPF_REG_2,
47 BPF_REG_3,
Christopher Ferris82d75042015-01-26 10:57:07 -080048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080049 BPF_REG_4,
50 BPF_REG_5,
51 BPF_REG_6,
52 BPF_REG_7,
Christopher Ferris82d75042015-01-26 10:57:07 -080053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080054 BPF_REG_8,
55 BPF_REG_9,
56 BPF_REG_10,
57 __MAX_BPF_REG,
Christopher Ferris82d75042015-01-26 10:57:07 -080058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59};
60#define MAX_BPF_REG __MAX_BPF_REG
61struct bpf_insn {
Tao Baod7db5942015-01-28 10:07:51 -080062 __u8 code;
Christopher Ferris82d75042015-01-26 10:57:07 -080063/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080064 __u8 dst_reg : 4;
65 __u8 src_reg : 4;
66 __s16 off;
67 __s32 imm;
Christopher Ferris82d75042015-01-26 10:57:07 -080068/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69};
70enum bpf_cmd {
Tao Baod7db5942015-01-28 10:07:51 -080071 BPF_MAP_CREATE,
72 BPF_MAP_LOOKUP_ELEM,
Christopher Ferris82d75042015-01-26 10:57:07 -080073/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080074 BPF_MAP_UPDATE_ELEM,
75 BPF_MAP_DELETE_ELEM,
76 BPF_MAP_GET_NEXT_KEY,
77 BPF_PROG_LOAD,
Christopher Ferris82d75042015-01-26 10:57:07 -080078/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080079 BPF_OBJ_PIN,
80 BPF_OBJ_GET,
Christopher Ferris82d75042015-01-26 10:57:07 -080081};
82enum bpf_map_type {
Christopher Ferris82d75042015-01-26 10:57:07 -080083/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080084 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 Ferris82d75042015-01-26 10:57:07 -080091enum bpf_prog_type {
Tao Baod7db5942015-01-28 10:07:51 -080092 BPF_PROG_TYPE_UNSPEC,
Christopher Ferris82d75042015-01-26 10:57:07 -080093/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080094 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
105union bpf_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800106 struct {
107 __u32 map_type;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800109 __u32 key_size;
110 __u32 value_size;
Tao Baod7db5942015-01-28 10:07:51 -0800111 __u32 max_entries;
112 };
Christopher Ferris05d08e92016-02-04 13:16:38 -0800113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800114 struct {
115 __u32 map_fd;
Tao Baod7db5942015-01-28 10:07:51 -0800116 __aligned_u64 key;
117 union {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800119 __aligned_u64 value;
120 __aligned_u64 next_key;
Tao Baod7db5942015-01-28 10:07:51 -0800121 };
Christopher Ferris05d08e92016-02-04 13:16:38 -0800122 __u64 flags;
123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800124 };
125 struct {
126 __u32 prog_type;
Tao Baod7db5942015-01-28 10:07:51 -0800127 __u32 insn_cnt;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800129 __aligned_u64 insns;
130 __aligned_u64 license;
131 __u32 log_level;
Tao Baod7db5942015-01-28 10:07:51 -0800132 __u32 log_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800134 __aligned_u64 log_buf;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800135 __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 Baod7db5942015-01-28 10:07:51 -0800141 };
Christopher Ferris82d75042015-01-26 10:57:07 -0800142} __attribute__((aligned(8)));
143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144enum bpf_func_id {
Tao Baod7db5942015-01-28 10:07:51 -0800145 BPF_FUNC_unspec,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800146 BPF_FUNC_map_lookup_elem,
147 BPF_FUNC_map_update_elem,
Christopher Ferris82d75042015-01-26 10:57:07 -0800148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800149 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};
180struct __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};
201struct 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 Ferris82d75042015-01-26 10:57:07 -0800206#endif