xref: /openbmc/linux/include/linux/bpf_types.h (revision fcb05fee)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* internal file - do not include directly */
3 
4 #ifdef CONFIG_NET
5 BPF_PROG_TYPE(BPF_PROG_TYPE_SOCKET_FILTER, sk_filter,
6 	      struct __sk_buff, struct sk_buff)
7 BPF_PROG_TYPE(BPF_PROG_TYPE_SCHED_CLS, tc_cls_act,
8 	      struct __sk_buff, struct sk_buff)
9 BPF_PROG_TYPE(BPF_PROG_TYPE_SCHED_ACT, tc_cls_act,
10 	      struct __sk_buff, struct sk_buff)
11 BPF_PROG_TYPE(BPF_PROG_TYPE_XDP, xdp,
12 	      struct xdp_md, struct xdp_buff)
13 #ifdef CONFIG_CGROUP_BPF
14 BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_SKB, cg_skb,
15 	      struct __sk_buff, struct sk_buff)
16 BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_SOCK, cg_sock,
17 	      struct bpf_sock, struct sock)
18 BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_SOCK_ADDR, cg_sock_addr,
19 	      struct bpf_sock_addr, struct bpf_sock_addr_kern)
20 #endif
21 BPF_PROG_TYPE(BPF_PROG_TYPE_LWT_IN, lwt_in,
22 	      struct __sk_buff, struct sk_buff)
23 BPF_PROG_TYPE(BPF_PROG_TYPE_LWT_OUT, lwt_out,
24 	      struct __sk_buff, struct sk_buff)
25 BPF_PROG_TYPE(BPF_PROG_TYPE_LWT_XMIT, lwt_xmit,
26 	      struct __sk_buff, struct sk_buff)
27 BPF_PROG_TYPE(BPF_PROG_TYPE_LWT_SEG6LOCAL, lwt_seg6local,
28 	      struct __sk_buff, struct sk_buff)
29 BPF_PROG_TYPE(BPF_PROG_TYPE_SOCK_OPS, sock_ops,
30 	      struct bpf_sock_ops, struct bpf_sock_ops_kern)
31 BPF_PROG_TYPE(BPF_PROG_TYPE_SK_SKB, sk_skb,
32 	      struct __sk_buff, struct sk_buff)
33 BPF_PROG_TYPE(BPF_PROG_TYPE_SK_MSG, sk_msg,
34 	      struct sk_msg_md, struct sk_msg)
35 BPF_PROG_TYPE(BPF_PROG_TYPE_FLOW_DISSECTOR, flow_dissector,
36 	      struct __sk_buff, struct bpf_flow_dissector)
37 #endif
38 #ifdef CONFIG_BPF_EVENTS
39 BPF_PROG_TYPE(BPF_PROG_TYPE_KPROBE, kprobe,
40 	      bpf_user_pt_regs_t, struct pt_regs)
41 BPF_PROG_TYPE(BPF_PROG_TYPE_TRACEPOINT, tracepoint,
42 	      __u64, u64)
43 BPF_PROG_TYPE(BPF_PROG_TYPE_PERF_EVENT, perf_event,
44 	      struct bpf_perf_event_data, struct bpf_perf_event_data_kern)
45 BPF_PROG_TYPE(BPF_PROG_TYPE_RAW_TRACEPOINT, raw_tracepoint,
46 	      struct bpf_raw_tracepoint_args, u64)
47 BPF_PROG_TYPE(BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE, raw_tracepoint_writable,
48 	      struct bpf_raw_tracepoint_args, u64)
49 BPF_PROG_TYPE(BPF_PROG_TYPE_TRACING, tracing,
50 	      void *, void *)
51 #endif
52 #ifdef CONFIG_CGROUP_BPF
53 BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_DEVICE, cg_dev,
54 	      struct bpf_cgroup_dev_ctx, struct bpf_cgroup_dev_ctx)
55 BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_SYSCTL, cg_sysctl,
56 	      struct bpf_sysctl, struct bpf_sysctl_kern)
57 BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_SOCKOPT, cg_sockopt,
58 	      struct bpf_sockopt, struct bpf_sockopt_kern)
59 #endif
60 #ifdef CONFIG_BPF_LIRC_MODE2
61 BPF_PROG_TYPE(BPF_PROG_TYPE_LIRC_MODE2, lirc_mode2,
62 	      __u32, u32)
63 #endif
64 #ifdef CONFIG_INET
65 BPF_PROG_TYPE(BPF_PROG_TYPE_SK_REUSEPORT, sk_reuseport,
66 	      struct sk_reuseport_md, struct sk_reuseport_kern)
67 BPF_PROG_TYPE(BPF_PROG_TYPE_SK_LOOKUP, sk_lookup,
68 	      struct bpf_sk_lookup, struct bpf_sk_lookup_kern)
69 #endif
70 #if defined(CONFIG_BPF_JIT)
71 BPF_PROG_TYPE(BPF_PROG_TYPE_STRUCT_OPS, bpf_struct_ops,
72 	      void *, void *)
73 BPF_PROG_TYPE(BPF_PROG_TYPE_EXT, bpf_extension,
74 	      void *, void *)
75 #ifdef CONFIG_BPF_LSM
76 BPF_PROG_TYPE(BPF_PROG_TYPE_LSM, lsm,
77 	       void *, void *)
78 #endif /* CONFIG_BPF_LSM */
79 #endif
80 BPF_PROG_TYPE(BPF_PROG_TYPE_SYSCALL, bpf_syscall,
81 	      void *, void *)
82 #ifdef CONFIG_NETFILTER_BPF_LINK
83 BPF_PROG_TYPE(BPF_PROG_TYPE_NETFILTER, netfilter,
84 	      struct bpf_nf_ctx, struct bpf_nf_ctx)
85 #endif
86 
87 BPF_MAP_TYPE(BPF_MAP_TYPE_ARRAY, array_map_ops)
88 BPF_MAP_TYPE(BPF_MAP_TYPE_PERCPU_ARRAY, percpu_array_map_ops)
89 BPF_MAP_TYPE(BPF_MAP_TYPE_PROG_ARRAY, prog_array_map_ops)
90 BPF_MAP_TYPE(BPF_MAP_TYPE_PERF_EVENT_ARRAY, perf_event_array_map_ops)
91 #ifdef CONFIG_CGROUPS
92 BPF_MAP_TYPE(BPF_MAP_TYPE_CGROUP_ARRAY, cgroup_array_map_ops)
93 BPF_MAP_TYPE(BPF_MAP_TYPE_CGRP_STORAGE, cgrp_storage_map_ops)
94 #endif
95 #ifdef CONFIG_CGROUP_BPF
96 BPF_MAP_TYPE(BPF_MAP_TYPE_CGROUP_STORAGE, cgroup_storage_map_ops)
97 BPF_MAP_TYPE(BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE, cgroup_storage_map_ops)
98 #endif
99 BPF_MAP_TYPE(BPF_MAP_TYPE_HASH, htab_map_ops)
100 BPF_MAP_TYPE(BPF_MAP_TYPE_PERCPU_HASH, htab_percpu_map_ops)
101 BPF_MAP_TYPE(BPF_MAP_TYPE_LRU_HASH, htab_lru_map_ops)
102 BPF_MAP_TYPE(BPF_MAP_TYPE_LRU_PERCPU_HASH, htab_lru_percpu_map_ops)
103 BPF_MAP_TYPE(BPF_MAP_TYPE_LPM_TRIE, trie_map_ops)
104 #ifdef CONFIG_PERF_EVENTS
105 BPF_MAP_TYPE(BPF_MAP_TYPE_STACK_TRACE, stack_trace_map_ops)
106 #endif
107 BPF_MAP_TYPE(BPF_MAP_TYPE_ARRAY_OF_MAPS, array_of_maps_map_ops)
108 BPF_MAP_TYPE(BPF_MAP_TYPE_HASH_OF_MAPS, htab_of_maps_map_ops)
109 #ifdef CONFIG_BPF_LSM
110 BPF_MAP_TYPE(BPF_MAP_TYPE_INODE_STORAGE, inode_storage_map_ops)
111 #endif
112 BPF_MAP_TYPE(BPF_MAP_TYPE_TASK_STORAGE, task_storage_map_ops)
113 #ifdef CONFIG_NET
114 BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP, dev_map_ops)
115 BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP_HASH, dev_map_hash_ops)
116 BPF_MAP_TYPE(BPF_MAP_TYPE_SK_STORAGE, sk_storage_map_ops)
117 BPF_MAP_TYPE(BPF_MAP_TYPE_CPUMAP, cpu_map_ops)
118 #if defined(CONFIG_XDP_SOCKETS)
119 BPF_MAP_TYPE(BPF_MAP_TYPE_XSKMAP, xsk_map_ops)
120 #endif
121 #ifdef CONFIG_INET
122 BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKMAP, sock_map_ops)
123 BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKHASH, sock_hash_ops)
124 BPF_MAP_TYPE(BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, reuseport_array_ops)
125 #endif
126 #endif
127 BPF_MAP_TYPE(BPF_MAP_TYPE_QUEUE, queue_map_ops)
128 BPF_MAP_TYPE(BPF_MAP_TYPE_STACK, stack_map_ops)
129 #if defined(CONFIG_BPF_JIT)
130 BPF_MAP_TYPE(BPF_MAP_TYPE_STRUCT_OPS, bpf_struct_ops_map_ops)
131 #endif
132 BPF_MAP_TYPE(BPF_MAP_TYPE_RINGBUF, ringbuf_map_ops)
133 BPF_MAP_TYPE(BPF_MAP_TYPE_BLOOM_FILTER, bloom_filter_map_ops)
134 BPF_MAP_TYPE(BPF_MAP_TYPE_USER_RINGBUF, user_ringbuf_map_ops)
135 
136 BPF_LINK_TYPE(BPF_LINK_TYPE_RAW_TRACEPOINT, raw_tracepoint)
137 BPF_LINK_TYPE(BPF_LINK_TYPE_TRACING, tracing)
138 #ifdef CONFIG_CGROUP_BPF
139 BPF_LINK_TYPE(BPF_LINK_TYPE_CGROUP, cgroup)
140 #endif
141 BPF_LINK_TYPE(BPF_LINK_TYPE_ITER, iter)
142 #ifdef CONFIG_NET
143 BPF_LINK_TYPE(BPF_LINK_TYPE_NETNS, netns)
144 BPF_LINK_TYPE(BPF_LINK_TYPE_XDP, xdp)
145 BPF_LINK_TYPE(BPF_LINK_TYPE_NETFILTER, netfilter)
146 BPF_LINK_TYPE(BPF_LINK_TYPE_TCX, tcx)
147 #endif
148 #ifdef CONFIG_PERF_EVENTS
149 BPF_LINK_TYPE(BPF_LINK_TYPE_PERF_EVENT, perf)
150 #endif
151 BPF_LINK_TYPE(BPF_LINK_TYPE_KPROBE_MULTI, kprobe_multi)
152 BPF_LINK_TYPE(BPF_LINK_TYPE_STRUCT_OPS, struct_ops)
153 BPF_LINK_TYPE(BPF_LINK_TYPE_UPROBE_MULTI, uprobe_multi)
154