aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-iec104.c
diff options
context:
space:
mode:
authorJiří Engelthaler <engycz@gmail.com>2015-03-25 16:57:16 +0100
committerMichael Mann <mmann78@netscape.net>2015-03-25 23:29:47 +0000
commit785fab7f01c98c54295596d4a25a2d2bc7343335 (patch)
tree457eaedcc2ca78cc40fac7cac0d8dd624291d24d /epan/dissectors/packet-iec104.c
parentffecd088dd48241e324ae413c7c90f9415a2e220 (diff)
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 <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-iec104.c')
-rw-r--r--epan/dissectors/packet-iec104.c11
1 files changed, 6 insertions, 5 deletions
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 */