refactor bpf_map_def into a single header file
Test: build, atest
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Iafd6016f4f24cc8fa263939c67e1a096aa91b125
diff --git a/libbpf_android/Loader.cpp b/libbpf_android/Loader.cpp
index f4533cb..3a25fbd 100644
--- a/libbpf_android/Loader.cpp
+++ b/libbpf_android/Loader.cpp
@@ -27,6 +27,7 @@
#include <sys/utsname.h>
#include <unistd.h>
+#include "../progs/include/bpf_map_def.h"
#include "LoaderUtils.h"
#include "include/libbpf_android.h"
@@ -88,17 +89,6 @@
unique_fd prog_fd; /* fd after loading */
} codeSection;
-/* Common with the eBPF C program */
-struct bpf_map_def {
- enum bpf_map_type type;
- unsigned int key_size;
- unsigned int value_size;
- unsigned int max_entries;
- unsigned int map_flags;
- unsigned int inner_map_idx;
- unsigned int numa_node;
-};
-
static int readElfHeader(ifstream& elfFile, Elf64_Ehdr* eh) {
elfFile.seekg(0);
if (elfFile.fail()) return -1;