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 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #ifndef __FRAME_DATA_H__
24 #define __FRAME_DATA_H__
28 #endif /* __cplusplus */
30 #include <ws_diag_control.h>
31 #include <ws_symbol_export.h>
32 #include <wsutil/nstime.h>
38 #define PINFO_FD_VISITED(pinfo) ((pinfo)->fd->flags.visited)
41 * Low-level frame data and metadata.
44 /** @defgroup framedata Frame Data
49 /** @todo XXX - some of this stuff is used only while a packet is being dissected;
50 should we keep that stuff in the "packet_info" structure, instead, to
53 /* Types of character encodings */
55 PACKET_CHAR_ENC_CHAR_ASCII = 0, /* ASCII */
56 PACKET_CHAR_ENC_CHAR_EBCDIC = 1 /* EBCDIC */
59 /** The frame number is the ordinal number of the frame in the capture, so
60 it's 1-origin. In various contexts, 0 as a frame number means "frame
62 struct _color_filter; /* Forward */
64 typedef struct _frame_data {
65 GSList *pfd; /**< Per frame proto data */
66 guint32 num; /**< Frame number */
67 guint32 pkt_len; /**< Packet length */
68 guint32 cap_len; /**< Amount actually captured */
69 guint32 cum_bytes; /**< Cumulative bytes into the capture */
70 gint64 file_off; /**< File offset */
71 guint16 subnum; /**< subframe number, for protocols that require this */
73 unsigned int passed_dfilter : 1; /**< 1 = display, 0 = no display */
74 unsigned int dependent_of_displayed : 1; /**< 1 if a displayed frame depends on this frame */
75 /* Do NOT use packet_char_enc enum here: MSVC compiler does not handle an enum in a bit field properly */
76 unsigned int encoding : 1; /**< Character encoding (ASCII, EBCDIC...) */
77 unsigned int visited : 1; /**< Has this packet been visited yet? 1=Yes,0=No*/
78 unsigned int marked : 1; /**< 1 = marked by user, 0 = normal */
79 unsigned int ref_time : 1; /**< 1 = marked as a reference time frame, 0 = normal */
80 unsigned int ignored : 1; /**< 1 = ignore this frame, 0 = normal */
81 unsigned int has_ts : 1; /**< 1 = has time stamp, 0 = no time stamp */
82 unsigned int has_phdr_comment : 1; /** 1 = there's comment for this packet */
83 unsigned int has_user_comment : 1; /** 1 = user set (also deleted) comment for this packet */
84 unsigned int need_colorize : 1; /**< 1 = need to (re-)calculate packet color */
86 gint16 tsprec; /**< Time stamp precision */
88 const struct _color_filter *color_filter; /**< Per-packet matching color_filter_t object */
90 nstime_t abs_ts; /**< Absolute timestamp */
91 nstime_t shift_offset; /**< How much the abs_tm of the frame is shifted */
92 guint32 frame_ref_num; /**< Previous reference frame (0 if this is one) */
93 guint32 prev_dis_num; /**< Previous displayed frame (0 if first one) */
97 /** compare two frame_datas */
98 WS_DLL_PUBLIC gint frame_data_compare(const struct epan_session *epan, const frame_data *fdata1, const frame_data *fdata2, int field);
100 WS_DLL_PUBLIC void frame_data_reset(frame_data *fdata);
102 WS_DLL_PUBLIC void frame_data_destroy(frame_data *fdata);
104 WS_DLL_PUBLIC void frame_data_init(frame_data *fdata, guint32 num,
105 const struct wtap_pkthdr *phdr, gint64 offset,
108 extern void frame_delta_abs_time(const struct epan_session *epan, const frame_data *fdata,
109 guint32 prev_num, nstime_t *delta);
111 * Sets the frame data struct values before dissection.
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);
118 WS_DLL_PUBLIC void frame_data_set_after_dissect(frame_data *fdata,
125 #endif /* __cplusplus */
127 #endif /* __FRAME_DATA__ */
130 * Editor modelines - http://www.wireshark.org/tools/modelines.html
135 * indent-tabs-mode: nil
138 * vi: set shiftwidth=2 tabstop=8 expandtab:
139 * :indentSize=2:tabSize=8:noTabs=true: