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 83 BPF_MAP_TYPE(BPF_MAP_TYPE_ARRAY, array_map_ops) 84 BPF_MAP_TYPE(BPF_MAP_TYPE_PERCPU_ARRAY, percpu_array_map_ops) 85 BPF_MAP_TYPE(BPF_MAP_TYPE_PROG_ARRAY, prog_array_map_ops) 86 BPF_MAP_TYPE(BPF_MAP_TYPE_PERF_EVENT_ARRAY, perf_event_array_map_ops) 87 #ifdef CONFIG_CGROUPS 88 BPF_MAP_TYPE(BPF_MAP_TYPE_CGROUP_ARRAY, cgroup_array_map_ops) 89 #endif 90 #ifdef CONFIG_CGROUP_BPF 91 BPF_MAP_TYPE(BPF_MAP_TYPE_CGROUP_STORAGE, cgroup_storage_map_ops) 92 BPF_MAP_TYPE(BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE, cgroup_storage_map_ops) 93 #endif 94 BPF_MAP_TYPE(BPF_MAP_TYPE_HASH, htab_map_ops) 95 BPF_MAP_TYPE(BPF_MAP_TYPE_PERCPU_HASH, htab_percpu_map_ops) 96 BPF_MAP_TYPE(BPF_MAP_TYPE_LRU_HASH, htab_lru_map_ops) 97 BPF_MAP_TYPE(BPF_MAP_TYPE_LRU_PERCPU_HASH, htab_lru_percpu_map_ops) 98 BPF_MAP_TYPE(BPF_MAP_TYPE_LPM_TRIE, trie_map_ops) 99 #ifdef CONFIG_PERF_EVENTS 100 BPF_MAP_TYPE(BPF_MAP_TYPE_STACK_TRACE, stack_trace_map_ops) 101 #endif 102 BPF_MAP_TYPE(BPF_MAP_TYPE_ARRAY_OF_MAPS, array_of_maps_map_ops) 103 BPF_MAP_TYPE(BPF_MAP_TYPE_HASH_OF_MAPS, htab_of_maps_map_ops) 104 #ifdef CONFIG_BPF_LSM 105 BPF_MAP_TYPE(BPF_MAP_TYPE_INODE_STORAGE, inode_storage_map_ops) 106 #endif 107 BPF_MAP_TYPE(BPF_MAP_TYPE_TASK_STORAGE, task_storage_map_ops) 108 #ifdef CONFIG_NET 109 BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP, dev_map_ops) 110 BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP_HASH, dev_map_hash_ops) 111 BPF_MAP_TYPE(BPF_MAP_TYPE_SK_STORAGE, sk_storage_map_ops) 112 BPF_MAP_TYPE(BPF_MAP_TYPE_CPUMAP, cpu_map_ops) 113 #if defined(CONFIG_XDP_SOCKETS) 114 BPF_MAP_TYPE(BPF_MAP_TYPE_XSKMAP, xsk_map_ops) 115 #endif 116 #ifdef CONFIG_INET 117 BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKMAP, sock_map_ops) 118 BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKHASH, sock_hash_ops) 119 BPF_MAP_TYPE(BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, reuseport_array_ops) 120 #endif 121 #endif 122 BPF_MAP_TYPE(BPF_MAP_TYPE_QUEUE, queue_map_ops) 123 BPF_MAP_TYPE(BPF_MAP_TYPE_STACK, stack_map_ops) 124 #if defined(CONFIG_BPF_JIT) 125 BPF_MAP_TYPE(BPF_MAP_TYPE_STRUCT_OPS, bpf_struct_ops_map_ops) 126 #endif 127 BPF_MAP_TYPE(BPF_MAP_TYPE_RINGBUF, ringbuf_map_ops) 128 BPF_MAP_TYPE(BPF_MAP_TYPE_BLOOM_FILTER, bloom_filter_map_ops) 129 130 BPF_LINK_TYPE(BPF_LINK_TYPE_RAW_TRACEPOINT, raw_tracepoint) 131 BPF_LINK_TYPE(BPF_LINK_TYPE_TRACING, tracing) 132 #ifdef CONFIG_CGROUP_BPF 133 BPF_LINK_TYPE(BPF_LINK_TYPE_CGROUP, cgroup) 134 #endif 135 BPF_LINK_TYPE(BPF_LINK_TYPE_ITER, iter) 136 #ifdef CONFIG_NET 137 BPF_LINK_TYPE(BPF_LINK_TYPE_NETNS, netns) 138 BPF_LINK_TYPE(BPF_LINK_TYPE_XDP, xdp) 139 #endif 140 #ifdef CONFIG_PERF_EVENTS 141 BPF_LINK_TYPE(BPF_LINK_TYPE_PERF_EVENT, perf) 142 #endif 143