BpfUtils - remove some spurious things
Test: builds
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4ffa11220794d64c324d9de8890ba27cac986710
diff --git a/libbpf_android/BpfUtils.cpp b/libbpf_android/BpfUtils.cpp
index d7f5c9b..3fc7cc9 100644
--- a/libbpf_android/BpfUtils.cpp
+++ b/libbpf_android/BpfUtils.cpp
@@ -86,8 +86,8 @@
int setrlimitForTest() {
// Set the memory rlimit for the test process if the default MEMLOCK rlimit is not enough.
struct rlimit limit = {
- .rlim_cur = TEST_LIMIT,
- .rlim_max = TEST_LIMIT,
+ .rlim_cur = 8388608, // 8 MiB
+ .rlim_max = 8388608, // 8 MiB
};
int res = setrlimit(RLIMIT_MEMLOCK, &limit);
if (res) {
diff --git a/libbpf_android/include/bpf/BpfUtils.h b/libbpf_android/include/bpf/BpfUtils.h
index 965840f..dc56277 100644
--- a/libbpf_android/include/bpf/BpfUtils.h
+++ b/libbpf_android/include/bpf/BpfUtils.h
@@ -19,7 +19,6 @@
#include <linux/bpf.h>
#include <linux/if_ether.h>
-#include <linux/in.h>
#include <linux/unistd.h>
#include <net/if.h>
#include <stdlib.h>
@@ -30,15 +29,7 @@
#include "android-base/unique_fd.h"
-#define BPF_PASS 1
-#define BPF_DROP 0
-
#define ptr_to_u64(x) ((uint64_t)(uintptr_t)(x))
-#define DEFAULT_LOG_LEVEL 1
-
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
-
-#define TEST_LIMIT 8388608
namespace android {
namespace bpf {
@@ -55,10 +46,6 @@
EXTENDED,
};
-#ifndef DEFAULT_OVERFLOWUID
-#define DEFAULT_OVERFLOWUID 65534
-#endif
-
constexpr const int OVERFLOW_COUNTERSET = 2;
constexpr const uint64_t NONEXISTENT_COOKIE = 0;