[flow-tools] Problem with flow-filter
Mark Fullmer
maf@eng.oar.net
Fri, 19 Apr 2002 02:47:22 -0400
Yes, -t 0xB8 would match ToS bit pattern 10111000.
>From the flow-filter man page.
-t tos_filter
ToS bits filter. An optional mask is available
which is applied to the tos field before compar-
ing to the filter list. For example to match a
tos bit pattern of 101xxxxx use 0xA0/0xE0.
0xE0 = 11100000 (save the first 3 bits)
0xA0 = 10100000 (match 101 to the first 3 bits)
What this does is
flow.tos &= 0xE0
if (flow.tos == 0xA0) then pass
else fail
The syntax is a little more flexible in that the first part can be a
list like many of the other filters, ie 0xA0,0xB0,0xC0.
mark
On Fri, Apr 19, 2002 at 09:43:02AM +0400, Mayank@TheWaterCooler.com wrote:
> Hi,
>
> Sorry to bother you, but I looked at the
> documentation, but I haven't been able to understand
> how to convert masked bits to hex. For instance,
> putting "-t 0xB8" gives me flows with ToS field set to
> 10111000, right?
>
> What do I need to put for a ToS field of 101xxxxx ?
>
> Thanks again,
>
> Mayank