| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
file-pcapng.h
1/* file-pcapng.h
2 *
3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
6 *
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
9
10
11#ifndef __FILE_PCAPNG_H__
12#define __FILE_PCAPNG_H__
13
14/*
15 * Structure to pass to block data dissectors.
16 */
17 typedef struct {
18 proto_item *block_item;
19 proto_tree *block_tree;
20 struct info *info;
21} block_data_arg;
22
23
24/* Callback for local block data dissection */
25 typedef void (local_block_dissect_t)(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, block_data_arg *argp);
26
27/* Callback for local block option dissection function */
28 typedef void (local_block_option_dissect_t)(proto_tree *option_tree, proto_item *option_item,
29 packet_info *pinfo, tvbuff_t *tvb, int offset,
30 int unknown_option_hf,
31 uint32_t option_code, uint32_t option_length,
32 unsigned encoding);
33
34 typedef struct {
35 const char* name;
36 local_block_dissect_t *dissector;
37 int option_root_hf;
38 const value_string *option_vals;
39 local_block_option_dissect_t *option_dissector;
40} local_block_callback_info_t;
41
42/* Routine for a local block dissector to register with main pcapng dissector.
43 * For an in-tree example, please see file-pcapng-darwin.c */
44 void register_pcapng_local_block_dissector(uint32_t block_number, local_block_callback_info_t *info);
45
46
47/* Can be called by local block type dissectors block dissector callback */
48 int dissect_options(proto_tree *tree, packet_info *pinfo,
49 uint32_t block_type, tvbuff_t *tvb, int offset, unsigned encoding,
50 void *user_data);
51
52
53
54/* PUBLIC_HEADER: This is used by custom dissectors and should be in the "install" target */
55
56/* File info */
57 struct info {
58 uint64_t block_offset;
59 uint32_t prev_block_length;
60 uint32_t block_number;
61 uint32_t section_number;
62 uint32_t interface_number;
63 uint32_t darwin_process_event_number;
64 uint32_t frame_number;
65 unsigned encoding;
66 wmem_array_t *interfaces;
67 wmem_array_t *darwin_process_events;
68};
69
70 struct interface_description {
71 uint32_t link_type;
72 uint32_t snap_len;
73 uint64_t timestamp_resolution;
74 uint64_t timestamp_offset;
75};
76
77 struct darwin_process_event_description {
78 uint32_t process_id;
79};
80
81/* Dissect one PCAPNG Block */
82 extern int dissect_block(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, struct info *info);
83
84#endif
dissect_options
struct dissect_options_tag dissect_options
_packet_info
Definition packet_info.h:43
_proto_node
Definition proto.h:905
_value_string
Mapping between a 32-bit integer value and its string representation.
Definition value_string.h:33
_wmem_array_t
Definition wmem_array.c:29
block_data_arg
Definition file-pcapng.h:17
darwin_process_event_description
Definition file-pcapng.h:77
info
Definition file-pcapng.h:57
interface_description
Definition file-pcapng.h:70
local_block_callback_info_t
Definition file-pcapng.h:34
tvbuff
Definition tvbuff-int.h:36