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

Wireshark-dev: Re: [Wireshark-dev] Replace TRUE/FALSE with proper ENC_* in proto_tree_add_item(

From: Bill Meier <wmeier@xxxxxxxxxxx>
Date: Tue, 04 Oct 2011 14:52:07 -0400
On 10/4/2011 1:53 PM, Bill Meier wrote:
I propose to use a perl script to automate as much as reasonable the
replacement of TRUE/FALSE in the encoding parameter of the
proto_tree_add_item() calls in dissectors as follows:

First step:
For hf[] entries with type
FT_NONE
FT_BYTES
FT_IPV6
FT_IPXNET
FT_UID

convert the field to ENC_NA.

Obviously there will be exception cases (e.g., something other than
TRUE/FALSE/ENC_NA for the param) which I'll need to flag (and presumably
handle manually).


If I can do this step then I'll proceed from there.

For the next step is it simply a case of replacing the remaining
TRUE/FALSE encoding parameter by ENC_LITTLE_ENDIAN/ENC_BIG_ENDIAN ?


Restriction: The replacement should be done only for those proto_tree_add_item() calls directly referencing an actual hf_* variable (that is: one referenced in the hf[] array).


One thing I don't quite understand: In a number of the dissectors why do
proto_tree_add_item() encoding parameters for hf items with type
FT_STRING have ENC_ASCII *and* ENC_LITTLE_ENDIAN|ENC_BIG_ENDIAN ?
Shouldn't this be ENC_ASCII | ENC_NA in this case ?


Comments ?

Bill



___________________________________________________________________________
Sent via: Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives: http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe