Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-mime-encap.c
blobf2ad9e35759641152ced4c477bea934f9c8c5cf0
1 /* packet-mime-encap.c
3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
10 #include "config.h"
12 #include <epan/packet.h>
14 #include <wiretap/wtap.h>
16 void proto_register_mime_encap(void);
17 void proto_reg_handoff_mime_encap(void);
19 static int proto_mime_encap;
21 static dissector_handle_t mime_encap_handle;
23 static heur_dissector_list_t heur_subdissector_list;
25 static int
26 dissect_mime_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
28 proto_item* item;
29 heur_dtbl_entry_t *hdtbl_entry;
31 /* XXX, COL_INFO */
33 col_set_str(pinfo->cinfo, COL_PROTOCOL, "MIME_FILE");
34 item = proto_tree_add_item(tree, proto_mime_encap, tvb, 0, -1, ENC_NA);
36 if (!dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree, &hdtbl_entry, NULL)) {
37 proto_item_append_text(item, " (Unhandled)");
38 call_data_dissector(tvb, pinfo, tree);
40 return tvb_captured_length(tvb);
43 void
44 proto_register_mime_encap(void)
46 proto_mime_encap = proto_register_protocol("MIME file", "MIME_FILE", "mime_dlt");
48 mime_encap_handle = register_dissector("mime_dlt", dissect_mime_encap, proto_mime_encap);
49 heur_subdissector_list = register_heur_dissector_list_with_description("wtap_file", "MIME file", proto_mime_encap);
52 void
53 proto_reg_handoff_mime_encap(void)
55 dissector_add_uint("wtap_encap", WTAP_ENCAP_MIME, mime_encap_handle);
59 * Editor modelines - https://www.wireshark.org/tools/modelines.html
61 * Local variables:
62 * c-basic-offset: 8
63 * tab-width: 8
64 * indent-tabs-mode: t
65 * End:
67 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
68 * :indentSize=8:tabSize=8:noTabs=false: