summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2011-08-25 11:17:33 +0200
committerJan Engelhardt <jengelh@medozas.de>2011-08-31 22:29:38 +0200
commit541e328689042fb855ac22903996b67b57e1f15a (patch)
treee88d1dd2078e38e4fbf3b49bbccdc786e3021868 /include
parent20a52295775126d1bd5740b6543d1ea8ea239b1b (diff)
ipset: use NFPROTO_ constants
ipset is actually using NFPROTO values rather than AF (xt_set passes that along).
Diffstat (limited to 'include')
-rw-r--r--include/libipset/nfproto.h19
-rw-r--r--include/libipset/types.h15
2 files changed, 28 insertions, 6 deletions
diff --git a/include/libipset/nfproto.h b/include/libipset/nfproto.h
new file mode 100644
index 0000000..800da11
--- /dev/null
+++ b/include/libipset/nfproto.h
@@ -0,0 +1,19 @@
+#ifndef LIBIPSET_NFPROTO_H
+#define LIBIPSET_NFPROTO_H
+
+/*
+ * The constants to select, same as in linux/netfilter.h.
+ * Like nf_inet_addr.h, this is just here so that we need not to rely on
+ * the presence of a recent-enough netfilter.h.
+ */
+enum {
+ NFPROTO_UNSPEC = 0,
+ NFPROTO_IPV4 = 2,
+ NFPROTO_ARP = 3,
+ NFPROTO_BRIDGE = 7,
+ NFPROTO_IPV6 = 10,
+ NFPROTO_DECNET = 12,
+ NFPROTO_NUMPROTO,
+};
+
+#endif /* LIBIPSET_NFPROTO_H */
diff --git a/include/libipset/types.h b/include/libipset/types.h
index d2801f1..cacce26 100644
--- a/include/libipset/types.h
+++ b/include/libipset/types.h
@@ -14,15 +14,18 @@
#include <libipset/parse.h> /* ipset_parsefn */
#include <libipset/print.h> /* ipset_printfn */
#include <libipset/linux_ip_set.h> /* IPSET_MAXNAMELEN */
-
-#define AF_INET46 255
+#include <libipset/nfproto.h> /* for NFPROTO_ */
/* Family rules:
- * - AF_UNSPEC: type is family-neutral
- * - AF_INET: type supports IPv4 only
- * - AF_INET6: type supports IPv6 only
- * - AF_INET46: type supports both IPv4 and IPv6
+ * - NFPROTO_UNSPEC: type is family-neutral
+ * - NFPROTO_IPV4: type supports IPv4 only
+ * - NFPROTO_IPV6: type supports IPv6 only
+ * Special (userspace) ipset-only extra value:
+ * - NFPROTO_IPSET_IPV46: type supports both IPv4 and IPv6
*/
+enum {
+ NFPROTO_IPSET_IPV46 = 255,
+};
/* The maximal type dimension userspace supports */
#define IPSET_DIM_UMAX 3