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;
83 /* Keep the bitfields below to 24 bits, so this plus the previous field
84 are 32 bits. (XXX - The previous field could be a bitfield too.) */
85 unsigned int passed_dfilter : 1;
86 unsigned int dependent_of_displayed : 1;
87 /* Do NOT use packet_char_enc enum here: MSVC compiler does not handle an enum in a bit field properly */
88 unsigned int encoding : 1;
89 unsigned int visited : 1;
90 unsigned int marked : 1;
91 unsigned int ref_time : 1;
92 unsigned int ignored : 1;
93 unsigned int has_ts : 1;
94 unsigned int has_modified_block : 1;
95 unsigned int need_colorize : 1;
96 unsigned int tsprec : 4;
99 uint32_t frame_ref_num;
100 uint32_t prev_dis_num;
102} frame_data;
103DIAG_ON_PEDANTIC
104
106WS_DLL_PUBLIC int frame_data_compare(const struct epan_session *epan, const frame_data *fdata1, const frame_data *fdata2, int field);
107
109WS_DLL_PUBLIC int frame_data_aggregation_compare(const frame_data* fdata1, const frame_data* fdata2);
110
111WS_DLL_PUBLIC void frame_data_reset(frame_data *fdata);
112
113WS_DLL_PUBLIC void frame_data_destroy(frame_data *fdata);
114
115WS_DLL_PUBLIC void free_aggregation_key(gpointer key);
116
117WS_DLL_PUBLIC void frame_data_aggregation_free(frame_data *fdata);
118
119WS_DLL_PUBLIC void frame_data_init(frame_data *fdata, uint32_t num,
120 const wtap_rec *rec, int64_t offset,
121 uint32_t cum_bytes);
122
123extern bool frame_rel_first_frame_time(const struct epan_session *epan,
124 const frame_data *fdata,
125 nstime_t *delta);
126
127extern bool frame_rel_time(const struct epan_session *epan,
128 const frame_data *fdata, nstime_t *delta);
129
130extern bool frame_delta_time_prev_captured(const struct epan_session *epan,
131 const frame_data *fdata,
132 nstime_t *delta);
133
134extern bool frame_delta_time_prev_displayed(const struct epan_session *epan,
135 const frame_data *fdata,
136 nstime_t *delta);
137
141WS_DLL_PUBLIC void frame_data_set_before_dissect(frame_data *fdata,
142 nstime_t *elapsed_time,
143 const frame_data **frame_ref,
144 const frame_data *prev_dis);
145
146WS_DLL_PUBLIC void frame_data_set_after_dissect(frame_data *fdata,
147 uint32_t *cum_bytes);
148
151#ifdef __cplusplus
152}
153#endif /* __cplusplus */
154
155#endif /* __FRAME_DATA__ */
156
157/*
158 * Editor modelines - https://www.wireshark.org/tools/modelines.html
159 *
160 * Local variables:
161 * c-basic-offset: 2
162 * tab-width: 8
163 * indent-tabs-mode: nil
164 * End:
165 *
166 * vi: set shiftwidth=2 tabstop=8 expandtab:
167 * :indentSize=2:tabSize=8:noTabs=true:
168 */
WS_DLL_PUBLIC int frame_data_aggregation_compare(const frame_data *fdata1, const frame_data *fdata2)
Definition frame_data.c:288
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:387
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:226
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:85
uint32_t pkt_len
Definition frame_data.h:72
uint32_t prev_dis_num
Definition frame_data.h:100
nstime_t shift_offset
Definition frame_data.h:98
unsigned int need_colorize
Definition frame_data.h:95
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:86
unsigned int marked
Definition frame_data.h:90
uint8_t tcp_snd_manual_analysis
Definition frame_data.h:82
int64_t file_off
Definition frame_data.h:74
GSList * aggregation_keys
Definition frame_data.h:101
uint32_t num
Definition frame_data.h:70
unsigned int visited
Definition frame_data.h:89
uint32_t frame_ref_num
Definition frame_data.h:99
uint32_t cap_len
Definition frame_data.h:73
unsigned int has_ts
Definition frame_data.h:93
unsigned int tsprec
Definition frame_data.h:96
unsigned int ignored
Definition frame_data.h:92
unsigned int encoding
Definition frame_data.h:88
uint32_t cum_bytes
Definition frame_data.h:81
unsigned int ref_time
Definition frame_data.h:91
nstime_t abs_ts
Definition frame_data.h:97
Definition packet_info.h:43
Definition epan.c:475
Definition nstime.h:26
Definition wtap.h:1425