aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-daap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-01-30 21:49:33 +0000
committerGuy Harris <guy@alum.mit.edu>2013-01-30 21:49:33 +0000
commita4714f643a8de3b771e22274f4f5ebd5fe148894 (patch)
tree590e4321c7ce7b9075151122760750d3fb2df864 /epan/dissectors/packet-daap.c
parent8499f78705767d6df3c3fb332e9de0bd436ae3df (diff)
downloadwireshark-a4714f643a8de3b771e22274f4f5ebd5fe148894.tar.gz
wireshark-a4714f643a8de3b771e22274f4f5ebd5fe148894.tar.bz2
wireshark-a4714f643a8de3b771e22274f4f5ebd5fe148894.zip
Add a routine to allow dissectors to specify ports that carry HTTP
traffic *without* claiming all that traffic for themselves; they might want, instead, to register for a particular media type. Not all traffic to or from port 3689 is DAAP - not even traffic between two Apple machines doing media stuff (e.g., some FairPlay traffic isn't). Register for the media type application/x-dmap-tagged, and just say port 3689 is HTTP. This means we can get rid of the FPLY hack, as that traffic is application/octet-stream. Update some comments. Leave it up to the DAAP dissector to tag traffic as DAAP in the protocol column. svn path=/trunk/; revision=47376
Diffstat (limited to 'epan/dissectors/packet-daap.c')
-rw-r--r--epan/dissectors/packet-daap.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/epan/dissectors/packet-daap.c b/epan/dissectors/packet-daap.c
index a32c50af79..e264dba623 100644
--- a/epan/dissectors/packet-daap.c
+++ b/epan/dissectors/packet-daap.c
@@ -206,7 +206,6 @@
#define dacp_canp 0x63616e70
#define daap_png 0x89504e47
-#define daap_FPLY 0x46504c59
/* date/time */
/* TODO:
#define daap_mstc 0xMMSSTTCC utctime
@@ -325,7 +324,6 @@ static const value_string vals_tag_code[] = {
{ dacp_cmsr, "status revision" },
{ dacp_cmst, "control container" },
{ dacp_cmvo, "volume" },
- { daap_FPLY, "FairPlay negotiation" },
{ daap_mbcl, "bag (mbcl)" },
{ daap_mccr, "content codes response" },
{ daap_mcna, "content codes name" },
@@ -393,21 +391,27 @@ dissect_daap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item *ti;
proto_tree *daap_tree;
guint first_tag = 0;
+ /*
+ * XXX - we now go by media type rather than TCP port,
+ * so is there another way to determine whether this
+ * is a request or response?
+ */
gboolean is_request = (pinfo->destport == TCP_PORT_DAAP);
first_tag = tvb_get_ntohl(tvb, 0);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "DAAP");
- /* This catches album art coming back from iTunes */
+ /*
+ * This catches album art coming back from iTunes.
+ * XXX - will those have a media type of image/png
+ * rather than application/x-dmap-tagged? If so,
+ * this is no longer necessary.
+ */
if (first_tag == daap_png) {
call_dissector(png_handle, tvb, pinfo, tree);
return;
}
- /*
- * XXX - what if the body is gzipped? This isn't the only protocol
- * running atop HTTP that might have a problem with that....
- */
if (is_request) {
col_set_str(pinfo->cinfo, COL_INFO, "DAAP Request");
} else {
@@ -415,26 +419,15 @@ dissect_daap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* functions fail, at least something will be in the info column
*/
col_set_str(pinfo->cinfo, COL_INFO, "DAAP Response");
- /* This catches FairPlay negotiation */
- if (first_tag == daap_FPLY) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " [first tag: %s]",
- tvb_format_text(tvb, 0, 4));
- } else {
- col_append_fstr(pinfo->cinfo, COL_INFO, " [first tag: %s, size: %d]",
- tvb_format_text(tvb, 0, 4),
- tvb_get_ntohl(tvb, 4));
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " [first tag: %s, size: %d]",
+ tvb_format_text(tvb, 0, 4),
+ tvb_get_ntohl(tvb, 4));
}
if (tree) {
ti = proto_tree_add_item(tree, proto_daap, tvb, 0, -1, ENC_NA);
daap_tree = proto_item_add_subtree(ti, ett_daap);
- /* This catches FairPlay negotiation */
- if (first_tag == daap_FPLY) {
- proto_tree_add_item(tree, hf_daap_name, tvb, 0, 4, ENC_ASCII|ENC_NA);
- proto_tree_add_text(tree, tvb, 4, -1, "FPLY data");
- } else
- dissect_daap_one_tag(daap_tree, tvb);
+ dissect_daap_one_tag(daap_tree, tvb);
}
}
@@ -751,7 +744,8 @@ proto_reg_handoff_daap(void)
dissector_handle_t daap_handle;
daap_handle = create_dissector_handle(dissect_daap, proto_daap);
- http_dissector_add(TCP_PORT_DAAP, daap_handle);
+ http_port_add(TCP_PORT_DAAP);
+ dissector_add_string("media_type", "application/x-dmap-tagged", daap_handle);
png_handle = find_dissector("png");
}