Date: Tue, 20 Sep 2005 09:15:04 +0200 From: Jeremie Le Hen <jeremie@le-hen.org> To: Brett Glass <brett@lariat.org> Cc: Luigi Rizzo <rizzo@icir.org>, Jeremie Le Hen <jeremie@le-hen.org>, net@freebsd.org Subject: Re: Efficient use of Dummynet pipes in IPFW Message-ID: <20050920071504.GC24643@obiwan.tataz.chchile.org> In-Reply-To: <6.2.3.4.2.20050919105218.07f5b0d8@localhost> References: <6.2.3.4.2.20050918205708.08cff430@localhost> <20050918235659.B60185@xorpc.icir.org> <6.2.3.4.2.20050919010035.07dfc448@localhost> <20050919005932.B60737@xorpc.icir.org> <6.2.3.4.2.20050919085600.07f783f0@localhost> <20050919160853.GA24643@obiwan.tataz.chchile.org> <20050919092003.A69332@xorpc.icir.org> <6.2.3.4.2.20050919105218.07f5b0d8@localhost>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi Brett, Luigi, all, > >original > > > > ipfw add 1000 dosomething cond1 cond2 cond3 cond4 cond5 ... condN > > > >negated: > > > > ipfw add 1000 skipto 1001 cond1 cond2 cond3 cond4 cond5 ... condN > > ipfw add 1000 dosomething > > This doesn't work, because you must transform cond1 && cond2 && cond3... > into multiple rules that implement ~(cond1 || cond2 || cond3...). So, > you'd need do do the following: > > ipfw add 1000 skipto 1001 not cond1 > ipfw add 1000 skipto 1001 not cond2 > ... (N rules total) > ipfw add 1000 skipto 1001 not condN > ipfw add 1000 dosomething > ipfw add 1000 skipto 5000 // Where to resume on success > ipfw add 1001 I tend to agree with Luigi now. I didn't realize this before, but let's apply De Morgan's theorem. Each condition is identified as a small letter "a", "b", "c". "/a" means "not a" and the "." operator is AND, while the "+" operator is OR. The above "original" rule is therefore : a.b.c The above "negated" rule is obviously : /(a.b.c) With your ruleset may be summed up as : /a+/b+/c Which is the same as the "negated" rule in regard to De Morgan's theorem. Do you agree with this ? Regards, -- Jeremie Le Hen < jeremie at le-hen dot org >< ttz at chchile dot org >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050920071504.GC24643>