blob: 8f82b71280da6834a560e46f079dd5788ca75d64 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Christopher Ferris82d75042015-01-26 10:57:07 -08007#ifndef _UAPI__LINUX_BPF_H__
8#define _UAPI__LINUX_BPF_H__
9#include <linux/types.h>
10#include <linux/bpf_common.h>
Christopher Ferris24f97eb2019-05-20 12:58:13 -070011#define BPF_JMP32 0x06
Christopher Ferris82d75042015-01-26 10:57:07 -080012#define BPF_ALU64 0x07
13#define BPF_DW 0x18
Christopher Ferris67d1e5e2023-10-31 13:36:37 -070014#define BPF_MEMSX 0x80
Christopher Ferrisa9750ed2021-05-03 14:02:49 -070015#define BPF_ATOMIC 0xc0
Christopher Ferris82d75042015-01-26 10:57:07 -080016#define BPF_XADD 0xc0
17#define BPF_MOV 0xb0
Christopher Ferris82d75042015-01-26 10:57:07 -080018#define BPF_ARSH 0xc0
19#define BPF_END 0xd0
20#define BPF_TO_LE 0x00
21#define BPF_TO_BE 0x08
Christopher Ferris82d75042015-01-26 10:57:07 -080022#define BPF_FROM_LE BPF_TO_LE
23#define BPF_FROM_BE BPF_TO_BE
24#define BPF_JNE 0x50
Christopher Ferris1308ad32017-11-14 17:32:13 -080025#define BPF_JLT 0xa0
26#define BPF_JLE 0xb0
Christopher Ferris82d75042015-01-26 10:57:07 -080027#define BPF_JSGT 0x60
Christopher Ferris82d75042015-01-26 10:57:07 -080028#define BPF_JSGE 0x70
Christopher Ferris1308ad32017-11-14 17:32:13 -080029#define BPF_JSLT 0xc0
30#define BPF_JSLE 0xd0
Christopher Ferris82d75042015-01-26 10:57:07 -080031#define BPF_CALL 0x80
32#define BPF_EXIT 0x90
Christopher Ferrisa9750ed2021-05-03 14:02:49 -070033#define BPF_FETCH 0x01
34#define BPF_XCHG (0xe0 | BPF_FETCH)
35#define BPF_CMPXCHG (0xf0 | BPF_FETCH)
Christopher Ferris82d75042015-01-26 10:57:07 -080036enum {
Tao Baod7db5942015-01-28 10:07:51 -080037 BPF_REG_0 = 0,
38 BPF_REG_1,
39 BPF_REG_2,
40 BPF_REG_3,
Tao Baod7db5942015-01-28 10:07:51 -080041 BPF_REG_4,
42 BPF_REG_5,
43 BPF_REG_6,
44 BPF_REG_7,
Tao Baod7db5942015-01-28 10:07:51 -080045 BPF_REG_8,
46 BPF_REG_9,
47 BPF_REG_10,
48 __MAX_BPF_REG,
Christopher Ferris82d75042015-01-26 10:57:07 -080049};
50#define MAX_BPF_REG __MAX_BPF_REG
51struct bpf_insn {
Tao Baod7db5942015-01-28 10:07:51 -080052 __u8 code;
Tao Baod7db5942015-01-28 10:07:51 -080053 __u8 dst_reg : 4;
54 __u8 src_reg : 4;
55 __s16 off;
56 __s32 imm;
Christopher Ferris82d75042015-01-26 10:57:07 -080057};
Christopher Ferris525ce912017-07-26 13:12:53 -070058struct bpf_lpm_trie_key {
59 __u32 prefixlen;
60 __u8 data[0];
61};
Christopher Ferris9ce28842018-10-25 12:11:39 -070062struct bpf_cgroup_storage_key {
63 __u64 cgroup_inode_id;
64 __u32 attach_type;
65};
Christopher Ferris6cd53a52022-12-12 23:39:16 +000066enum bpf_cgroup_iter_order {
67 BPF_CGROUP_ITER_ORDER_UNSPEC = 0,
68 BPF_CGROUP_ITER_SELF_ONLY,
69 BPF_CGROUP_ITER_DESCENDANTS_PRE,
70 BPF_CGROUP_ITER_DESCENDANTS_POST,
71 BPF_CGROUP_ITER_ANCESTORS_UP,
72};
Christopher Ferris25c18d42020-10-14 17:42:58 -070073union bpf_iter_link_info {
74 struct {
75 __u32 map_fd;
76 } map;
Christopher Ferris6cd53a52022-12-12 23:39:16 +000077 struct {
78 enum bpf_cgroup_iter_order order;
79 __u32 cgroup_fd;
80 __u64 cgroup_id;
81 } cgroup;
82 struct {
83 __u32 tid;
84 __u32 pid;
85 __u32 pid_fd;
86 } task;
Christopher Ferris25c18d42020-10-14 17:42:58 -070087};
Christopher Ferris82d75042015-01-26 10:57:07 -080088enum bpf_cmd {
Tao Baod7db5942015-01-28 10:07:51 -080089 BPF_MAP_CREATE,
90 BPF_MAP_LOOKUP_ELEM,
Tao Baod7db5942015-01-28 10:07:51 -080091 BPF_MAP_UPDATE_ELEM,
92 BPF_MAP_DELETE_ELEM,
93 BPF_MAP_GET_NEXT_KEY,
94 BPF_PROG_LOAD,
Christopher Ferris05d08e92016-02-04 13:16:38 -080095 BPF_OBJ_PIN,
96 BPF_OBJ_GET,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080097 BPF_PROG_ATTACH,
98 BPF_PROG_DETACH,
Christopher Ferris525ce912017-07-26 13:12:53 -070099 BPF_PROG_TEST_RUN,
Christopher Ferris3a39c0b2021-09-02 00:03:38 +0000100 BPF_PROG_RUN = BPF_PROG_TEST_RUN,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800101 BPF_PROG_GET_NEXT_ID,
102 BPF_MAP_GET_NEXT_ID,
103 BPF_PROG_GET_FD_BY_ID,
104 BPF_MAP_GET_FD_BY_ID,
105 BPF_OBJ_GET_INFO_BY_FD,
Christopher Ferris934ec942018-01-31 15:29:16 -0800106 BPF_PROG_QUERY,
Christopher Ferris76a1d452018-06-27 14:12:29 -0700107 BPF_RAW_TRACEPOINT_OPEN,
Christopher Ferris9ce28842018-10-25 12:11:39 -0700108 BPF_BTF_LOAD,
109 BPF_BTF_GET_FD_BY_ID,
110 BPF_TASK_FD_QUERY,
Christopher Ferris86a48372019-01-10 14:14:59 -0800111 BPF_MAP_LOOKUP_AND_DELETE_ELEM,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700112 BPF_MAP_FREEZE,
Christopher Ferris9584fa42019-12-09 15:36:13 -0800113 BPF_BTF_GET_NEXT_ID,
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700114 BPF_MAP_LOOKUP_BATCH,
115 BPF_MAP_LOOKUP_AND_DELETE_BATCH,
116 BPF_MAP_UPDATE_BATCH,
117 BPF_MAP_DELETE_BATCH,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700118 BPF_LINK_CREATE,
119 BPF_LINK_UPDATE,
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700120 BPF_LINK_GET_FD_BY_ID,
121 BPF_LINK_GET_NEXT_ID,
122 BPF_ENABLE_STATS,
123 BPF_ITER_CREATE,
Christopher Ferris25c18d42020-10-14 17:42:58 -0700124 BPF_LINK_DETACH,
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800125 BPF_PROG_BIND_MAP,
Christopher Ferris82d75042015-01-26 10:57:07 -0800126};
127enum bpf_map_type {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800128 BPF_MAP_TYPE_UNSPEC,
129 BPF_MAP_TYPE_HASH,
130 BPF_MAP_TYPE_ARRAY,
131 BPF_MAP_TYPE_PROG_ARRAY,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800132 BPF_MAP_TYPE_PERF_EVENT_ARRAY,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700133 BPF_MAP_TYPE_PERCPU_HASH,
134 BPF_MAP_TYPE_PERCPU_ARRAY,
135 BPF_MAP_TYPE_STACK_TRACE,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800136 BPF_MAP_TYPE_CGROUP_ARRAY,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800137 BPF_MAP_TYPE_LRU_HASH,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800138 BPF_MAP_TYPE_LRU_PERCPU_HASH,
Christopher Ferris525ce912017-07-26 13:12:53 -0700139 BPF_MAP_TYPE_LPM_TRIE,
140 BPF_MAP_TYPE_ARRAY_OF_MAPS,
141 BPF_MAP_TYPE_HASH_OF_MAPS,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800142 BPF_MAP_TYPE_DEVMAP,
143 BPF_MAP_TYPE_SOCKMAP,
Christopher Ferris934ec942018-01-31 15:29:16 -0800144 BPF_MAP_TYPE_CPUMAP,
Christopher Ferris9ce28842018-10-25 12:11:39 -0700145 BPF_MAP_TYPE_XSKMAP,
146 BPF_MAP_TYPE_SOCKHASH,
Christopher Ferris8b7fdc92023-02-21 13:36:32 -0800147 BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED,
148 BPF_MAP_TYPE_CGROUP_STORAGE = BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED,
Christopher Ferris9ce28842018-10-25 12:11:39 -0700149 BPF_MAP_TYPE_REUSEPORT_SOCKARRAY,
Christopher Ferris0f795212024-01-17 14:17:28 -0800150 BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED,
151 BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE = BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED,
Christopher Ferris86a48372019-01-10 14:14:59 -0800152 BPF_MAP_TYPE_QUEUE,
153 BPF_MAP_TYPE_STACK,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700154 BPF_MAP_TYPE_SK_STORAGE,
Christopher Ferris9584fa42019-12-09 15:36:13 -0800155 BPF_MAP_TYPE_DEVMAP_HASH,
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700156 BPF_MAP_TYPE_STRUCT_OPS,
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700157 BPF_MAP_TYPE_RINGBUF,
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800158 BPF_MAP_TYPE_INODE_STORAGE,
Christopher Ferris05667cd2021-02-16 16:01:34 -0800159 BPF_MAP_TYPE_TASK_STORAGE,
Christopher Ferrisa4792612022-01-10 13:51:15 -0800160 BPF_MAP_TYPE_BLOOM_FILTER,
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000161 BPF_MAP_TYPE_USER_RINGBUF,
Christopher Ferris8b7fdc92023-02-21 13:36:32 -0800162 BPF_MAP_TYPE_CGRP_STORAGE,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800163};
Christopher Ferris82d75042015-01-26 10:57:07 -0800164enum bpf_prog_type {
Tao Baod7db5942015-01-28 10:07:51 -0800165 BPF_PROG_TYPE_UNSPEC,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800166 BPF_PROG_TYPE_SOCKET_FILTER,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800167 BPF_PROG_TYPE_KPROBE,
168 BPF_PROG_TYPE_SCHED_CLS,
169 BPF_PROG_TYPE_SCHED_ACT,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800170 BPF_PROG_TYPE_TRACEPOINT,
171 BPF_PROG_TYPE_XDP,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800172 BPF_PROG_TYPE_PERF_EVENT,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800173 BPF_PROG_TYPE_CGROUP_SKB,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800174 BPF_PROG_TYPE_CGROUP_SOCK,
175 BPF_PROG_TYPE_LWT_IN,
176 BPF_PROG_TYPE_LWT_OUT,
177 BPF_PROG_TYPE_LWT_XMIT,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800178 BPF_PROG_TYPE_SOCK_OPS,
179 BPF_PROG_TYPE_SK_SKB,
Christopher Ferris934ec942018-01-31 15:29:16 -0800180 BPF_PROG_TYPE_CGROUP_DEVICE,
Christopher Ferris76a1d452018-06-27 14:12:29 -0700181 BPF_PROG_TYPE_SK_MSG,
182 BPF_PROG_TYPE_RAW_TRACEPOINT,
183 BPF_PROG_TYPE_CGROUP_SOCK_ADDR,
Christopher Ferris9ce28842018-10-25 12:11:39 -0700184 BPF_PROG_TYPE_LWT_SEG6LOCAL,
185 BPF_PROG_TYPE_LIRC_MODE2,
186 BPF_PROG_TYPE_SK_REUSEPORT,
Christopher Ferris86a48372019-01-10 14:14:59 -0800187 BPF_PROG_TYPE_FLOW_DISSECTOR,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700188 BPF_PROG_TYPE_CGROUP_SYSCTL,
189 BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE,
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700190 BPF_PROG_TYPE_CGROUP_SOCKOPT,
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800191 BPF_PROG_TYPE_TRACING,
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700192 BPF_PROG_TYPE_STRUCT_OPS,
193 BPF_PROG_TYPE_EXT,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700194 BPF_PROG_TYPE_LSM,
Christopher Ferris25c18d42020-10-14 17:42:58 -0700195 BPF_PROG_TYPE_SK_LOOKUP,
Christopher Ferris3a39c0b2021-09-02 00:03:38 +0000196 BPF_PROG_TYPE_SYSCALL,
Christopher Ferris37c3f3c2023-07-10 10:59:05 -0700197 BPF_PROG_TYPE_NETFILTER,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800198};
199enum bpf_attach_type {
200 BPF_CGROUP_INET_INGRESS,
201 BPF_CGROUP_INET_EGRESS,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800202 BPF_CGROUP_INET_SOCK_CREATE,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800203 BPF_CGROUP_SOCK_OPS,
204 BPF_SK_SKB_STREAM_PARSER,
205 BPF_SK_SKB_STREAM_VERDICT,
Christopher Ferris934ec942018-01-31 15:29:16 -0800206 BPF_CGROUP_DEVICE,
Christopher Ferris76a1d452018-06-27 14:12:29 -0700207 BPF_SK_MSG_VERDICT,
208 BPF_CGROUP_INET4_BIND,
209 BPF_CGROUP_INET6_BIND,
210 BPF_CGROUP_INET4_CONNECT,
211 BPF_CGROUP_INET6_CONNECT,
212 BPF_CGROUP_INET4_POST_BIND,
213 BPF_CGROUP_INET6_POST_BIND,
Christopher Ferris9ce28842018-10-25 12:11:39 -0700214 BPF_CGROUP_UDP4_SENDMSG,
215 BPF_CGROUP_UDP6_SENDMSG,
216 BPF_LIRC_MODE2,
Christopher Ferris86a48372019-01-10 14:14:59 -0800217 BPF_FLOW_DISSECTOR,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700218 BPF_CGROUP_SYSCTL,
219 BPF_CGROUP_UDP4_RECVMSG,
220 BPF_CGROUP_UDP6_RECVMSG,
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700221 BPF_CGROUP_GETSOCKOPT,
222 BPF_CGROUP_SETSOCKOPT,
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800223 BPF_TRACE_RAW_TP,
224 BPF_TRACE_FENTRY,
225 BPF_TRACE_FEXIT,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700226 BPF_MODIFY_RETURN,
227 BPF_LSM_MAC,
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700228 BPF_TRACE_ITER,
229 BPF_CGROUP_INET4_GETPEERNAME,
230 BPF_CGROUP_INET6_GETPEERNAME,
231 BPF_CGROUP_INET4_GETSOCKNAME,
232 BPF_CGROUP_INET6_GETSOCKNAME,
233 BPF_XDP_DEVMAP,
Christopher Ferris25c18d42020-10-14 17:42:58 -0700234 BPF_CGROUP_INET_SOCK_RELEASE,
235 BPF_XDP_CPUMAP,
236 BPF_SK_LOOKUP,
237 BPF_XDP,
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000238 BPF_SK_SKB_VERDICT,
Christopher Ferris3a39c0b2021-09-02 00:03:38 +0000239 BPF_SK_REUSEPORT_SELECT,
240 BPF_SK_REUSEPORT_SELECT_OR_MIGRATE,
Christopher Ferris2abfa9e2021-11-01 16:26:06 -0700241 BPF_PERF_EVENT,
Christopher Ferris10a76e62022-06-08 13:31:52 -0700242 BPF_TRACE_KPROBE_MULTI,
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700243 BPF_LSM_CGROUP,
Christopher Ferris37c3f3c2023-07-10 10:59:05 -0700244 BPF_STRUCT_OPS,
245 BPF_NETFILTER,
Christopher Ferris67d1e5e2023-10-31 13:36:37 -0700246 BPF_TCX_INGRESS,
247 BPF_TCX_EGRESS,
248 BPF_TRACE_UPROBE_MULTI,
Christopher Ferris0f795212024-01-17 14:17:28 -0800249 BPF_CGROUP_UNIX_CONNECT,
250 BPF_CGROUP_UNIX_SENDMSG,
251 BPF_CGROUP_UNIX_RECVMSG,
252 BPF_CGROUP_UNIX_GETPEERNAME,
253 BPF_CGROUP_UNIX_GETSOCKNAME,
254 BPF_NETKIT_PRIMARY,
255 BPF_NETKIT_PEER,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800256 __MAX_BPF_ATTACH_TYPE
257};
258#define MAX_BPF_ATTACH_TYPE __MAX_BPF_ATTACH_TYPE
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700259enum bpf_link_type {
260 BPF_LINK_TYPE_UNSPEC = 0,
261 BPF_LINK_TYPE_RAW_TRACEPOINT = 1,
262 BPF_LINK_TYPE_TRACING = 2,
263 BPF_LINK_TYPE_CGROUP = 3,
264 BPF_LINK_TYPE_ITER = 4,
265 BPF_LINK_TYPE_NETNS = 5,
Christopher Ferris25c18d42020-10-14 17:42:58 -0700266 BPF_LINK_TYPE_XDP = 6,
Christopher Ferris2abfa9e2021-11-01 16:26:06 -0700267 BPF_LINK_TYPE_PERF_EVENT = 7,
Christopher Ferris10a76e62022-06-08 13:31:52 -0700268 BPF_LINK_TYPE_KPROBE_MULTI = 8,
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700269 BPF_LINK_TYPE_STRUCT_OPS = 9,
Christopher Ferris37c3f3c2023-07-10 10:59:05 -0700270 BPF_LINK_TYPE_NETFILTER = 10,
Christopher Ferris67d1e5e2023-10-31 13:36:37 -0700271 BPF_LINK_TYPE_TCX = 11,
272 BPF_LINK_TYPE_UPROBE_MULTI = 12,
Christopher Ferris0f795212024-01-17 14:17:28 -0800273 BPF_LINK_TYPE_NETKIT = 13,
Christopher Ferrisb830ddf2024-03-28 11:48:08 -0700274 __MAX_BPF_LINK_TYPE,
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700275};
Christopher Ferrisb830ddf2024-03-28 11:48:08 -0700276#define MAX_BPF_LINK_TYPE __MAX_BPF_LINK_TYPE
Christopher Ferris67d1e5e2023-10-31 13:36:37 -0700277enum bpf_perf_event_type {
278 BPF_PERF_EVENT_UNSPEC = 0,
279 BPF_PERF_EVENT_UPROBE = 1,
280 BPF_PERF_EVENT_URETPROBE = 2,
281 BPF_PERF_EVENT_KPROBE = 3,
282 BPF_PERF_EVENT_KRETPROBE = 4,
283 BPF_PERF_EVENT_TRACEPOINT = 5,
284 BPF_PERF_EVENT_EVENT = 6,
285};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800286#define BPF_F_ALLOW_OVERRIDE (1U << 0)
Christopher Ferris934ec942018-01-31 15:29:16 -0800287#define BPF_F_ALLOW_MULTI (1U << 1)
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700288#define BPF_F_REPLACE (1U << 2)
Christopher Ferris67d1e5e2023-10-31 13:36:37 -0700289#define BPF_F_BEFORE (1U << 3)
290#define BPF_F_AFTER (1U << 4)
291#define BPF_F_ID (1U << 5)
292#define BPF_F_LINK BPF_F_LINK
Christopher Ferris525ce912017-07-26 13:12:53 -0700293#define BPF_F_STRICT_ALIGNMENT (1U << 0)
Christopher Ferrisd842e432019-03-07 10:21:59 -0800294#define BPF_F_ANY_ALIGNMENT (1U << 1)
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700295#define BPF_F_TEST_RND_HI32 (1U << 2)
Christopher Ferris9584fa42019-12-09 15:36:13 -0800296#define BPF_F_TEST_STATE_FREQ (1U << 3)
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800297#define BPF_F_SLEEPABLE (1U << 4)
Christopher Ferris10a76e62022-06-08 13:31:52 -0700298#define BPF_F_XDP_HAS_FRAGS (1U << 5)
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +0000299#define BPF_F_XDP_DEV_BOUND_ONLY (1U << 6)
Christopher Ferrisb830ddf2024-03-28 11:48:08 -0700300#define BPF_F_TEST_REG_INVARIANTS (1U << 7)
Christopher Ferris67d1e5e2023-10-31 13:36:37 -0700301enum {
302 BPF_F_KPROBE_MULTI_RETURN = (1U << 0)
303};
304enum {
305 BPF_F_UPROBE_MULTI_RETURN = (1U << 0)
306};
307#define BPF_F_NETFILTER_IP_DEFRAG (1U << 0)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800308#define BPF_PSEUDO_MAP_FD 1
Christopher Ferris3a39c0b2021-09-02 00:03:38 +0000309#define BPF_PSEUDO_MAP_IDX 5
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700310#define BPF_PSEUDO_MAP_VALUE 2
Christopher Ferris3a39c0b2021-09-02 00:03:38 +0000311#define BPF_PSEUDO_MAP_IDX_VALUE 6
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800312#define BPF_PSEUDO_BTF_ID 3
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000313#define BPF_PSEUDO_FUNC 4
Christopher Ferris76a1d452018-06-27 14:12:29 -0700314#define BPF_PSEUDO_CALL 1
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000315#define BPF_PSEUDO_KFUNC_CALL 2
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700316enum {
317 BPF_ANY = 0,
318 BPF_NOEXIST = 1,
319 BPF_EXIST = 2,
320 BPF_F_LOCK = 4,
321};
322enum {
323 BPF_F_NO_PREALLOC = (1U << 0),
324 BPF_F_NO_COMMON_LRU = (1U << 1),
325 BPF_F_NUMA_NODE = (1U << 2),
326 BPF_F_RDONLY = (1U << 3),
327 BPF_F_WRONLY = (1U << 4),
328 BPF_F_STACK_BUILD_ID = (1U << 5),
329 BPF_F_ZERO_SEED = (1U << 6),
330 BPF_F_RDONLY_PROG = (1U << 7),
331 BPF_F_WRONLY_PROG = (1U << 8),
332 BPF_F_CLONE = (1U << 9),
333 BPF_F_MMAPABLE = (1U << 10),
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800334 BPF_F_PRESERVE_ELEMS = (1U << 11),
335 BPF_F_INNER_MAP = (1U << 12),
Christopher Ferris37c3f3c2023-07-10 10:59:05 -0700336 BPF_F_LINK = (1U << 13),
Christopher Ferris8666d042023-09-06 14:55:31 -0700337 BPF_F_PATH_FD = (1U << 14),
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700338};
Christopher Ferrisd842e432019-03-07 10:21:59 -0800339#define BPF_F_QUERY_EFFECTIVE (1U << 0)
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800340#define BPF_F_TEST_RUN_ON_CPU (1U << 0)
Christopher Ferris10a76e62022-06-08 13:31:52 -0700341#define BPF_F_TEST_XDP_LIVE_FRAMES (1U << 1)
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700342enum bpf_stats_type {
343 BPF_STATS_RUN_TIME = 0,
344};
Christopher Ferris76a1d452018-06-27 14:12:29 -0700345enum bpf_stack_build_id_status {
346 BPF_STACK_BUILD_ID_EMPTY = 0,
347 BPF_STACK_BUILD_ID_VALID = 1,
348 BPF_STACK_BUILD_ID_IP = 2,
349};
350#define BPF_BUILD_ID_SIZE 20
351struct bpf_stack_build_id {
352 __s32 status;
353 unsigned char build_id[BPF_BUILD_ID_SIZE];
354 union {
355 __u64 offset;
356 __u64 ip;
357 };
358};
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700359#define BPF_OBJ_NAME_LEN 16U
Christopher Ferris05d08e92016-02-04 13:16:38 -0800360union bpf_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800361 struct {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700362 __u32 map_type;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800363 __u32 key_size;
Tao Baod7db5942015-01-28 10:07:51 -0800364 __u32 value_size;
Tao Baod7db5942015-01-28 10:07:51 -0800365 __u32 max_entries;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700366 __u32 map_flags;
Christopher Ferris525ce912017-07-26 13:12:53 -0700367 __u32 inner_map_fd;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800368 __u32 numa_node;
Christopher Ferris934ec942018-01-31 15:29:16 -0800369 char map_name[BPF_OBJ_NAME_LEN];
Christopher Ferris76a1d452018-06-27 14:12:29 -0700370 __u32 map_ifindex;
Christopher Ferris9ce28842018-10-25 12:11:39 -0700371 __u32 btf_fd;
372 __u32 btf_key_type_id;
373 __u32 btf_value_type_id;
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700374 __u32 btf_vmlinux_value_type_id;
Christopher Ferrisa4792612022-01-10 13:51:15 -0800375 __u64 map_extra;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800376 };
Tao Baod7db5942015-01-28 10:07:51 -0800377 struct {
378 __u32 map_fd;
Tao Baod7db5942015-01-28 10:07:51 -0800379 __aligned_u64 key;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800380 union {
Tao Baod7db5942015-01-28 10:07:51 -0800381 __aligned_u64 value;
382 __aligned_u64 next_key;
Tao Baod7db5942015-01-28 10:07:51 -0800383 };
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800384 __u64 flags;
Tao Baod7db5942015-01-28 10:07:51 -0800385 };
386 struct {
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700387 __aligned_u64 in_batch;
388 __aligned_u64 out_batch;
389 __aligned_u64 keys;
390 __aligned_u64 values;
391 __u32 count;
392 __u32 map_fd;
393 __u64 elem_flags;
394 __u64 flags;
395 } batch;
396 struct {
Tao Baod7db5942015-01-28 10:07:51 -0800397 __u32 prog_type;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800398 __u32 insn_cnt;
Tao Baod7db5942015-01-28 10:07:51 -0800399 __aligned_u64 insns;
400 __aligned_u64 license;
401 __u32 log_level;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800402 __u32 log_size;
Tao Baod7db5942015-01-28 10:07:51 -0800403 __aligned_u64 log_buf;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800404 __u32 kern_version;
Christopher Ferris525ce912017-07-26 13:12:53 -0700405 __u32 prog_flags;
Christopher Ferris934ec942018-01-31 15:29:16 -0800406 char prog_name[BPF_OBJ_NAME_LEN];
407 __u32 prog_ifindex;
Christopher Ferris76a1d452018-06-27 14:12:29 -0700408 __u32 expected_attach_type;
Christopher Ferrisd842e432019-03-07 10:21:59 -0800409 __u32 prog_btf_fd;
410 __u32 func_info_rec_size;
411 __aligned_u64 func_info;
412 __u32 func_info_cnt;
413 __u32 line_info_rec_size;
414 __aligned_u64 line_info;
415 __u32 line_info_cnt;
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800416 __u32 attach_btf_id;
Christopher Ferris05667cd2021-02-16 16:01:34 -0800417 union {
418 __u32 attach_prog_fd;
419 __u32 attach_btf_obj_fd;
420 };
Christopher Ferris1ed55342022-03-22 16:06:25 -0700421 __u32 core_relo_cnt;
Christopher Ferris3a39c0b2021-09-02 00:03:38 +0000422 __aligned_u64 fd_array;
Christopher Ferris1ed55342022-03-22 16:06:25 -0700423 __aligned_u64 core_relos;
424 __u32 core_relo_rec_size;
Christopher Ferris37c3f3c2023-07-10 10:59:05 -0700425 __u32 log_true_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800426 };
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800427 struct {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800428 __aligned_u64 pathname;
429 __u32 bpf_fd;
Christopher Ferris934ec942018-01-31 15:29:16 -0800430 __u32 file_flags;
Christopher Ferris8666d042023-09-06 14:55:31 -0700431 __s32 path_fd;
Tao Baod7db5942015-01-28 10:07:51 -0800432 };
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800433 struct {
Christopher Ferris67d1e5e2023-10-31 13:36:37 -0700434 union {
435 __u32 target_fd;
436 __u32 target_ifindex;
437 };
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800438 __u32 attach_bpf_fd;
439 __u32 attach_type;
440 __u32 attach_flags;
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700441 __u32 replace_bpf_fd;
Christopher Ferris67d1e5e2023-10-31 13:36:37 -0700442 union {
443 __u32 relative_fd;
444 __u32 relative_id;
445 };
446 __u64 expected_revision;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800447 };
Christopher Ferris525ce912017-07-26 13:12:53 -0700448 struct {
449 __u32 prog_fd;
450 __u32 retval;
451 __u32 data_size_in;
452 __u32 data_size_out;
453 __aligned_u64 data_in;
454 __aligned_u64 data_out;
455 __u32 repeat;
456 __u32 duration;
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700457 __u32 ctx_size_in;
458 __u32 ctx_size_out;
459 __aligned_u64 ctx_in;
460 __aligned_u64 ctx_out;
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800461 __u32 flags;
462 __u32 cpu;
Christopher Ferris10a76e62022-06-08 13:31:52 -0700463 __u32 batch_size;
Christopher Ferris525ce912017-07-26 13:12:53 -0700464 } test;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800465 struct {
466 union {
467 __u32 start_id;
468 __u32 prog_id;
469 __u32 map_id;
Christopher Ferris9ce28842018-10-25 12:11:39 -0700470 __u32 btf_id;
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700471 __u32 link_id;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800472 };
473 __u32 next_id;
Christopher Ferris934ec942018-01-31 15:29:16 -0800474 __u32 open_flags;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800475 };
476 struct {
477 __u32 bpf_fd;
478 __u32 info_len;
479 __aligned_u64 info;
480 } info;
Christopher Ferris934ec942018-01-31 15:29:16 -0800481 struct {
Christopher Ferris67d1e5e2023-10-31 13:36:37 -0700482 union {
483 __u32 target_fd;
484 __u32 target_ifindex;
485 };
Christopher Ferris934ec942018-01-31 15:29:16 -0800486 __u32 attach_type;
487 __u32 query_flags;
488 __u32 attach_flags;
489 __aligned_u64 prog_ids;
Christopher Ferris67d1e5e2023-10-31 13:36:37 -0700490 union {
491 __u32 prog_cnt;
492 __u32 count;
493 };
494 __u32 : 32;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700495 __aligned_u64 prog_attach_flags;
Christopher Ferris67d1e5e2023-10-31 13:36:37 -0700496 __aligned_u64 link_ids;
497 __aligned_u64 link_attach_flags;
498 __u64 revision;
Christopher Ferris934ec942018-01-31 15:29:16 -0800499 } query;
Christopher Ferris76a1d452018-06-27 14:12:29 -0700500 struct {
501 __u64 name;
502 __u32 prog_fd;
503 } raw_tracepoint;
Christopher Ferris9ce28842018-10-25 12:11:39 -0700504 struct {
505 __aligned_u64 btf;
506 __aligned_u64 btf_log_buf;
507 __u32 btf_size;
508 __u32 btf_log_size;
509 __u32 btf_log_level;
Christopher Ferris37c3f3c2023-07-10 10:59:05 -0700510 __u32 btf_log_true_size;
Christopher Ferris9ce28842018-10-25 12:11:39 -0700511 };
512 struct {
513 __u32 pid;
514 __u32 fd;
515 __u32 flags;
516 __u32 buf_len;
517 __aligned_u64 buf;
518 __u32 prog_id;
519 __u32 fd_type;
520 __u64 probe_offset;
521 __u64 probe_addr;
522 } task_fd_query;
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700523 struct {
Christopher Ferris37c3f3c2023-07-10 10:59:05 -0700524 union {
525 __u32 prog_fd;
526 __u32 map_fd;
527 };
Christopher Ferris25c18d42020-10-14 17:42:58 -0700528 union {
529 __u32 target_fd;
530 __u32 target_ifindex;
531 };
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700532 __u32 attach_type;
533 __u32 flags;
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800534 union {
535 __u32 target_btf_id;
536 struct {
537 __aligned_u64 iter_info;
538 __u32 iter_info_len;
539 };
Christopher Ferris2abfa9e2021-11-01 16:26:06 -0700540 struct {
541 __u64 bpf_cookie;
542 } perf_event;
Christopher Ferris10a76e62022-06-08 13:31:52 -0700543 struct {
544 __u32 flags;
545 __u32 cnt;
546 __aligned_u64 syms;
547 __aligned_u64 addrs;
548 __aligned_u64 cookies;
549 } kprobe_multi;
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700550 struct {
551 __u32 target_btf_id;
552 __u64 cookie;
553 } tracing;
Christopher Ferris37c3f3c2023-07-10 10:59:05 -0700554 struct {
555 __u32 pf;
556 __u32 hooknum;
557 __s32 priority;
558 __u32 flags;
559 } netfilter;
Christopher Ferris67d1e5e2023-10-31 13:36:37 -0700560 struct {
561 union {
562 __u32 relative_fd;
563 __u32 relative_id;
564 };
565 __u64 expected_revision;
566 } tcx;
567 struct {
568 __aligned_u64 path;
569 __aligned_u64 offsets;
570 __aligned_u64 ref_ctr_offsets;
571 __aligned_u64 cookies;
572 __u32 cnt;
573 __u32 flags;
574 __u32 pid;
575 } uprobe_multi;
Christopher Ferris0f795212024-01-17 14:17:28 -0800576 struct {
577 union {
578 __u32 relative_fd;
579 __u32 relative_id;
580 };
581 __u64 expected_revision;
582 } netkit;
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800583 };
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700584 } link_create;
585 struct {
586 __u32 link_fd;
Christopher Ferris37c3f3c2023-07-10 10:59:05 -0700587 union {
588 __u32 new_prog_fd;
589 __u32 new_map_fd;
590 };
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700591 __u32 flags;
Christopher Ferris37c3f3c2023-07-10 10:59:05 -0700592 union {
593 __u32 old_prog_fd;
594 __u32 old_map_fd;
595 };
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700596 } link_update;
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700597 struct {
Christopher Ferris25c18d42020-10-14 17:42:58 -0700598 __u32 link_fd;
599 } link_detach;
600 struct {
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700601 __u32 type;
602 } enable_stats;
603 struct {
604 __u32 link_fd;
605 __u32 flags;
606 } iter_create;
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800607 struct {
608 __u32 prog_fd;
609 __u32 map_fd;
610 __u32 flags;
611 } prog_bind_map;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800612} __attribute__((aligned(8)));
Christopher Ferris8b7fdc92023-02-21 13:36:32 -0800613#define ___BPF_FUNC_MAPPER(FN,ctx...) FN(unspec, 0, ##ctx) FN(map_lookup_elem, 1, ##ctx) FN(map_update_elem, 2, ##ctx) FN(map_delete_elem, 3, ##ctx) FN(probe_read, 4, ##ctx) FN(ktime_get_ns, 5, ##ctx) FN(trace_printk, 6, ##ctx) FN(get_prandom_u32, 7, ##ctx) FN(get_smp_processor_id, 8, ##ctx) FN(skb_store_bytes, 9, ##ctx) FN(l3_csum_replace, 10, ##ctx) FN(l4_csum_replace, 11, ##ctx) FN(tail_call, 12, ##ctx) FN(clone_redirect, 13, ##ctx) FN(get_current_pid_tgid, 14, ##ctx) FN(get_current_uid_gid, 15, ##ctx) FN(get_current_comm, 16, ##ctx) FN(get_cgroup_classid, 17, ##ctx) FN(skb_vlan_push, 18, ##ctx) FN(skb_vlan_pop, 19, ##ctx) FN(skb_get_tunnel_key, 20, ##ctx) FN(skb_set_tunnel_key, 21, ##ctx) FN(perf_event_read, 22, ##ctx) FN(redirect, 23, ##ctx) FN(get_route_realm, 24, ##ctx) FN(perf_event_output, 25, ##ctx) FN(skb_load_bytes, 26, ##ctx) FN(get_stackid, 27, ##ctx) FN(csum_diff, 28, ##ctx) FN(skb_get_tunnel_opt, 29, ##ctx) FN(skb_set_tunnel_opt, 30, ##ctx) FN(skb_change_proto, 31, ##ctx) FN(skb_change_type, 32, ##ctx) FN(skb_under_cgroup, 33, ##ctx) FN(get_hash_recalc, 34, ##ctx) FN(get_current_task, 35, ##ctx) FN(probe_write_user, 36, ##ctx) FN(current_task_under_cgroup, 37, ##ctx) FN(skb_change_tail, 38, ##ctx) FN(skb_pull_data, 39, ##ctx) FN(csum_update, 40, ##ctx) FN(set_hash_invalid, 41, ##ctx) FN(get_numa_node_id, 42, ##ctx) FN(skb_change_head, 43, ##ctx) FN(xdp_adjust_head, 44, ##ctx) FN(probe_read_str, 45, ##ctx) FN(get_socket_cookie, 46, ##ctx) FN(get_socket_uid, 47, ##ctx) FN(set_hash, 48, ##ctx) FN(setsockopt, 49, ##ctx) FN(skb_adjust_room, 50, ##ctx) FN(redirect_map, 51, ##ctx) FN(sk_redirect_map, 52, ##ctx) FN(sock_map_update, 53, ##ctx) FN(xdp_adjust_meta, 54, ##ctx) FN(perf_event_read_value, 55, ##ctx) FN(perf_prog_read_value, 56, ##ctx) FN(getsockopt, 57, ##ctx) FN(override_return, 58, ##ctx) FN(sock_ops_cb_flags_set, 59, ##ctx) FN(msg_redirect_map, 60, ##ctx) FN(msg_apply_bytes, 61, ##ctx) FN(msg_cork_bytes, 62, ##ctx) FN(msg_pull_data, 63, ##ctx) FN(bind, 64, ##ctx) FN(xdp_adjust_tail, 65, ##ctx) FN(skb_get_xfrm_state, 66, ##ctx) FN(get_stack, 67, ##ctx) FN(skb_load_bytes_relative, 68, ##ctx) FN(fib_lookup, 69, ##ctx) FN(sock_hash_update, 70, ##ctx) FN(msg_redirect_hash, 71, ##ctx) FN(sk_redirect_hash, 72, ##ctx) FN(lwt_push_encap, 73, ##ctx) FN(lwt_seg6_store_bytes, 74, ##ctx) FN(lwt_seg6_adjust_srh, 75, ##ctx) FN(lwt_seg6_action, 76, ##ctx) FN(rc_repeat, 77, ##ctx) FN(rc_keydown, 78, ##ctx) FN(skb_cgroup_id, 79, ##ctx) FN(get_current_cgroup_id, 80, ##ctx) FN(get_local_storage, 81, ##ctx) FN(sk_select_reuseport, 82, ##ctx) FN(skb_ancestor_cgroup_id, 83, ##ctx) FN(sk_lookup_tcp, 84, ##ctx) FN(sk_lookup_udp, 85, ##ctx) FN(sk_release, 86, ##ctx) FN(map_push_elem, 87, ##ctx) FN(map_pop_elem, 88, ##ctx) FN(map_peek_elem, 89, ##ctx) FN(msg_push_data, 90, ##ctx) FN(msg_pop_data, 91, ##ctx) FN(rc_pointer_rel, 92, ##ctx) FN(spin_lock, 93, ##ctx) FN(spin_unlock, 94, ##ctx) FN(sk_fullsock, 95, ##ctx) FN(tcp_sock, 96, ##ctx) FN(skb_ecn_set_ce, 97, ##ctx) FN(get_listener_sock, 98, ##ctx) FN(skc_lookup_tcp, 99, ##ctx) FN(tcp_check_syncookie, 100, ##ctx) FN(sysctl_get_name, 101, ##ctx) FN(sysctl_get_current_value, 102, ##ctx) FN(sysctl_get_new_value, 103, ##ctx) FN(sysctl_set_new_value, 104, ##ctx) FN(strtol, 105, ##ctx) FN(strtoul, 106, ##ctx) FN(sk_storage_get, 107, ##ctx) FN(sk_storage_delete, 108, ##ctx) FN(send_signal, 109, ##ctx) FN(tcp_gen_syncookie, 110, ##ctx) FN(skb_output, 111, ##ctx) FN(probe_read_user, 112, ##ctx) FN(probe_read_kernel, 113, ##ctx) FN(probe_read_user_str, 114, ##ctx) FN(probe_read_kernel_str, 115, ##ctx) FN(tcp_send_ack, 116, ##ctx) FN(send_signal_thread, 117, ##ctx) FN(jiffies64, 118, ##ctx) FN(read_branch_records, 119, ##ctx) FN(get_ns_current_pid_tgid, 120, ##ctx) FN(xdp_output, 121, ##ctx) FN(get_netns_cookie, 122, ##ctx) FN(get_current_ancestor_cgroup_id, 123, ##ctx) FN(sk_assign, 124, ##ctx) FN(ktime_get_boot_ns, 125, ##ctx) FN(seq_printf, 126, ##ctx) FN(seq_write, 127, ##ctx) FN(sk_cgroup_id, 128, ##ctx) FN(sk_ancestor_cgroup_id, 129, ##ctx) FN(ringbuf_output, 130, ##ctx) FN(ringbuf_reserve, 131, ##ctx) FN(ringbuf_submit, 132, ##ctx) FN(ringbuf_discard, 133, ##ctx) FN(ringbuf_query, 134, ##ctx) FN(csum_level, 135, ##ctx) FN(skc_to_tcp6_sock, 136, ##ctx) FN(skc_to_tcp_sock, 137, ##ctx) FN(skc_to_tcp_timewait_sock, 138, ##ctx) FN(skc_to_tcp_request_sock, 139, ##ctx) FN(skc_to_udp6_sock, 140, ##ctx) FN(get_task_stack, 141, ##ctx) FN(load_hdr_opt, 142, ##ctx) FN(store_hdr_opt, 143, ##ctx) FN(reserve_hdr_opt, 144, ##ctx) FN(inode_storage_get, 145, ##ctx) FN(inode_storage_delete, 146, ##ctx) FN(d_path, 147, ##ctx) FN(copy_from_user, 148, ##ctx) FN(snprintf_btf, 149, ##ctx) FN(seq_printf_btf, 150, ##ctx) FN(skb_cgroup_classid, 151, ##ctx) FN(redirect_neigh, 152, ##ctx) FN(per_cpu_ptr, 153, ##ctx) FN(this_cpu_ptr, 154, ##ctx) FN(redirect_peer, 155, ##ctx) FN(task_storage_get, 156, ##ctx) FN(task_storage_delete, 157, ##ctx) FN(get_current_task_btf, 158, ##ctx) FN(bprm_opts_set, 159, ##ctx) FN(ktime_get_coarse_ns, 160, ##ctx) FN(ima_inode_hash, 161, ##ctx) FN(sock_from_file, 162, ##ctx) FN(check_mtu, 163, ##ctx) FN(for_each_map_elem, 164, ##ctx) FN(snprintf, 165, ##ctx) FN(sys_bpf, 166, ##ctx) FN(btf_find_by_name_kind, 167, ##ctx) FN(sys_close, 168, ##ctx) FN(timer_init, 169, ##ctx) FN(timer_set_callback, 170, ##ctx) FN(timer_start, 171, ##ctx) FN(timer_cancel, 172, ##ctx) FN(get_func_ip, 173, ##ctx) FN(get_attach_cookie, 174, ##ctx) FN(task_pt_regs, 175, ##ctx) FN(get_branch_snapshot, 176, ##ctx) FN(trace_vprintk, 177, ##ctx) FN(skc_to_unix_sock, 178, ##ctx) FN(kallsyms_lookup_name, 179, ##ctx) FN(find_vma, 180, ##ctx) FN(loop, 181, ##ctx) FN(strncmp, 182, ##ctx) FN(get_func_arg, 183, ##ctx) FN(get_func_ret, 184, ##ctx) FN(get_func_arg_cnt, 185, ##ctx) FN(get_retval, 186, ##ctx) FN(set_retval, 187, ##ctx) FN(xdp_get_buff_len, 188, ##ctx) FN(xdp_load_bytes, 189, ##ctx) FN(xdp_store_bytes, 190, ##ctx) FN(copy_from_user_task, 191, ##ctx) FN(skb_set_tstamp, 192, ##ctx) FN(ima_file_hash, 193, ##ctx) FN(kptr_xchg, 194, ##ctx) FN(map_lookup_percpu_elem, 195, ##ctx) FN(skc_to_mptcp_sock, 196, ##ctx) FN(dynptr_from_mem, 197, ##ctx) FN(ringbuf_reserve_dynptr, 198, ##ctx) FN(ringbuf_submit_dynptr, 199, ##ctx) FN(ringbuf_discard_dynptr, 200, ##ctx) FN(dynptr_read, 201, ##ctx) FN(dynptr_write, 202, ##ctx) FN(dynptr_data, 203, ##ctx) FN(tcp_raw_gen_syncookie_ipv4, 204, ##ctx) FN(tcp_raw_gen_syncookie_ipv6, 205, ##ctx) FN(tcp_raw_check_syncookie_ipv4, 206, ##ctx) FN(tcp_raw_check_syncookie_ipv6, 207, ##ctx) FN(ktime_get_tai_ns, 208, ##ctx) FN(user_ringbuf_drain, 209, ##ctx) FN(cgrp_storage_get, 210, ##ctx) FN(cgrp_storage_delete, 211, ##ctx)
614#define __BPF_FUNC_MAPPER_APPLY(name,value,FN) FN(name),
615#define __BPF_FUNC_MAPPER(FN) ___BPF_FUNC_MAPPER(__BPF_FUNC_MAPPER_APPLY, FN)
616#define __BPF_ENUM_FN(x,y) BPF_FUNC_ ##x = y,
Christopher Ferris82d75042015-01-26 10:57:07 -0800617enum bpf_func_id {
Christopher Ferris8b7fdc92023-02-21 13:36:32 -0800618 ___BPF_FUNC_MAPPER(__BPF_ENUM_FN) __BPF_FUNC_MAX_ID,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800619};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800620#undef __BPF_ENUM_FN
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700621enum {
622 BPF_F_RECOMPUTE_CSUM = (1ULL << 0),
623 BPF_F_INVALIDATE_HASH = (1ULL << 1),
624};
625enum {
626 BPF_F_HDR_FIELD_MASK = 0xfULL,
627};
628enum {
629 BPF_F_PSEUDO_HDR = (1ULL << 4),
630 BPF_F_MARK_MANGLED_0 = (1ULL << 5),
631 BPF_F_MARK_ENFORCE = (1ULL << 6),
632};
633enum {
634 BPF_F_INGRESS = (1ULL << 0),
635};
636enum {
637 BPF_F_TUNINFO_IPV6 = (1ULL << 0),
638};
639enum {
640 BPF_F_SKIP_FIELD_MASK = 0xffULL,
641 BPF_F_USER_STACK = (1ULL << 8),
642 BPF_F_FAST_STACK_CMP = (1ULL << 9),
643 BPF_F_REUSE_STACKID = (1ULL << 10),
644 BPF_F_USER_BUILD_ID = (1ULL << 11),
645};
646enum {
647 BPF_F_ZERO_CSUM_TX = (1ULL << 1),
648 BPF_F_DONT_FRAGMENT = (1ULL << 2),
649 BPF_F_SEQ_NUMBER = (1ULL << 3),
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +0000650 BPF_F_NO_TUNNEL_KEY = (1ULL << 4),
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700651};
652enum {
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000653 BPF_F_TUNINFO_FLAGS = (1ULL << 4),
654};
655enum {
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700656 BPF_F_INDEX_MASK = 0xffffffffULL,
657 BPF_F_CURRENT_CPU = BPF_F_INDEX_MASK,
658 BPF_F_CTXLEN_MASK = (0xfffffULL << 32),
659};
660enum {
661 BPF_F_CURRENT_NETNS = (- 1L),
662};
663enum {
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700664 BPF_CSUM_LEVEL_QUERY,
665 BPF_CSUM_LEVEL_INC,
666 BPF_CSUM_LEVEL_DEC,
667 BPF_CSUM_LEVEL_RESET,
668};
669enum {
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700670 BPF_F_ADJ_ROOM_FIXED_GSO = (1ULL << 0),
671 BPF_F_ADJ_ROOM_ENCAP_L3_IPV4 = (1ULL << 1),
672 BPF_F_ADJ_ROOM_ENCAP_L3_IPV6 = (1ULL << 2),
673 BPF_F_ADJ_ROOM_ENCAP_L4_GRE = (1ULL << 3),
674 BPF_F_ADJ_ROOM_ENCAP_L4_UDP = (1ULL << 4),
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700675 BPF_F_ADJ_ROOM_NO_CSUM_RESET = (1ULL << 5),
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000676 BPF_F_ADJ_ROOM_ENCAP_L2_ETH = (1ULL << 6),
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +0000677 BPF_F_ADJ_ROOM_DECAP_L3_IPV4 = (1ULL << 7),
678 BPF_F_ADJ_ROOM_DECAP_L3_IPV6 = (1ULL << 8),
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700679};
680enum {
681 BPF_ADJ_ROOM_ENCAP_L2_MASK = 0xff,
682 BPF_ADJ_ROOM_ENCAP_L2_SHIFT = 56,
683};
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700684#define BPF_F_ADJ_ROOM_ENCAP_L2(len) (((__u64) len & BPF_ADJ_ROOM_ENCAP_L2_MASK) << BPF_ADJ_ROOM_ENCAP_L2_SHIFT)
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700685enum {
686 BPF_F_SYSCTL_BASE_NAME = (1ULL << 0),
687};
688enum {
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800689 BPF_LOCAL_STORAGE_GET_F_CREATE = (1ULL << 0),
690 BPF_SK_STORAGE_GET_F_CREATE = BPF_LOCAL_STORAGE_GET_F_CREATE,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700691};
692enum {
693 BPF_F_GET_BRANCH_RECORDS_SIZE = (1ULL << 0),
694};
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700695enum {
696 BPF_RB_NO_WAKEUP = (1ULL << 0),
697 BPF_RB_FORCE_WAKEUP = (1ULL << 1),
698};
699enum {
700 BPF_RB_AVAIL_DATA = 0,
701 BPF_RB_RING_SIZE = 1,
702 BPF_RB_CONS_POS = 2,
703 BPF_RB_PROD_POS = 3,
704};
705enum {
706 BPF_RINGBUF_BUSY_BIT = (1U << 31),
707 BPF_RINGBUF_DISCARD_BIT = (1U << 30),
708 BPF_RINGBUF_HDR_SZ = 8,
709};
Christopher Ferris25c18d42020-10-14 17:42:58 -0700710enum {
711 BPF_SK_LOOKUP_F_REPLACE = (1ULL << 0),
712 BPF_SK_LOOKUP_F_NO_REUSEPORT = (1ULL << 1),
713};
Christopher Ferris1308ad32017-11-14 17:32:13 -0800714enum bpf_adj_room_mode {
715 BPF_ADJ_ROOM_NET,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700716 BPF_ADJ_ROOM_MAC,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800717};
Christopher Ferris9ce28842018-10-25 12:11:39 -0700718enum bpf_hdr_start_off {
719 BPF_HDR_START_MAC,
720 BPF_HDR_START_NET,
721};
722enum bpf_lwt_encap_mode {
723 BPF_LWT_ENCAP_SEG6,
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700724 BPF_LWT_ENCAP_SEG6_INLINE,
725 BPF_LWT_ENCAP_IP,
Christopher Ferris9ce28842018-10-25 12:11:39 -0700726};
Christopher Ferris05667cd2021-02-16 16:01:34 -0800727enum {
728 BPF_F_BPRM_SECUREEXEC = (1ULL << 0),
729};
Christopher Ferris3a39c0b2021-09-02 00:03:38 +0000730enum {
731 BPF_F_BROADCAST = (1ULL << 3),
732 BPF_F_EXCLUDE_INGRESS = (1ULL << 4),
733};
Christopher Ferris86a48372019-01-10 14:14:59 -0800734#define __bpf_md_ptr(type,name) union { type name; __u64 : 64; \
735} __attribute__((aligned(8)))
Christopher Ferris10a76e62022-06-08 13:31:52 -0700736enum {
737 BPF_SKB_TSTAMP_UNSPEC,
738 BPF_SKB_TSTAMP_DELIVERY_MONO,
739};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800740struct __sk_buff {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800741 __u32 len;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800742 __u32 pkt_type;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800743 __u32 mark;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800744 __u32 queue_mapping;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800745 __u32 protocol;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800746 __u32 vlan_present;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800747 __u32 vlan_tci;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800748 __u32 vlan_proto;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800749 __u32 priority;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800750 __u32 ingress_ifindex;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800751 __u32 ifindex;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800752 __u32 tc_index;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800753 __u32 cb[5];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800754 __u32 hash;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800755 __u32 tc_classid;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800756 __u32 data;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800757 __u32 data_end;
Christopher Ferris525ce912017-07-26 13:12:53 -0700758 __u32 napi_id;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800759 __u32 family;
760 __u32 remote_ip4;
761 __u32 local_ip4;
762 __u32 remote_ip6[4];
763 __u32 local_ip6[4];
764 __u32 remote_port;
765 __u32 local_port;
Christopher Ferris934ec942018-01-31 15:29:16 -0800766 __u32 data_meta;
Christopher Ferris86a48372019-01-10 14:14:59 -0800767 __bpf_md_ptr(struct bpf_flow_keys *, flow_keys);
Christopher Ferrisd842e432019-03-07 10:21:59 -0800768 __u64 tstamp;
769 __u32 wire_len;
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700770 __u32 gso_segs;
771 __bpf_md_ptr(struct bpf_sock *, sk);
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700772 __u32 gso_size;
Christopher Ferris10a76e62022-06-08 13:31:52 -0700773 __u8 tstamp_type;
774 __u32 : 24;
Christopher Ferrisa4792612022-01-10 13:51:15 -0800775 __u64 hwtstamp;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800776};
777struct bpf_tunnel_key {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800778 __u32 tunnel_id;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800779 union {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700780 __u32 remote_ipv4;
781 __u32 remote_ipv6[4];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800782 };
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800783 __u8 tunnel_tos;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700784 __u8 tunnel_ttl;
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000785 union {
786 __u16 tunnel_ext;
787 __be16 tunnel_flags;
788 };
Christopher Ferris49f525c2016-12-12 14:55:36 -0800789 __u32 tunnel_label;
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700790 union {
791 __u32 local_ipv4;
792 __u32 local_ipv6[4];
793 };
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800794};
Christopher Ferris9ce28842018-10-25 12:11:39 -0700795struct bpf_xfrm_state {
796 __u32 reqid;
797 __u32 spi;
798 __u16 family;
799 __u16 ext;
800 union {
801 __u32 remote_ipv4;
802 __u32 remote_ipv6[4];
803 };
804};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800805enum bpf_ret_code {
806 BPF_OK = 0,
807 BPF_DROP = 2,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800808 BPF_REDIRECT = 7,
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700809 BPF_LWT_REROUTE = 128,
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000810 BPF_FLOW_DISSECTOR_CONTINUE = 129,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800811};
812struct bpf_sock {
813 __u32 bound_dev_if;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800814 __u32 family;
815 __u32 type;
816 __u32 protocol;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800817 __u32 mark;
818 __u32 priority;
Christopher Ferris76a1d452018-06-27 14:12:29 -0700819 __u32 src_ip4;
820 __u32 src_ip6[4];
821 __u32 src_port;
Christopher Ferris10a76e62022-06-08 13:31:52 -0700822 __be16 dst_port;
823 __u16 : 16;
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700824 __u32 dst_ip4;
825 __u32 dst_ip6[4];
826 __u32 state;
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700827 __s32 rx_queue_mapping;
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700828};
829struct bpf_tcp_sock {
830 __u32 snd_cwnd;
831 __u32 srtt_us;
832 __u32 rtt_min;
833 __u32 snd_ssthresh;
834 __u32 rcv_nxt;
835 __u32 snd_nxt;
836 __u32 snd_una;
837 __u32 mss_cache;
838 __u32 ecn_flags;
839 __u32 rate_delivered;
840 __u32 rate_interval_us;
841 __u32 packets_out;
842 __u32 retrans_out;
843 __u32 total_retrans;
844 __u32 segs_in;
845 __u32 data_segs_in;
846 __u32 segs_out;
847 __u32 data_segs_out;
848 __u32 lost_out;
849 __u32 sacked_out;
850 __u64 bytes_received;
851 __u64 bytes_acked;
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700852 __u32 dsack_dups;
853 __u32 delivered;
854 __u32 delivered_ce;
855 __u32 icsk_retransmits;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800856};
Christopher Ferris86a48372019-01-10 14:14:59 -0800857struct bpf_sock_tuple {
858 union {
859 struct {
860 __be32 saddr;
861 __be32 daddr;
862 __be16 sport;
863 __be16 dport;
864 } ipv4;
865 struct {
866 __be32 saddr[4];
867 __be32 daddr[4];
868 __be16 sport;
869 __be16 dport;
870 } ipv6;
871 };
872};
Christopher Ferris67d1e5e2023-10-31 13:36:37 -0700873enum tcx_action_base {
874 TCX_NEXT = - 1,
875 TCX_PASS = 0,
876 TCX_DROP = 2,
877 TCX_REDIRECT = 7,
878};
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700879struct bpf_xdp_sock {
880 __u32 queue_id;
881};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800882#define XDP_PACKET_HEADROOM 256
Christopher Ferris49f525c2016-12-12 14:55:36 -0800883enum xdp_action {
884 XDP_ABORTED = 0,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800885 XDP_DROP,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800886 XDP_PASS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800887 XDP_TX,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800888 XDP_REDIRECT,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800889};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800890struct xdp_md {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800891 __u32 data;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800892 __u32 data_end;
Christopher Ferris934ec942018-01-31 15:29:16 -0800893 __u32 data_meta;
Christopher Ferris76a1d452018-06-27 14:12:29 -0700894 __u32 ingress_ifindex;
895 __u32 rx_queue_index;
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700896 __u32 egress_ifindex;
897};
898struct bpf_devmap_val {
899 __u32 ifindex;
900 union {
901 int fd;
902 __u32 id;
903 } bpf_prog;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800904};
Christopher Ferris25c18d42020-10-14 17:42:58 -0700905struct bpf_cpumap_val {
906 __u32 qsize;
907 union {
908 int fd;
909 __u32 id;
910 } bpf_prog;
911};
Christopher Ferris1308ad32017-11-14 17:32:13 -0800912enum sk_action {
913 SK_DROP = 0,
914 SK_PASS,
915};
Christopher Ferris76a1d452018-06-27 14:12:29 -0700916struct sk_msg_md {
Christopher Ferris86a48372019-01-10 14:14:59 -0800917 __bpf_md_ptr(void *, data);
918 __bpf_md_ptr(void *, data_end);
Christopher Ferris9ce28842018-10-25 12:11:39 -0700919 __u32 family;
920 __u32 remote_ip4;
921 __u32 local_ip4;
922 __u32 remote_ip6[4];
923 __u32 local_ip6[4];
924 __u32 remote_port;
925 __u32 local_port;
Christopher Ferrisd842e432019-03-07 10:21:59 -0800926 __u32 size;
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700927 __bpf_md_ptr(struct bpf_sock *, sk);
Christopher Ferris9ce28842018-10-25 12:11:39 -0700928};
929struct sk_reuseport_md {
Christopher Ferris86a48372019-01-10 14:14:59 -0800930 __bpf_md_ptr(void *, data);
931 __bpf_md_ptr(void *, data_end);
Christopher Ferris9ce28842018-10-25 12:11:39 -0700932 __u32 len;
933 __u32 eth_protocol;
934 __u32 ip_protocol;
935 __u32 bind_inany;
936 __u32 hash;
Christopher Ferris3a39c0b2021-09-02 00:03:38 +0000937 __bpf_md_ptr(struct bpf_sock *, sk);
938 __bpf_md_ptr(struct bpf_sock *, migrating_sk);
Christopher Ferris76a1d452018-06-27 14:12:29 -0700939};
Christopher Ferris1308ad32017-11-14 17:32:13 -0800940#define BPF_TAG_SIZE 8
941struct bpf_prog_info {
942 __u32 type;
943 __u32 id;
944 __u8 tag[BPF_TAG_SIZE];
945 __u32 jited_prog_len;
946 __u32 xlated_prog_len;
947 __aligned_u64 jited_prog_insns;
948 __aligned_u64 xlated_prog_insns;
Christopher Ferris934ec942018-01-31 15:29:16 -0800949 __u64 load_time;
950 __u32 created_by_uid;
951 __u32 nr_map_ids;
952 __aligned_u64 map_ids;
953 char name[BPF_OBJ_NAME_LEN];
Christopher Ferris76a1d452018-06-27 14:12:29 -0700954 __u32 ifindex;
Christopher Ferris9ce28842018-10-25 12:11:39 -0700955 __u32 gpl_compatible : 1;
Christopher Ferrisfa59a102019-08-05 12:58:49 -0700956 __u32 : 31;
Christopher Ferris76a1d452018-06-27 14:12:29 -0700957 __u64 netns_dev;
958 __u64 netns_ino;
Christopher Ferris9ce28842018-10-25 12:11:39 -0700959 __u32 nr_jited_ksyms;
960 __u32 nr_jited_func_lens;
961 __aligned_u64 jited_ksyms;
962 __aligned_u64 jited_func_lens;
Christopher Ferrisd842e432019-03-07 10:21:59 -0800963 __u32 btf_id;
964 __u32 func_info_rec_size;
965 __aligned_u64 func_info;
966 __u32 nr_func_info;
967 __u32 nr_line_info;
968 __aligned_u64 line_info;
969 __aligned_u64 jited_line_info;
970 __u32 nr_jited_line_info;
971 __u32 line_info_rec_size;
972 __u32 jited_line_info_rec_size;
973 __u32 nr_prog_tags;
974 __aligned_u64 prog_tags;
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700975 __u64 run_time_ns;
976 __u64 run_cnt;
Christopher Ferrisa9750ed2021-05-03 14:02:49 -0700977 __u64 recursion_misses;
Christopher Ferrisa4792612022-01-10 13:51:15 -0800978 __u32 verified_insns;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700979 __u32 attach_btf_obj_id;
980 __u32 attach_btf_id;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800981} __attribute__((aligned(8)));
982struct bpf_map_info {
983 __u32 type;
984 __u32 id;
985 __u32 key_size;
986 __u32 value_size;
987 __u32 max_entries;
988 __u32 map_flags;
Christopher Ferris934ec942018-01-31 15:29:16 -0800989 char name[BPF_OBJ_NAME_LEN];
Christopher Ferris76a1d452018-06-27 14:12:29 -0700990 __u32 ifindex;
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700991 __u32 btf_vmlinux_value_type_id;
Christopher Ferris76a1d452018-06-27 14:12:29 -0700992 __u64 netns_dev;
993 __u64 netns_ino;
Christopher Ferris9ce28842018-10-25 12:11:39 -0700994 __u32 btf_id;
995 __u32 btf_key_type_id;
996 __u32 btf_value_type_id;
Christopher Ferrisa4792612022-01-10 13:51:15 -0800997 __u32 : 32;
998 __u64 map_extra;
Christopher Ferris9ce28842018-10-25 12:11:39 -0700999} __attribute__((aligned(8)));
1000struct bpf_btf_info {
1001 __aligned_u64 btf;
1002 __u32 btf_size;
1003 __u32 id;
Christopher Ferris05667cd2021-02-16 16:01:34 -08001004 __aligned_u64 name;
1005 __u32 name_len;
1006 __u32 kernel_btf;
Christopher Ferris1308ad32017-11-14 17:32:13 -08001007} __attribute__((aligned(8)));
Christopher Ferris8177cdf2020-08-03 11:53:55 -07001008struct bpf_link_info {
1009 __u32 type;
1010 __u32 id;
1011 __u32 prog_id;
1012 union {
1013 struct {
1014 __aligned_u64 tp_name;
1015 __u32 tp_name_len;
1016 } raw_tracepoint;
1017 struct {
1018 __u32 attach_type;
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +00001019 __u32 target_obj_id;
1020 __u32 target_btf_id;
Christopher Ferris8177cdf2020-08-03 11:53:55 -07001021 } tracing;
1022 struct {
1023 __u64 cgroup_id;
1024 __u32 attach_type;
1025 } cgroup;
1026 struct {
Christopher Ferris32ff3f82020-12-14 13:10:04 -08001027 __aligned_u64 target_name;
1028 __u32 target_name_len;
1029 union {
1030 struct {
1031 __u32 map_id;
1032 } map;
1033 };
Christopher Ferris6cd53a52022-12-12 23:39:16 +00001034 union {
1035 struct {
1036 __u64 cgroup_id;
1037 __u32 order;
1038 } cgroup;
1039 struct {
1040 __u32 tid;
1041 __u32 pid;
1042 } task;
1043 };
Christopher Ferris32ff3f82020-12-14 13:10:04 -08001044 } iter;
1045 struct {
Christopher Ferris8177cdf2020-08-03 11:53:55 -07001046 __u32 netns_ino;
1047 __u32 attach_type;
1048 } netns;
Christopher Ferris25c18d42020-10-14 17:42:58 -07001049 struct {
1050 __u32 ifindex;
1051 } xdp;
Christopher Ferris37c3f3c2023-07-10 10:59:05 -07001052 struct {
1053 __u32 map_id;
1054 } struct_ops;
1055 struct {
1056 __u32 pf;
1057 __u32 hooknum;
1058 __s32 priority;
1059 __u32 flags;
1060 } netfilter;
Christopher Ferris67d1e5e2023-10-31 13:36:37 -07001061 struct {
1062 __aligned_u64 addrs;
1063 __u32 count;
1064 __u32 flags;
Christopher Ferris0f795212024-01-17 14:17:28 -08001065 __u64 missed;
Christopher Ferris67d1e5e2023-10-31 13:36:37 -07001066 } kprobe_multi;
1067 struct {
Christopher Ferrisb830ddf2024-03-28 11:48:08 -07001068 __aligned_u64 path;
1069 __aligned_u64 offsets;
1070 __aligned_u64 ref_ctr_offsets;
1071 __aligned_u64 cookies;
1072 __u32 path_size;
1073 __u32 count;
1074 __u32 flags;
1075 __u32 pid;
1076 } uprobe_multi;
1077 struct {
Christopher Ferris67d1e5e2023-10-31 13:36:37 -07001078 __u32 type;
1079 __u32 : 32;
1080 union {
1081 struct {
1082 __aligned_u64 file_name;
1083 __u32 name_len;
1084 __u32 offset;
1085 } uprobe;
1086 struct {
1087 __aligned_u64 func_name;
1088 __u32 name_len;
1089 __u32 offset;
1090 __u64 addr;
Christopher Ferris0f795212024-01-17 14:17:28 -08001091 __u64 missed;
Christopher Ferris67d1e5e2023-10-31 13:36:37 -07001092 } kprobe;
1093 struct {
1094 __aligned_u64 tp_name;
1095 __u32 name_len;
1096 } tracepoint;
1097 struct {
1098 __u64 config;
1099 __u32 type;
1100 } event;
1101 };
1102 } perf_event;
1103 struct {
1104 __u32 ifindex;
1105 __u32 attach_type;
1106 } tcx;
Christopher Ferris0f795212024-01-17 14:17:28 -08001107 struct {
1108 __u32 ifindex;
1109 __u32 attach_type;
1110 } netkit;
Christopher Ferris8177cdf2020-08-03 11:53:55 -07001111 };
1112} __attribute__((aligned(8)));
Christopher Ferris76a1d452018-06-27 14:12:29 -07001113struct bpf_sock_addr {
1114 __u32 user_family;
1115 __u32 user_ip4;
1116 __u32 user_ip6[4];
1117 __u32 user_port;
1118 __u32 family;
1119 __u32 type;
1120 __u32 protocol;
Christopher Ferris9ce28842018-10-25 12:11:39 -07001121 __u32 msg_src_ip4;
1122 __u32 msg_src_ip6[4];
Christopher Ferrisb8a95e22019-10-02 18:29:20 -07001123 __bpf_md_ptr(struct bpf_sock *, sk);
Christopher Ferris76a1d452018-06-27 14:12:29 -07001124};
Christopher Ferris1308ad32017-11-14 17:32:13 -08001125struct bpf_sock_ops {
1126 __u32 op;
1127 union {
Christopher Ferris76a1d452018-06-27 14:12:29 -07001128 __u32 args[4];
Christopher Ferris1308ad32017-11-14 17:32:13 -08001129 __u32 reply;
1130 __u32 replylong[4];
1131 };
1132 __u32 family;
1133 __u32 remote_ip4;
1134 __u32 local_ip4;
1135 __u32 remote_ip6[4];
1136 __u32 local_ip6[4];
1137 __u32 remote_port;
1138 __u32 local_port;
Christopher Ferris76a1d452018-06-27 14:12:29 -07001139 __u32 is_fullsock;
1140 __u32 snd_cwnd;
1141 __u32 srtt_us;
1142 __u32 bpf_sock_ops_cb_flags;
1143 __u32 state;
1144 __u32 rtt_min;
1145 __u32 snd_ssthresh;
1146 __u32 rcv_nxt;
1147 __u32 snd_nxt;
1148 __u32 snd_una;
1149 __u32 mss_cache;
1150 __u32 ecn_flags;
1151 __u32 rate_delivered;
1152 __u32 rate_interval_us;
1153 __u32 packets_out;
1154 __u32 retrans_out;
1155 __u32 total_retrans;
1156 __u32 segs_in;
1157 __u32 data_segs_in;
1158 __u32 segs_out;
1159 __u32 data_segs_out;
1160 __u32 lost_out;
1161 __u32 sacked_out;
1162 __u32 sk_txhash;
1163 __u64 bytes_received;
1164 __u64 bytes_acked;
Christopher Ferrisb8a95e22019-10-02 18:29:20 -07001165 __bpf_md_ptr(struct bpf_sock *, sk);
Christopher Ferris32ff3f82020-12-14 13:10:04 -08001166 __bpf_md_ptr(void *, skb_data);
1167 __bpf_md_ptr(void *, skb_data_end);
1168 __u32 skb_len;
1169 __u32 skb_tcp_flags;
Christopher Ferris8b7fdc92023-02-21 13:36:32 -08001170 __u64 skb_hwtstamp;
Christopher Ferris1308ad32017-11-14 17:32:13 -08001171};
Christopher Ferrisaf09c702020-06-01 20:29:29 -07001172enum {
1173 BPF_SOCK_OPS_RTO_CB_FLAG = (1 << 0),
1174 BPF_SOCK_OPS_RETRANS_CB_FLAG = (1 << 1),
1175 BPF_SOCK_OPS_STATE_CB_FLAG = (1 << 2),
1176 BPF_SOCK_OPS_RTT_CB_FLAG = (1 << 3),
Christopher Ferris32ff3f82020-12-14 13:10:04 -08001177 BPF_SOCK_OPS_PARSE_ALL_HDR_OPT_CB_FLAG = (1 << 4),
1178 BPF_SOCK_OPS_PARSE_UNKNOWN_HDR_OPT_CB_FLAG = (1 << 5),
1179 BPF_SOCK_OPS_WRITE_HDR_OPT_CB_FLAG = (1 << 6),
1180 BPF_SOCK_OPS_ALL_CB_FLAGS = 0x7F,
Christopher Ferrisaf09c702020-06-01 20:29:29 -07001181};
Christopher Ferris1308ad32017-11-14 17:32:13 -08001182enum {
1183 BPF_SOCK_OPS_VOID,
1184 BPF_SOCK_OPS_TIMEOUT_INIT,
1185 BPF_SOCK_OPS_RWND_INIT,
1186 BPF_SOCK_OPS_TCP_CONNECT_CB,
1187 BPF_SOCK_OPS_ACTIVE_ESTABLISHED_CB,
1188 BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB,
1189 BPF_SOCK_OPS_NEEDS_ECN,
Christopher Ferris934ec942018-01-31 15:29:16 -08001190 BPF_SOCK_OPS_BASE_RTT,
Christopher Ferris76a1d452018-06-27 14:12:29 -07001191 BPF_SOCK_OPS_RTO_CB,
1192 BPF_SOCK_OPS_RETRANS_CB,
1193 BPF_SOCK_OPS_STATE_CB,
Christopher Ferris9ce28842018-10-25 12:11:39 -07001194 BPF_SOCK_OPS_TCP_LISTEN_CB,
Christopher Ferrisb8a95e22019-10-02 18:29:20 -07001195 BPF_SOCK_OPS_RTT_CB,
Christopher Ferris32ff3f82020-12-14 13:10:04 -08001196 BPF_SOCK_OPS_PARSE_HDR_OPT_CB,
1197 BPF_SOCK_OPS_HDR_OPT_LEN_CB,
1198 BPF_SOCK_OPS_WRITE_HDR_OPT_CB,
Christopher Ferris76a1d452018-06-27 14:12:29 -07001199};
1200enum {
1201 BPF_TCP_ESTABLISHED = 1,
1202 BPF_TCP_SYN_SENT,
1203 BPF_TCP_SYN_RECV,
1204 BPF_TCP_FIN_WAIT1,
1205 BPF_TCP_FIN_WAIT2,
1206 BPF_TCP_TIME_WAIT,
1207 BPF_TCP_CLOSE,
1208 BPF_TCP_CLOSE_WAIT,
1209 BPF_TCP_LAST_ACK,
1210 BPF_TCP_LISTEN,
1211 BPF_TCP_CLOSING,
1212 BPF_TCP_NEW_SYN_RECV,
Christopher Ferrisb830ddf2024-03-28 11:48:08 -07001213 BPF_TCP_BOUND_INACTIVE,
Christopher Ferris76a1d452018-06-27 14:12:29 -07001214 BPF_TCP_MAX_STATES
Christopher Ferris1308ad32017-11-14 17:32:13 -08001215};
Christopher Ferrisaf09c702020-06-01 20:29:29 -07001216enum {
1217 TCP_BPF_IW = 1001,
1218 TCP_BPF_SNDCWND_CLAMP = 1002,
Christopher Ferris32ff3f82020-12-14 13:10:04 -08001219 TCP_BPF_DELACK_MAX = 1003,
1220 TCP_BPF_RTO_MIN = 1004,
1221 TCP_BPF_SYN = 1005,
1222 TCP_BPF_SYN_IP = 1006,
1223 TCP_BPF_SYN_MAC = 1007,
1224};
1225enum {
1226 BPF_LOAD_HDR_OPT_TCP_SYN = (1ULL << 0),
1227};
1228enum {
1229 BPF_WRITE_HDR_TCP_CURRENT_MSS = 1,
1230 BPF_WRITE_HDR_TCP_SYNACK_COOKIE = 2,
Christopher Ferrisaf09c702020-06-01 20:29:29 -07001231};
Christopher Ferris934ec942018-01-31 15:29:16 -08001232struct bpf_perf_event_value {
1233 __u64 counter;
1234 __u64 enabled;
1235 __u64 running;
1236};
Christopher Ferrisaf09c702020-06-01 20:29:29 -07001237enum {
1238 BPF_DEVCG_ACC_MKNOD = (1ULL << 0),
1239 BPF_DEVCG_ACC_READ = (1ULL << 1),
1240 BPF_DEVCG_ACC_WRITE = (1ULL << 2),
1241};
1242enum {
1243 BPF_DEVCG_DEV_BLOCK = (1ULL << 0),
1244 BPF_DEVCG_DEV_CHAR = (1ULL << 1),
1245};
Christopher Ferris934ec942018-01-31 15:29:16 -08001246struct bpf_cgroup_dev_ctx {
1247 __u32 access_type;
1248 __u32 major;
1249 __u32 minor;
1250};
Christopher Ferris76a1d452018-06-27 14:12:29 -07001251struct bpf_raw_tracepoint_args {
1252 __u64 args[0];
1253};
Christopher Ferrisaf09c702020-06-01 20:29:29 -07001254enum {
1255 BPF_FIB_LOOKUP_DIRECT = (1U << 0),
1256 BPF_FIB_LOOKUP_OUTPUT = (1U << 1),
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +00001257 BPF_FIB_LOOKUP_SKIP_NEIGH = (1U << 2),
Christopher Ferris8666d042023-09-06 14:55:31 -07001258 BPF_FIB_LOOKUP_TBID = (1U << 3),
Christopher Ferris0f795212024-01-17 14:17:28 -08001259 BPF_FIB_LOOKUP_SRC = (1U << 4),
Christopher Ferrisaf09c702020-06-01 20:29:29 -07001260};
Christopher Ferris9ce28842018-10-25 12:11:39 -07001261enum {
1262 BPF_FIB_LKUP_RET_SUCCESS,
1263 BPF_FIB_LKUP_RET_BLACKHOLE,
1264 BPF_FIB_LKUP_RET_UNREACHABLE,
1265 BPF_FIB_LKUP_RET_PROHIBIT,
1266 BPF_FIB_LKUP_RET_NOT_FWDED,
1267 BPF_FIB_LKUP_RET_FWD_DISABLED,
1268 BPF_FIB_LKUP_RET_UNSUPP_LWT,
1269 BPF_FIB_LKUP_RET_NO_NEIGH,
1270 BPF_FIB_LKUP_RET_FRAG_NEEDED,
Christopher Ferris0f795212024-01-17 14:17:28 -08001271 BPF_FIB_LKUP_RET_NO_SRC_ADDR,
Christopher Ferris9ce28842018-10-25 12:11:39 -07001272};
1273struct bpf_fib_lookup {
1274 __u8 family;
1275 __u8 l4_protocol;
1276 __be16 sport;
1277 __be16 dport;
Christopher Ferrisa9750ed2021-05-03 14:02:49 -07001278 union {
1279 __u16 tot_len;
1280 __u16 mtu_result;
1281 };
Christopher Ferris9ce28842018-10-25 12:11:39 -07001282 __u32 ifindex;
1283 union {
1284 __u8 tos;
1285 __be32 flowinfo;
1286 __u32 rt_metric;
1287 };
1288 union {
1289 __be32 ipv4_src;
1290 __u32 ipv6_src[4];
1291 };
1292 union {
1293 __be32 ipv4_dst;
1294 __u32 ipv6_dst[4];
1295 };
Christopher Ferris8666d042023-09-06 14:55:31 -07001296 union {
1297 struct {
1298 __be16 h_vlan_proto;
1299 __be16 h_vlan_TCI;
1300 };
1301 __u32 tbid;
1302 };
Christopher Ferris9ce28842018-10-25 12:11:39 -07001303 __u8 smac[6];
1304 __u8 dmac[6];
1305};
Christopher Ferris32ff3f82020-12-14 13:10:04 -08001306struct bpf_redir_neigh {
1307 __u32 nh_family;
1308 union {
1309 __be32 ipv4_nh;
1310 __u32 ipv6_nh[4];
1311 };
1312};
Christopher Ferrisa9750ed2021-05-03 14:02:49 -07001313enum bpf_check_mtu_flags {
1314 BPF_MTU_CHK_SEGS = (1U << 0),
1315};
1316enum bpf_check_mtu_ret {
1317 BPF_MTU_CHK_RET_SUCCESS,
1318 BPF_MTU_CHK_RET_FRAG_NEEDED,
1319 BPF_MTU_CHK_RET_SEGS_TOOBIG,
1320};
Christopher Ferris9ce28842018-10-25 12:11:39 -07001321enum bpf_task_fd_type {
1322 BPF_FD_TYPE_RAW_TRACEPOINT,
1323 BPF_FD_TYPE_TRACEPOINT,
1324 BPF_FD_TYPE_KPROBE,
1325 BPF_FD_TYPE_KRETPROBE,
1326 BPF_FD_TYPE_UPROBE,
1327 BPF_FD_TYPE_URETPROBE,
1328};
Christopher Ferrisaf09c702020-06-01 20:29:29 -07001329enum {
1330 BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG = (1U << 0),
1331 BPF_FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL = (1U << 1),
1332 BPF_FLOW_DISSECTOR_F_STOP_AT_ENCAP = (1U << 2),
1333};
Christopher Ferris86a48372019-01-10 14:14:59 -08001334struct bpf_flow_keys {
1335 __u16 nhoff;
1336 __u16 thoff;
1337 __u16 addr_proto;
1338 __u8 is_frag;
1339 __u8 is_first_frag;
1340 __u8 is_encap;
1341 __u8 ip_proto;
1342 __be16 n_proto;
1343 __be16 sport;
1344 __be16 dport;
1345 union {
1346 struct {
1347 __be32 ipv4_src;
1348 __be32 ipv4_dst;
1349 };
1350 struct {
1351 __u32 ipv6_src[4];
1352 __u32 ipv6_dst[4];
1353 };
1354 };
Christopher Ferris9584fa42019-12-09 15:36:13 -08001355 __u32 flags;
1356 __be32 flow_label;
Christopher Ferris86a48372019-01-10 14:14:59 -08001357};
Christopher Ferrisd842e432019-03-07 10:21:59 -08001358struct bpf_func_info {
1359 __u32 insn_off;
1360 __u32 type_id;
1361};
1362#define BPF_LINE_INFO_LINE_NUM(line_col) ((line_col) >> 10)
1363#define BPF_LINE_INFO_LINE_COL(line_col) ((line_col) & 0x3ff)
1364struct bpf_line_info {
1365 __u32 insn_off;
1366 __u32 file_name_off;
1367 __u32 line_off;
1368 __u32 line_col;
1369};
Christopher Ferris24f97eb2019-05-20 12:58:13 -07001370struct bpf_spin_lock {
1371 __u32 val;
1372};
Christopher Ferris2abfa9e2021-11-01 16:26:06 -07001373struct bpf_timer {
Christopher Ferrisb830ddf2024-03-28 11:48:08 -07001374 __u64 __opaque[2];
Christopher Ferris2abfa9e2021-11-01 16:26:06 -07001375} __attribute__((aligned(8)));
Christopher Ferris80ae69d2022-08-02 16:32:21 -07001376struct bpf_dynptr {
Christopher Ferrisb830ddf2024-03-28 11:48:08 -07001377 __u64 __opaque[2];
Christopher Ferris80ae69d2022-08-02 16:32:21 -07001378} __attribute__((aligned(8)));
Christopher Ferris8b7fdc92023-02-21 13:36:32 -08001379struct bpf_list_head {
Christopher Ferrisb830ddf2024-03-28 11:48:08 -07001380 __u64 __opaque[2];
Christopher Ferris8b7fdc92023-02-21 13:36:32 -08001381} __attribute__((aligned(8)));
1382struct bpf_list_node {
Christopher Ferrisb830ddf2024-03-28 11:48:08 -07001383 __u64 __opaque[3];
Christopher Ferris8b7fdc92023-02-21 13:36:32 -08001384} __attribute__((aligned(8)));
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +00001385struct bpf_rb_root {
Christopher Ferrisb830ddf2024-03-28 11:48:08 -07001386 __u64 __opaque[2];
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +00001387} __attribute__((aligned(8)));
1388struct bpf_rb_node {
Christopher Ferrisb830ddf2024-03-28 11:48:08 -07001389 __u64 __opaque[4];
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +00001390} __attribute__((aligned(8)));
Christopher Ferris37c3f3c2023-07-10 10:59:05 -07001391struct bpf_refcount {
Christopher Ferrisb830ddf2024-03-28 11:48:08 -07001392 __u32 __opaque[1];
Christopher Ferris37c3f3c2023-07-10 10:59:05 -07001393} __attribute__((aligned(4)));
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -07001394struct bpf_sysctl {
1395 __u32 write;
1396 __u32 file_pos;
1397};
Christopher Ferrisb8a95e22019-10-02 18:29:20 -07001398struct bpf_sockopt {
1399 __bpf_md_ptr(struct bpf_sock *, sk);
1400 __bpf_md_ptr(void *, optval);
1401 __bpf_md_ptr(void *, optval_end);
1402 __s32 level;
1403 __s32 optname;
1404 __s32 optlen;
1405 __s32 retval;
1406};
Christopher Ferrisaf09c702020-06-01 20:29:29 -07001407struct bpf_pidns_info {
1408 __u32 pid;
1409 __u32 tgid;
1410};
Christopher Ferris25c18d42020-10-14 17:42:58 -07001411struct bpf_sk_lookup {
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +00001412 union {
1413 __bpf_md_ptr(struct bpf_sock *, sk);
1414 __u64 cookie;
1415 };
Christopher Ferris25c18d42020-10-14 17:42:58 -07001416 __u32 family;
1417 __u32 protocol;
1418 __u32 remote_ip4;
1419 __u32 remote_ip6[4];
Christopher Ferris10a76e62022-06-08 13:31:52 -07001420 __be16 remote_port;
1421 __u16 : 16;
Christopher Ferris25c18d42020-10-14 17:42:58 -07001422 __u32 local_ip4;
1423 __u32 local_ip6[4];
1424 __u32 local_port;
Christopher Ferris1ed55342022-03-22 16:06:25 -07001425 __u32 ingress_ifindex;
Christopher Ferris25c18d42020-10-14 17:42:58 -07001426};
Christopher Ferris32ff3f82020-12-14 13:10:04 -08001427struct btf_ptr {
1428 void * ptr;
1429 __u32 type_id;
1430 __u32 flags;
1431};
1432enum {
1433 BTF_F_COMPACT = (1ULL << 0),
1434 BTF_F_NONAME = (1ULL << 1),
1435 BTF_F_PTR_RAW = (1ULL << 2),
1436 BTF_F_ZERO = (1ULL << 3),
1437};
Christopher Ferris1ed55342022-03-22 16:06:25 -07001438enum bpf_core_relo_kind {
1439 BPF_CORE_FIELD_BYTE_OFFSET = 0,
1440 BPF_CORE_FIELD_BYTE_SIZE = 1,
1441 BPF_CORE_FIELD_EXISTS = 2,
1442 BPF_CORE_FIELD_SIGNED = 3,
1443 BPF_CORE_FIELD_LSHIFT_U64 = 4,
1444 BPF_CORE_FIELD_RSHIFT_U64 = 5,
1445 BPF_CORE_TYPE_ID_LOCAL = 6,
1446 BPF_CORE_TYPE_ID_TARGET = 7,
1447 BPF_CORE_TYPE_EXISTS = 8,
1448 BPF_CORE_TYPE_SIZE = 9,
1449 BPF_CORE_ENUMVAL_EXISTS = 10,
1450 BPF_CORE_ENUMVAL_VALUE = 11,
Christopher Ferris7447a1c2022-10-04 18:24:44 -07001451 BPF_CORE_TYPE_MATCHES = 12,
Christopher Ferris1ed55342022-03-22 16:06:25 -07001452};
1453struct bpf_core_relo {
1454 __u32 insn_off;
1455 __u32 type_id;
1456 __u32 access_str_off;
1457 enum bpf_core_relo_kind kind;
1458};
Christopher Ferris37c3f3c2023-07-10 10:59:05 -07001459enum {
1460 BPF_F_TIMER_ABS = (1ULL << 0),
Christopher Ferris0f795212024-01-17 14:17:28 -08001461 BPF_F_TIMER_CPU_PIN = (1ULL << 1),
Christopher Ferris37c3f3c2023-07-10 10:59:05 -07001462};
1463struct bpf_iter_num {
1464 __u64 __opaque[1];
1465} __attribute__((aligned(8)));
Christopher Ferris82d75042015-01-26 10:57:07 -08001466#endif