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