2011-06-09 21:21:06 +00:00
|
|
|
/* packet-mime-encap.c
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998
|
|
|
|
*
|
2018-02-12 11:23:27 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2011-06-09 21:21:06 +00:00
|
|
|
*/
|
|
|
|
|
2012-09-20 02:03:38 +00:00
|
|
|
#include "config.h"
|
2011-06-09 21:21:06 +00:00
|
|
|
|
|
|
|
#include <epan/packet.h>
|
|
|
|
|
2013-12-31 23:47:24 +00:00
|
|
|
#include <wiretap/wtap.h>
|
2013-07-14 08:41:04 +00:00
|
|
|
|
2013-12-14 16:09:57 +00:00
|
|
|
void proto_register_mime_encap(void);
|
|
|
|
void proto_reg_handoff_mime_encap(void);
|
|
|
|
|
2011-06-09 21:21:06 +00:00
|
|
|
static int proto_mime_encap = -1;
|
|
|
|
|
2016-12-17 01:06:11 +00:00
|
|
|
static dissector_handle_t mime_encap_handle;
|
|
|
|
|
2011-06-09 21:21:06 +00:00
|
|
|
static heur_dissector_list_t heur_subdissector_list;
|
|
|
|
|
2015-11-14 01:18:34 +00:00
|
|
|
static int
|
|
|
|
dissect_mime_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
|
2011-06-09 21:21:06 +00:00
|
|
|
{
|
|
|
|
proto_item* item;
|
2014-05-20 10:54:20 +00:00
|
|
|
heur_dtbl_entry_t *hdtbl_entry;
|
2011-06-09 21:21:06 +00:00
|
|
|
|
2011-06-09 21:37:19 +00:00
|
|
|
/* XXX, COL_INFO */
|
|
|
|
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MIME_FILE");
|
2011-10-21 02:10:19 +00:00
|
|
|
item = proto_tree_add_item(tree, proto_mime_encap, tvb, 0, -1, ENC_NA);
|
2011-06-09 21:21:06 +00:00
|
|
|
|
2014-05-20 10:54:20 +00:00
|
|
|
if (!dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree, &hdtbl_entry, NULL)) {
|
2013-12-31 23:47:24 +00:00
|
|
|
proto_item_append_text(item, " (Unhandled)");
|
2016-03-20 00:33:14 +00:00
|
|
|
call_data_dissector(tvb, pinfo, tree);
|
2011-06-09 21:21:06 +00:00
|
|
|
}
|
2015-11-14 01:18:34 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2011-06-09 21:21:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_mime_encap(void)
|
|
|
|
{
|
|
|
|
proto_mime_encap = proto_register_protocol("MIME file", "MIME_FILE", "mime_dlt");
|
2011-06-09 22:42:44 +00:00
|
|
|
|
2016-12-17 01:06:11 +00:00
|
|
|
mime_encap_handle = register_dissector("mime_dlt", dissect_mime_encap, proto_mime_encap);
|
2016-03-13 11:51:45 +00:00
|
|
|
heur_subdissector_list = register_heur_dissector_list("wtap_file", proto_mime_encap);
|
2011-06-09 21:21:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_mime_encap(void)
|
|
|
|
{
|
|
|
|
dissector_add_uint("wtap_encap", WTAP_ENCAP_MIME, mime_encap_handle);
|
|
|
|
}
|
2014-09-30 23:12:26 +00:00
|
|
|
|
|
|
|
/*
|
2019-07-26 18:43:17 +00:00
|
|
|
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
2014-09-30 23:12:26 +00:00
|
|
|
*
|
|
|
|
* Local variables:
|
|
|
|
* c-basic-offset: 8
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: t
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
|
|
|
|
* :indentSize=8:tabSize=8:noTabs=false:
|
|
|
|
*/
|