3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
7 * SPDX-License-Identifier: GPL-2.0-or-later
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
;
26 dissect_mime_encap(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
29 heur_dtbl_entry_t
*hdtbl_entry
;
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
);
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
);
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
67 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
68 * :indentSize=8:tabSize=8:noTabs=false: