bpf: add constants PRIVATE, SHARED, MANDATORY, OPTIONAL
use them & IGNORE_ON_* LOAD_ON_* as needed.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ibadd782d289e6a2ce1467778a1930c6f1b609f98
diff --git a/bpf_progs/bpf_net_helpers.h b/bpf_progs/bpf_net_helpers.h
index b9f67aa..bb5e330 100644
--- a/bpf_progs/bpf_net_helpers.h
+++ b/bpf_progs/bpf_net_helpers.h
@@ -87,6 +87,14 @@
if (skb->data_end - skb->data < len) bpf_skb_pull_data(skb, len);
}
+// constants for passing in to 'bool shared' (for maps)
+static const bool PRIVATE = false;
+static const bool SHARED = true;
+
+// constants for passing in to 'bool optional' (for programs)
+static const bool MANDATORY = false;
+static const bool OPTIONAL = true;
+
// constants for passing in to 'bool egress'
static const bool INGRESS = false;
static const bool EGRESS = true;