Ethereal-dev: Re: [Ethereal-dev] Bitmaps/fields support in Ethereal (plugins)

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

From: Guy Harris <guy@xxxxxxxxxx>
Date: Thu, 8 Aug 2002 10:57:21 -0700
On Thu, Aug 08, 2002 at 04:42:22PM +0200, andreas.sikkema@xxxxxxxxxxx wrote:
> I seem to remember that some time ago there was talk 
> about bitfields or whatever you call them, example:
> 
>     Flags: 0x0018 (PSH, ACK)
>         0... .... = Congestion Window Reduced (CWR): Not set
>         .0.. .... = ECN-Echo: Not set
>         ..0. .... = Urgent: Not set
>         ...1 .... = Acknowledgment: Set
>         .... 1... = Push: Set
>         .... .0.. = Reset: Not set
>         .... ..0. = Syn: Not set
>         .... ...0 = Fin: Not set
> 
> Did someone implement something in the API for this kind of 
> functionality, or do I really have to everythin by hand (like 
> the TCP dissector does)?

What sort of functionality do you mean?  The TCP dissector uses the
functionality we have, i.e. it declares the flag fields in question as
bitfields, and uses "proto_tree_add_boolean()" to add them.  That code
does all the work of putting the "."s, "0"s, and "1"s in.

There's no routine that takes a tvbuff, an offset, a length, and a list
of hf_ values for all the bitfields in that item, and automatically adds
all of them, but that's another matter.