On Fri, Feb 28, 2014 at 01:27:35PM +0100, Daniel Wendler wrote:
Hello List,
at the moment we try to implement an fine granulary filter mechanism in our Bird OSPF setup. We ask ourselfes if anyone has implementet bitwise operations in Bird filters which is not in official code. If not, are there any plans to implement such an feature in Bird filters or should we try it to implement on our own and contribute this to the mailing list?
Hi Although adding bitfield operations is generally a good idea, your problem could be easily solved with current code and this filter function (a - number, b - value of the bit): function bittest(int a; int b) { return a/(2*b) != (a+b)/(2*b); } bittest(13,1) -> true bittest(13,2) -> false bittest(13,4) -> true bittest(13,8) -> true bittest(13,16) -> false -- Elen sila lumenn' omentielvo Ondrej 'SanTiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."