From 1ca1473de8c8046c69c84fe865f0ba6cec5711c5 Mon Sep 17 00:00:00 2001 From: Graham Bloice Date: Thu, 1 Jul 2021 18:55:35 +0100 Subject: 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. --- epan/dissectors/packet-dnp.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'epan/dissectors/packet-dnp.c') 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)", -- cgit v1.2.3