summaryrefslogtreecommitdiff
path: root/src/xdp/common/common_libbpf.h
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-12-18 17:13:13 +0100
committerChristian Poessinger <christian@poessinger.com>2020-12-19 21:56:19 +0100
commitb5c80d310527223b93e4133ac2f4c8c063c70a98 (patch)
tree48ae9e2752b4b94c07f767a019c99a8c2460c014 /src/xdp/common/common_libbpf.h
parent22308b05dfbcd8da0230bbd8ba3bbc2a55da7786 (diff)
downloadvyos-1x-b5c80d310527223b93e4133ac2f4c8c063c70a98.tar.gz
vyos-1x-b5c80d310527223b93e4133ac2f4c8c063c70a98.zip
xdp: T2666: switch to example code provided by xdp-tutorial
Diffstat (limited to 'src/xdp/common/common_libbpf.h')
-rw-r--r--src/xdp/common/common_libbpf.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/xdp/common/common_libbpf.h b/src/xdp/common/common_libbpf.h
new file mode 100644
index 000000000..4754bd8ca
--- /dev/null
+++ b/src/xdp/common/common_libbpf.h
@@ -0,0 +1,24 @@
+/* Common function that with time should be moved to libbpf */
+#ifndef __COMMON_LIBBPF_H
+#define __COMMON_LIBBPF_H
+
+struct bpf_pinned_map {
+ const char *name;
+ const char *filename;
+ int map_fd;
+};
+
+/* bpf_prog_load_attr extended */
+struct bpf_prog_load_attr_maps {
+ const char *file;
+ enum bpf_prog_type prog_type;
+ enum bpf_attach_type expected_attach_type;
+ int ifindex;
+ int nr_pinned_maps;
+ struct bpf_pinned_map *pinned_maps;
+};
+
+int bpf_prog_load_xattr_maps(const struct bpf_prog_load_attr_maps *attr,
+ struct bpf_object **pobj, int *prog_fd);
+
+#endif /* __COMMON_LIBBPF_H */