aboutsummaryrefslogtreecommitdiffstats
path: root/tools/asterix
diff options
context:
space:
mode:
authorZoran BoĆĄnjak <zoran.bosnjak@sloveniacontrol.si>2022-02-22 12:05:26 +0100
committerA Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2022-02-25 08:30:46 +0000
commit86c14aed44207d619bcbce7bb132afd27b3ffc77 (patch)
tree21dfa331d9a344f623c6010aca644174ee746a06 /tools/asterix
parent68edbaece17bb1aa2f663dfb11171408ce53778d (diff)
asterix: long items fix
Do not use FT_UNIT for very long items. Sync with asterix-specs #e603aaae8a
Diffstat (limited to 'tools/asterix')
-rw-r--r--tools/asterix/packet-asterix-template.c2
-rwxr-xr-xtools/asterix/update-specs.py4
2 files changed, 5 insertions, 1 deletions
diff --git a/tools/asterix/packet-asterix-template.c b/tools/asterix/packet-asterix-template.c
index e5160afde6..f5db80bb8f 100644
--- a/tools/asterix/packet-asterix-template.c
+++ b/tools/asterix/packet-asterix-template.c
@@ -98,7 +98,7 @@ static dissector_handle_t asterix_handle;
typedef struct FieldPart_s FieldPart;
struct FieldPart_s {
- guint8 bit_length; /* length of field in bits */
+ guint16 bit_length; /* length of field in bits */
double scaling_factor; /* scaling factor of the field (for instance: 1/128) */
guint8 type; /* Pre-defined type for proper presentation */
gint *hf; /* Pointer to hf representing this kind of data */
diff --git a/tools/asterix/update-specs.py b/tools/asterix/update-specs.py
index c29fc93c67..49b0391959 100755
--- a/tools/asterix/update-specs.py
+++ b/tools/asterix/update-specs.py
@@ -254,6 +254,10 @@ def get_ft(ref, n, content, offset):
t = content['type']
if t == 'Raw':
+ if n > 64: # very long items
+ assert (n % 8) == 0, "very long items require byte alignment"
+ return 'FT_NONE, BASE_NONE, NULL, 0x00'
+
if (n % 8): # not byte aligned
base = 'DEC'
else: # byte aligned