Ethereal-dev: Re: [Ethereal-dev] guint128

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxx>
Date: Sun, 09 Jan 2005 12:48:38 -0800
Olivier Biot wrote:

One other possibility is to register the protocol field several times with the *same* field name but with a *different* field type, depending on the width of the field. You'd then for example define the following header fields: hf_alc_lct_toi_8 when the value is encoded in 1 byte (8 bits), hf_alc_lct_toi_16 when in 2 bytes, hf_alc_lct_toi_24 when in 3 bytes, hf_alc_lct_toi_32 when in 4 bytes, hf_alc_lct_toi_64 when in 8 bytes etc.

Only two of those would be necessary - an FT_UINT32 field can be used to store an 8-bit value (the differences between FT_UINT{8,16,24,32} are only display differences, controlling how many digits are shown if displayed in hex and how many bits are shown if displayed as bitfields).

None of them is sufficient for the problem about which he's asking, though, as the "etc." in "...hf_alc_lct_toi_64 when in 8 bytes etc." is just FT_BYTES - there's no FT_UINT128 field type.