2 * Dissector to handle pcapng file-type-specific blocks.
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
13 #include <epan/packet.h>
15 #include <wiretap/wtap.h>
17 void proto_register_pcapng_block(void);
18 void proto_reg_handoff_pcapng_block(void);
20 static dissector_handle_t pcapng_block_handle
;
22 static int proto_pcapng_block
;
24 static dissector_table_t pcapng_block_type_dissector_table
;
27 dissect_pcapng_block(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
30 * Call the dissector for the block type of this block, if there
33 if (!dissector_try_uint(pcapng_block_type_dissector_table
,
34 pinfo
->rec
->rec_header
.ft_specific_header
.record_type
, tvb
, pinfo
, tree
)) {
36 * There isn't one; just do a minimal display.
38 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "PCAPNG");
39 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "Pcapng block, type %u",
40 pinfo
->rec
->rec_header
.ft_specific_header
.record_type
);
42 proto_tree_add_item(tree
, proto_pcapng_block
, tvb
, 0, -1, ENC_NA
);
44 return tvb_captured_length(tvb
);
47 void proto_register_pcapng_block(void)
49 proto_pcapng_block
= proto_register_protocol("Pcapng block", "PCAPNG", "pcapng");
50 pcapng_block_type_dissector_table
= register_dissector_table("pcapng.block_type",
51 "pcapng block type", proto_pcapng_block
, FT_UINT32
, BASE_DEC
);
53 pcapng_block_handle
= register_dissector("pcapng", dissect_pcapng_block
,
58 proto_reg_handoff_pcapng_block(void)
60 dissector_add_uint("wtap_fts_rec", wtap_pcapng_file_type_subtype(),
65 * Editor modelines - https://www.wireshark.org/tools/modelines.html
73 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
74 * :indentSize=8:tabSize=8:noTabs=false: