Wireshark  4.3.0
The Wireshark network protocol analyzer
recent.h
Go to the documentation of this file.
1 
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 
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 
43 typedef struct _col_width_data {
44  gint cfmt;
45  gchar *cfield;
46  gint width;
47  gchar xalign;
49 
51 #define COLUMN_XALIGN_DEFAULT 0
52 #define COLUMN_XALIGN_LEFT 'L'
53 #define COLUMN_XALIGN_CENTER 'C'
54 #define COLUMN_XALIGN_RIGHT 'R'
55 
56 typedef enum {
57  BYTES_HEX,
58  BYTES_BITS,
59  BYTES_DEC,
60  BYTES_OCT
61 } bytes_view_type;
62 
63 typedef enum {
64  BYTES_ENC_FROM_PACKET, // frame_data packet_char_enc
65  BYTES_ENC_ASCII,
66  BYTES_ENC_EBCDIC
67 } bytes_encoding_type;
68 
69 typedef enum {
70  SEARCH_IN_PACKET_LIST,
71  SEARCH_IN_PACKET_DETAILS,
72  SEARCH_IN_PACKET_BYTES
73 } search_in_type;
74 
75 typedef enum {
76  SEARCH_CHAR_SET_NARROW_AND_WIDE,
77  SEARCH_CHAR_SET_NARROW,
78  SEARCH_CHAR_SET_WIDE
79 } search_char_set_type;
80 
81 typedef enum {
82  SEARCH_TYPE_DISPLAY_FILTER,
83  SEARCH_TYPE_HEX_VALUE,
84  SEARCH_TYPE_STRING,
85  SEARCH_TYPE_REGEX
86 } search_type_type;
87 
88 typedef enum {
89  SHOW_ASCII,
90  SHOW_ASCII_CONTROL,
91  SHOW_CARRAY,
92  SHOW_EBCDIC,
93  SHOW_HEXDUMP,
94  SHOW_HTML,
95  SHOW_IMAGE,
96  SHOW_JSON,
97  SHOW_RAW,
98  SHOW_RUSTARRAY,
99  SHOW_CODEC, // Will map to UTF-8 in the combobox (other codecs
100  // are generated at runtime).
101  SHOW_YAML
102 } bytes_show_type;
103 
104 typedef enum {
105  DecodeAsNone,
106  DecodeAsBASE64,
107  DecodeAsCompressed,
108  DecodeAsHexDigits,
109  DecodeAsPercentEncoding,
110  DecodeAsQuotedPrintable,
111  DecodeAsROT13
112 } bytes_decode_type;
113 
115 typedef struct recent_settings_tag {
116  gboolean main_toolbar_show;
117  gboolean filter_toolbar_show;
118  gboolean wireless_toolbar_show;
119  gboolean packet_list_show;
120  gboolean tree_view_show;
121  gboolean byte_view_show;
122  gboolean packet_diagram_show;
123  gboolean statusbar_show;
124  gboolean packet_list_colorize;
125  gboolean capture_auto_scroll;
126  ts_type gui_time_format;
127  gint gui_time_precision;
128  ts_seconds_type gui_seconds_format;
129  gint gui_zoom_level;
130  bytes_view_type gui_bytes_view;
131  bytes_encoding_type gui_bytes_encoding;
132  gboolean gui_packet_diagram_field_values;
133  gboolean gui_allow_hover_selection;
134 
135  search_in_type gui_search_in;
136  search_char_set_type gui_search_char_set;
137  gboolean gui_search_case_sensitive;
138  gboolean gui_search_reverse_dir;
139  gboolean gui_search_multiple_occurs;
140  search_type_type gui_search_type;
141  bytes_show_type gui_follow_show;
142  bytes_decode_type gui_show_bytes_decode;
143  bytes_show_type gui_show_bytes_show;
144 
145  gint gui_geometry_main_x;
146  gint gui_geometry_main_y;
147  gint gui_geometry_main_width;
148  gint gui_geometry_main_height;
149 
150  gboolean gui_geometry_main_maximized;
151  gboolean gui_geometry_leftalign_actions;
152 
153  gint gui_geometry_main_upper_pane;
154  gint gui_geometry_main_lower_pane;
155  gint gui_geometry_wlan_stats_pane;
156  gboolean privs_warn_if_elevated;
157  gboolean sys_warn_if_no_capture;
158  GList *col_width_list; /* column widths */
159  GList *conversation_tabs; /* enabled conversation dialog tabs */
160  GList *conversation_tabs_columns; /* save the columns for conversation dialogs */
161  GList *endpoint_tabs; /* enabled endpoint dialog tabs */
162  GList *endpoint_tabs_columns; /* save the columns for endpoint dialogs */
163  gchar *gui_fileopen_remembered_dir; /* folder of last capture loaded in File Open dialog */
164  gboolean gui_rlc_use_pdus_from_mac;
165  GList *custom_colors;
166  GList *gui_additional_toolbars;
167  GList *interface_toolbars;
169 
172 
174 extern void recent_init(void);
175 
177 extern void recent_cleanup(void);
178 
183 extern gboolean write_recent(void);
184 
189 extern gboolean write_profile_recent(void);
190 
197 extern gboolean recent_read_static(char **rf_path_return, int *rf_errno_return);
198 
205 extern gboolean recent_read_profile_static(char **rf_path_return, int *rf_errno_return);
206 
213 extern gboolean recent_read_dynamic(char **rf_path_return, int *rf_errno_return);
214 
224 extern int recent_set_arg(char *prefarg);
225 
230 extern gint recent_get_column_width(gint col);
231 
237 extern void recent_set_column_width(gint col, gint width);
238 
243 extern gchar recent_get_column_xalign(gint col);
244 
250 extern void recent_set_column_xalign(gint col, gchar xalign);
251 
252 /* save the window and its current geometry into the geometry hashtable */
253 extern void window_geom_save(const gchar *name, window_geometry_t *geom);
254 
255 /* load the desired geometry for this window from the geometry hashtable */
256 extern gboolean window_geom_load(const gchar *name, window_geometry_t *geom);
257 
263 extern GList *recent_get_cfilter_list(const gchar *ifname);
264 
272 extern void recent_add_cfilter(const gchar *ifname, const gchar *s);
273 
281 extern struct remote_host *recent_get_remote_host(const gchar *host);
282 
289 
297 extern void recent_remote_host_list_foreach(GHFunc func, gpointer user_data);
298 
303 
310 extern void recent_add_remote_host(gchar *host, struct remote_host *rh);
311 
312 #ifdef __cplusplus
313 }
314 #endif /* __cplusplus */
315 
316 #endif /* recent.h */
void recent_add_cfilter(const gchar *ifname, const gchar *s)
Definition: recent.c:414
struct recent_settings_tag recent_settings_t
gboolean recent_read_dynamic(char **rf_path_return, int *rf_errno_return)
Definition: recent.c:1565
void recent_set_column_width(gint col, gint width)
Definition: recent.c:1633
int recent_set_arg(char *prefarg)
Definition: recent.c:1386
gboolean recent_read_static(char **rf_path_return, int *rf_errno_return)
Definition: recent.c:1423
GList * recent_get_cfilter_list(const gchar *ifname)
Definition: recent.c:395
int recent_get_remote_host_list_size(void)
struct remote_host * recent_get_remote_host(const gchar *host)
void recent_remote_host_list_foreach(GHFunc func, gpointer user_data)
gboolean write_recent(void)
Definition: recent.c:693
void recent_free_remote_host_list(void)
gint recent_get_column_width(gint col)
Definition: recent.c:1604
void recent_add_remote_host(gchar *host, struct remote_host *rh)
gboolean recent_read_profile_static(char **rf_path_return, int *rf_errno_return)
Definition: recent.c:1473
void recent_init(void)
Definition: recent.c:1736
gchar recent_get_column_xalign(gint col)
Definition: recent.c:1670
recent_settings_t recent
Definition: recent.c:92
gboolean write_profile_recent(void)
Definition: recent.c:830
void recent_cleanup(void)
Definition: recent.c:1742
void recent_set_column_xalign(gint col, gchar xalign)
Definition: recent.c:1699
Definition: recent.h:43
Definition: recent.h:115
Definition: ws_ui_util.h:30