summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis Ontanon <luis.ontanon@gmail.com>2007-08-10 21:03:26 +0000
committerLuis Ontanon <luis.ontanon@gmail.com>2007-08-10 21:03:26 +0000
commitd7b93782321980ea363bad33fa38e77c745e8763 (patch)
treee9e0ec2687bb5bd935f28a26aff5dd955b4bf3c1
parent8ae37d9391abedad4139ea2c0583ef92bcbadd36 (diff)
downloadwireshark-d7b93782321980ea363bad33fa38e77c745e8763.tar.gz
An old proposal from Martin, append to COL_PROTO the name taken from a matching DTD (in case the media-type actually matches it). Having the name of the root element found would be nicer.
svn path=/trunk/; revision=22483
-rw-r--r--dtds/presence.dtd3
-rw-r--r--epan/dissectors/packet-xml.c13
2 files changed, 11 insertions, 5 deletions
diff --git a/dtds/presence.dtd b/dtds/presence.dtd
index 49c4543451..4e5c42b662 100644
--- a/dtds/presence.dtd
+++ b/dtds/presence.dtd
@@ -1,9 +1,10 @@
<? wireshark:protocol
proto_name="presence"
description="presence XML doc (RFC 3863)"
+ media="application/cpim-pidf+xml"
hierarchy="yes" ?>
<!--
-$Id:$
+$Id$
-->
diff --git a/epan/dissectors/packet-xml.c b/epan/dissectors/packet-xml.c
index fceb4be553..6d9a14a052 100644
--- a/epan/dissectors/packet-xml.c
+++ b/epan/dissectors/packet-xml.c
@@ -182,10 +182,8 @@ dissect_xml(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvbparse_elem_t* tok = NULL;
static GPtrArray* stack = NULL;
xml_frame_t* current_frame;
-
- if (check_col(pinfo->cinfo, COL_PROTOCOL))
- col_append_str(pinfo->cinfo, COL_PROTOCOL, "/XML");
-
+ char* colinfo_str;
+
if(!tree) return;
if (stack != NULL)
@@ -205,8 +203,15 @@ dissect_xml(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (! root_ns ) {
root_ns = &xml_ns;
+ colinfo_str = "/XML";
+ } else {
+ colinfo_str = ep_strdup_printf("/%s",root_ns->name);
+ g_strup(colinfo_str);
}
+ if (check_col(pinfo->cinfo, COL_PROTOCOL))
+ col_append_str(pinfo->cinfo, COL_PROTOCOL, colinfo_str);
+
current_frame->ns = root_ns;
current_frame->item = proto_tree_add_item(tree,current_frame->ns->hf_tag,tvb,0,-1,FALSE);