From 785fab7f01c98c54295596d4a25a2d2bc7343335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Engelthaler?= Date: Wed, 25 Mar 2015 16:57:16 +0100 Subject: packet-iec104: fix showing information objects if SQ flag is set IOA of information object is shown only for first object in sequence, corrected byte count for information object. Change-Id: Id428ce3b9d98da0be0315f2a880e5c025e076183 Reviewed-on: https://code.wireshark.org/review/7821 Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- epan/dissectors/packet-iec104.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'epan/dissectors/packet-iec104.c') diff --git a/epan/dissectors/packet-iec104.c b/epan/dissectors/packet-iec104.c index db7595ab87..4636b72e96 100644 --- a/epan/dissectors/packet-iec104.c +++ b/epan/dissectors/packet-iec104.c @@ -1066,7 +1066,6 @@ static void dissect_iec104asdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr wmem_strbuf_t * res; guint8 offset = 0; /* byte offset, signal dissection */ - guint8 offset_start_ioa = 0; /* position first ioa */ guint8 i; guint32 asdu_info_obj_addr = 0; proto_item * itSignal = NULL; @@ -1183,13 +1182,16 @@ static void dissect_iec104asdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr for(i = 0; i < asduh.NumIx; i++) { /* create subtree for the signal values ... */ - trSignal = proto_tree_add_subtree(it104tree, tvb, offset, asduh.DataLength + 3, + if (i == 0 || !asduh.SQ) + trSignal = proto_tree_add_subtree(it104tree, tvb, offset, asduh.DataLength + 3, + ett_asdu_objects, &itSignal, "IOA:s"); + else + trSignal = proto_tree_add_subtree(it104tree, tvb, offset, asduh.DataLength, ett_asdu_objects, &itSignal, "IOA:s"); /* -------- First Information object address */ - if (!i) + if (i == 0) { - offset_start_ioa = offset; /* -------- Information object address */ /* check length */ if(Len < (guint)(offset + 3)) { @@ -1202,7 +1204,6 @@ static void dissect_iec104asdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr if (asduh.SQ) /* <=> SQ=1, info obj addr = startaddr++ */ { asdu_info_obj_addr++; - proto_tree_add_uint(trSignal, hf_ioa, tvb, offset_start_ioa, 3, asdu_info_obj_addr); } else { /* SQ=0, info obj addr given */ /* -------- Information object address */ /* check length */ -- cgit v1.2.3