2 * Definitions for frame_data structures and routines
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
11 #ifndef __FRAME_DATA_H__
12 #define __FRAME_DATA_H__
16 #endif /* __cplusplus */
18 #include <ws_diag_control.h>
19 #include <ws_symbol_export.h>
20 #include <wsutil/nstime.h>
22 #include <wiretap/wtap.h>
27 #define PINFO_FD_VISITED(pinfo) ((pinfo)->fd->flags.visited)
30 * Low-level frame data and metadata.
33 /** @defgroup framedata Frame Data
38 /** @todo XXX - some of this stuff is used only while a packet is being dissected;
39 should we keep that stuff in the "packet_info" structure, instead, to
42 /* Types of character encodings */
44 PACKET_CHAR_ENC_CHAR_ASCII = 0, /* ASCII */
45 PACKET_CHAR_ENC_CHAR_EBCDIC = 1 /* EBCDIC */
48 /** The frame number is the ordinal number of the frame in the capture, so
49 it's 1-origin. In various contexts, 0 as a frame number means "frame
51 struct _color_filter; /* Forward */
53 typedef struct _frame_data {
54 GSList *pfd; /**< Per frame proto data */
55 guint32 num; /**< Frame number */
56 guint32 pkt_len; /**< Packet length */
57 guint32 cap_len; /**< Amount actually captured */
58 guint32 cum_bytes; /**< Cumulative bytes into the capture */
59 gint64 file_off; /**< File offset */
60 guint16 subnum; /**< subframe number, for protocols that require this */
61 gint16 tsprec; /**< Time stamp precision */
63 unsigned int passed_dfilter : 1; /**< 1 = display, 0 = no display */
64 unsigned int dependent_of_displayed : 1; /**< 1 if a displayed frame depends on this frame */
65 /* Do NOT use packet_char_enc enum here: MSVC compiler does not handle an enum in a bit field properly */
66 unsigned int encoding : 1; /**< Character encoding (ASCII, EBCDIC...) */
67 unsigned int visited : 1; /**< Has this packet been visited yet? 1=Yes,0=No*/
68 unsigned int marked : 1; /**< 1 = marked by user, 0 = normal */
69 unsigned int ref_time : 1; /**< 1 = marked as a reference time frame, 0 = normal */
70 unsigned int ignored : 1; /**< 1 = ignore this frame, 0 = normal */
71 unsigned int has_ts : 1; /**< 1 = has time stamp, 0 = no time stamp */
72 unsigned int has_phdr_comment : 1; /** 1 = there's comment for this packet */
73 unsigned int has_user_comment : 1; /** 1 = user set (also deleted) comment for this packet */
74 unsigned int need_colorize : 1; /**< 1 = need to (re-)calculate packet color */
77 const struct _color_filter *color_filter; /**< Per-packet matching color_filter_t object */
79 nstime_t abs_ts; /**< Absolute timestamp */
80 nstime_t shift_offset; /**< How much the abs_tm of the frame is shifted */
81 guint32 frame_ref_num; /**< Previous reference frame (0 if this is one) */
82 guint32 prev_dis_num; /**< Previous displayed frame (0 if first one) */
86 /** compare two frame_datas */
87 WS_DLL_PUBLIC gint frame_data_compare(const struct epan_session *epan, const frame_data *fdata1, const frame_data *fdata2, int field);
89 WS_DLL_PUBLIC void frame_data_reset(frame_data *fdata);
91 WS_DLL_PUBLIC void frame_data_destroy(frame_data *fdata);
93 WS_DLL_PUBLIC void frame_data_init(frame_data *fdata, guint32 num,
94 const wtap_rec *rec, gint64 offset,
97 extern void frame_delta_abs_time(const struct epan_session *epan, const frame_data *fdata,
98 guint32 prev_num, nstime_t *delta);
100 * Sets the frame data struct values before dissection.
102 WS_DLL_PUBLIC void frame_data_set_before_dissect(frame_data *fdata,
103 nstime_t *elapsed_time,
104 const frame_data **frame_ref,
105 const frame_data *prev_dis);
107 WS_DLL_PUBLIC void frame_data_set_after_dissect(frame_data *fdata,
114 #endif /* __cplusplus */
116 #endif /* __FRAME_DATA__ */
119 * Editor modelines - http://www.wireshark.org/tools/modelines.html
124 * indent-tabs-mode: nil
127 * vi: set shiftwidth=2 tabstop=8 expandtab:
128 * :indentSize=2:tabSize=8:noTabs=true: