diff options
author | jake <jake@f5534014-38df-0310-8fa8-9805f1628bb7> | 2008-01-06 11:49:32 +0000 |
---|---|---|
committer | jake <jake@f5534014-38df-0310-8fa8-9805f1628bb7> | 2008-01-06 11:49:32 +0000 |
commit | 533127fbe6f03e6e6601765925ef44abaa9c08e9 (patch) | |
tree | b1520d9cae94cdbb4ccc97c346ad34461d8d9b92 /epan | |
parent | 9553a238693aebd771610e0790f8a308aea57430 (diff) |
Fix for bug 2026:
Clean up RTP header extension code. Remove duplicate raw presentation.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24016 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-rtp.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/epan/dissectors/packet-rtp.c b/epan/dissectors/packet-rtp.c index efab956d24..2bc5ec3ed7 100644 --- a/epan/dissectors/packet-rtp.c +++ b/epan/dissectors/packet-rtp.c @@ -905,6 +905,7 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) proto_item *ti = NULL; proto_tree *rtp_tree = NULL; proto_tree *rtp_csrc_tree = NULL; + proto_tree *rtp_hext_tree = NULL; guint8 octet1, octet2; unsigned int version; gboolean padding_set; @@ -1007,7 +1008,7 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) rtp_info->info_seq_num = seq_num; rtp_info->info_timestamp = timestamp; rtp_info->info_sync_src = sync_src; - rtp_info->info_is_srtp = FALSE; + rtp_info->info_is_srtp = FALSE; rtp_info->info_setup_frame_num = 0; rtp_info->info_payload_type_str = NULL; @@ -1049,7 +1050,7 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) p_conv_data = p_get_proto_data(pinfo->fd, proto_rtp); if (p_conv_data && p_conv_data->srtp_info) is_srtp = TRUE; - rtp_info->info_is_srtp = is_srtp; + rtp_info->info_is_srtp = is_srtp; if ( check_col( pinfo->cinfo, COL_PROTOCOL ) ) { col_set_str( pinfo->cinfo, COL_PROTOCOL, (is_srtp) ? "SRTP" : "RTP" ); @@ -1159,29 +1160,20 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) offset += 2; hdr_extension = tvb_get_ntohs( tvb, offset ); - if ( tree ) proto_tree_add_uint( rtp_tree, hf_rtp_length, tvb, - offset, 2, hdr_extension); + if ( tree ) proto_tree_add_uint( rtp_tree, hf_rtp_length, tvb, offset, 2, hdr_extension); offset += 2; if ( hdr_extension > 0 ) { if ( tree ) { - ti = proto_tree_add_item(rtp_tree, hf_rtp_hdr_exts, tvb, offset, hdr_extension * 4, - FALSE); - /* I'm re-using the old tree variable here - from the CSRC list!*/ - rtp_csrc_tree = proto_item_add_subtree( ti, - ett_hdr_ext ); - } - for (i = 0; i < hdr_extension; i++ ) { - if ( tree ) proto_tree_add_uint(rtp_csrc_tree, hf_rtp_hdr_ext, tvb, offset, 4, - tvb_get_ntohl( tvb, offset ) ); - offset += 4; + ti = proto_tree_add_item(rtp_tree, hf_rtp_hdr_exts, tvb, offset, hdr_extension * 4, FALSE); + rtp_hext_tree = proto_item_add_subtree( ti, ett_hdr_ext ); } /* pass interpretation of header extension to a registered subdissector */ newtvb = tvb_new_subset(tvb, offset, hdr_extension * 4, hdr_extension * 4); - if ( !(rtp_info->info_payload_type_str && dissector_try_string(rtp_hdr_ext_dissector_table, rtp_info->info_payload_type_str, newtvb, pinfo, rtp_csrc_tree)) ) { - for (i = 0; i < hdr_extension; i++ ) { - if ( tree ) proto_tree_add_uint( rtp_csrc_tree, hf_rtp_hdr_ext, tvb, offset, 4, tvb_get_ntohl( tvb, offset ) ); + if ( !(rtp_info->info_payload_type_str && dissector_try_string(rtp_hdr_ext_dissector_table, + rtp_info->info_payload_type_str, newtvb, pinfo, rtp_hext_tree)) ) { + for ( i = 0; i < hdr_extension; i++ ) { + if ( tree ) proto_tree_add_uint( rtp_hext_tree, hf_rtp_hdr_ext, tvb, offset, 4, tvb_get_ntohl( tvb, offset ) ); } } offset += hdr_extension * 4; |