logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

xt_bpf.h (935B)


  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _XT_BPF_H
  3. #define _XT_BPF_H
  4. #include <linux/filter.h>
  5. #include <linux/limits.h>
  6. #include <linux/types.h>
  7. #define XT_BPF_MAX_NUM_INSTR 64
  8. #define XT_BPF_PATH_MAX (XT_BPF_MAX_NUM_INSTR * sizeof(struct sock_filter))
  9. struct bpf_prog;
  10. struct xt_bpf_info {
  11. __u16 bpf_program_num_elem;
  12. struct sock_filter bpf_program[XT_BPF_MAX_NUM_INSTR];
  13. /* only used in the kernel */
  14. struct bpf_prog *filter __attribute__((aligned(8)));
  15. };
  16. enum xt_bpf_modes {
  17. XT_BPF_MODE_BYTECODE,
  18. XT_BPF_MODE_FD_PINNED,
  19. XT_BPF_MODE_FD_ELF,
  20. };
  21. #define XT_BPF_MODE_PATH_PINNED XT_BPF_MODE_FD_PINNED
  22. struct xt_bpf_info_v1 {
  23. __u16 mode;
  24. __u16 bpf_program_num_elem;
  25. __s32 fd;
  26. union {
  27. struct sock_filter bpf_program[XT_BPF_MAX_NUM_INSTR];
  28. char path[XT_BPF_PATH_MAX];
  29. };
  30. /* only used in the kernel */
  31. struct bpf_prog *filter __attribute__((aligned(8)));
  32. };
  33. #endif /*_XT_BPF_H */