Ethereal-users: Re: [Ethereal-users] Bit test in a Display Filter

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Martin Regner" <martin.regner@xxxxxxxxx>
Date: Sun, 28 Mar 2004 20:09:20 +0200
Wes wrote
> I noticed with release 0.10.3 Ethereal:
>
>  "Display filters now support the bitwise and (&)
> operator."
>
> This sounds like it might allow me to do the binary
> display filter I was looking for, but I haven't been
> able to find any description or example how to use it.
> I tried some variations like below, but it didn't seem
> to work.
>
> rtp.payload[4] and 2 == 0
>
> I am not a programmer and I'm probably missing
> something obvious.
>
> Can someone provide any insight on what this feature
> is
> and how to use it?
>

The "bitwise and" operator is & or bitwise_and

However it seems not currently possible to do a filter like "rtp.payload[4]
& 2 == 0".

Maybe the following filter will work for what you want to do:
rtp.payload and !(rtp.payload[4] & 2).