Ethereal-dev: Re: [Ethereal-dev] using a bitmask without dotted presentation?

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

From: Guy Harris <gharris@xxxxxxxxx>
Date: Mon, 16 Jan 2006 21:31:52 -0800
Patrick Fuchs wrote:

i want to work with a bitmask in a hf_register_info-element to compute and display a value smaller than 8 bit. Is it possible to do this without having the special dotted bitmaskpresentation. (->" ..010...") if i use a proto_add_yyy funktion?

Only if you use proto_tree_add_XXX_format(). Ethereal's standard display format for bitfields is the dotted presentation, so you have to bypass Ethereal's standard formatting to get anything else.

Alternatively, you could add fields that *aren't* bitfields, and do your own masking and shifting and use proto_tree_add_uint(), etc. to add the item to the protocol tree.