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] How to modify hf_register_info hf[] ?

From: "Jan Kokott" <Blind007@xxxxxx>
Date: Mon, 22 Jan 2007 14:35:39 +0100
Hi,

I have a little problem with the hf [] array.
In the subtree "frame" are two fields defining the length of my subtree "Adressing Field".

The Field could varry between 4 and 20 byte. The total length is a problem I have already solved. My problem is, that 2 of the 4 fields in those 4-20 byte have a variable length(0,2 or 8 Byte).

The dissector (if (tree)) was solved with an switch/case, for every possibility.
But how do I change the hf [], so that it could have 2 or 4 fields with 0-8 Byte ?
I could use a switch/case again but therefore I would need to write 6 different hf_register with 14-16 entrys.

Any ideas on how I could do that a bit smoother ?

Regards
Jan Kokott