aboutsummaryrefslogtreecommitdiffstats
path: root/packet-multipart.c
diff options
context:
space:
mode:
authorOlivier Biot <obiot.ethereal@gmail.com>2004-02-06 01:07:51 +0000
committerOlivier Biot <obiot.ethereal@gmail.com>2004-02-06 01:07:51 +0000
commitca5a28560dd568d44c8b1c071f8d6ea077f32e51 (patch)
treefdd313499fcf5b7fec0517420fca63e705b23d4b /packet-multipart.c
parentf3a4c61c9333aa0e5390f16eb3b6762d19d8b1f5 (diff)
Add a new dissector table for multipart media encpsulation (similar to the
"media_type" dissector table defined in the HTTP dissector), allowing us to make the distinction between dissecting a standaone media type and an encapsulated media type (e.g., encapsulated in a multipart entity). Provide separate dissectors for "standalone" and "encapsulated" MMSE, hence fixing the needlessly clearing of the Info column when the MMSE is only part of the encapsulated entity (e.g., in the PAP protocol for WAP Push). svn path=/trunk/; revision=9988
Diffstat (limited to 'packet-multipart.c')
-rwxr-xr-xpacket-multipart.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/packet-multipart.c b/packet-multipart.c
index 7f561da500..75de2696ba 100755
--- a/packet-multipart.c
+++ b/packet-multipart.c
@@ -3,7 +3,7 @@
* Copyright 2004, Anders Broman <anders.broman[at]ericsson.com>
* Copyright 2004, Olivier Biot <olivier.biot[at]siemens.com>
*
- * $Id: packet-multipart.c,v 1.5 2004/01/22 23:47:59 obiot Exp $
+ * $Id: packet-multipart.c,v 1.6 2004/02/06 01:07:51 obiot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -70,6 +70,9 @@
#include <epan/packet.h>
+/* Dissector table for media requiring special attention in multipart
+ * encapsulation. */
+static dissector_table_t multipart_media_subdissector_table;
/* Initialize the protocol and registered fields */
static int proto_multipart = -1;
@@ -633,8 +636,18 @@ process_body_part(proto_tree *tree, tvbuff_t *tvb, const guint8 *boundary,
gboolean dissected;
pinfo->private_data = parameters;
- dissected = dissector_try_string(media_type_dissector_table,
+ /*
+ * First try the dedicated multipart dissector table
+ */
+ dissected = dissector_try_string(multipart_media_subdissector_table,
+ content_type_str, tmp_tvb, pinfo, subtree);
+ if (! dissected) {
+ /*
+ * Fall back to the default media dissector table
+ */
+ dissected = dissector_try_string(media_type_dissector_table,
content_type_str, tmp_tvb, pinfo, subtree);
+ }
pinfo->private_data = save_private_data;
g_free(content_type_str);
content_type_str = NULL;
@@ -868,6 +881,17 @@ proto_register_multipart(void)
"Display multipart bodies with no media type dissector"
" as raw text (may cause problems with binary data).",
&display_unknown_body_as_text);
+
+ /*
+ * Dissectors requiring different behavior in cases where the media
+ * is contained in a multipart entity should register their multipart
+ * dissector in the dissector table below, which is similar to the
+ * "media_type" dissector table defined in the HTTP dissector code.
+ */
+ multipart_media_subdissector_table = register_dissector_table(
+ "multipart_media_type",
+ "Internet media type (for multipart processing)",
+ FT_STRING, BASE_NONE);
}