diff options
author | Luis Ontanon <luis.ontanon@gmail.com> | 2006-02-11 00:13:23 +0000 |
---|---|---|
committer | Luis Ontanon <luis.ontanon@gmail.com> | 2006-02-11 00:13:23 +0000 |
commit | 009b5f7d29fd92fbddc5b3ac008441bc9cd8a098 (patch) | |
tree | 8525bd1a0041ed950781aba6433a9c3d9b7c1a08 /epan/dissectors/packet-sip.c | |
parent | f535b4cba14e94b98050f4864aa047e47a3edf04 (diff) |
From ENDOH Akira:
Add heuristic dissection of XML to SIP bodies with unknown media_type.
svn path=/trunk/; revision=17247
Diffstat (limited to 'epan/dissectors/packet-sip.c')
-rw-r--r-- | epan/dissectors/packet-sip.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/epan/dissectors/packet-sip.c b/epan/dissectors/packet-sip.c index efa1049b04..7a05006e55 100644 --- a/epan/dissectors/packet-sip.c +++ b/epan/dissectors/packet-sip.c @@ -443,6 +443,8 @@ static guint sip_is_packet_resend(packet_info *pinfo, * http://www.iana.org/assignments/media-types/index.html */ static dissector_table_t media_type_dissector_table; +static heur_dissector_list_t heur_subdissector_list; + #define SIP2_HDR "SIP/2.0" #define SIP2_HDR_LEN (strlen (SIP2_HDR)) @@ -1686,16 +1688,20 @@ separator_found2: } if ( found_match != TRUE ) { - int tmp_offset = 0; - while (tvb_offset_exists(next_tvb, tmp_offset)) { - tvb_find_line_end(next_tvb, tmp_offset, -1, &next_offset, FALSE); - linelen = next_offset - tmp_offset; - if(message_body_tree) { - proto_tree_add_text(message_body_tree, next_tvb, tmp_offset, linelen, - "%s", tvb_format_text(next_tvb, tmp_offset, linelen)); - } - tmp_offset = next_offset; - }/* end while */ + if (!(dissector_try_heuristic(heur_subdissector_list, + next_tvb, pinfo, message_body_tree))) { + int tmp_offset = 0; + while (tvb_offset_exists(next_tvb, tmp_offset)) { + tvb_find_line_end(next_tvb, tmp_offset, -1, &next_offset, FALSE); + linelen = next_offset - tmp_offset; + if(message_body_tree) { + proto_tree_add_text(message_body_tree, next_tvb, + tmp_offset, linelen, "%s", + tvb_format_text(next_tvb, tmp_offset, linelen)); + } + tmp_offset = next_offset; + }/* end while */ + } } offset += datalen; } @@ -2734,7 +2740,7 @@ void proto_register_sip(void) &sip_desegment_body); register_init_routine(&sip_init_protocol); - + register_heur_dissector_list("sip", &heur_subdissector_list); /* Register for tapping */ sip_tap = register_tap("sip"); } |