Wireshark  4.3.0
The Wireshark network protocol analyzer
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;
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  guint32 option_code, guint32 option_length,
32  guint 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;
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(guint32 block_number, local_block_callback_info_t *info);
45 
46 
47 /* Can be called by local block type dissectors block dissector callback */
48 gint dissect_options(proto_tree *tree, packet_info *pinfo,
49  guint32 block_type, tvbuff_t *tvb, int offset, guint encoding,
50  void *user_data);
51 
52 
53 
54 /* Used by custom dissector */
55 
56 /* File info */
57 struct info {
58  guint32 block_number;
59  guint32 section_number;
60  guint32 interface_number;
61  guint32 darwin_process_event_number;
62  guint32 frame_number;
63  guint encoding;
64  wmem_array_t *interfaces;
65  wmem_array_t *darwin_process_events;
66 };
67 
69  guint32 link_type;
70  guint32 snap_len;
71  guint64 timestamp_resolution;
72  guint64 timestamp_offset;
73 };
74 
76  guint32 process_id;
77 };
78 
79 /* Dissect one PCAPNG Block */
80 extern gint dissect_block(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, struct info *info);
81 
82 #endif
struct dissect_options_tag dissect_options
Definition: packet_info.h:44
Definition: proto.h:904
Definition: value_string.h:26
Definition: wmem_array.c:27
Definition: file-pcapng.h:17
Definition: file-pcapng.h:75
Definition: file-pcapng.h:57
Definition: file-pcapng.h:68
Definition: file-pcapng.h:34
Definition: tvbuff-int.h:35