| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
recent.h
Go to the documentation of this file.
1
12
13#ifndef __RECENT_H__
14#define __RECENT_H__
15
16#include <glib.h>
17
18#include <stdio.h>
19#include "epan/timestamp.h"
20#include "ui/ws_ui_util.h"
21
22#ifdef __cplusplus
23 extern "C" {
24#endif /* __cplusplus */
25
30
32#define RECENT_KEY_CAPTURE_FILE "recent.capture_file"
33
35#define RECENT_KEY_DISPLAY_FILTER "recent.display_filter"
36
37#define RECENT_KEY_COL_WIDTH "column.width"
38
39#define RECENT_KEY_CAPTURE_FILTER "recent.capture_filter"
40
41#define RECENT_KEY_REMOTE_HOST "recent.remote_host"
42
46 typedef struct _col_width_data {
47 int fmt;
48 int width;
49 char xalign;
50} col_width_data;
51
53#define COLUMN_XALIGN_DEFAULT 0
54#define COLUMN_XALIGN_LEFT 'L'
55#define COLUMN_XALIGN_CENTER 'C'
56#define COLUMN_XALIGN_RIGHT 'R'
57
61 typedef enum {
62 BYTES_HEX,
63 BYTES_BITS,
64 BYTES_DEC,
65 BYTES_OCT
66} bytes_view_type;
67
68
72 typedef enum {
73 BYTES_ENC_FROM_PACKET,
74 BYTES_ENC_ASCII,
75 BYTES_ENC_EBCDIC
76} bytes_encoding_type;
77
78
82 typedef enum {
83 SEARCH_IN_PACKET_LIST,
84 SEARCH_IN_PACKET_DETAILS,
85 SEARCH_IN_PACKET_BYTES
86} search_in_type;
87
88
92 typedef enum {
93 SEARCH_CHAR_SET_NARROW_AND_WIDE,
94 SEARCH_CHAR_SET_NARROW,
95 SEARCH_CHAR_SET_WIDE
96} search_char_set_type;
97
98
102 typedef enum {
103 SEARCH_TYPE_DISPLAY_FILTER,
104 SEARCH_TYPE_HEX_VALUE,
105 SEARCH_TYPE_STRING,
106 SEARCH_TYPE_REGEX
107} search_type_type;
108
109
113 typedef enum {
114 SHOW_ASCII,
115 SHOW_ASCII_CONTROL,
116 SHOW_CARRAY,
117 SHOW_EBCDIC,
118 SHOW_HEXDUMP,
119 SHOW_HTML,
120 SHOW_IMAGE,
121 SHOW_JSON,
122 SHOW_RAW,
123 SHOW_RUSTARRAY,
124 SHOW_CODEC,
125 SHOW_YAML
126} bytes_show_type;
127
128
132 typedef enum {
133 FOLLOW_DELTA_NONE,
134 FOLLOW_DELTA_TURN,
135 FOLLOW_DELTA_ALL
136} follow_delta_type;
137
138
142 typedef enum {
143 DecodeAsNone,
144 DecodeAsBASE64,
145 DecodeAsCompressed,
146 DecodeAsHexDigits,
147 DecodeAsPercentEncoding,
148 DecodeAsQuotedPrintable,
149 DecodeAsROT13
150} bytes_decode_type;
151
152
156 typedef struct recent_settings_tag {
157
158 /* --- Toolbar and pane visibility --- */
159 bool main_toolbar_show;
160 bool filter_toolbar_show;
161 bool wireless_toolbar_show;
162 bool packet_list_show;
163 bool tree_view_show;
164 bool byte_view_show;
165 bool packet_diagram_show;
166 bool statusbar_show;
167
168 /* --- Packet list behaviour --- */
169 bool packet_list_colorize;
170 bool capture_auto_scroll;
171 bool aggregation_view;
172
173 /* --- Time display --- */
174 ts_type gui_time_format;
175 int gui_time_precision;
176 ts_seconds_type gui_seconds_format;
177
178 /* --- Zoom and bytes display --- */
179 int gui_zoom_level;
180 bytes_view_type gui_bytes_view;
181 bytes_encoding_type gui_bytes_encoding;
182 bool gui_packet_diagram_field_values;
183 bool gui_allow_hover_selection;
184
185 /* --- Find Packet settings --- */
186 search_in_type gui_search_in;
187 search_char_set_type gui_search_char_set;
188 bool gui_search_case_sensitive;
189 bool gui_search_reverse_dir;
190 bool gui_search_multiple_occurs;
191 search_type_type gui_search_type;
192
193 /* --- Follow Stream settings --- */
194 bytes_show_type gui_follow_show;
195 follow_delta_type gui_follow_delta;
196
197 /* --- Show Packet Bytes settings --- */
198 bytes_decode_type gui_show_bytes_decode;
199 bytes_show_type gui_show_bytes_show;
200
201 /* --- Main window geometry --- */
202 int gui_geometry_main_x;
203 int gui_geometry_main_y;
204 int gui_geometry_main_width;
205 int gui_geometry_main_height;
206 bool gui_geometry_main_maximized;
207 bool gui_geometry_leftalign_actions;
208
209 /* --- Splitter positions --- */
210 int gui_geometry_main_upper_pane;
211 int gui_geometry_main_lower_pane;
212 char *gui_geometry_main;
213 char *gui_geometry_main_master_split;
214 char *gui_geometry_main_extra_split;
215
216 /* --- Privilege and system warnings --- */
217 bool privs_warn_if_elevated;
218 bool sys_warn_if_no_capture;
219
220 /* --- Column and dialog tab state --- */
221 GList *col_width_list;
222 GList *conversation_tabs;
223 GList *conversation_tabs_columns;
224 GList *endpoint_tabs;
225 GList *endpoint_tabs_columns;
226
227 /* --- Miscellaneous --- */
228 int gui_profile_switch_check_count;
229 char *gui_fileopen_remembered_dir;
230 bool gui_rlc_use_pdus_from_mac;
231 GList *custom_colors;
232 GList *gui_additional_toolbars;
233 GList *interface_toolbars;
234
235 /* --- TCP Stream Graph dialog --- */
236 bool gui_tsgd_throughput_show;
237 bool gui_tsgd_goodput_show;
238 double gui_tsgd_ma_window_size;
239
240 /* --- Welcome page sidebar / banner slides --- */
241 bool gui_welcome_page_sidebar_learn_visible;
242 bool gui_welcome_page_sidebar_tips_visible;
243 bool gui_welcome_page_sidebar_tips_events;
244 bool gui_welcome_page_sidebar_tips_sponsorship;
245 bool gui_welcome_page_sidebar_tips_tips;
246 bool gui_welcome_page_sidebar_tips_auto_advance;
247 unsigned gui_welcome_page_sidebar_tips_interval;
248
256 char *gui_theme_name;
257
264 int gui_color_scheme;
265 bool gui_welcome_page_sidebar_tips_slides_test;
266
267} recent_settings_t;
268
270 extern recent_settings_t recent;
271
275 extern void recent_init(void);
276
282 extern void recent_cleanup(void);
283
289 extern bool write_recent(void);
290
296 extern bool write_profile_recent(void);
297
305 extern bool recent_read_static(char **rf_path_return, int *rf_errno_return);
306
314 extern bool recent_read_profile_static(char **rf_path_return, int *rf_errno_return);
315
323 extern bool recent_read_dynamic(char **rf_path_return, int *rf_errno_return);
324
334 extern int recent_set_arg(char *prefarg);
335
341 extern void recent_free_column_width_info(recent_settings_t *rs);
342
350 extern void recent_insert_column(int col);
351
359 extern void recent_remove_column(int col);
360
367 extern void recent_set_column_format(int col, int format);
368
374 extern int recent_get_column_width(int col);
375
382 extern void recent_set_column_width(int col, int width);
383
389 extern char recent_get_column_xalign(int col);
390
397 extern void recent_set_column_xalign(int col, char xalign);
398
408 extern void window_geom_save(const char *name, window_geometry_t *geom);
409
417 extern bool window_geom_load(const char *name, window_geometry_t *geom);
418
425 extern void window_splitter_save(const char *name, const char *splitter_state);
426
433 extern const char * window_splitter_load(const char *name);
434
441 extern GList *recent_get_cfilter_list(const char *ifname);
442
450 extern void recent_add_cfilter(const char *ifname, const char *s);
451
458 extern struct remote_host *recent_get_remote_host(const char *host);
459
465 extern int recent_get_remote_host_list_size(void);
466
474 extern void recent_remote_host_list_foreach(GFunc func, void *user_data);
475
479 extern void recent_free_remote_host_list(void);
480
487 extern void recent_add_remote_host(char *host, struct remote_host *rh);
488
489#ifdef __cplusplus
490}
491#endif /* __cplusplus */
492
493#endif /* recent.h */
recent_settings_t
struct recent_settings_tag recent_settings_t
Persisted GUI state and preferences restored across Wireshark sessions.
recent_remote_host_list_foreach
void recent_remote_host_list_foreach(GFunc func, void *user_data)
Iterate over all items in the remote host list, calling a function for each member.
window_geom_load
bool window_geom_load(const char *name, window_geometry_t *geom)
Load the desired geometry for this window from the geometry hashtable.
Definition recent.c:318
bytes_show_type
bytes_show_type
Selects the presentation format for payload data in the Follow Stream and Show Packet Bytes dialogs.
Definition recent.h:113
SHOW_ASCII_CONTROL
@ SHOW_ASCII_CONTROL
Definition recent.h:115
SHOW_IMAGE
@ SHOW_IMAGE
Definition recent.h:120
SHOW_RUSTARRAY
@ SHOW_RUSTARRAY
Definition recent.h:123
SHOW_HTML
@ SHOW_HTML
Definition recent.h:119
SHOW_JSON
@ SHOW_JSON
Definition recent.h:121
recent_set_column_width
void recent_set_column_width(int col, int width)
Set the column width for the given column.
Definition recent.c:1964
recent_read_static
bool recent_read_static(char **rf_path_return, int *rf_errno_return)
Read recent settings file (static part).
Definition recent.c:1705
window_splitter_load
const char * window_splitter_load(const char *name)
Load the splitter state for a given interface.
Definition recent.c:351
col_width_data
struct _col_width_data col_width_data
Stores the display width and alignment for a single column.
recent_set_arg
int recent_set_arg(char *prefarg)
Given a -o command line string, parse it and set the recent value in question. Return an indication o...
Definition recent.c:1668
window_splitter_save
void window_splitter_save(const char *name, const char *splitter_state)
Save the splitter state for a given interface.
Definition recent.c:339
recent_get_cfilter_list
GList * recent_get_cfilter_list(const char *ifname)
Returns a list of recent capture filters.
Definition recent.c:497
recent_set_column_xalign
void recent_set_column_xalign(int col, char xalign)
Set the column xalign for the given column.
Definition recent.c:2026
recent_insert_column
void recent_insert_column(int col)
Insert an entry in the recent column width setting for the given column, which should have been just ...
Definition recent.c:1910
recent_set_column_format
void recent_set_column_format(int col, int format)
Set the column width for the given column.
recent_get_remote_host_list_size
int recent_get_remote_host_list_size(void)
Get the number of entries of the remote host list.
bytes_encoding_type
bytes_encoding_type
Character encoding used to render the ASCII side-panel in the Packet Bytes pane.
Definition recent.h:72
BYTES_ENC_FROM_PACKET
@ BYTES_ENC_FROM_PACKET
Definition recent.h:73
BYTES_ENC_EBCDIC
@ BYTES_ENC_EBCDIC
Definition recent.h:75
BYTES_ENC_ASCII
@ BYTES_ENC_ASCII
Definition recent.h:74
recent_add_cfilter
void recent_add_cfilter(const char *ifname, const char *s)
Add a capture filter to the global recent capture filter list or the recent capture filter list for a...
Definition recent.c:516
write_profile_recent
bool write_profile_recent(void)
Write profile recent settings file.
Definition recent.c:1054
recent_read_dynamic
bool recent_read_dynamic(char **rf_path_return, int *rf_errno_return)
Read recent settings file (dynamic part).
Definition recent.c:1864
bytes_decode_type
bytes_decode_type
Secondary decode transformation applied to raw bytes before display in the Show Packet Bytes dialog.
Definition recent.h:142
DecodeAsPercentEncoding
@ DecodeAsPercentEncoding
Definition recent.h:147
DecodeAsHexDigits
@ DecodeAsHexDigits
Definition recent.h:146
DecodeAsCompressed
@ DecodeAsCompressed
Definition recent.h:145
DecodeAsNone
@ DecodeAsNone
Definition recent.h:143
DecodeAsROT13
@ DecodeAsROT13
Definition recent.h:149
DecodeAsBASE64
@ DecodeAsBASE64
Definition recent.h:144
DecodeAsQuotedPrintable
@ DecodeAsQuotedPrintable
Definition recent.h:148
recent_get_column_width
int recent_get_column_width(int col)
Get the column width for the given column.
Definition recent.c:1939
window_geom_save
void window_geom_save(const char *name, window_geometry_t *geom)
save the window and its current geometry into the geometry hashtable.
Definition recent.c:297
recent_add_remote_host
void recent_add_remote_host(char *host, struct remote_host *rh)
Add an entry to the remote_host_list.
recent_get_remote_host
struct remote_host * recent_get_remote_host(const char *host)
Get the value of an entry for a remote host from the remote host list.
search_char_set_type
search_char_set_type
Controls whether string searches match narrow (single-byte), wide (two-byte), or both character encod...
Definition recent.h:92
SEARCH_CHAR_SET_NARROW_AND_WIDE
@ SEARCH_CHAR_SET_NARROW_AND_WIDE
Definition recent.h:93
SEARCH_CHAR_SET_WIDE
@ SEARCH_CHAR_SET_WIDE
Definition recent.h:95
SEARCH_CHAR_SET_NARROW
@ SEARCH_CHAR_SET_NARROW
Definition recent.h:94
recent_free_remote_host_list
void recent_free_remote_host_list(void)
Free all entries of the remote host list.
search_in_type
search_in_type
Selects which packet pane the Find Packet search operates on.
Definition recent.h:82
SEARCH_IN_PACKET_DETAILS
@ SEARCH_IN_PACKET_DETAILS
Definition recent.h:84
SEARCH_IN_PACKET_BYTES
@ SEARCH_IN_PACKET_BYTES
Definition recent.h:85
SEARCH_IN_PACKET_LIST
@ SEARCH_IN_PACKET_LIST
Definition recent.h:83
recent_get_column_xalign
char recent_get_column_xalign(int col)
Get the column xalign for the given column.
Definition recent.c:2006
follow_delta_type
follow_delta_type
Controls display of inter-segment timing deltas in the Follow Stream dialog.
Definition recent.h:132
FOLLOW_DELTA_ALL
@ FOLLOW_DELTA_ALL
Definition recent.h:135
FOLLOW_DELTA_NONE
@ FOLLOW_DELTA_NONE
Definition recent.h:133
FOLLOW_DELTA_TURN
@ FOLLOW_DELTA_TURN
Definition recent.h:134
recent_init
void recent_init(void)
Initialize recent settings module (done at startup).
Definition recent.c:2048
recent_remove_column
void recent_remove_column(int col)
Remove an entry in the recent column width setting for the given column, which should have been just ...
Definition recent.c:1922
bytes_view_type
bytes_view_type
Numeric base used to render byte values in the Packet Bytes pane.
Definition recent.h:61
BYTES_OCT
@ BYTES_OCT
Definition recent.h:65
BYTES_BITS
@ BYTES_BITS
Definition recent.h:63
BYTES_DEC
@ BYTES_DEC
Definition recent.h:64
BYTES_HEX
@ BYTES_HEX
Definition recent.h:62
recent_read_profile_static
bool recent_read_profile_static(char **rf_path_return, int *rf_errno_return)
Read profile recent settings file (static part).
Definition recent.c:1769
recent_cleanup
void recent_cleanup(void)
Cleans up recent settings and frees allocated memory.
Definition recent.c:2054
recent_free_column_width_info
void recent_free_column_width_info(recent_settings_t *rs)
Free the recent settings list of column width information.
Definition recent.c:244
write_recent
bool write_recent(void)
Write recent_common settings file.
Definition recent.c:869
search_type_type
search_type_type
Specifies the matching method used by the Find Packet dialog.
Definition recent.h:102
SEARCH_TYPE_HEX_VALUE
@ SEARCH_TYPE_HEX_VALUE
Definition recent.h:104
SEARCH_TYPE_STRING
@ SEARCH_TYPE_STRING
Definition recent.h:105
SEARCH_TYPE_DISPLAY_FILTER
@ SEARCH_TYPE_DISPLAY_FILTER
Definition recent.h:103
SEARCH_TYPE_REGEX
@ SEARCH_TYPE_REGEX
Definition recent.h:106
_col_width_data
Stores the display width and alignment for a single column.
Definition recent.h:46
_col_width_data::fmt
int fmt
Definition recent.h:47
_col_width_data::width
int width
Definition recent.h:48
_col_width_data::xalign
char xalign
Definition recent.h:49
recent_settings_tag
Persisted GUI state and preferences restored across Wireshark sessions.
Definition recent.h:156
recent_settings_tag::gui_zoom_level
int gui_zoom_level
Definition recent.h:179
recent_settings_tag::gui_follow_show
bytes_show_type gui_follow_show
Definition recent.h:194
recent_settings_tag::gui_welcome_page_sidebar_tips_sponsorship
bool gui_welcome_page_sidebar_tips_sponsorship
Definition recent.h:244
recent_settings_tag::gui_search_multiple_occurs
bool gui_search_multiple_occurs
Definition recent.h:190
recent_settings_tag::tree_view_show
bool tree_view_show
Definition recent.h:163
recent_settings_tag::gui_welcome_page_sidebar_tips_tips
bool gui_welcome_page_sidebar_tips_tips
Definition recent.h:245
recent_settings_tag::gui_geometry_main
char * gui_geometry_main
Definition recent.h:212
recent_settings_tag::gui_search_type
search_type_type gui_search_type
Definition recent.h:191
recent_settings_tag::gui_show_bytes_decode
bytes_decode_type gui_show_bytes_decode
Definition recent.h:198
recent_settings_tag::gui_geometry_leftalign_actions
bool gui_geometry_leftalign_actions
Definition recent.h:207
recent_settings_tag::gui_additional_toolbars
GList * gui_additional_toolbars
Definition recent.h:232
recent_settings_tag::gui_show_bytes_show
bytes_show_type gui_show_bytes_show
Definition recent.h:199
recent_settings_tag::gui_theme_name
char * gui_theme_name
Definition recent.h:256
recent_settings_tag::gui_time_format
ts_type gui_time_format
Definition recent.h:174
recent_settings_tag::byte_view_show
bool byte_view_show
Definition recent.h:164
recent_settings_tag::gui_geometry_main_y
int gui_geometry_main_y
Definition recent.h:203
recent_settings_tag::gui_search_reverse_dir
bool gui_search_reverse_dir
Definition recent.h:189
recent_settings_tag::gui_allow_hover_selection
bool gui_allow_hover_selection
Definition recent.h:183
recent_settings_tag::gui_fileopen_remembered_dir
char * gui_fileopen_remembered_dir
Definition recent.h:229
recent_settings_tag::gui_geometry_main_maximized
bool gui_geometry_main_maximized
Definition recent.h:206
recent_settings_tag::packet_list_show
bool packet_list_show
Definition recent.h:162
recent_settings_tag::gui_time_precision
int gui_time_precision
Definition recent.h:175
recent_settings_tag::gui_geometry_main_height
int gui_geometry_main_height
Definition recent.h:205
recent_settings_tag::gui_geometry_main_width
int gui_geometry_main_width
Definition recent.h:204
recent_settings_tag::interface_toolbars
GList * interface_toolbars
Definition recent.h:233
recent_settings_tag::capture_auto_scroll
bool capture_auto_scroll
Definition recent.h:170
recent_settings_tag::gui_welcome_page_sidebar_tips_visible
bool gui_welcome_page_sidebar_tips_visible
Definition recent.h:242
recent_settings_tag::aggregation_view
bool aggregation_view
Definition recent.h:171
recent_settings_tag::filter_toolbar_show
bool filter_toolbar_show
Definition recent.h:160
recent_settings_tag::gui_welcome_page_sidebar_learn_visible
bool gui_welcome_page_sidebar_learn_visible
Definition recent.h:241
recent_settings_tag::custom_colors
GList * custom_colors
Definition recent.h:231
recent_settings_tag::gui_welcome_page_sidebar_tips_interval
unsigned gui_welcome_page_sidebar_tips_interval
Definition recent.h:247
recent_settings_tag::gui_geometry_main_lower_pane
int gui_geometry_main_lower_pane
Definition recent.h:211
recent_settings_tag::gui_follow_delta
follow_delta_type gui_follow_delta
Definition recent.h:195
recent_settings_tag::gui_welcome_page_sidebar_tips_slides_test
bool gui_welcome_page_sidebar_tips_slides_test
Definition recent.h:265
recent_settings_tag::gui_geometry_main_x
int gui_geometry_main_x
Definition recent.h:202
recent_settings_tag::gui_geometry_main_upper_pane
int gui_geometry_main_upper_pane
Definition recent.h:210
recent_settings_tag::wireless_toolbar_show
bool wireless_toolbar_show
Definition recent.h:161
recent_settings_tag::col_width_list
GList * col_width_list
Definition recent.h:221
recent_settings_tag::gui_profile_switch_check_count
int gui_profile_switch_check_count
Definition recent.h:228
recent_settings_tag::gui_rlc_use_pdus_from_mac
bool gui_rlc_use_pdus_from_mac
Definition recent.h:230
recent_settings_tag::packet_diagram_show
bool packet_diagram_show
Definition recent.h:165
recent_settings_tag::gui_bytes_encoding
bytes_encoding_type gui_bytes_encoding
Definition recent.h:181
recent_settings_tag::gui_welcome_page_sidebar_tips_auto_advance
bool gui_welcome_page_sidebar_tips_auto_advance
Definition recent.h:246
recent_settings_tag::gui_tsgd_goodput_show
bool gui_tsgd_goodput_show
Definition recent.h:237
recent_settings_tag::gui_bytes_view
bytes_view_type gui_bytes_view
Definition recent.h:180
recent_settings_tag::conversation_tabs
GList * conversation_tabs
Definition recent.h:222
recent_settings_tag::endpoint_tabs_columns
GList * endpoint_tabs_columns
Definition recent.h:225
recent_settings_tag::gui_welcome_page_sidebar_tips_events
bool gui_welcome_page_sidebar_tips_events
Definition recent.h:243
recent_settings_tag::endpoint_tabs
GList * endpoint_tabs
Definition recent.h:224
recent_settings_tag::gui_geometry_main_master_split
char * gui_geometry_main_master_split
Definition recent.h:213
recent_settings_tag::privs_warn_if_elevated
bool privs_warn_if_elevated
Definition recent.h:217
recent_settings_tag::main_toolbar_show
bool main_toolbar_show
Definition recent.h:159
recent_settings_tag::gui_search_case_sensitive
bool gui_search_case_sensitive
Definition recent.h:188
recent_settings_tag::statusbar_show
bool statusbar_show
Definition recent.h:166
recent_settings_tag::gui_tsgd_ma_window_size
double gui_tsgd_ma_window_size
Definition recent.h:238
recent_settings_tag::gui_geometry_main_extra_split
char * gui_geometry_main_extra_split
Definition recent.h:214
recent_settings_tag::gui_seconds_format
ts_seconds_type gui_seconds_format
Definition recent.h:176
recent_settings_tag::conversation_tabs_columns
GList * conversation_tabs_columns
Definition recent.h:223
recent_settings_tag::gui_color_scheme
int gui_color_scheme
Definition recent.h:264
recent_settings_tag::packet_list_colorize
bool packet_list_colorize
Definition recent.h:169
recent_settings_tag::gui_packet_diagram_field_values
bool gui_packet_diagram_field_values
Definition recent.h:182
recent_settings_tag::gui_tsgd_throughput_show
bool gui_tsgd_throughput_show
Definition recent.h:236
recent_settings_tag::sys_warn_if_no_capture
bool sys_warn_if_no_capture
Definition recent.h:218
recent_settings_tag::gui_search_in
search_in_type gui_search_in
Definition recent.h:186
recent_settings_tag::gui_search_char_set
search_char_set_type gui_search_char_set
Definition recent.h:187
timestamp.h
ts_seconds_type
ts_seconds_type
Controls how the seconds component of a timestamp is formatted for display.
Definition timestamp.h:60
ts_type
ts_type
Format used to display packet timestamps in the summary packet list.
Definition timestamp.h:22
ws_ui_util.h
window_geometry_t
struct window_geometry_s window_geometry_t