Wireshark mailing list archives

Re: Problems with bitmasks and 64 bit values


From: Pascal Quantin <pascal.quantin () gmail com>
Date: Tue, 1 Nov 2016 12:28:34 +0100

Le 1 nov. 2016 12:18, "Thomas Wiens" <th.wiens () gmx de> a écrit :

On 01.11.2016 12:05, Pascal Quantin wrote:

Why not simply select the right function based on ft type? For
FT_(U)INT40
and above use the functions I indicated earlier.

Now someone can use a value_string inside a bitmask field, even if the
type FT_UINT64 is used.
If I change it so you have to use always val64_string with FT_UINT64
(even if the value which is bitmasked has only 16 bits for example),
then it may be that some of the existing dissectors will fail.

If it was not using the 64 bits variant while mandated in the developer
guide, then it was a bug that need to be fixed. And it should hopefully be
detected by the test suite that performs a display of all fields values.

Or can
you go with a value_string into the functions for val64_string?

This sounds bad :)


For value strings checking the flag BASE_VAL64_STRING is possible, but
there is also the format function, which also has to be a 64 bit function.

That's why you must rely on FT type.


--
Thomas





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

Current thread: