]> granicus.if.org Git - ipset/commitdiff
Remove include/net/pfxlen.h
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Tue, 7 Dec 2010 16:28:17 +0000 (17:28 +0100)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Tue, 7 Dec 2010 16:28:17 +0000 (17:28 +0100)
Spare some memory by moving the static prefixlen maps to the ipset core.
Thus we can get rid of include/net/pfxlen.h too.

12 files changed:
kernel/include/linux/netfilter/ip_set.h
kernel/include/net/pfxlen.h [deleted file]
kernel/ip_set.c
kernel/ip_set_bitmap_ip.c
kernel/ip_set_bitmap_ipmac.c
kernel/ip_set_bitmap_port.c
kernel/ip_set_hash_ip.c
kernel/ip_set_hash_ipport.c
kernel/ip_set_hash_ipportip.c
kernel/ip_set_hash_ipportnet.c
kernel/ip_set_hash_net.c
kernel/ip_set_hash_netport.c

index 2d789d4fb89190cdabf3eda9dd73a69fb2575fc0..1e18b145f32982171fef906f03456f75b9a37891 100644 (file)
@@ -164,6 +164,7 @@ enum ipset_adt {
 #include <linux/ip.h>
 #include <linux/ipv6.h>
 #include <linux/netlink.h>
+#include <linux/netfilter.h>
 #include <linux/vmalloc.h>
 #include <net/netlink.h>
 
@@ -211,13 +212,6 @@ enum ip_set_feature {
        IPSET_DUMP_LAST = (1 << IPSET_DUMP_LAST_FLAG),
 };
 
-/* Calculate the bytes required to store the inclusive range of a-b */
-static inline int
-bitmap_bytes(u32 a, u32 b)
-{
-       return 4 * ((((b - a + 8) / 8) + 3) / 4);
-}
-
 struct ip_set;
 
 typedef int (*ipset_adtfn)(struct ip_set *set, void *value,
@@ -486,6 +480,22 @@ ip6addrptr(const struct sk_buff *skb, bool src, struct in6_addr *addr)
               sizeof(*addr));
 }
 
+/* Calculate the bytes required to store the inclusive range of a-b */
+static inline int
+bitmap_bytes(u32 a, u32 b)
+{
+       return 4 * ((((b - a + 8) / 8) + 3) / 4);
+}
+
+/* Prefixlen maps */
+extern const union nf_inet_addr prefixlen_netmask_map[];
+extern const union nf_inet_addr prefixlen_hostmask_map[];
+
+#define NETMASK(n)     prefixlen_netmask_map[n].ip
+#define NETMASK6(n)    prefixlen_netmask_map[n].ip6
+#define HOSTMASK(n)    prefixlen_hostmask_map[n].ip
+#define HOSTMASK6(n)   prefixlen_hostmask_map[n].ip6
+
 /* Interface to iptables/ip6tables */
 
 #define SO_IP_SET              83
diff --git a/kernel/include/net/pfxlen.h b/kernel/include/net/pfxlen.h
deleted file mode 100644 (file)
index 6935145..0000000
+++ /dev/null
@@ -1,295 +0,0 @@
-#ifndef _NET_PFXLEN_H
-#define _NET_PFXLEN_H 1
-
-#include <asm/byteorder.h>
-#include <linux/netfilter.h>           /* union nf_inet_addr */
-
-#define E(a, b, c, d) \
-       {.ip6 = { \
-               __constant_htonl(a), __constant_htonl(b), \
-               __constant_htonl(c), __constant_htonl(d), \
-       } }
-
-/*
- * This table works for both IPv4 and IPv6;
- * just use prefixlen_netmask_map[prefixlength].ip.
- */
-const union nf_inet_addr prefixlen_netmask_map[] = {
-       E(0x00000000, 0x00000000, 0x00000000, 0x00000000),
-       E(0x80000000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xC0000000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xE0000000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xF0000000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xF8000000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFC000000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFE000000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFF000000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFF800000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFC00000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFE00000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFF00000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFF80000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFC0000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFE0000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFF0000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFF8000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFC000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFE000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFF000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFF800, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFC00, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFE00, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFF00, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFF80, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFC0, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFE0, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFF0, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFF8, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFC, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFE, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0x80000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xC0000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xE0000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xF0000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xF8000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFC000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFE000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFF000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFF800000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFC00000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFE00000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFF00000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFF80000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFC0000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFE0000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFF0000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFF8000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFC000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFE000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFF000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFF800, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFC00, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFE00, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFF00, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFF80, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFC0, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFE0, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFF0, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFF8, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFC, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFE, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0x80000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xC0000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xE0000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xF0000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xF8000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFC000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFE000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFF800000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFC00000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFE00000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFF00000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFF80000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFC0000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFE0000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF0000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF8000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFC000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFF000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFF800, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFC00, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFE00, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFF00, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFF80, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFC0, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFE0, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFF0, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFF8, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFC, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFE, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x80000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xC0000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xE0000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xF0000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xF8000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFC000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFE000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF800000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFC00000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFE00000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFF00000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFF80000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFC0000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFE0000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF0000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF8000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFC000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFF000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFF800),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFC00),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFE00),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFF00),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFF80),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFC0),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFE0),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFF0),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFF8),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFC),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFE),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF),
-};
-
-#define NETMASK(n)     prefixlen_netmask_map[n].ip
-#define NETMASK6(n)    prefixlen_netmask_map[n].ip6
-
-#undef  E
-#define E(a, b, c, d) \
-       {.ip6 = { a, b, c, d } }
-
-/*
- * This table works for both IPv4 and IPv6;
- * just use prefixlen_netmask_map[prefixlength].ip.
- */
-const union nf_inet_addr prefixlen_hostmask_map[] = {
-       E(0x00000000, 0x00000000, 0x00000000, 0x00000000),
-       E(0x80000000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xC0000000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xE0000000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xF0000000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xF8000000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFC000000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFE000000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFF000000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFF800000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFC00000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFE00000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFF00000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFF80000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFC0000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFE0000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFF0000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFF8000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFC000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFE000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFF000, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFF800, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFC00, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFE00, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFF00, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFF80, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFC0, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFE0, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFF0, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFF8, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFC, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFE, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0x80000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xC0000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xE0000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xF0000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xF8000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFC000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFE000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFF000000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFF800000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFC00000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFE00000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFF00000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFF80000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFC0000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFE0000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFF0000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFF8000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFC000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFE000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFF000, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFF800, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFC00, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFE00, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFF00, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFF80, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFC0, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFE0, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFF0, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFF8, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFC, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFE, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0x80000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xC0000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xE0000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xF0000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xF8000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFC000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFE000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFF800000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFC00000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFE00000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFF00000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFF80000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFC0000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFE0000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF0000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF8000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFC000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFF000, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFF800, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFC00, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFE00, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFF00, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFF80, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFC0, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFE0, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFF0, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFF8, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFC, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFE, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x80000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xC0000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xE0000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xF0000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xF8000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFC000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFE000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF800000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFC00000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFE00000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFF00000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFF80000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFC0000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFE0000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF0000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF8000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFC000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFF000),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFF800),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFC00),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFE00),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFF00),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFF80),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFC0),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFE0),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFF0),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFF8),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFC),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFE),
-       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF),
-};
-
-#define HOSTMASK(n)    prefixlen_hostmask_map[n].ip
-#define HOSTMASK6(n)   prefixlen_hostmask_map[n].ip6
-
-#endif /* _NET_PFXLEN_H */
index 1edb6bae7ee74ac8f7fd9e996ec9e1b30a1dc9a4..1e64845df4394bf5e825d7270d5f42db398f330b 100644 (file)
@@ -41,6 +41,294 @@ MODULE_AUTHOR("Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>");
 MODULE_DESCRIPTION("core IP set support");
 MODULE_ALIAS_NFNL_SUBSYS(NFNL_SUBSYS_IPSET);
 
+/*
+ * Prefixlen maps for fast conversions
+ */
+
+#define E(a, b, c, d) \
+       {.ip6 = { \
+               __constant_htonl(a), __constant_htonl(b), \
+               __constant_htonl(c), __constant_htonl(d), \
+       } }
+
+/*
+ * This table works for both IPv4 and IPv6;
+ * just use prefixlen_netmask_map[prefixlength].ip.
+ */
+const union nf_inet_addr prefixlen_netmask_map[] = {
+       E(0x00000000, 0x00000000, 0x00000000, 0x00000000),
+       E(0x80000000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xC0000000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xE0000000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xF0000000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xF8000000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFC000000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFE000000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFF000000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFF800000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFC00000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFE00000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFF00000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFF80000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFC0000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFE0000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFF0000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFF8000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFC000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFE000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFF000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFF800, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFC00, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFE00, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFF00, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFF80, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFC0, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFE0, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFF0, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFF8, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFC, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFE, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0x80000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xC0000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xE0000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xF0000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xF8000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFC000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFE000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFF000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFF800000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFC00000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFE00000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFF00000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFF80000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFC0000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFE0000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFF0000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFF8000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFC000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFE000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFF000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFF800, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFC00, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFE00, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFF00, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFF80, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFC0, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFE0, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFF0, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFF8, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFC, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFE, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0x80000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xC0000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xE0000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xF0000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xF8000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFC000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFE000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFF800000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFC00000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFE00000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFF00000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFF80000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFC0000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFE0000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF0000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF8000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFC000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFF000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFF800, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFC00, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFE00, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFF00, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFF80, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFC0, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFE0, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFF0, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFF8, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFC, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFE, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x80000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xC0000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xE0000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xF0000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xF8000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFC000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFE000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF800000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFC00000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFE00000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFF00000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFF80000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFC0000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFE0000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF0000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF8000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFC000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFF000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFF800),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFC00),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFE00),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFF00),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFF80),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFC0),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFE0),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFF0),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFF8),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFC),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFE),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF),
+};
+EXPORT_SYMBOL(prefixlen_netmask_map);
+
+#undef  E
+#define E(a, b, c, d) \
+       {.ip6 = { a, b, c, d } }
+
+/*
+ * This table works for both IPv4 and IPv6;
+ * just use prefixlen_hostmask_map[prefixlength].ip.
+ */
+const union nf_inet_addr prefixlen_hostmask_map[] = {
+       E(0x00000000, 0x00000000, 0x00000000, 0x00000000),
+       E(0x80000000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xC0000000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xE0000000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xF0000000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xF8000000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFC000000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFE000000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFF000000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFF800000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFC00000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFE00000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFF00000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFF80000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFC0000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFE0000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFF0000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFF8000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFC000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFE000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFF000, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFF800, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFC00, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFE00, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFF00, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFF80, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFC0, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFE0, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFF0, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFF8, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFC, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFE, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0x80000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xC0000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xE0000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xF0000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xF8000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFC000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFE000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFF000000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFF800000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFC00000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFE00000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFF00000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFF80000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFC0000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFE0000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFF0000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFF8000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFC000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFE000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFF000, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFF800, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFC00, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFE00, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFF00, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFF80, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFC0, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFE0, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFF0, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFF8, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFC, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFE, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0x80000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xC0000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xE0000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xF0000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xF8000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFC000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFE000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFF800000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFC00000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFE00000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFF00000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFF80000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFC0000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFE0000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF0000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF8000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFC000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFF000, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFF800, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFC00, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFE00, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFF00, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFF80, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFC0, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFE0, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFF0, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFF8, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFC, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFE, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x80000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xC0000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xE0000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xF0000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xF8000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFC000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFE000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF800000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFC00000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFE00000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFF00000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFF80000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFC0000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFE0000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF0000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF8000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFC000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFF000),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFF800),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFC00),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFE00),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFF00),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFF80),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFC0),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFE0),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFF0),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFF8),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFC),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFE),
+       E(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF),
+};
+EXPORT_SYMBOL(prefixlen_hostmask_map);
+
 /*
  * The set types are implemented in modules and registered set types
  * can be found in ip_set_type_list. Adding/deleting types is
index 815769fcd15a85a0e02c758d8001e4c11b383d33..76a358a2c5898c671507fdb360d023176ae8e834 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/jiffies.h>
 #include <linux/timer.h>
 #include <net/netlink.h>
-#include <net/pfxlen.h>
 #include <net/tcp.h>
 
 #include <linux/netfilter/ip_set.h>
index f2f34eda4b7350ad89545fcedd6ba05fa96841db..e88673439ee3c248d705d986ca83567adc9b44b9 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/jiffies.h>
 #include <linux/timer.h>
 #include <net/netlink.h>
-#include <net/pfxlen.h>
 
 #include <linux/netfilter/ip_set.h>
 #include <linux/netfilter/ip_set_timeout.h>
index b6d812034d182d47bbc73aae41cd38dbf1ae931e..5710f634fd4898987ce03b2e54d7c76f7129bc3d 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/jiffies.h>
 #include <linux/timer.h>
 #include <net/netlink.h>
-#include <net/pfxlen.h>
 
 #include <linux/netfilter/ip_set.h>
 #include <linux/netfilter/ip_set_bitmap.h>
index eb4a85906f2b57edee565b87c13b04a0ef265556..7ae46aa21e6e926c0737bfcdd8d22117fa6c0806 100644 (file)
@@ -20,7 +20,6 @@
 #include <net/ip.h>
 #include <net/ipv6.h>
 #include <net/netlink.h>
-#include <net/pfxlen.h>
 #include <net/tcp.h>
 
 #include <linux/netfilter.h>
index 7ac0c05d5794c8541436a98d85ee6d168798bc50..fb6888e9f1912d0a8f090d9ae719419b16b94154 100644 (file)
@@ -20,7 +20,6 @@
 #include <net/ip.h>
 #include <net/ipv6.h>
 #include <net/netlink.h>
-#include <net/pfxlen.h>
 
 #include <linux/netfilter.h>
 #include <linux/netfilter/ip_set.h>
index 2dccb29625d17500b05525e13aa5c437dfe741fb..a82a5ca5d6b04b1a2c76e1480eda9642183a97f0 100644 (file)
@@ -20,7 +20,6 @@
 #include <net/ip.h>
 #include <net/ipv6.h>
 #include <net/netlink.h>
-#include <net/pfxlen.h>
 
 #include <linux/netfilter.h>
 #include <linux/netfilter/ip_set.h>
index 4151135e9b79d6b0e5ccca2923f2ed6125f7796d..73af21ec7a90fd47aa29b5e9d0b582ff355a455b 100644 (file)
@@ -20,7 +20,6 @@
 #include <net/ip.h>
 #include <net/ipv6.h>
 #include <net/netlink.h>
-#include <net/pfxlen.h>
 
 #include <linux/netfilter.h>
 #include <linux/netfilter/ip_set.h>
index 94c411846a74c1d52b4ae7e5dbec5f1e2dd63ce2..b713d2a77cca7770c83889bafafe838cc44cb888 100644 (file)
@@ -20,7 +20,6 @@
 #include <net/ip.h>
 #include <net/ipv6.h>
 #include <net/netlink.h>
-#include <net/pfxlen.h>
 
 #include <linux/netfilter.h>
 #include <linux/netfilter/ip_set.h>
index b9f5789ccb2ee7361b6143ef13b6ffd4d8b5229e..bc59e9d0573cf4b8f1fe7322e1dae70cc2b34368 100644 (file)
@@ -20,7 +20,6 @@
 #include <net/ip.h>
 #include <net/ipv6.h>
 #include <net/netlink.h>
-#include <net/pfxlen.h>
 
 #include <linux/netfilter.h>
 #include <linux/netfilter/ip_set.h>