bitwise operation in filters

Daniel Wendler dwe at boreus.de
Mon Mar 3 17:46:32 CET 2014


Hello Ondrej,

thanks for your help.
We have implementet your function and it works great.

-- 

Mit freundlichen Grüßen
---------------------------------
Daniel Wendler

Am Freitag, 28. Februar 2014, 20:12:40 schrieb Ondrej Zajicek:
> 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




More information about the Bird-users mailing list