netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] ipset: New set type iptreemap
@ 2007-08-20 20:36 Sven Wegener
  2007-08-20 20:36 ` [RFC] ipset: New set type iptreemap, kernel part Sven Wegener
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Sven Wegener @ 2007-08-20 20:36 UTC (permalink / raw)
  To: netfilter-devel

Hi all,

based on the feedback from Jan Engelhardt I've converted the fullipmap [1] 
set type I announced last week to manage the bitmaps with a tree 
structure, instead of a large flat single array. The code is based on 
iptree and the name of the new type is iptreemap.

Worst case memory usage has increased slightly over fullipmap, but the 
average memory usage should be lower. It also supports adding and deleting 
of ranges, so it can be used to match against lists of ranges and 
networks. Be aware that the set type doesn't store the range itself, but 
it expands the range so that the set contains all addresses within that 
range. With a pure network set type like nethash the following is not 
possible:

ipset -A foo 172.16.0.0/12
ipset -D foo 172.17.0.0/16

But iptreemap will handle it as expected and after the delete operation 
the set will only contain the ranges:

172.16.0.0-172.16.255.255
172.18.0.0-172.31.255.255

(The userspace part uses : as the range separator to not interfere with - 
in hostnames)

For ranges that start and end at octet boundaries iptreemap will not use 
any memory for the bitmaps as it manages this by reusing global allocated 
bitmaps. A garbage collector checks whether a bitmap or a complete subtree 
can be replaced by these global bitmaps.

I'm responding with two patches, one for the kernel part and one for the 
userspace part. I think the looping code for the add and delete operation 
for ranges could need some cleanup. The CHECK[1-3] macro is for checking 
whether a complete subtree can be added or deleted. And the GETVALUE[1-3] 
is for getting the start and end values for octets when we're inside of a 
range.

Sven

[1] https://lists.netfilter.org/pipermail/netfilter-devel/2007-August/029066.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-08-21 11:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-20 20:36 [RFC] ipset: New set type iptreemap Sven Wegener
2007-08-20 20:36 ` [RFC] ipset: New set type iptreemap, kernel part Sven Wegener
2007-08-21  5:59   ` Jan Engelhardt
2007-08-21  6:54     ` Sven Wegener
2007-08-21 10:20       ` Jan Engelhardt
2007-08-20 20:37 ` [RFC] ipset: New set type iptreemap, userspace part Sven Wegener
2007-08-21 11:29 ` [RFC] ipset: New set type iptreemap Jozsef Kadlecsik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).