|
5 | 5 | #define _LINUX_BPF_H 1
|
6 | 6 |
|
7 | 7 | #include <uapi/linux/bpf.h>
|
| 8 | +#include <uapi/linux/filter.h> |
8 | 9 |
|
9 | 10 | #include <linux/workqueue.h>
|
10 | 11 | #include <linux/file.h>
|
|
22 | 23 | #include <linux/sched/mm.h>
|
23 | 24 | #include <linux/slab.h>
|
24 | 25 | #include <linux/percpu-refcount.h>
|
| 26 | +#include <linux/stddef.h> |
25 | 27 | #include <linux/bpfptr.h>
|
26 | 28 | #include <linux/btf.h>
|
27 | 29 |
|
@@ -1084,6 +1086,40 @@ struct bpf_prog_aux {
|
1084 | 1086 | };
|
1085 | 1087 | };
|
1086 | 1088 |
|
| 1089 | +struct bpf_prog { |
| 1090 | + u16 pages; /* Number of allocated pages */ |
| 1091 | + u16 jited:1, /* Is our filter JIT'ed? */ |
| 1092 | + jit_requested:1,/* archs need to JIT the prog */ |
| 1093 | + gpl_compatible:1, /* Is filter GPL compatible? */ |
| 1094 | + cb_access:1, /* Is control block accessed? */ |
| 1095 | + dst_needed:1, /* Do we need dst entry? */ |
| 1096 | + blinding_requested:1, /* needs constant blinding */ |
| 1097 | + blinded:1, /* Was blinded */ |
| 1098 | + is_func:1, /* program is a bpf function */ |
| 1099 | + kprobe_override:1, /* Do we override a kprobe? */ |
| 1100 | + has_callchain_buf:1, /* callchain buffer allocated? */ |
| 1101 | + enforce_expected_attach_type:1, /* Enforce expected_attach_type checking at attach time */ |
| 1102 | + call_get_stack:1, /* Do we call bpf_get_stack() or bpf_get_stackid() */ |
| 1103 | + call_get_func_ip:1, /* Do we call get_func_ip() */ |
| 1104 | + tstamp_type_access:1; /* Accessed __sk_buff->tstamp_type */ |
| 1105 | + enum bpf_prog_type type; /* Type of BPF program */ |
| 1106 | + enum bpf_attach_type expected_attach_type; /* For some prog types */ |
| 1107 | + u32 len; /* Number of filter blocks */ |
| 1108 | + u32 jited_len; /* Size of jited insns in bytes */ |
| 1109 | + u8 tag[BPF_TAG_SIZE]; |
| 1110 | + struct bpf_prog_stats __percpu *stats; |
| 1111 | + int __percpu *active; |
| 1112 | + unsigned int (*bpf_func)(const void *ctx, |
| 1113 | + const struct bpf_insn *insn); |
| 1114 | + struct bpf_prog_aux *aux; /* Auxiliary fields */ |
| 1115 | + struct sock_fprog_kern *orig_prog; /* Original BPF program */ |
| 1116 | + /* Instructions for interpreter */ |
| 1117 | + union { |
| 1118 | + DECLARE_FLEX_ARRAY(struct sock_filter, insns); |
| 1119 | + DECLARE_FLEX_ARRAY(struct bpf_insn, insnsi); |
| 1120 | + }; |
| 1121 | +}; |
| 1122 | + |
1087 | 1123 | struct bpf_array_aux {
|
1088 | 1124 | /* Programs with direct jumps into programs part of this array. */
|
1089 | 1125 | struct list_head poke_progs;
|
|
0 commit comments