blob: cc9f6d626ac14fb2279ec0affea88b7092ecd9c0 [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 */
79};
80enum bpf_map_type {
Tao Baod7db5942015-01-28 10:07:51 -080081 BPF_MAP_TYPE_UNSPEC,
Christopher Ferris82d75042015-01-26 10:57:07 -080082};
83/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84enum bpf_prog_type {
Tao Baod7db5942015-01-28 10:07:51 -080085 BPF_PROG_TYPE_UNSPEC,
Christopher Ferris82d75042015-01-26 10:57:07 -080086};
87union bpf_attr {
88/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080089 struct {
90 __u32 map_type;
91 __u32 key_size;
92 __u32 value_size;
Christopher Ferris82d75042015-01-26 10:57:07 -080093/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080094 __u32 max_entries;
95 };
96 struct {
97 __u32 map_fd;
Christopher Ferris82d75042015-01-26 10:57:07 -080098/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080099 __aligned_u64 key;
100 union {
101 __aligned_u64 value;
102 __aligned_u64 next_key;
Christopher Ferris82d75042015-01-26 10:57:07 -0800103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800104 };
105 };
106 struct {
107 __u32 prog_type;
Christopher Ferris82d75042015-01-26 10:57:07 -0800108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800109 __u32 insn_cnt;
110 __aligned_u64 insns;
111 __aligned_u64 license;
112 __u32 log_level;
Christopher Ferris82d75042015-01-26 10:57:07 -0800113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800114 __u32 log_size;
115 __aligned_u64 log_buf;
116 };
Christopher Ferris82d75042015-01-26 10:57:07 -0800117} __attribute__((aligned(8)));
118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119enum bpf_func_id {
Tao Baod7db5942015-01-28 10:07:51 -0800120 BPF_FUNC_unspec,
121 __BPF_FUNC_MAX_ID,
Christopher Ferris82d75042015-01-26 10:57:07 -0800122};
123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124#endif