Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
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
19extern "C" {
20#endif /* __cplusplus */
21
22typedef struct wtap_rec wtap_rec;
23struct _packet_info;
24struct epan_session;
25
26#define PINFO_FD_VISITED(pinfo) ((pinfo)->fd->visited)
27
41/* Types of character encodings */
42typedef enum {
43 PACKET_CHAR_ENC_CHAR_ASCII = 0, /* ASCII */
44 PACKET_CHAR_ENC_CHAR_EBCDIC = 1 /* EBCDIC */
46
47typedef struct _aggregation_key {
48 gchar* field;
49 GSList* values;
50 int values_num;
52
67struct _color_filter; /* Forward */
68DIAG_OFF_PEDANTIC
69typedef struct _frame_data {
70 uint32_t num;
71 uint32_t dis_num;
72 uint32_t pkt_len;
73 uint32_t cap_len;
74 int64_t file_off;
75 /* These two are pointers, meaning 64-bit on LP64 (64-bit UN*X) and
76 LLP64 (64-bit Windows) platforms. Put them here, one after the
77 other, so they don't require padding between them. */
78 GSList *pfd;
79 GHashTable *dependent_frames;
81 uint32_t cum_bytes;
82 /* XXX - cum_bytes presumably ought to be 64-bit as well now */
84 /* Keep the bitfields below to 24 bits, so this plus the previous field
85 are 32 bits. (XXX - The previous field could be a bitfield too.) */
86 unsigned int passed_dfilter : 1;
87 unsigned int dependent_of_displayed : 1;
88 /* Do NOT use packet_char_enc enum here: MSVC compiler does not handle an enum in a bit field properly */
89 unsigned int encoding : 1;
90 unsigned int visited : 1;
91 unsigned int marked : 1;
92 unsigned int ref_time : 1;
93 unsigned int ignored : 1;
94 unsigned int has_ts : 1;
95 unsigned int has_modified_block : 1;
96 unsigned int need_colorize : 1;
97 unsigned int tsprec : 4;
100 uint32_t frame_ref_num;
101 /* frame_ref_num == num if ref_time == true, but also if this is the first
102 * record that has_ts (or if somehow a record without a TS is a reference
103 * time frame, the first frame after that with has_ts == true.) */
104 uint32_t prev_dis_num;
106} frame_data;
107DIAG_ON_PEDANTIC
108
110WS_DLL_PUBLIC int frame_data_compare(const struct epan_session *epan, const frame_data *fdata1, const frame_data *fdata2, int field);
111
113WS_DLL_PUBLIC int frame_data_aggregation_compare(const frame_data* fdata1, const frame_data* fdata2);
114
115WS_DLL_PUBLIC void frame_data_reset(frame_data *fdata);
116
117WS_DLL_PUBLIC void frame_data_destroy(frame_data *fdata);
118
119WS_DLL_PUBLIC void free_aggregation_key(gpointer key);
120
121WS_DLL_PUBLIC void frame_data_aggregation_free(frame_data *fdata);
122
123WS_DLL_PUBLIC void frame_data_init(frame_data *fdata, uint32_t num,
124 const wtap_rec *rec, int64_t offset,
125 uint32_t cum_bytes);
126
127extern bool frame_rel_first_frame_time(const struct epan_session *epan,
128 const frame_data *fdata,
129 nstime_t *delta);
130
131extern bool frame_rel_time(const struct epan_session *epan,
132 const frame_data *fdata, nstime_t *delta);
133
134extern bool frame_rel_start_time(const struct epan_session *epan,
135 const frame_data *fdata, nstime_t *delta);
136
137extern bool frame_delta_time_prev_captured(const struct epan_session *epan,
138 const frame_data *fdata,
139 nstime_t *delta);
140
141extern bool frame_delta_time_prev_displayed(const struct epan_session *epan,
142 const frame_data *fdata,
143 nstime_t *delta);
144
148WS_DLL_PUBLIC void frame_data_set_before_dissect(frame_data *fdata,
149 nstime_t *elapsed_time,
150 const frame_data **frame_ref,
151 const frame_data *prev_dis);
152
153WS_DLL_PUBLIC void frame_data_set_after_dissect(frame_data *fdata,
154 uint32_t *cum_bytes);
155
158#ifdef __cplusplus
159}
160#endif /* __cplusplus */
161
162#endif /* __FRAME_DATA__ */
163
164/*
165 * Editor modelines - https://www.wireshark.org/tools/modelines.html
166 *
167 * Local variables:
168 * c-basic-offset: 2
169 * tab-width: 8
170 * indent-tabs-mode: nil
171 * End:
172 *
173 * vi: set shiftwidth=2 tabstop=8 expandtab:
174 * :indentSize=2:tabSize=8:noTabs=true:
175 */
WS_DLL_PUBLIC int frame_data_aggregation_compare(const frame_data *fdata1, const frame_data *fdata2)
Definition frame_data.c:335
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:434
DIAG_ON_PEDANTIC WS_DLL_PUBLIC int frame_data_compare(const struct epan_session *epan, const frame_data *fdata1, const frame_data *fdata2, int field)
Definition frame_data.c:270
Definition frame_data.h:47
Definition color_filters.h:33
Definition frame_data.h:69
GHashTable * dependent_frames
Definition frame_data.h:79
unsigned int passed_dfilter
Definition frame_data.h:86
uint32_t pkt_len
Definition frame_data.h:72
uint32_t prev_dis_num
Definition frame_data.h:104
nstime_t shift_offset
Definition frame_data.h:99
unsigned int need_colorize
Definition frame_data.h:96
uint32_t dis_num
Definition frame_data.h:71
GSList * pfd
Definition frame_data.h:78
const struct _color_filter * color_filter
Definition frame_data.h:80
unsigned int dependent_of_displayed
Definition frame_data.h:87
unsigned int marked
Definition frame_data.h:91
uint8_t tcp_snd_manual_analysis
Definition frame_data.h:83
int64_t file_off
Definition frame_data.h:74
GSList * aggregation_keys
Definition frame_data.h:105
uint32_t num
Definition frame_data.h:70
unsigned int visited
Definition frame_data.h:90
uint32_t frame_ref_num
Definition frame_data.h:100
uint32_t cap_len
Definition frame_data.h:73
unsigned int has_ts
Definition frame_data.h:94
unsigned int tsprec
Definition frame_data.h:97
unsigned int ignored
Definition frame_data.h:93
unsigned int encoding
Definition frame_data.h:89
uint32_t cum_bytes
Definition frame_data.h:81
unsigned int ref_time
Definition frame_data.h:92
nstime_t abs_ts
Definition frame_data.h:98
Definition packet_info.h:43
Definition epan.c:479
Definition nstime.h:26
Definition wtap.h:1442