bpf.h 631 B

12345678910111213141516171819202122232425262728
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * BPF programs attached to network namespace
  4. */
  5. #ifndef __NETNS_BPF_H__
  6. #define __NETNS_BPF_H__
  7. #include <linux/list.h>
  8. struct bpf_prog;
  9. struct bpf_prog_array;
  10. enum netns_bpf_attach_type {
  11. NETNS_BPF_INVALID = -1,
  12. NETNS_BPF_FLOW_DISSECTOR = 0,
  13. NETNS_BPF_SK_LOOKUP,
  14. MAX_NETNS_BPF_ATTACH_TYPE
  15. };
  16. struct netns_bpf {
  17. /* Array of programs to run compiled from progs or links */
  18. struct bpf_prog_array __rcu *run_array[MAX_NETNS_BPF_ATTACH_TYPE];
  19. struct bpf_prog *progs[MAX_NETNS_BPF_ATTACH_TYPE];
  20. struct list_head links[MAX_NETNS_BPF_ATTACH_TYPE];
  21. };
  22. #endif /* __NETNS_BPF_H__ */