diff options
author | Zoran BoĆĄnjak <zoran.bosnjak@via.si> | 2022-01-12 12:55:32 +0100 |
---|---|---|
committer | A Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2022-01-23 08:45:04 +0000 |
commit | 63cbb2dd1e413db90f19017e5ab9896fd518c986 (patch) | |
tree | de89ff2f140f2f19d9ed20ebd8f0d527bdbf0322 /tools/asterix | |
parent | 99ab96555a6db9b38fcc6b5c9d75cca539225db9 (diff) |
asterix: output format fix
Use HEX, DEC, HEX_DEC..., depending on item size and byte alignment.
Diffstat (limited to 'tools/asterix')
-rwxr-xr-x | tools/asterix/update-specs.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/asterix/update-specs.py b/tools/asterix/update-specs.py index 9bb691c5db..40dc2b5c0b 100755 --- a/tools/asterix/update-specs.py +++ b/tools/asterix/update-specs.py @@ -245,7 +245,14 @@ def get_ft(ref, n, content, offset): t = content['type'] if t == 'Raw': - return 'FT_UINT{}, BASE_DEC, NULL, {}'.format(m, mask) + if (n % 8): # not byte aligned + base = 'DEC' + else: # byte aligned + if n >= 32: # long items + base = 'HEX' + else: # short items + base = 'HEX_DEC' + return 'FT_UINT{}, BASE_{}, NULL, {}'.format(m, base, mask) elif t == 'Table': return 'FT_UINT{}, BASE_DEC, VALS (valstr_{}), {}'.format(m, ref, mask) elif t == 'String': |