[EMAIL PROTECTED] wrote:
> On Wed, 5 Nov 2008, Risto Vaarandi wrote:
> 
>> I understand... it is indeed shorter because you have one rule less (a
>> check for the so called "return result" from another rule set). However,
>> checking the end result explicitly in the calling ruleset is not as bad
>> as it might seem. From the programmer's point of view, I'd actually
>> prefer it - a final decision is made by the caller which increases
>> readability in another sense (pretty much like if (!func()) {...} does).
>> But that's my personal preference :)
> 
> I think it's much cleaner and more powerful to allow the branched set of 
> rules to do anything that the main rules can do. This includes setting 
> contexts that can be checked after a return (which would behave the way 
> you want), but it also includes the branched rules doing anything else, 
> including creating logs, taking actions, or delaring the line should be 
> ignored by all following rules.
> 
> using this sort of logic in iptables/ipchains I was able to take a 2000 
> line ruleset and reduce it down to 200 lines, with the result being much 
> easier to understand.
> 
> This sort of capability is _very_ powerful.

I can tell that you can do all the things in the branched set that you 
would be able to do in the main set. Currently, the main set is 
processed with a loop
foreach $file (@conffiles) { process_rules($file); }
and the branched set will be processed by invoking the same loop from 
the process_rule() recursively. (In fact, now that I've thought about it 
for a while I can only blame myself not having this relatively simple 
idea earlier.) From the end user's point of view a recursive call of the 
same rule processing function means that everything supported in the 
main rule set is also supported in the branched set.
br,
risto

> 
> David Lang
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Simple-evcorr-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users
> 


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Simple-evcorr-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users

Reply via email to