Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: [Wireshark-dev] Is there a good way of handling bitfields with different bitmask

From: "Neil Piercy" <Neil.Piercy@xxxxxxxxxxxx>
Date: Mon, 12 Nov 2007 18:01:09 -0000
If the protocol has bitfields they can be defined in the hf structs, but
what is the best way to cope if these fields can be at different bit
offsets within the byte ? E.g. a 4 bit field which can occur as the
lower 4 bits or the upper 4 bits of a byte.

The more I think about it, the general way would be to add a bit offset
to _every_ existing proto_tree_add_*() to go with the existing byte
offset, but is there a simpler way which
A) maintains the bitmask display in the main packet field view which the
hf bitmasks provide.
B) isnt just a text decode - is based on hf entries.

Neil