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 <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10#pragma once
11#include <ws_diag_control.h>
12#include <ws_symbol_export.h>
13#include <wsutil/nstime.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif /* __cplusplus */
18
19typedef struct wtap_rec wtap_rec;
20struct _packet_info;
21struct epan_session;
22
23#define PINFO_FD_VISITED(pinfo) ((pinfo)->fd->visited)
24
43
44
59struct _color_filter; /* Forward */
60DIAG_OFF_PEDANTIC
61
63typedef struct _frame_data {
64 uint32_t num;
65 uint32_t dis_num;
66 uint32_t pkt_len;
67 uint32_t cap_len;
68 int64_t 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;
75 uint32_t cum_bytes;
76 /* XXX - cum_bytes presumably ought to be 64-bit as well now */
78 /* Keep the bitfields below to 24 bits, so this plus the previous field
79 are 32 bits. (XXX - The previous field could be a bitfield too.) */
80 unsigned int passed_dfilter : 1;
81 unsigned int dependent_of_displayed : 1;
82 /* Do NOT use packet_char_enc enum here: MSVC compiler does not handle an enum in a bit field properly */
83 unsigned int encoding : 1;
84 unsigned int visited : 1;
85 unsigned int marked : 1;
86 unsigned int ref_time : 1;
87 unsigned int ignored : 1;
88 unsigned int has_ts : 1;
89 unsigned int has_modified_block : 1;
90 unsigned int need_colorize : 1;
91 unsigned int tsprec : 4;
94 uint32_t frame_ref_num;
95 /* frame_ref_num == num if ref_time == true, but also if this is the first
96 * record that has_ts (or if somehow a record without a TS is a reference
97 * time frame, the first frame after that with has_ts == true.) */
98 uint32_t prev_dis_num;
103DIAG_ON_PEDANTIC
104
112WS_DLL_PUBLIC int frame_data_compare(const struct epan_session *epan, const frame_data *fdata1, const frame_data *fdata2, int field);
113
119WS_DLL_PUBLIC void frame_data_reset(frame_data *fdata);
120
126WS_DLL_PUBLIC void frame_data_destroy(frame_data *fdata);
127
133WS_DLL_PUBLIC void frame_data_aggregation_free(frame_data *fdata);
134
144WS_DLL_PUBLIC void frame_data_init(frame_data *fdata, uint32_t num,
145 const wtap_rec *rec, int64_t offset,
146 uint32_t cum_bytes);
147
156extern bool frame_rel_first_frame_time(const struct epan_session *epan,
157 const frame_data *fdata,
158 nstime_t *delta);
159
168extern bool frame_rel_time(const struct epan_session *epan,
169 const frame_data *fdata, nstime_t *delta);
170
179extern bool frame_rel_start_time(const struct epan_session *epan,
180 const frame_data *fdata, nstime_t *delta);
181
190extern bool frame_delta_time_prev_captured(const struct epan_session *epan,
191 const frame_data *fdata,
192 nstime_t *delta);
193
202extern bool frame_delta_time_prev_displayed(const struct epan_session *epan,
203 const frame_data *fdata,
204 nstime_t *delta);
205
216WS_DLL_PUBLIC void frame_data_set_before_dissect(frame_data *fdata,
217 nstime_t *elapsed_time,
218 const frame_data **frame_ref,
219 const frame_data *prev_dis);
220
228WS_DLL_PUBLIC void frame_data_set_after_dissect(frame_data *fdata,
229 uint32_t *cum_bytes);
230
233#ifdef __cplusplus
234}
235#endif /* __cplusplus */
236
237/*
238 * Editor modelines - https://www.wireshark.org/tools/modelines.html
239 *
240 * Local variables:
241 * c-basic-offset: 2
242 * tab-width: 8
243 * indent-tabs-mode: nil
244 * End:
245 *
246 * vi: set shiftwidth=2 tabstop=8 expandtab:
247 * :indentSize=2:tabSize=8:noTabs=true:
248 */
WS_DLL_PUBLIC void frame_data_set_after_dissect(frame_data *fdata, uint32_t *cum_bytes)
Set frame_data fields after dissection.
Definition frame_data.c:428
WS_DLL_PUBLIC void frame_data_aggregation_free(frame_data *fdata)
Free the aggregation data associated with a frame_data struct.
Definition frame_data.c:469
WS_DLL_PUBLIC void frame_data_destroy(frame_data *fdata)
Free all resources owned by a frame_data struct.
Definition frame_data.c:454
WS_DLL_PUBLIC void frame_data_init(frame_data *fdata, uint32_t num, const wtap_rec *rec, int64_t offset, uint32_t cum_bytes)
Initialize a frame_data struct for a newly read frame.
Definition frame_data.c:301
bool frame_rel_start_time(const struct epan_session *epan, const frame_data *fdata, nstime_t *delta)
Compute the time delta from the first displayed frame to this frame.
Definition frame_data.c:136
bool frame_delta_time_prev_displayed(const struct epan_session *epan, const frame_data *fdata, nstime_t *delta)
Compute the time delta from the previous displayed frame to this frame.
Definition frame_data.c:216
packet_char_enc
Types of character encodings.
Definition frame_data.h:39
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)
Set frame_data fields before dissection.
Definition frame_data.c:381
bool frame_rel_first_frame_time(const struct epan_session *epan, const frame_data *fdata, nstime_t *delta)
Compute the time delta from the first frame to this frame.
Definition frame_data.c:113
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)
Compare two frame_data structs by a given field.
Definition frame_data.c:236
bool frame_rel_time(const struct epan_session *epan, const frame_data *fdata, nstime_t *delta)
Compute the time delta from the capture start to this frame.
Definition frame_data.c:123
WS_DLL_PUBLIC void frame_data_reset(frame_data *fdata)
Reset a frame_data struct to its initial state without freeing it.
Definition frame_data.c:446
bool frame_delta_time_prev_captured(const struct epan_session *epan, const frame_data *fdata, nstime_t *delta)
Compute the time delta from the previous captured frame to this frame.
Definition frame_data.c:194
DIAG_OFF_PEDANTIC struct _frame_data frame_data
Frame data structure.
@ PACKET_CHAR_ENC_CHAR_EBCDIC
Definition frame_data.h:41
@ PACKET_CHAR_ENC_CHAR_ASCII
Definition frame_data.h:40
Data for a color filter.
Definition color_filters.h:34
Frame data structure.
Definition frame_data.h:63
GHashTable * dependent_frames
Definition frame_data.h:73
unsigned int passed_dfilter
Definition frame_data.h:80
uint32_t pkt_len
Definition frame_data.h:66
uint32_t prev_dis_num
Definition frame_data.h:98
nstime_t shift_offset
Definition frame_data.h:93
unsigned int need_colorize
Definition frame_data.h:90
uint32_t dis_num
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:81
unsigned int marked
Definition frame_data.h:85
uint8_t tcp_snd_manual_analysis
Definition frame_data.h:77
gchar * aggregation_key
Definition frame_data.h:99
int64_t file_off
Definition frame_data.h:68
uint32_t num
Definition frame_data.h:64
unsigned int visited
Definition frame_data.h:84
uint32_t frame_ref_num
Definition frame_data.h:94
uint32_t cap_len
Definition frame_data.h:67
unsigned int has_ts
Definition frame_data.h:88
bool aggregated
Definition frame_data.h:100
unsigned int tsprec
Definition frame_data.h:91
unsigned int ignored
Definition frame_data.h:87
unsigned int encoding
Definition frame_data.h:83
uint32_t cum_bytes
Definition frame_data.h:75
unsigned int ref_time
Definition frame_data.h:86
nstime_t abs_ts
Definition frame_data.h:92
Represents the metadata and indexing information for a single captured frame.
Definition packet_info.h:43
Definition epan.c:532
Definition nstime.h:26
Definition wtap.h:1540