ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] proto_add_tree_item versus proto_add_tree_string

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Mon, 12 Mar 2007 17:39:43 -0700

On Mar 12, 2007, at 5:11 PM, Neely Grady-W30566 wrote:

The problem I run into is the bitmask will need to be shifted depending on where in the byte the interesting bits are. Is there a way to shift the bitmasks in the hf_ struct?

No.  The bitmask for any given hf_ structure is a constant.

However, there can be more than one hf_ structure for a given field name, with different bit masks.

BTW, how do you plan to handle a field that straddles a byte boundary? You can't do that with a 1-byte field, even if the field has fewer than 8 bits.