Coverage Report

Created: 2026-05-14 06:28

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-mime-encap.c
Line
Count
Source
1
/* packet-mime-encap.c
2
 *
3
 * Wireshark - Network traffic analyzer
4
 * By Gerald Combs <gerald@wireshark.org>
5
 * Copyright 1998
6
 *
7
 * SPDX-License-Identifier: GPL-2.0-or-later
8
 */
9
10
#include "config.h"
11
12
#include <epan/packet.h>
13
14
#include <wiretap/wtap.h>
15
16
void proto_register_mime_encap(void);
17
void proto_reg_handoff_mime_encap(void);
18
19
static int proto_mime_encap;
20
21
static dissector_handle_t mime_encap_handle;
22
23
static heur_dissector_list_t heur_subdissector_list;
24
25
static int
26
dissect_mime_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
27
0
{
28
0
  proto_item* item;
29
0
  heur_dtbl_entry_t *hdtbl_entry;
30
31
  /* XXX, COL_INFO */
32
33
0
  col_set_str(pinfo->cinfo, COL_PROTOCOL, "MIME_FILE");
34
0
  item = proto_tree_add_item(tree, proto_mime_encap, tvb, 0, -1, ENC_NA);
35
36
0
  if (!dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree, &hdtbl_entry, NULL)) {
37
0
    proto_item_append_text(item, " (Unhandled)");
38
0
    call_data_dissector(tvb, pinfo, tree);
39
0
  }
40
0
  return tvb_captured_length(tvb);
41
0
}
42
43
void
44
proto_register_mime_encap(void)
45
15
{
46
15
  proto_mime_encap = proto_register_protocol("MIME file", "MIME_FILE", "mime_dlt");
47
48
15
  mime_encap_handle = register_dissector("mime_dlt", dissect_mime_encap, proto_mime_encap);
49
15
  heur_subdissector_list = register_heur_dissector_list_with_description("wtap_file", "MIME file", proto_mime_encap);
50
15
}
51
52
void
53
proto_reg_handoff_mime_encap(void)
54
15
{
55
15
  dissector_add_uint("wtap_encap", WTAP_ENCAP_MIME, mime_encap_handle);
56
15
}
57
58
/*
59
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
60
 *
61
 * Local variables:
62
 * c-basic-offset: 8
63
 * tab-width: 8
64
 * indent-tabs-mode: t
65
 * End:
66
 *
67
 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
68
 * :indentSize=8:tabSize=8:noTabs=false:
69
 */