diff options
author | Nicolas Bertin <nicolas.bertin@al-enterprise.com> | 2017-05-15 14:16:48 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-05-16 04:20:52 +0000 |
commit | bb6e31d8cce2d8b1c56722a816ef608555ece45f (patch) | |
tree | 31c5a7086d4c17b1ca61aad7269567e08c09c620 | |
parent | c1389b98445791af9bcbbcfba4fe5d8549759984 (diff) | |
download | wireshark-bb6e31d8cce2d8b1c56722a816ef608555ece45f.tar.gz |
ua3g: fixed START_TONE message decoding
Change-Id: Ib0cdf793d728b9bdc39754878e878e41e09309de
Reviewed-on: https://code.wireshark.org/review/21663
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | epan/dissectors/packet-ua3g.c | 53 |
1 files changed, 14 insertions, 39 deletions
diff --git a/epan/dissectors/packet-ua3g.c b/epan/dissectors/packet-ua3g.c index 408fa999a5..f76fa27640 100644 --- a/epan/dissectors/packet-ua3g.c +++ b/epan/dissectors/packet-ua3g.c @@ -1439,54 +1439,29 @@ decode_ip_device_routing(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, } case 0x05: /* START TONE */ { - guint8 ii, tone_nb_entries, tone_id; -#if 0 - guint8 tone_direction, tone_id, tone_duration tone_silence; -#endif - int tone_duration; - - tone_nb_entries = tvb_get_guint8(tvb, offset); + guint8 ii; + guint8 tone_nb_entries = tvb_get_guint8(tvb, offset); proto_tree_add_item(ua3g_body_tree, hf_ua3g_ip_device_routing_start_tone_direction, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(ua3g_body_tree, hf_ua3g_ip_device_routing_start_tone_num_entries, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; length--; - while (length > 0 && tone_nb_entries) { - for (ii = 0; ii < tone_nb_entries; ii++) { - tone_id = tvb_get_guint8(tvb, offset); - tone_duration = tvb_get_ntohs(tvb, offset + 1); -#if 0 - tone_duration = tvb_get_guint8(tvb, offset + 1); - tone_silence = tvb_get_guint8(tvb, offset + 2); -#endif - - ua3g_param_tree = proto_tree_add_subtree_format(ua3g_body_tree, tvb, offset, 3, -#if 0 - ett_ua3g_param, NULL, "Tone Pair %d: Id: %d, Duration: %d ms, Silence: %d ms", - ii+1, tone_id, tone_duration, tone_silence); -#endif - ett_ua3g_param, NULL, "Tone Pair %d: Id: %d, Duration: %d ms", - ii+1, tone_id, tone_duration); - - proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_tone_identification, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - length--; + for (ii = 0; ii < tone_nb_entries; ii++) { + guint8 tone_id = tvb_get_guint8(tvb, offset); + gint tone_duration = tvb_get_ntohs(tvb, offset + 1); - proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_tone_duration, tvb, offset, 2, ENC_BIG_ENDIAN); - offset += 2; - length -= 2; + ua3g_param_tree = proto_tree_add_subtree_format(ua3g_body_tree, tvb, offset, 3, + ett_ua3g_param, NULL, "Tone Pair %d: Id: %d, Duration: %d ms", + ii+1, tone_id, tone_duration); -#if 0 - proto_tree_add_uint(ua3g_param_tree, hf_ua3g_feedback_duration, tvb, offset, 1, tone_duration); - offset++; - length--; + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_tone_identification, tvb, offset, 1, ENC_BIG_ENDIAN); + offset++; + length--; - proto_tree_add_uint(ua3g_param_tree, hf_ua3g_silence, tvb, offset, 1, tone_silence); - offset++; - length--; -#endif - } + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_tone_duration, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; + length -= 2; } break; } |