Add element count to hash headers
Subsystems (2)
PATCH RESEND v2 1/1 Add element count to hash headers
It would be useful for userspace to query the size of an ipset hash, however, this data is not exposed to userspace outside of counting the number of member entries. This patch uses the attribute IPSET_ATTR_ELEMENTS to indicate the size in the the header that is exported to userspace. This field is then printed by the userspace tool for hashes.
Because it is only meaningful for hashes to report their size, the output is conditional on the set type. To do this checking the MATCH_TYPENAME macro was moved to utils.h.
The bulk of this patch changes the expected test suite to account for the change in output.
---
This is the same as the V2 I posted in Decemeber with a rebase to the latest upstream
include/libipset/utils.h | 3 +++ kernel/net/netfilter/ipset/ip_set_hash_gen.h | 3 ++- lib/errcode.c | 2 -- lib/session.c | 14 ++++++++++++-- tests/check_cidrs.sh | 4 ++-- tests/comment.t.list2 | 3 ++- tests/comment.t.list21 | 3 ++- tests/comment.t.list22 | 3 ++- tests/comment.t.list3 | 9 ++++++--- tests/hash:ip,mark.t.list0 | 3 ++- tests/hash:ip,mark.t.list1 | 3 ++- tests/hash:ip,port,ip.t.list0 | 3 ++- tests/hash:ip,port,ip.t.list1 | 3 ++- tests/hash:ip,port,net.t.list0 | 3 ++- tests/hash:ip,port.t.list0 | 3 ++- tests/hash:ip,port.t.list1 | 3 ++- tests/hash:ip,port.t.list2 | 3 ++- tests/hash:ip.t.list0 | 3 ++- tests/hash:ip.t.list1 | 3 ++- tests/hash:ip.t.list2 | 3 ++- tests/hash:ip.t.list3 | 3 ++- tests/hash:ip6,mark.t.list0 | 3 ++- tests/hash:ip6,mark.t.list1 | 3 ++- tests/hash:ip6,port,ip6.t.list0 | 4 +++- tests/hash:ip6,port,ip6.t.list1 | 3 ++- tests/hash:ip6,port,net6.t.list0 | 3 ++- tests/hash:ip6,port.t.list0 | 3 ++- tests/hash:ip6,port.t.list1 | 3 ++- tests/hash:ip6.t.list0 | 3 ++- tests/hash:ip6.t.list1 | 3 ++- tests/hash:ip6.t.list2 | 3 ++- tests/hash:ip6.t.list3 | 3 ++- tests/hash:mac.t.list0 | 3 ++- tests/hash:mac.t.list1 | 3 ++- tests/hash:mac.t.list2 | 3 ++- tests/hash:mac.t.list3 | 3 ++- tests/hash:net,iface.t | 2 +- tests/hash:net,iface.t.list0 | 3 ++- tests/hash:net,iface.t.list1 | 3 ++- tests/hash:net,iface.t.list2 | 3 ++- tests/hash:net,net.t.list0 | 3 ++- tests/hash:net,net.t.list1 | 3 ++- tests/hash:net,net.t.list2 | 3 ++- tests/hash:net,port,net.t.list0 | 3 ++- tests/hash:net,port.t.list0 | 3 ++- tests/hash:net,port.t.list1 | 3 ++- tests/hash:net.t.list0 | 3 ++- tests/hash:net.t.list1 | 3 ++- tests/hash:net.t.list2 | 3 ++- tests/hash:net6,net6.t.list0 | 3 ++- tests/hash:net6,net6.t.list1 | 3 ++- tests/hash:net6,port,net6.t.list0 | 3 ++- tests/hash:net6,port.t.list0 | 3 ++- tests/hash:net6,port.t.list1 | 3 ++- tests/hash:net6.t.list0 | 3 ++- tests/hash:net6.t.list1 | 3 ++- tests/iphash.t.list0 | 3 ++- tests/iphash.t.list1 | 3 ++- tests/ipmarkhash.t.list0 | 3 ++- tests/ipmarkhash.t.list1 | 3 ++- tests/ipporthash.t.list0 | 3 ++- tests/ipporthash.t.list1 | 3 ++- tests/ipportiphash.t.list0 | 3 ++- tests/ipportiphash.t.list1 | 3 ++- tests/iptables.sh | 2 +- tests/nethash.t.list0 | 3 ++- tests/resizet.sh | 2 +- tests/restore.t.list0 | 3 ++- tests/restore.t.list1 | 3 ++- tests/setlist.t.list4 | 12 ++++++++---- tests/sort.sh | 4 ++-- 71 files changed, 159 insertions(+), 79 deletions(-)
include/libipset/utils.h +3 -0
@@ -19,6 +19,9 @@#define STRCASEQ (a, b) (strcasecmp(a, b) == 0)#define STRNCASEQ (a, b, n) (strncasecmp(a, b, n) == 0) +/* Match set type names */ +#define MATCH_TYPENAME (a, b) STRNEQ(a, b, strlen(b)) +/* Stringify tokens */ #define _STR (c) #c#define STR (c) _STR(c)
kernel/net/netfilter/ipset/ip_set_hash_gen.h +2 -1
@@ -1068,7 +1068,8 @@ mtype_head(struct ip_set *set, struct sk_buff *skb) goto nla_put_failure;#endif if (nla_put_net32 (skb,IPSET_ATTR_REFERENCES ,htonl (set->ref -1 )) || -nla_put_net32 (skb,IPSET_ATTR_MEMSIZE ,htonl (memsize))) +nla_put_net32 (skb,IPSET_ATTR_MEMSIZE ,htonl (memsize)) || +nla_put_net32 (skb,IPSET_ATTR_ELEMENTS ,htonl (h->elements))) goto nla_put_failure;if (unlikely (ip_set_put_flags (skb, set))) goto nla_put_failure;
lib/errcode.c +0 -2
@@ -148,8 +148,6 @@ static const struct ipset_errcode_table list_errcode_table[] = { { }, }; -#define MATCH_TYPENAME (a, b) STRNEQ(a, b, strlen(b)) -/** * ipset_errcode - interpret a kernel error code * @session: session structure
lib/session.c +12 -2
@@ -931,6 +931,10 @@ list_create(struct ipset_session *session, struct nlattr *nla[])safe_dprintf (session, ipset_print_number,IPSET_OPT_MEMSIZE );safe_snprintf (session,"\nReferences: " );safe_dprintf (session, ipset_print_number,IPSET_OPT_REFERENCES ); +if (MATCH_TYPENAME (type->name ,"hash:" )) { +safe_snprintf (session,"\nNumber of Entries: " ); +safe_dprintf (session, ipset_print_number,IPSET_OPT_ELEMENTS ); + }safe_snprintf (session, session->envopts &IPSET_ENV_LIST_HEADER ?"\n" :"\nMembers:\n" );
@@ -940,10 +944,16 @@ list_create(struct ipset_session *session, struct nlattr *nla[])safe_dprintf (session, ipset_print_number,IPSET_OPT_MEMSIZE );safe_snprintf (session,"</memsize>\n<references>" );safe_dprintf (session, ipset_print_number,IPSET_OPT_REFERENCES ); +safe_snprintf (session,"</references>\n" ); +if (MATCH_TYPENAME (type->name ,"hash:" )) { +safe_snprintf (session,"<numentries>" ); +safe_dprintf (session, ipset_print_number,IPSET_OPT_ELEMENTS ); +safe_snprintf (session,"</numentries>\n" ); + }safe_snprintf (session, session->envopts &IPSET_ENV_LIST_HEADER ? -"</references>\n</header>\n" : -"</references>\n</header>\n<members>\n" ); +"</header>\n" : +"</header>\n<members>\n" );break ;default :break ;
tests/check_cidrs.sh +2 -2
@@ -10,14 +10,14 @@ $ipset n test hash:net for x in `seq 1 32`; do $ipset a test 10.0.0.0/$x n=`$ipset l test | wc -l` - n=$((n - 7)) + n=$((n - 8)) test $n -eq $x || exit 1 done for x in `seq 32 -1 1`; do $ipset d test 10.0.0.0/$x n=`$ipset l test | wc -l` # We deleted one element - n=$((n - 7 + 1)) + n=$((n - 8 + 1)) test $n -eq $x || exit 1 done $ipset x test
tests/comment.t.list2 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:net,net Header: family inet hashsize 128 maxelem 65536 comment -Size in memory: 3392 +Size in memory: 1288 References: 0 +Number of Entries: 4 Members: 1.1.1.1,1.1.1.2 comment "text 1.1.1.1/32,1.1.1.2/32" 192.168.68.64/27,192.168.129.64/27 comment "text 192.168.68.69/27,192.168.129.69/27"
tests/comment.t.list21 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:ip Header: family inet hashsize 1024 maxelem 65536 timeout x comment -Size in memory: 101400 +Size in memory: 95168 References: 0 +Number of Entries: 512 Members: 2.0.0.0 timeout x comment "text message 0" 2.0.0.1 timeout x comment "text message 1"
tests/comment.t.list22 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:ip Header: family inet hashsize 1024 maxelem 65536 timeout x comment -Size in memory: 100152 +Size in memory: 98256 References: 0 +Number of Entries: 512 Members: 2.0.1.0 timeout x comment "text message 0" 2.0.1.1 timeout x comment "text message 1"
tests/comment.t.list3 +6 -3
@@ -1,22 +1,25 @@ Name: a Type: hash:ip Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 16536 +Size in memory: 128 References: 1 +Number of Entries: 0 Members: Name: b Type: hash:ip Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 16536 +Size in memory: 128 References: 1 +Number of Entries: 0 Members: Name: c Type: hash:ip Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 16536 +Size in memory: 128 References: 1 +Number of Entries: 0 Members: Name: test
tests/hash:ip,mark.t.list0 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:ip,mark Header: family inet markmask 0xffffffff hashsize 1024 maxelem 65536 timeout x -Size in memory: 8836 +Size in memory: 640 References: 0 +Number of Entries: 4 Members: 2.0.0.0,0x00000005 timeout x 2.0.0.1,0x00000005 timeout x
tests/hash:ip,mark.t.list1 +2 -1
@@ -1,6 +1,7 @@ Name: test Type: hash:ip,mark Header: family inet markmask 0xffffffff hashsize 1024 maxelem 65536 timeout 5 -Size in memory: 8836 +Size in memory: 640 References: 0 +Number of Entries: 4 Members:
tests/hash:ip,port,ip.t.list0 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:ip,port,ip Header: family inet hashsize 1024 maxelem 65536 timeout x -Size in memory: 8720 +Size in memory: 840 References: 0 +Number of Entries: 4 Members: 2.0.0.0,tcp:5,1.1.1.1 timeout x 2.0.0.1,tcp:5,1.1.1.1 timeout x
tests/hash:ip,port,ip.t.list1 +2 -1
@@ -1,6 +1,7 @@ Name: test Type: hash:ip,port,ip Header: family inet hashsize 1024 maxelem 65536 timeout 5 -Size in memory: 8304 +Size in memory: 840 References: 0 +Number of Entries: 4 Members:
tests/hash:ip,port,net.t.list0 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:ip,port,net Header: family inet hashsize 1024 maxelem 65536 timeout x -Size in memory: 8720 +Size in memory: 1096 References: 0 +Number of Entries: 4 Members: 2.0.0.0,tcp:5,192.168.0.0/25 timeout x 2.0.0.1,tcp:5,192.168.0.0/24 timeout x
tests/hash:ip,port.t.list0 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:ip,port Header: family inet hashsize 1024 maxelem 65536 timeout x -Size in memory: 8592 +Size in memory: 640 References: 0 +Number of Entries: 4 Members: 2.0.0.0,tcp:5 timeout x 2.0.0.1,tcp:5 timeout x
tests/hash:ip,port.t.list1 +2 -1
@@ -1,6 +1,7 @@ Name: test Type: hash:ip,port Header: family inet hashsize 1024 maxelem 65536 timeout 5 -Size in memory: 8304 +Size in memory: 640 References: 0 +Number of Entries: 4 Members:
tests/hash:ip,port.t.list2 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:ip,port Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 8432 +Size in memory: 320 References: 0 +Number of Entries: 3 Members: 2.0.0.1,tcp:80 2.0.0.1,udp:80
tests/hash:ip.t.list0 +2 -1
@@ -1,7 +1,8 @@ Name: test Type: hash:ip Header: family inet hashsize 128 maxelem 65536 timeout 5 -Size in memory: 1208 +Size in memory: 352 References: 0 +Number of Entries: 2 Members: 192.168.68.69 timeout 0
tests/hash:ip.t.list1 +2 -1
@@ -1,7 +1,8 @@ Name: test Type: hash:ip Header: family inet hashsize 128 maxelem 65536 netmask 24 timeout 5 -Size in memory: 1352 +Size in memory: 464 References: 0 +Number of Entries: 3 Members: 200.100.10.0 timeout 0
tests/hash:ip.t.list2 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:ip Header: family inet hashsize 128 maxelem 65536 timeout x -Size in memory: 1280 +Size in memory: 352 References: 0 +Number of Entries: 2 Members: 192.168.68.69 timeout x 2.0.0.1 timeout x
tests/hash:ip.t.list3 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:ip Header: family inet hashsize 128 maxelem 65536 netmask 24 timeout x -Size in memory: 1352 +Size in memory: 464 References: 0 +Number of Entries: 3 Members: 192.168.68.0 timeout x 2.0.0.0 timeout x
tests/hash:ip6,mark.t.list0 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:ip,mark Header: family inet6 markmask 0xffffffff hashsize 1024 maxelem 65536 timeout x -Size in memory: 9316 +Size in memory: 1088 References: 0 +Number of Entries: 4 Members: 2:1::,0x00000080 timeout x 2:1::1,0x00000080 timeout x
tests/hash:ip6,mark.t.list1 +2 -1
@@ -1,6 +1,7 @@ Name: test Type: hash:ip,mark Header: family inet6 markmask 0xffffffff hashsize 1024 maxelem 65536 timeout 5 -Size in memory: 9316 +Size in memory: 1088 References: 0 +Number of Entries: 4 Members:
tests/hash:ip6,port,ip6.t.list0 +3 -1
@@ -1,8 +1,10 @@ Name: test Type: hash:ip,port,ip Header: family inet6 hashsize 1024 maxelem 65536 timeout x -Size in memory: 9104 +Size in memory: 1608 References: 0 +Size in memory: 9104 +Number of Entries: 4 Members: 2:1::,tcp:128,2:2:2::2 timeout x 2:1::1,tcp:128,2:2:2::2 timeout x
tests/hash:ip6,port,ip6.t.list1 +2 -1
@@ -1,6 +1,7 @@ Name: test Type: hash:ip,port,ip Header: family inet6 hashsize 1024 maxelem 65536 timeout 5 -Size in memory: 8304 +Size in memory: 1608 References: 0 +Number of Entries: 4 Members:
tests/hash:ip6,port,net6.t.list0 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:ip,port,net Header: family inet6 hashsize 1024 maxelem 65536 -Size in memory: 9928 +Size in memory: 1864 References: 0 +Number of Entries: 4 Members: 2:1::,tcp:128,::/12 2:1::1,tcp:128,::/12
tests/hash:ip6,port.t.list0 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:ip,port Header: family inet6 hashsize 1024 maxelem 65536 timeout x -Size in memory: 8848 +Size in memory: 1088 References: 0 +Number of Entries: 4 Members: 2:1::,tcp:128 timeout x 2:1::1,tcp:128 timeout x
tests/hash:ip6,port.t.list1 +2 -1
@@ -1,6 +1,7 @@ Name: test Type: hash:ip,port Header: family inet6 hashsize 1024 maxelem 65536 timeout 5 -Size in memory: 8304 +Size in memory: 1088 References: 0 +Number of Entries: 4 Members:
tests/hash:ip6.t.list0 +2 -1
@@ -1,7 +1,8 @@ Name: test Type: hash:ip Header: family inet6 hashsize 128 maxelem 65536 timeout 5 -Size in memory: 1240 +Size in memory: 512 References: 0 +Number of Entries: 2 Members: 192:168:68::69 timeout 0
tests/hash:ip6.t.list1 +2 -1
@@ -1,7 +1,8 @@ Name: test Type: hash:ip Header: family inet6 hashsize 128 maxelem 65536 netmask 64 timeout 5 -Size in memory: 1448 +Size in memory: 704 References: 0 +Number of Entries: 3 Members: 200:100:10:: timeout 0
tests/hash:ip6.t.list2 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:ip Header: family inet6 hashsize 128 maxelem 65536 timeout x -Size in memory: 1344 +Size in memory: 512 References: 0 +Number of Entries: 2 Members: 192:168:68::69 timeout x 2::1 timeout x
tests/hash:ip6.t.list3 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:ip Header: family inet6 hashsize 128 maxelem 65536 netmask 64 timeout x -Size in memory: 1448 +Size in memory: 704 References: 0 +Number of Entries: 3 Members: 192:168:68:: timeout x 200:100:10:: timeout x
tests/hash:mac.t.list0 +2 -1
@@ -1,7 +1,8 @@ Name: test Type: hash:mac Header: hashsize 128 maxelem 65536 timeout 5 -Size in memory: 2488 +Size in memory: 384 References: 0 +Number of Entries: 2 Members: 00:0A:00:00:00:00 timeout 0
tests/hash:mac.t.list1 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:mac Header: hashsize 1024 maxelem 65536 skbinfo -Size in memory: 17304 +Size in memory: 1088 References: 0 +Number of Entries: 6 Members: 01:02:03:04:05:06 skbmark 0x123456 01:02:03:04:05:07 skbmark 0x1234ab/0xffff
tests/hash:mac.t.list2 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:mac Header: hashsize 128 maxelem 65536 timeout x -Size in memory: 2488 +Size in memory: 384 References: 0 +Number of Entries: 2 Members: 00:00:00:00:02:00 timeout x 00:0A:00:00:00:00 timeout x
tests/hash:mac.t.list3 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:mac Header: hashsize 1024 maxelem 2 skbinfo -Size in memory: 632 +Size in memory: 448 References: 0 +Number of Entries: 2 Members: 01:02:03:04:05:06 skbprio 1:10 01:02:03:04:05:07 skbprio 1:12 skbqueue 8
tests/hash:net,iface.t +1 -1
@@ -131,7 +131,7 @@ # Add clashing elements 0 (set -e; for x in `seq 0 63`; do ipset add test 10.0.0.0/16,eth$x; done) # Check listing -0 n=`ipset list test | grep -v Revision: | wc -l` && test $n -eq 70 +0 n=`ipset list test | grep -v Revision: | wc -l` && test $n -eq 71 # Delete test set 0 ipset destroy test # Create test set with timeout support
tests/hash:net,iface.t.list0 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:net,iface Header: family inet hashsize 128 maxelem 65536 -Size in memory: 2928 +Size in memory: 928 References: 0 +Number of Entries: 4 Members: 1.1.1.1,eth0 192.168.68.64/27,eth1
tests/hash:net,iface.t.list1 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:net,iface Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 18512 +Size in memory: 3872 References: 0 +Number of Entries: 27 Members: 192.0.0.0/10,eth10 192.0.0.0/11,eth11
tests/hash:net,iface.t.list2 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:net,iface Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 17168 +Size in memory: 928 References: 0 +Number of Entries: 4 Members: 10.2.0.0/24,eth0 10.2.1.0/29,eth0
tests/hash:net,net.t.list0 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:net,net Header: family inet hashsize 128 maxelem 65536 timeout x -Size in memory: 3040 +Size in memory: 1288 References: 0 +Number of Entries: 4 Members: 1.1.1.1,1.1.1.2 timeout x 192.168.68.64/27,192.168.129.64/27 timeout x
tests/hash:net,net.t.list1 +2 -1
@@ -1,6 +1,7 @@ Name: test Type: hash:net,net Header: family inet hashsize 128 maxelem 65536 timeout 5 -Size in memory: 3040 +Size in memory: 1288 References: 0 +Number of Entries: 4 Members:
tests/hash:net,net.t.list2 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:net,net Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 17664 +Size in memory: 2056 References: 0 +Number of Entries: 16 Members: 10.2.0.0/24,10.3.0.0/24 10.2.0.0/24,10.3.1.0/29
tests/hash:net,port,net.t.list0 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:net,port,net Header: family inet hashsize 1024 maxelem 65536 timeout x -Size in memory: 17672 +Size in memory: 1288 References: 0 +Number of Entries: 4 Members: 2.0.0.0/24,tcp:5,192.168.0.0/24 timeout x 2.0.0.0/24,tcp:5,192.168.0.0/25 timeout x
tests/hash:net,port.t.list0 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:net,port Header: family inet hashsize 128 maxelem 65536 timeout x -Size in memory: 2072 +Size in memory: 1024 References: 0 +Number of Entries: 5 Members: 1.1.1.1,tcp:5 timeout x 192.168.68.64/27,tcp:8 timeout x
tests/hash:net,port.t.list1 +2 -1
@@ -1,6 +1,7 @@ Name: test Type: hash:net,port Header: family inet hashsize 128 maxelem 65536 timeout 5 -Size in memory: 2000 +Size in memory: 1024 References: 0 +Number of Entries: 4 Members:
tests/hash:net.t.list0 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:net Header: family inet hashsize 128 maxelem 65536 timeout x -Size in memory: 1672 +Size in memory: 896 References: 0 +Number of Entries: 4 Members: 1.1.1.1 timeout x 192.168.68.64/27 timeout x
tests/hash:net.t.list1 +2 -1
@@ -1,6 +1,7 @@ Name: test Type: hash:net Header: family inet hashsize 128 maxelem 65536 timeout 5 -Size in memory: 1672 +Size in memory: 895 References: 0 +Number of Entries: 4 Members:
tests/hash:net.t.list2 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:net Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 17016 +Size in memory: 640 References: 0 +Number of Entries: 4 Members: 10.2.0.0/24 10.2.1.0/29
tests/hash:net6,net6.t.list0 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:net,net Header: family inet6 hashsize 128 maxelem 65536 timeout x -Size in memory: 4672 +Size in memory: 3144 References: 0 +Number of Entries: 4 Members: 192:160::/27,172:16:68::/48 timeout x 1:1:1::1,2:2:2::2 timeout x
tests/hash:net6,net6.t.list1 +2 -1
@@ -1,6 +1,7 @@ Name: test Type: hash:net,net Header: family inet6 hashsize 128 maxelem 65536 timeout 5 -Size in memory: 4672 +Size in memory: 3144 References: 0 +Number of Entries: 4 Members:
tests/hash:net6,port,net6.t.list0 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:net,port,net Header: family inet6 hashsize 1024 maxelem 65536 -Size in memory: 18824 +Size in memory: 2440 References: 0 +Number of Entries: 4 Members: 2:1::,tcp:128,::/12 2:1::1,tcp:128,::/12
tests/hash:net6,port.t.list0 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:net,port Header: family inet6 hashsize 128 maxelem 65536 timeout x -Size in memory: 2328 +Size in memory: 2352 References: 0 +Number of Entries: 5 Members: 192:160::/27,ipv6-icmp:echo-request timeout x 192:168:68::95,ipv6-icmp:port-unreachable timeout x
tests/hash:net6,port.t.list1 +2 -1
@@ -1,7 +1,8 @@ Name: test Type: hash:net,port Header: family inet6 hashsize 128 maxelem 65536 timeout 5 -Size in memory: 2328 +Size in memory: 2352 References: 0 +Number of Entries: 5 Members: 1:1:1::1,tcp:8 timeout 0
tests/hash:net6.t.list0 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:net Header: family inet6 hashsize 128 maxelem 65536 timeout x -Size in memory: 2696 +Size in memory: 2112 References: 0 +Number of Entries: 4 Members: 192:160::/27 timeout x 1:1:1::1 timeout x
tests/hash:net6.t.list1 +2 -1
@@ -1,6 +1,7 @@ Name: test Type: hash:net Header: family inet6 hashsize 128 maxelem 65536 timeout 5 -Size in memory: 2696 +Size in memory: 2112 References: 0 +Number of Entries: 4 Members:
tests/iphash.t.list0 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:ip Header: family inet hashsize 128 maxelem 65536 -Size in memory: 1184 +Size in memory: 224 References: 0 +Number of Entries: 2 Members: 192.168.68.69 2.0.0.1
tests/iphash.t.list1 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:ip Header: family inet hashsize 128 maxelem 65536 netmask 24 -Size in memory: 1184 +Size in memory: 224 References: 0 +Number of Entries: 2 Members: 192.168.68.0 2.0.0.0
tests/ipmarkhash.t.list0 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:ip,mark Header: family inet markmask 0xffffffff hashsize 1024 maxelem 65536 -Size in memory: 8516 +Size in memory: 384 References: 0 +Number of Entries: 4 Members: 2.0.0.0,0x00000005 2.0.0.1,0x00000005
tests/ipmarkhash.t.list1 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:ip,mark Header: family inet markmask 0xffffffff hashsize 1024 maxelem 65536 -Size in memory: 8468 +Size in memory: 384 References: 0 +Number of Entries: 4 Members: 1.255.255.255,0x00000005 2.0.0.0,0x00000005
tests/ipporthash.t.list0 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:ip,port Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 8464 +Size in memory: 384 References: 0 +Number of Entries: 4 Members: 2.0.0.0,tcp:5 2.0.0.1,tcp:5
tests/ipporthash.t.list1 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:ip,port Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 8464 +Size in memory: 384 References: 0 +Number of Entries: 4 Members: 1.255.255.255,tcp:5 2.0.0.0,tcp:5
tests/ipportiphash.t.list0 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:ip,port,ip Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 8528 +Size in memory: 456 References: 0 +Number of Entries: 4 Members: 2.0.0.0,tcp:5,1.1.1.1 2.0.0.1,tcp:5,1.1.1.1
tests/ipportiphash.t.list1 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:ip,port,ip Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 8416 +Size in memory: 296 References: 0 +Number of Entries: 2 Members: 2.0.0.0,tcp:5,1.1.1.1 2.0.255.255,tcp:128,2.2.2.2
tests/iptables.sh +1 -1
@@ -1,6 +1,6 @@ #!/bin/sh -# set -x +set -x set -e ipset=${IPSET_BIN:-../src/ipset}
tests/nethash.t.list0 +2 -1
@@ -1,8 +1,9 @@ Name: test Type: hash:net Header: family inet hashsize 128 maxelem 65536 -Size in memory: 1544 +Size in memory: 640 References: 0 +Number of Entries: 4 Members: 1.1.1.1 192.168.68.64/27
tests/resizet.sh +1 -1
@@ -1,6 +1,6 @@ #!/bin/sh -# set -x +#set -x set -e ipset=${IPSET_BIN:-../src/ipset}
tests/restore.t.list0 +2 -1
@@ -1,8 +1,9 @@ Name: a Type: hash:ip Header: family inet6 hashsize 1024 maxelem 65536 -Size in memory: 16704 +Size in memory: 416 References: 0 +Number of Entries: 3 Members: 3::3 4::4
tests/restore.t.list1 +2 -1
@@ -1,8 +1,9 @@ Name: b Type: hash:ip Header: family inet6 hashsize 1024 maxelem 65536 -Size in memory: 16704 +Size in memory: 416 References: 0 +Number of Entries: 3 Members: 1::1 2::2
tests/setlist.t.list4 +8 -4
@@ -1,29 +1,33 @@ Name: a Type: hash:ip Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 16504 +Size in memory: 128 References: 1 +Number of Entries: 0 Members: Name: b Type: hash:ip Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 16504 +Size in memory: 128 References: 0 +Number of Entries: 0 Members: Name: c Type: hash:ip Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 16504 +Size in memory: 128 References: 0 +Number of Entries: 0 Members: Name: d Type: hash:ip Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 16504 +Size in memory: 128 References: 0 +Number of Entries: 0 Members: Name: test
tests/sort.sh +2 -2
@@ -1,5 +1,5 @@ #!/bin/sh -head -n 6 $1 > .foo -tail -n +7 $1 | grep '[[:alnum:]]' | sort >> .foo +head -n 7 $1 > .foo +tail -n +8 $1 | grep '[[:alnum:]]' | sort >> .foo rm $1
Signature · 1 line
1.9.1
Pablo Neira Ayuso
maintainerQuoted 7 lines · Eric B Munson
It would be useful for userspace to query the size of an ipset hash, however, this data is not exposed to userspace outside of counting the number of member entries. This patch uses the attribute
IPSET_ATTR_ELEMENTSto indicate the size in the the header that is exported to userspace. This field is then printed by the userspace tool for hashes.
Quoted 6 lines
Because it is only meaningful for hashes to report their size, the output is conditional on the set type. To do this checking the
MATCH_TYPENAMEmacro was moved toutils.h.The bulk of this patch changes the expected test suite to account for the change in output.
AFAIK, Jozsef wants to integrate this into ipset once the RCU patchset for ipset is merged mainstream.
Quoted 12 lines · Pablo Neira Ayuso
Quoted 11 lines · Eric B Munson
It would be useful for userspace to query the size of an ipset hash, however, this data is not exposed to userspace outside of counting the number of member entries. This patch uses the attribute
IPSET_ATTR_ELEMENTSto indicate the size in the the header that is exported to userspace. This field is then printed by the userspace tool for hashes.Because it is only meaningful for hashes to report their size, the output is conditional on the set type. To do this checking the
MATCH_TYPENAMEmacro was moved toutils.h.
Quoted 5 lines
Quoted 2 lines
The bulk of this patch changes the expected test suite to account for the change in output.
AFAIK, Jozsef wants to integrate this into ipset once the RCU patchset for ipset is merged mainstream.
Yes, exactly, after that this patch will be applied.
Best regards,
Jozsef
-
E-mail : [email protected], [email protected] PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences
H-1525 Budapest 114, POB. 49, Hungary
Hi,
Quoted 10 lines · Eric B Munson
It would be useful for userspace to query the size of an ipset hash, however, this data is not exposed to userspace outside of counting the number of member entries. This patch uses the attribute
IPSET_ATTR_ELEMENTSto indicate the size in the the header that is exported to userspace. This field is then printed by the userspace tool for hashes.Because it is only meaningful for hashes to report their size, the output is conditional on the set type. To do this checking the
MATCH_TYPENAMEmacro was moved toutils.h.
The patch is applied with a slight modification: "Number of entries" is printed instead of "Number of Entries". Thank you!
Best regards,
Jozsef
Quoted 1,180 lines
The bulk of this patch changes the expected test suite to account for the change in output.
Signed-off-by Eric B Munson <[email protected]>Cc Pablo Neira Ayuso <[email protected]>Cc Josh Hunt <[email protected]>---
This is the same as the V2 I posted in Decemeber with a rebase to the latest upstreaminclude/libipset/utils.h | 3 +++ kernel/net/netfilter/ipset/ip_set_hash_gen.h | 3 ++- lib/errcode.c | 2 -- lib/session.c | 14 ++++++++++++-- tests/check_cidrs.sh | 4 ++-- tests/comment.t.list2 | 3 ++- tests/comment.t.list21 | 3 ++- tests/comment.t.list22 | 3 ++- tests/comment.t.list3 | 9 ++++++--- tests/hash:ip,mark.t.list0 | 3 ++- tests/hash:ip,mark.t.list1 | 3 ++- tests/hash:ip,port,ip.t.list0 | 3 ++- tests/hash:ip,port,ip.t.list1 | 3 ++- tests/hash:ip,port,net.t.list0 | 3 ++- tests/hash:ip,port.t.list0 | 3 ++- tests/hash:ip,port.t.list1 | 3 ++- tests/hash:ip,port.t.list2 | 3 ++- tests/hash:ip.t.list0 | 3 ++- tests/hash:ip.t.list1 | 3 ++- tests/hash:ip.t.list2 | 3 ++- tests/hash:ip.t.list3 | 3 ++- tests/hash:ip6,mark.t.list0 | 3 ++- tests/hash:ip6,mark.t.list1 | 3 ++- tests/hash:ip6,port,ip6.t.list0 | 4 +++- tests/hash:ip6,port,ip6.t.list1 | 3 ++- tests/hash:ip6,port,net6.t.list0 | 3 ++- tests/hash:ip6,port.t.list0 | 3 ++- tests/hash:ip6,port.t.list1 | 3 ++- tests/hash:ip6.t.list0 | 3 ++- tests/hash:ip6.t.list1 | 3 ++- tests/hash:ip6.t.list2 | 3 ++- tests/hash:ip6.t.list3 | 3 ++- tests/hash:mac.t.list0 | 3 ++- tests/hash:mac.t.list1 | 3 ++- tests/hash:mac.t.list2 | 3 ++- tests/hash:mac.t.list3 | 3 ++- tests/hash:net,iface.t | 2 +- tests/hash:net,iface.t.list0 | 3 ++- tests/hash:net,iface.t.list1 | 3 ++- tests/hash:net,iface.t.list2 | 3 ++- tests/hash:net,net.t.list0 | 3 ++- tests/hash:net,net.t.list1 | 3 ++- tests/hash:net,net.t.list2 | 3 ++- tests/hash:net,port,net.t.list0 | 3 ++- tests/hash:net,port.t.list0 | 3 ++- tests/hash:net,port.t.list1 | 3 ++- tests/hash:net.t.list0 | 3 ++- tests/hash:net.t.list1 | 3 ++- tests/hash:net.t.list2 | 3 ++- tests/hash:net6,net6.t.list0 | 3 ++- tests/hash:net6,net6.t.list1 | 3 ++- tests/hash:net6,port,net6.t.list0 | 3 ++- tests/hash:net6,port.t.list0 | 3 ++- tests/hash:net6,port.t.list1 | 3 ++- tests/hash:net6.t.list0 | 3 ++- tests/hash:net6.t.list1 | 3 ++- tests/iphash.t.list0 | 3 ++- tests/iphash.t.list1 | 3 ++- tests/ipmarkhash.t.list0 | 3 ++- tests/ipmarkhash.t.list1 | 3 ++- tests/ipporthash.t.list0 | 3 ++- tests/ipporthash.t.list1 | 3 ++- tests/ipportiphash.t.list0 | 3 ++- tests/ipportiphash.t.list1 | 3 ++- tests/iptables.sh | 2 +- tests/nethash.t.list0 | 3 ++- tests/resizet.sh | 2 +- tests/restore.t.list0 | 3 ++- tests/restore.t.list1 | 3 ++- tests/setlist.t.list4 | 12 ++++++++---- tests/sort.sh | 4 ++-- 71 files changed, 159 insertions(+), 79 deletions(-)include/libipset/utils.h +3
-0@@ -19,6 +19,9 @@#define STRCASEQ (a, b) (strcasecmp(a, b) == 0)#define STRNCASEQ (a, b, n) (strncasecmp(a, b, n) == 0) +/* Match set type names */ +#define MATCH_TYPENAME (a, b) STRNEQ(a, b, strlen(b)) +/* Stringify tokens */ #define _STR (c) #c#define STR (c) _STR(c)kernel/net/netfilter/ipset/ip_set_hash_gen.h +2
-1@@ -1068,7 +1068,8 @@ mtype_head(struct ip_set *set, struct sk_buff *skb) goto nla_put_failure;#endif if (nla_put_net32 (skb,IPSET_ATTR_REFERENCES ,htonl (set->ref -1 )) || -nla_put_net32 (skb,IPSET_ATTR_MEMSIZE ,htonl (memsize))) +nla_put_net32 (skb,IPSET_ATTR_MEMSIZE ,htonl (memsize)) || +nla_put_net32 (skb,IPSET_ATTR_ELEMENTS ,htonl (h->elements))) goto nla_put_failure;if (unlikely (ip_set_put_flags (skb, set))) goto nla_put_failure;lib/errcode.c +0
-2@@ -148,8 +148,6 @@ static const struct ipset_errcode_table list_errcode_table[] = { { }, }; -#define MATCH_TYPENAME (a, b) STRNEQ(a, b, strlen(b)) -/** * ipset_errcode - interpret a kernel error code * @session: session structure lib/session.c +12
-2@@ -931,6 +931,10 @@ list_create(struct ipset_session *session, struct nlattr *nla[])safe_dprintf (session, ipset_print_number,IPSET_OPT_MEMSIZE );safe_snprintf (session,"\nReferences: " );safe_dprintf (session, ipset_print_number,IPSET_OPT_REFERENCES ); +if (MATCH_TYPENAME (type->name ,"hash:" )) { +safe_snprintf (session,"\nNumber of Entries: " ); +safe_dprintf (session, ipset_print_number,IPSET_OPT_ELEMENTS ); + }safe_snprintf (session, session->envopts &IPSET_ENV_LIST_HEADER ?"\n" :"\nMembers:\n" );@@ -940,10 +944,16 @@ list_create(struct ipset_session *session, struct nlattr *nla[])safe_dprintf (session, ipset_print_number,IPSET_OPT_MEMSIZE );safe_snprintf (session,"</memsize>\n<references>" );safe_dprintf (session, ipset_print_number,IPSET_OPT_REFERENCES ); +safe_snprintf (session,"</references>\n" ); +if (MATCH_TYPENAME (type->name ,"hash:" )) { +safe_snprintf (session,"<numentries>" ); +safe_dprintf (session, ipset_print_number,IPSET_OPT_ELEMENTS ); +safe_snprintf (session,"</numentries>\n" ); + }safe_snprintf (session, session->envopts &IPSET_ENV_LIST_HEADER ? -"</references>\n</header>\n" : -"</references>\n</header>\n<members>\n" ); +"</header>\n" : +"</header>\n<members>\n" );break ;default :break ;tests/check_cidrs.sh +2
-2@@ -10,14 +10,14 @@ $ipset n test hash:net for x in `seq 1 32`; do $ipset a test 10.0.0.0/$x n=`$ipset l test | wc -l` - n=$((n - 7)) + n=$((n - 8)) test $n -eq $x || exit 1 done for x in `seq 32 -1 1`; do $ipset d test 10.0.0.0/$x n=`$ipset l test | wc -l` # We deleted one element - n=$((n - 7 + 1)) + n=$((n - 8 + 1)) test $n -eq $x || exit 1 done $ipset x testtests/comment.t.list2 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:net,net Header: family inet hashsize 128 maxelem 65536 comment -Size in memory: 3392 +Size in memory: 1288 References: 0 +Number of Entries: 4 Members: 1.1.1.1,1.1.1.2 comment "text 1.1.1.1/32,1.1.1.2/32" 192.168.68.64/27,192.168.129.64/27 comment "text 192.168.68.69/27,192.168.129.69/27"tests/comment.t.list21 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:ip Header: family inet hashsize 1024 maxelem 65536 timeout x comment -Size in memory: 101400 +Size in memory: 95168 References: 0 +Number of Entries: 512 Members: 2.0.0.0 timeout x comment "text message 0" 2.0.0.1 timeout x comment "text message 1"tests/comment.t.list22 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:ip Header: family inet hashsize 1024 maxelem 65536 timeout x comment -Size in memory: 100152 +Size in memory: 98256 References: 0 +Number of Entries: 512 Members: 2.0.1.0 timeout x comment "text message 0" 2.0.1.1 timeout x comment "text message 1"tests/comment.t.list3 +6
-3@@ -1,22 +1,25 @@ Name: a Type: hash:ip Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 16536 +Size in memory: 128 References: 1 +Number of Entries: 0 Members: Name: b Type: hash:ip Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 16536 +Size in memory: 128 References: 1 +Number of Entries: 0 Members: Name: c Type: hash:ip Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 16536 +Size in memory: 128 References: 1 +Number of Entries: 0 Members: Name: testtests/hash:ip,mark.t.list0 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:ip,mark Header: family inet markmask 0xffffffff hashsize 1024 maxelem 65536 timeout x -Size in memory: 8836 +Size in memory: 640 References: 0 +Number of Entries: 4 Members: 2.0.0.0,0x00000005 timeout x 2.0.0.1,0x00000005 timeout xtests/hash:ip,mark.t.list1 +2
-1@@ -1,6 +1,7 @@ Name: test Type: hash:ip,mark Header: family inet markmask 0xffffffff hashsize 1024 maxelem 65536 timeout 5 -Size in memory: 8836 +Size in memory: 640 References: 0 +Number of Entries: 4 Members:tests/hash:ip,port,ip.t.list0 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:ip,port,ip Header: family inet hashsize 1024 maxelem 65536 timeout x -Size in memory: 8720 +Size in memory: 840 References: 0 +Number of Entries: 4 Members: 2.0.0.0,tcp:5,1.1.1.1 timeout x 2.0.0.1,tcp:5,1.1.1.1 timeout xtests/hash:ip,port,ip.t.list1 +2
-1@@ -1,6 +1,7 @@ Name: test Type: hash:ip,port,ip Header: family inet hashsize 1024 maxelem 65536 timeout 5 -Size in memory: 8304 +Size in memory: 840 References: 0 +Number of Entries: 4 Members:tests/hash:ip,port,net.t.list0 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:ip,port,net Header: family inet hashsize 1024 maxelem 65536 timeout x -Size in memory: 8720 +Size in memory: 1096 References: 0 +Number of Entries: 4 Members: 2.0.0.0,tcp:5,192.168.0.0/25 timeout x 2.0.0.1,tcp:5,192.168.0.0/24 timeout xtests/hash:ip,port.t.list0 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:ip,port Header: family inet hashsize 1024 maxelem 65536 timeout x -Size in memory: 8592 +Size in memory: 640 References: 0 +Number of Entries: 4 Members: 2.0.0.0,tcp:5 timeout x 2.0.0.1,tcp:5 timeout xtests/hash:ip,port.t.list1 +2
-1@@ -1,6 +1,7 @@ Name: test Type: hash:ip,port Header: family inet hashsize 1024 maxelem 65536 timeout 5 -Size in memory: 8304 +Size in memory: 640 References: 0 +Number of Entries: 4 Members:tests/hash:ip,port.t.list2 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:ip,port Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 8432 +Size in memory: 320 References: 0 +Number of Entries: 3 Members: 2.0.0.1,tcp:80 2.0.0.1,udp:80tests/hash:ip.t.list0 +2
-1@@ -1,7 +1,8 @@ Name: test Type: hash:ip Header: family inet hashsize 128 maxelem 65536 timeout 5 -Size in memory: 1208 +Size in memory: 352 References: 0 +Number of Entries: 2 Members: 192.168.68.69 timeout 0tests/hash:ip.t.list1 +2
-1@@ -1,7 +1,8 @@ Name: test Type: hash:ip Header: family inet hashsize 128 maxelem 65536 netmask 24 timeout 5 -Size in memory: 1352 +Size in memory: 464 References: 0 +Number of Entries: 3 Members: 200.100.10.0 timeout 0tests/hash:ip.t.list2 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:ip Header: family inet hashsize 128 maxelem 65536 timeout x -Size in memory: 1280 +Size in memory: 352 References: 0 +Number of Entries: 2 Members: 192.168.68.69 timeout x 2.0.0.1 timeout xtests/hash:ip.t.list3 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:ip Header: family inet hashsize 128 maxelem 65536 netmask 24 timeout x -Size in memory: 1352 +Size in memory: 464 References: 0 +Number of Entries: 3 Members: 192.168.68.0 timeout x 2.0.0.0 timeout xtests/hash:ip6,mark.t.list0 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:ip,mark Header: family inet6 markmask 0xffffffff hashsize 1024 maxelem 65536 timeout x -Size in memory: 9316 +Size in memory: 1088 References: 0 +Number of Entries: 4 Members: 2:1::,0x00000080 timeout x 2:1::1,0x00000080 timeout xtests/hash:ip6,mark.t.list1 +2
-1@@ -1,6 +1,7 @@ Name: test Type: hash:ip,mark Header: family inet6 markmask 0xffffffff hashsize 1024 maxelem 65536 timeout 5 -Size in memory: 9316 +Size in memory: 1088 References: 0 +Number of Entries: 4 Members:tests/hash:ip6,port,ip6.t.list0 +3
-1@@ -1,8 +1,10 @@ Name: test Type: hash:ip,port,ip Header: family inet6 hashsize 1024 maxelem 65536 timeout x -Size in memory: 9104 +Size in memory: 1608 References: 0 +Size in memory: 9104 +Number of Entries: 4 Members: 2:1::,tcp:128,2:2:2::2 timeout x 2:1::1,tcp:128,2:2:2::2 timeout xtests/hash:ip6,port,ip6.t.list1 +2
-1@@ -1,6 +1,7 @@ Name: test Type: hash:ip,port,ip Header: family inet6 hashsize 1024 maxelem 65536 timeout 5 -Size in memory: 8304 +Size in memory: 1608 References: 0 +Number of Entries: 4 Members:tests/hash:ip6,port,net6.t.list0 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:ip,port,net Header: family inet6 hashsize 1024 maxelem 65536 -Size in memory: 9928 +Size in memory: 1864 References: 0 +Number of Entries: 4 Members: 2:1::,tcp:128,::/12 2:1::1,tcp:128,::/12tests/hash:ip6,port.t.list0 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:ip,port Header: family inet6 hashsize 1024 maxelem 65536 timeout x -Size in memory: 8848 +Size in memory: 1088 References: 0 +Number of Entries: 4 Members: 2:1::,tcp:128 timeout x 2:1::1,tcp:128 timeout xtests/hash:ip6,port.t.list1 +2
-1@@ -1,6 +1,7 @@ Name: test Type: hash:ip,port Header: family inet6 hashsize 1024 maxelem 65536 timeout 5 -Size in memory: 8304 +Size in memory: 1088 References: 0 +Number of Entries: 4 Members:tests/hash:ip6.t.list0 +2
-1@@ -1,7 +1,8 @@ Name: test Type: hash:ip Header: family inet6 hashsize 128 maxelem 65536 timeout 5 -Size in memory: 1240 +Size in memory: 512 References: 0 +Number of Entries: 2 Members: 192:168:68::69 timeout 0tests/hash:ip6.t.list1 +2
-1@@ -1,7 +1,8 @@ Name: test Type: hash:ip Header: family inet6 hashsize 128 maxelem 65536 netmask 64 timeout 5 -Size in memory: 1448 +Size in memory: 704 References: 0 +Number of Entries: 3 Members: 200:100:10:: timeout 0tests/hash:ip6.t.list2 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:ip Header: family inet6 hashsize 128 maxelem 65536 timeout x -Size in memory: 1344 +Size in memory: 512 References: 0 +Number of Entries: 2 Members: 192:168:68::69 timeout x 2::1 timeout xtests/hash:ip6.t.list3 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:ip Header: family inet6 hashsize 128 maxelem 65536 netmask 64 timeout x -Size in memory: 1448 +Size in memory: 704 References: 0 +Number of Entries: 3 Members: 192:168:68:: timeout x 200:100:10:: timeout xtests/hash:mac.t.list0 +2
-1@@ -1,7 +1,8 @@ Name: test Type: hash:mac Header: hashsize 128 maxelem 65536 timeout 5 -Size in memory: 2488 +Size in memory: 384 References: 0 +Number of Entries: 2 Members: 00:0A:00:00:00:00 timeout 0tests/hash:mac.t.list1 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:mac Header: hashsize 1024 maxelem 65536 skbinfo -Size in memory: 17304 +Size in memory: 1088 References: 0 +Number of Entries: 6 Members: 01:02:03:04:05:06 skbmark 0x123456 01:02:03:04:05:07 skbmark 0x1234ab/0xfffftests/hash:mac.t.list2 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:mac Header: hashsize 128 maxelem 65536 timeout x -Size in memory: 2488 +Size in memory: 384 References: 0 +Number of Entries: 2 Members: 00:00:00:00:02:00 timeout x 00:0A:00:00:00:00 timeout xtests/hash:mac.t.list3 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:mac Header: hashsize 1024 maxelem 2 skbinfo -Size in memory: 632 +Size in memory: 448 References: 0 +Number of Entries: 2 Members: 01:02:03:04:05:06 skbprio 1:10 01:02:03:04:05:07 skbprio 1:12 skbqueue 8tests/hash:net,iface.t +1
-1@@ -131,7 +131,7 @@ # Add clashing elements 0 (set -e; for x in `seq 0 63`; do ipset add test 10.0.0.0/16,eth$x; done) # Check listing -0 n=`ipset list test | grep -v Revision: | wc -l` && test $n -eq 70 +0 n=`ipset list test | grep -v Revision: | wc -l` && test $n -eq 71 # Delete test set 0 ipset destroy test # Create test set with timeout supporttests/hash:net,iface.t.list0 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:net,iface Header: family inet hashsize 128 maxelem 65536 -Size in memory: 2928 +Size in memory: 928 References: 0 +Number of Entries: 4 Members: 1.1.1.1,eth0 192.168.68.64/27,eth1tests/hash:net,iface.t.list1 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:net,iface Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 18512 +Size in memory: 3872 References: 0 +Number of Entries: 27 Members: 192.0.0.0/10,eth10 192.0.0.0/11,eth11tests/hash:net,iface.t.list2 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:net,iface Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 17168 +Size in memory: 928 References: 0 +Number of Entries: 4 Members: 10.2.0.0/24,eth0 10.2.1.0/29,eth0tests/hash:net,net.t.list0 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:net,net Header: family inet hashsize 128 maxelem 65536 timeout x -Size in memory: 3040 +Size in memory: 1288 References: 0 +Number of Entries: 4 Members: 1.1.1.1,1.1.1.2 timeout x 192.168.68.64/27,192.168.129.64/27 timeout xtests/hash:net,net.t.list1 +2
-1@@ -1,6 +1,7 @@ Name: test Type: hash:net,net Header: family inet hashsize 128 maxelem 65536 timeout 5 -Size in memory: 3040 +Size in memory: 1288 References: 0 +Number of Entries: 4 Members:tests/hash:net,net.t.list2 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:net,net Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 17664 +Size in memory: 2056 References: 0 +Number of Entries: 16 Members: 10.2.0.0/24,10.3.0.0/24 10.2.0.0/24,10.3.1.0/29tests/hash:net,port,net.t.list0 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:net,port,net Header: family inet hashsize 1024 maxelem 65536 timeout x -Size in memory: 17672 +Size in memory: 1288 References: 0 +Number of Entries: 4 Members: 2.0.0.0/24,tcp:5,192.168.0.0/24 timeout x 2.0.0.0/24,tcp:5,192.168.0.0/25 timeout xtests/hash:net,port.t.list0 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:net,port Header: family inet hashsize 128 maxelem 65536 timeout x -Size in memory: 2072 +Size in memory: 1024 References: 0 +Number of Entries: 5 Members: 1.1.1.1,tcp:5 timeout x 192.168.68.64/27,tcp:8 timeout xtests/hash:net,port.t.list1 +2
-1@@ -1,6 +1,7 @@ Name: test Type: hash:net,port Header: family inet hashsize 128 maxelem 65536 timeout 5 -Size in memory: 2000 +Size in memory: 1024 References: 0 +Number of Entries: 4 Members:tests/hash:net.t.list0 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:net Header: family inet hashsize 128 maxelem 65536 timeout x -Size in memory: 1672 +Size in memory: 896 References: 0 +Number of Entries: 4 Members: 1.1.1.1 timeout x 192.168.68.64/27 timeout xtests/hash:net.t.list1 +2
-1@@ -1,6 +1,7 @@ Name: test Type: hash:net Header: family inet hashsize 128 maxelem 65536 timeout 5 -Size in memory: 1672 +Size in memory: 895 References: 0 +Number of Entries: 4 Members:tests/hash:net.t.list2 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:net Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 17016 +Size in memory: 640 References: 0 +Number of Entries: 4 Members: 10.2.0.0/24 10.2.1.0/29tests/hash:net6,net6.t.list0 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:net,net Header: family inet6 hashsize 128 maxelem 65536 timeout x -Size in memory: 4672 +Size in memory: 3144 References: 0 +Number of Entries: 4 Members: 192:160::/27,172:16:68::/48 timeout x 1:1:1::1,2:2:2::2 timeout xtests/hash:net6,net6.t.list1 +2
-1@@ -1,6 +1,7 @@ Name: test Type: hash:net,net Header: family inet6 hashsize 128 maxelem 65536 timeout 5 -Size in memory: 4672 +Size in memory: 3144 References: 0 +Number of Entries: 4 Members:tests/hash:net6,port,net6.t.list0 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:net,port,net Header: family inet6 hashsize 1024 maxelem 65536 -Size in memory: 18824 +Size in memory: 2440 References: 0 +Number of Entries: 4 Members: 2:1::,tcp:128,::/12 2:1::1,tcp:128,::/12tests/hash:net6,port.t.list0 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:net,port Header: family inet6 hashsize 128 maxelem 65536 timeout x -Size in memory: 2328 +Size in memory: 2352 References: 0 +Number of Entries: 5 Members: 192:160::/27,ipv6-icmp:echo-request timeout x 192:168:68::95,ipv6-icmp:port-unreachable timeout xtests/hash:net6,port.t.list1 +2
-1@@ -1,7 +1,8 @@ Name: test Type: hash:net,port Header: family inet6 hashsize 128 maxelem 65536 timeout 5 -Size in memory: 2328 +Size in memory: 2352 References: 0 +Number of Entries: 5 Members: 1:1:1::1,tcp:8 timeout 0tests/hash:net6.t.list0 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:net Header: family inet6 hashsize 128 maxelem 65536 timeout x -Size in memory: 2696 +Size in memory: 2112 References: 0 +Number of Entries: 4 Members: 192:160::/27 timeout x 1:1:1::1 timeout xtests/hash:net6.t.list1 +2
-1@@ -1,6 +1,7 @@ Name: test Type: hash:net Header: family inet6 hashsize 128 maxelem 65536 timeout 5 -Size in memory: 2696 +Size in memory: 2112 References: 0 +Number of Entries: 4 Members:tests/iphash.t.list0 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:ip Header: family inet hashsize 128 maxelem 65536 -Size in memory: 1184 +Size in memory: 224 References: 0 +Number of Entries: 2 Members: 192.168.68.69 2.0.0.1tests/iphash.t.list1 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:ip Header: family inet hashsize 128 maxelem 65536 netmask 24 -Size in memory: 1184 +Size in memory: 224 References: 0 +Number of Entries: 2 Members: 192.168.68.0 2.0.0.0tests/ipmarkhash.t.list0 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:ip,mark Header: family inet markmask 0xffffffff hashsize 1024 maxelem 65536 -Size in memory: 8516 +Size in memory: 384 References: 0 +Number of Entries: 4 Members: 2.0.0.0,0x00000005 2.0.0.1,0x00000005tests/ipmarkhash.t.list1 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:ip,mark Header: family inet markmask 0xffffffff hashsize 1024 maxelem 65536 -Size in memory: 8468 +Size in memory: 384 References: 0 +Number of Entries: 4 Members: 1.255.255.255,0x00000005 2.0.0.0,0x00000005tests/ipporthash.t.list0 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:ip,port Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 8464 +Size in memory: 384 References: 0 +Number of Entries: 4 Members: 2.0.0.0,tcp:5 2.0.0.1,tcp:5tests/ipporthash.t.list1 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:ip,port Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 8464 +Size in memory: 384 References: 0 +Number of Entries: 4 Members: 1.255.255.255,tcp:5 2.0.0.0,tcp:5tests/ipportiphash.t.list0 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:ip,port,ip Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 8528 +Size in memory: 456 References: 0 +Number of Entries: 4 Members: 2.0.0.0,tcp:5,1.1.1.1 2.0.0.1,tcp:5,1.1.1.1tests/ipportiphash.t.list1 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:ip,port,ip Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 8416 +Size in memory: 296 References: 0 +Number of Entries: 2 Members: 2.0.0.0,tcp:5,1.1.1.1 2.0.255.255,tcp:128,2.2.2.2tests/iptables.sh +1
-1@@ -1,6 +1,6 @@ #!/bin/sh -# set -x +set -x set -e ipset=${IPSET_BIN:-../src/ipset}tests/nethash.t.list0 +2
-1@@ -1,8 +1,9 @@ Name: test Type: hash:net Header: family inet hashsize 128 maxelem 65536 -Size in memory: 1544 +Size in memory: 640 References: 0 +Number of Entries: 4 Members: 1.1.1.1 192.168.68.64/27tests/resizet.sh +1
-1@@ -1,6 +1,6 @@ #!/bin/sh -# set -x +#set -x set -e ipset=${IPSET_BIN:-../src/ipset}tests/restore.t.list0 +2
-1@@ -1,8 +1,9 @@ Name: a Type: hash:ip Header: family inet6 hashsize 1024 maxelem 65536 -Size in memory: 16704 +Size in memory: 416 References: 0 +Number of Entries: 3 Members: 3::3 4::4tests/restore.t.list1 +2
-1@@ -1,8 +1,9 @@ Name: b Type: hash:ip Header: family inet6 hashsize 1024 maxelem 65536 -Size in memory: 16704 +Size in memory: 416 References: 0 +Number of Entries: 3 Members: 1::1 2::2tests/setlist.t.list4 +8
-4@@ -1,29 +1,33 @@ Name: a Type: hash:ip Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 16504 +Size in memory: 128 References: 1 +Number of Entries: 0 Members: Name: b Type: hash:ip Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 16504 +Size in memory: 128 References: 0 +Number of Entries: 0 Members: Name: c Type: hash:ip Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 16504 +Size in memory: 128 References: 0 +Number of Entries: 0 Members: Name: d Type: hash:ip Header: family inet hashsize 1024 maxelem 65536 -Size in memory: 16504 +Size in memory: 128 References: 0 +Number of Entries: 0 Members: Name: testtests/sort.sh +2
-2@@ -1,5 +1,5 @@ #!/bin/sh -head -n 6 $1 > .foo -tail -n +7 $1 | grep '[[:alnum:]]' | sort >> .foo +head -n 7 $1 > .foo +tail -n +8 $1 | grep '[[:alnum:]]' | sort >> .foo rm $1Signature · 1 line
1.9.1
-
E-mail : [email protected], [email protected] PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences
H-1525 Budapest 114, POB. 49, Hungary