diff options
author | Graham Bloice <graham.bloice@trihedral.com> | 2021-07-01 18:55:35 +0100 |
---|---|---|
committer | Graham Bloice <graham.bloice@trihedral.com> | 2021-07-01 18:55:35 +0100 |
commit | 1ca1473de8c8046c69c84fe865f0ba6cec5711c5 (patch) | |
tree | eed4d35a963ac1ea5813c0f188e6d63f3ecfd7b4 /epan/dissectors/packet-dnp.c | |
parent | b8a489e2e3688e0cf9cf3939b2c8923d1496cfa7 (diff) |
DNP3: Add Octet string length to item text
The Octet string is an outlier amongst DNP3 objects as the variation
doesn't define a specific type of string but the length.
Presiously the length was not displayed in the packet details,
this change adds the length to the object header.
Diffstat (limited to 'epan/dissectors/packet-dnp.c')
-rw-r--r-- | epan/dissectors/packet-dnp.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/epan/dissectors/packet-dnp.c b/epan/dissectors/packet-dnp.c index 6c3a3da507..033846e3ea 100644 --- a/epan/dissectors/packet-dnp.c +++ b/epan/dissectors/packet-dnp.c @@ -1719,6 +1719,13 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, expert_add_info(pinfo, object_item, &ei_dnp3_unknown_group0_variation); } } + else if ((AL_OBJ_GROUP(al_obj) == AL_OBJ_GROUP(AL_OBJ_OCT)) || (AL_OBJ_GROUP(al_obj) == AL_OBJ_GROUP(AL_OBJ_OCT_EVT))) { + /* For octet strings the variation is the length */ + object_item = proto_tree_add_uint_format(robj_tree, hf_dnp3_al_obj, tvb, offset, 2, al_obj, + "Object(s): %s (0x%04x), Length: %d", + val_to_str_ext_const(al_obj, &dnp3_al_obj_vals_ext, "Unknown Object\\Variation"), + al_obj, al_oct_len); + } else { object_item = proto_tree_add_uint_format(robj_tree, hf_dnp3_al_obj, tvb, offset, 2, al_obj, "Object(s): %s (0x%04x)", |