aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-text-media.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2011-08-11 15:51:41 +0000
committerAnders Broman <anders.broman@ericsson.com>2011-08-11 15:51:41 +0000
commit8b1263c6184677ec251c656eabe00ad357c914b0 (patch)
treeebabba7823ab3669e214335ab2e39d2db6bf94ea /epan/dissectors/packet-text-media.c
parent23c516516905abd244f5937806a110793b35a366 (diff)
Check if the embedded text is xml, if it is call the xml dissector.
svn path=/trunk/; revision=38486
Diffstat (limited to 'epan/dissectors/packet-text-media.c')
-rw-r--r--epan/dissectors/packet-text-media.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/epan/dissectors/packet-text-media.c b/epan/dissectors/packet-text-media.c
index ba2248cc6d..a72e366cbc 100644
--- a/epan/dissectors/packet-text-media.c
+++ b/epan/dissectors/packet-text-media.c
@@ -55,6 +55,9 @@ static gint proto_text_lines = -1;
/* Subtrees */
static gint ett_text_lines = -1;
+/* Dissector handles */
+static dissector_handle_t xml_handle;
+
static void
dissect_text_lines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
@@ -63,6 +66,20 @@ dissect_text_lines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gint offset = 0, next_offset;
gint len;
const char *data_name;
+ guint8 word[6];
+ int length = tvb_length(tvb);
+
+ /* Check if this is actually xml
+ * If there is less than 38 characters this is not XML
+ * <?xml version="1.0" encoding="UTF-8"?>
+ */
+ if(length > 38){
+ tvb_get_nstringz0(tvb, 0, sizeof(word),word);
+ if (g_ascii_strncasecmp(word, "<?xml", 5) == 0){
+ call_dissector(xml_handle, tvb, pinfo, tree);
+ return;
+ }
+ }
data_name = pinfo->match_string;
if (! (data_name && data_name[0])) {
@@ -159,4 +176,6 @@ proto_reg_handoff_text_lines(void)
dissector_add_string("media_type", "application/x-wms-logplaystats", text_lines_handle);
dissector_add_string("media_type", "application/x-rtsp-udp-packetpair", text_lines_handle);
+
+ xml_handle = find_dissector("xml");
}