Wireshark  4.3.0
The Wireshark network protocol analyzer
frame_data.h
Go to the documentation of this file.
1 /* frame_data.h
2  * Definitions for frame_data structures and routines
3  *
4  * Wireshark - Network traffic analyzer
5  * By Gerald Combs <[email protected]>
6  * Copyright 1998 Gerald Combs
7  *
8  * SPDX-License-Identifier: GPL-2.0-or-later
9  */
10 
11 #ifndef __FRAME_DATA_H__
12 #define __FRAME_DATA_H__
13 
14 #include <ws_diag_control.h>
15 #include <ws_symbol_export.h>
16 #include <wsutil/nstime.h>
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif /* __cplusplus */
21 
22 typedef struct wtap_rec wtap_rec;
23 struct _packet_info;
24 struct epan_session;
25 
26 #define PINFO_FD_VISITED(pinfo) ((pinfo)->fd->visited)
27 
41 /* Types of character encodings */
42 typedef enum {
43  PACKET_CHAR_ENC_CHAR_ASCII = 0, /* ASCII */
44  PACKET_CHAR_ENC_CHAR_EBCDIC = 1 /* EBCDIC */
46 
61 struct _color_filter; /* Forward */
62 DIAG_OFF_PEDANTIC
63 typedef struct _frame_data {
64  guint32 num;
65  guint32 pkt_len;
66  guint32 cap_len;
67  guint32 cum_bytes;
68  gint64 file_off;
69  /* These two are pointers, meaning 64-bit on LP64 (64-bit UN*X) and
70  LLP64 (64-bit Windows) platforms. Put them here, one after the
71  other, so they don't require padding between them. */
72  GSList *pfd;
73  GHashTable *dependent_frames;
74  const struct _color_filter *color_filter;
76  /* Keep the bitfields below to 24 bits, so this plus the previous field
77  are 32 bits. (XXX - The previous field could be a bitfield too.) */
78  unsigned int passed_dfilter : 1;
79  unsigned int dependent_of_displayed : 1;
80  /* Do NOT use packet_char_enc enum here: MSVC compiler does not handle an enum in a bit field properly */
81  unsigned int encoding : 1;
82  unsigned int visited : 1;
83  unsigned int marked : 1;
84  unsigned int ref_time : 1;
85  unsigned int ignored : 1;
86  unsigned int has_ts : 1;
87  unsigned int has_modified_block : 1;
88  unsigned int need_colorize : 1;
89  unsigned int tsprec : 4;
92  guint32 frame_ref_num;
93  guint32 prev_dis_num;
94 } frame_data;
95 DIAG_ON_PEDANTIC
96 
98 WS_DLL_PUBLIC gint frame_data_compare(const struct epan_session *epan, const frame_data *fdata1, const frame_data *fdata2, int field);
99 
100 WS_DLL_PUBLIC void frame_data_reset(frame_data *fdata);
101 
102 WS_DLL_PUBLIC void frame_data_destroy(frame_data *fdata);
103 
104 WS_DLL_PUBLIC void frame_data_init(frame_data *fdata, guint32 num,
105  const wtap_rec *rec, gint64 offset,
106  guint32 cum_bytes);
107 
108 extern void frame_delta_abs_time(const struct epan_session *epan, const frame_data *fdata,
109  guint32 prev_num, nstime_t *delta);
113 WS_DLL_PUBLIC void frame_data_set_before_dissect(frame_data *fdata,
114  nstime_t *elapsed_time,
115  const frame_data **frame_ref,
116  const frame_data *prev_dis);
117 
118 WS_DLL_PUBLIC void frame_data_set_after_dissect(frame_data *fdata,
119  guint32 *cum_bytes);
120 
123 #ifdef __cplusplus
124 }
125 #endif /* __cplusplus */
126 
127 #endif /* __FRAME_DATA__ */
128 
129 /*
130  * Editor modelines - https://www.wireshark.org/tools/modelines.html
131  *
132  * Local variables:
133  * c-basic-offset: 2
134  * tab-width: 8
135  * indent-tabs-mode: nil
136  * End:
137  *
138  * vi: set shiftwidth=2 tabstop=8 expandtab:
139  * :indentSize=2:tabSize=8:noTabs=true:
140  */
packet_char_enc
Definition: frame_data.h:42
WS_DLL_PUBLIC void frame_data_set_before_dissect(frame_data *fdata, nstime_t *elapsed_time, const frame_data **frame_ref, const frame_data *prev_dis)
Definition: frame_data.c:241
DIAG_ON_PEDANTIC WS_DLL_PUBLIC gint frame_data_compare(const struct epan_session *epan, const frame_data *fdata1, const frame_data *fdata2, int field)
Definition: frame_data.c:96
Definition: color_filters.h:33
Definition: frame_data.h:63
GHashTable * dependent_frames
Definition: frame_data.h:73
unsigned int passed_dfilter
Definition: frame_data.h:78
guint32 frame_ref_num
Definition: frame_data.h:92
guint32 cap_len
Definition: frame_data.h:66
nstime_t shift_offset
Definition: frame_data.h:91
gint64 file_off
Definition: frame_data.h:68
unsigned int need_colorize
Definition: frame_data.h:88
guint32 prev_dis_num
Definition: frame_data.h:93
guint32 pkt_len
Definition: frame_data.h:65
GSList * pfd
Definition: frame_data.h:72
const struct _color_filter * color_filter
Definition: frame_data.h:74
unsigned int dependent_of_displayed
Definition: frame_data.h:79
unsigned int marked
Definition: frame_data.h:83
unsigned int visited
Definition: frame_data.h:82
guint8 tcp_snd_manual_analysis
Definition: frame_data.h:75
unsigned int has_ts
Definition: frame_data.h:86
unsigned int tsprec
Definition: frame_data.h:89
unsigned int ignored
Definition: frame_data.h:85
unsigned int encoding
Definition: frame_data.h:81
guint32 num
Definition: frame_data.h:64
guint32 cum_bytes
Definition: frame_data.h:67
unsigned int ref_time
Definition: frame_data.h:84
nstime_t abs_ts
Definition: frame_data.h:90
Definition: packet_info.h:44
Definition: epan.c:460
Definition: nstime.h:26
Definition: wtap.h:1395