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

Wireshark-dev: [Wireshark-dev] header field arrays

From: "Jonathan Walker (c)" <JWalker@xxxxxxxxxxxx>
Date: Thu, 18 Jun 2009 13:43:55 -0700

Hello all,

   When creating and registering a new header field array in a plug-in, does the size of the array have to be exactly the same as the number of used fields?  For example, I created a hf array as follows:

 

      static hf_register_info hf[MAX_FIELDS];

 

I plan to fill up a certain variable amount of fields (up to “cur_field”) less than MAX_FIELDS, and then register the first cur_field amount of values of the array as follows:

 

      proto_register_field_array(proto_shsip, hf, cur_field);

 

However, I’m getting a run-time error upon trying to click a field in Wireshark, and I was wondering if this is the problem.  I’ve been trying to figure out other possible errors, but I can’t find any, and I don’t see the problem with doing something like I have done above.

 

Thanks,

J. Walker