[sf-ipf-dev] Adding in destination lists for IPFilter 5
Brought to you by:
darren_r
|
From: Darren R. <da...@re...> - 2007-11-12 09:30:43
|
Over the weekend, I've been working on improving the format of
ippool.conf so
that it is more readable as well as updating the implementation in the
kernel to be
more OO. ippool will continue to read the old format.
The new format will look like this:
pool ipf/in dst-list(name john; round-robin;) { bge0:1.2.2.3; hme0:2.2.2.2;}
pool ipf/out tree(name mark;) {;};
pool nat/in hash(name mary; size 101; seed 55;) {;};
pool ipf/in group-map(name peter;) {;};
pool nat/out dst-list ( name venus; weighted bytes;) { 1.2.3.4; 5.6.7.8; };
The intention is to allow rules to be written like:
pass in on foo0 to dst-list/john from foo to bar
rdr bar0 201.1.1.1 port 80 -> dst-list/venus port 80 tcp
For the existing code, this means moving a bunch of logic out of ip_lookup.c
(this becomes more of an accessor interface) and into ip_htable.c and
ip_pool.c
which now export only an ipf_lookup_t structure that contains a bunch of
function
pointers and a type field to identify which module it is.
There will be a new ip_dstlist.c to provide the new pool style above.
Another change that I'm currentuy exploring is changing some use of the IP
protocol version (4 or 6) to be address family (ie AF_INET, etc) so that
IPFilter
can be more easily adapted to other protocol families.
When I've got some more of this done and a little bit of preliminary testing
done, I'll post a reference to a patch for people to ry.
Cheers,
Darren
|