]> git.ipfire.org Git - thirdparty/ipset.git/commit
Add element count to hash headers
authorEric B Munson <emunson@akamai.com>
Fri, 29 May 2015 15:36:25 +0000 (11:36 -0400)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Fri, 19 Jun 2015 21:30:06 +0000 (23:30 +0200)
commiteb9af8fe6d4776242fea84f5228b46d903539146
treed7578d91c40b1c228ddf7e354683362e7042e7c3
parent01a13aa4fe0cb668fc535d38d6f9383433923874
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.

Signed-off-by: Eric B Munson <emunson@akamai.com>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Josh Hunt <johunt@akamai.com>
Cc: netfilter-devel@vger.kernel.org
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
71 files changed:
include/libipset/utils.h
kernel/net/netfilter/ipset/ip_set_hash_gen.h
lib/errcode.c
lib/session.c
tests/check_cidrs.sh
tests/comment.t.list2
tests/comment.t.list21
tests/comment.t.list22
tests/comment.t.list3
tests/hash:ip,mark.t.list0
tests/hash:ip,mark.t.list1
tests/hash:ip,port,ip.t.list0
tests/hash:ip,port,ip.t.list1
tests/hash:ip,port,net.t.list0
tests/hash:ip,port.t.list0
tests/hash:ip,port.t.list1
tests/hash:ip,port.t.list2
tests/hash:ip.t.list0
tests/hash:ip.t.list1
tests/hash:ip.t.list2
tests/hash:ip.t.list3
tests/hash:ip6,mark.t.list0
tests/hash:ip6,mark.t.list1
tests/hash:ip6,port,ip6.t.list0
tests/hash:ip6,port,ip6.t.list1
tests/hash:ip6,port,net6.t.list0
tests/hash:ip6,port.t.list0
tests/hash:ip6,port.t.list1
tests/hash:ip6.t.list0
tests/hash:ip6.t.list1
tests/hash:ip6.t.list2
tests/hash:ip6.t.list3
tests/hash:mac.t.list0
tests/hash:mac.t.list1
tests/hash:mac.t.list2
tests/hash:mac.t.list3
tests/hash:net,iface.t
tests/hash:net,iface.t.list0
tests/hash:net,iface.t.list1
tests/hash:net,iface.t.list2
tests/hash:net,net.t.list0
tests/hash:net,net.t.list1
tests/hash:net,net.t.list2
tests/hash:net,port,net.t.list0
tests/hash:net,port.t.list0
tests/hash:net,port.t.list1
tests/hash:net.t.list0
tests/hash:net.t.list1
tests/hash:net.t.list2
tests/hash:net6,net6.t.list0
tests/hash:net6,net6.t.list1
tests/hash:net6,port,net6.t.list0
tests/hash:net6,port.t.list0
tests/hash:net6,port.t.list1
tests/hash:net6.t.list0
tests/hash:net6.t.list1
tests/iphash.t.list0
tests/iphash.t.list1
tests/ipmarkhash.t.list0
tests/ipmarkhash.t.list1
tests/ipporthash.t.list0
tests/ipporthash.t.list1
tests/ipportiphash.t.list0
tests/ipportiphash.t.list1
tests/iptables.sh
tests/nethash.t.list0
tests/resizet.sh
tests/restore.t.list0
tests/restore.t.list1
tests/setlist.t.list4
tests/sort.sh