Revert "plaintext=decrypt_krb5_data => enc_key_t"
[metze/wireshark/wip.git] / epan / frame_data.h
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
11 #ifndef __FRAME_DATA_H__
12 #define __FRAME_DATA_H__
13
14 #ifdef __cplusplus
15 extern "C" {
16 #endif /* __cplusplus */
17
18 #include <ws_diag_control.h>
19 #include <ws_symbol_export.h>
20 #include <wsutil/nstime.h>
21
22 #include <wiretap/wtap.h>
23
24 struct _packet_info;
25 struct epan_session;
26
27 #define PINFO_FD_VISITED(pinfo)   ((pinfo)->fd->flags.visited)
28
29 /** @file
30  * Low-level frame data and metadata.
31  */
32
33 /** @defgroup framedata Frame Data
34  *
35  * @{
36  */
37
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
40    save memory? */
41
42 /* Types of character encodings */
43 typedef enum {
44   PACKET_CHAR_ENC_CHAR_ASCII     = 0, /* ASCII */
45   PACKET_CHAR_ENC_CHAR_EBCDIC    = 1  /* EBCDIC */
46 } packet_char_enc;
47
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
50    number unknown". */
51 struct _color_filter; /* Forward */
52 DIAG_OFF_PEDANTIC
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 */
62   struct {
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 */
75   } flags;
76
77   const struct _color_filter *color_filter;  /**< Per-packet matching color_filter_t object */
78
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) */
83 } frame_data;
84 DIAG_ON_PEDANTIC
85
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);
88
89 WS_DLL_PUBLIC void frame_data_reset(frame_data *fdata);
90
91 WS_DLL_PUBLIC void frame_data_destroy(frame_data *fdata);
92
93 WS_DLL_PUBLIC void frame_data_init(frame_data *fdata, guint32 num,
94                 const wtap_rec *rec, gint64 offset,
95                 guint32 cum_bytes);
96
97 extern void frame_delta_abs_time(const struct epan_session *epan, const frame_data *fdata,
98                 guint32 prev_num, nstime_t *delta);
99 /**
100  * Sets the frame data struct values before dissection.
101  */
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);
106
107 WS_DLL_PUBLIC void frame_data_set_after_dissect(frame_data *fdata,
108                 guint32 *cum_bytes);
109
110 /** @} */
111
112 #ifdef __cplusplus
113 }
114 #endif /* __cplusplus */
115
116 #endif  /* __FRAME_DATA__ */
117
118 /*
119  * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
120  *
121  * Local variables:
122  * c-basic-offset: 2
123  * tab-width: 8
124  * indent-tabs-mode: nil
125  * End:
126  *
127  * vi: set shiftwidth=2 tabstop=8 expandtab:
128  * :indentSize=2:tabSize=8:noTabs=true:
129  */