summaryrefslogtreecommitdiff
path: root/lib/ip.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ip.h')
-rw-r--r--lib/ip.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ip.h b/lib/ip.h
index c3683992..87cd3aa9 100644
--- a/lib/ip.h
+++ b/lib/ip.h
@@ -35,4 +35,10 @@
#define SCOPE_SITE 2
#define SCOPE_UNIVERSE 3
+/*
+ * Is it a valid network prefix?
+ */
+
+#define ip_is_prefix(a,l) (!ipa_nonzero(ipa_and(a, ipa_not(ipa_mkmask(l)))))
+
#endif