aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorLuis Ontanon <luis.ontanon@gmail.com>2006-02-11 00:13:23 +0000
committerLuis Ontanon <luis.ontanon@gmail.com>2006-02-11 00:13:23 +0000
commit009b5f7d29fd92fbddc5b3ac008441bc9cd8a098 (patch)
tree8525bd1a0041ed950781aba6433a9c3d9b7c1a08 /epan
parentf535b4cba14e94b98050f4864aa047e47a3edf04 (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')
-rw-r--r--epan/dissectors/packet-sip.c28
-rw-r--r--epan/dissectors/packet-xml.c3
2 files changed, 19 insertions, 12 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");
}
diff --git a/epan/dissectors/packet-xml.c b/epan/dissectors/packet-xml.c
index 5f619449fc..323b4a2160 100644
--- a/epan/dissectors/packet-xml.c
+++ b/epan/dissectors/packet-xml.c
@@ -1166,7 +1166,8 @@ static void init_xml_names(void) {
static void apply_prefs(void) {
if (pref_heuristic) {
- heur_dissector_add("http", dissect_xml_heur, xml_ns.hf_tag);
+ heur_dissector_add("http", dissect_xml_heur, xml_ns.hf_tag);
+ heur_dissector_add("sip", dissect_xml_heur, xml_ns.hf_tag);
heur_dissector_add("media", dissect_xml_heur, xml_ns.hf_tag);
}
}