Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] master f412c9a: Use ENC_BIG_ENDIAN when
From: Bill Meier <wmeier@xxxxxxxxxxx>
Date: Sun, 14 Dec 2014 13:44:19 -0500
On 12/13/2014 4:56 PM, Evan Huus wrote:
I didn't think single-byte fields could really have an endianess, so I
thought ENC_NA was appropriate for them?

Evan


Using ENC_NA is certainly reasonable (and makes logical sense) for fetching single-byte fields.

That being said, the convention (certainly not enforced) seems to be to use ENC_..._ENDIAN for fetching all integral types.

Looking at the current (non-generated) dissector source before I started making changes, I noted that the usage for singe-byte fetches (for proto_tree_add_item(), etc) was more or less as follows:

ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN:    ~12.5K
ENC_NA                               ~ 2.7K

I also noted that the ASN.1 generated dissectors appear to be using the ENC_..._ENDIAN convention as well when fetching single-byte fields.

----------

If there's a consensus that ENC_NA should be used when fetching single-byte fields, it might be a bit of work, but probably fairly simple to do a wholesale change....

Bill