]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - include/bpf_util.h
Merge branch 'master' of git://git.kernel.org/pub/scm/network/iproute2/iproute2-next
[mirror_iproute2.git] / include / bpf_util.h
index 638721f6315ab4f87bdb92a930722dadd55b8834..63837a04e56fedd6f35bb33d183428258b7f02ea 100644 (file)
@@ -14,6 +14,7 @@
 #define __BPF_UTIL__
 
 #include <linux/bpf.h>
+#include <linux/btf.h>
 #include <linux/filter.h>
 #include <linux/magic.h>
 #include <linux/elf-em.h>
@@ -70,9 +71,15 @@ struct bpf_cfg_in {
        const char *uds;
        enum bpf_prog_type type;
        enum bpf_mode mode;
+       __u32 ifindex;
+       bool verbose;
        int argc;
        char **argv;
        struct sock_filter opcodes[BPF_MAXINSNS];
+       union {
+               int n_opcodes;
+               int prog_fd;
+       };
 };
 
 /* ALU ops on registers, bpf_add|sub|...: dst_reg += src_reg */
@@ -254,8 +261,11 @@ struct bpf_cfg_in {
                .off   = 0,                                     \
                .imm   = 0 })
 
-int bpf_parse_common(struct bpf_cfg_in *cfg, const struct bpf_cfg_ops *ops,
-                    void *nl);
+int bpf_parse_common(struct bpf_cfg_in *cfg, const struct bpf_cfg_ops *ops);
+int bpf_load_common(struct bpf_cfg_in *cfg, const struct bpf_cfg_ops *ops,
+                   void *nl);
+int bpf_parse_and_load_common(struct bpf_cfg_in *cfg,
+                             const struct bpf_cfg_ops *ops, void *nl);
 
 const char *bpf_prog_to_default_section(enum bpf_prog_type type);