2011-06-09 21:21:06 +00:00
|
|
|
/* packet-mime-encap.c
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
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
|
|
|
|
|
|
|
/*
|
|
|
|
* Editor modelines - http://www.wireshark.org/tools/modelines.html
|
|
|
|
*
|
|
|
|
* 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:
|
|
|
|
*/
|