summaryrefslogtreecommitdiff
path: root/src/xdp/common/common_user_bpf_xdp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/xdp/common/common_user_bpf_xdp.h')
-rw-r--r--src/xdp/common/common_user_bpf_xdp.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/xdp/common/common_user_bpf_xdp.h b/src/xdp/common/common_user_bpf_xdp.h
new file mode 100644
index 000000000..4f8aa51d4
--- /dev/null
+++ b/src/xdp/common/common_user_bpf_xdp.h
@@ -0,0 +1,20 @@
+/* Common BPF/XDP functions used by userspace side programs */
+#ifndef __COMMON_USER_BPF_XDP_H
+#define __COMMON_USER_BPF_XDP_H
+
+int xdp_link_attach(int ifindex, __u32 xdp_flags, int prog_fd);
+int xdp_link_detach(int ifindex, __u32 xdp_flags, __u32 expected_prog_id);
+
+struct bpf_object *load_bpf_object_file(const char *filename, int ifindex);
+struct bpf_object *load_bpf_and_xdp_attach(struct config *cfg);
+
+const char *action2str(__u32 action);
+
+int check_map_fd_info(const struct bpf_map_info *info,
+ const struct bpf_map_info *exp);
+
+int open_bpf_map_file(const char *pin_dir,
+ const char *mapname,
+ struct bpf_map_info *info);
+
+#endif /* __COMMON_USER_BPF_XDP_H */