bpf: move BPF_(DIS)ALLOW from block.c to bpf_net_helpers.h
And use the new constants in netd.c.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Icebaaf78298f0a6e00a28e79a8e0779fc9dc3f1c
diff --git a/bpf_progs/block.c b/bpf_progs/block.c
index 127ec4e..d1d7091 100644
--- a/bpf_progs/block.c
+++ b/bpf_progs/block.c
@@ -14,18 +14,13 @@
* limitations under the License.
*/
-#include <linux/types.h>
-#include <linux/bpf.h>
-#include <netinet/in.h>
-#include <stdint.h>
+#include <linux/in.h>
// The resulting .o needs to load on Android T+
#define BPFLOADER_MIN_VER BPFLOADER_MAINLINE_T_VERSION
#include "bpf_helpers.h"
-
-static const int BPF_ALLOW = 1;
-static const int BPF_DISALLOW = 0;
+#include "bpf_net_helpers.h"
DEFINE_BPF_MAP_GRW(blocked_ports_map, ARRAY, int, uint64_t,
1024 /* 64K ports -> 1024 u64s */, AID_SYSTEM)