Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
recent.h
Go to the documentation of this file.
1 /* recent.h
2  * Definitions for recent "preference" handling routines
3  * Copyright 2004, Ulf Lamping <ulf.lamping@web.de>
4  *
5  * Wireshark - Network traffic analyzer
6  * By Gerald Combs <gerald@wireshark.org>
7  * Copyright 1998 Gerald Combs
8  *
9  * SPDX-License-Identifier: GPL-2.0-or-later
10  */
11 
12 #ifndef __RECENT_H__
13 #define __RECENT_H__
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif /* __cplusplus */
18 
19 #include <glib.h>
20 #include <stdio.h>
21 #include "epan/timestamp.h"
22 #include "ui/ws_ui_util.h"
23 
30 #define RECENT_KEY_CAPTURE_FILE "recent.capture_file"
31 
33 #define RECENT_KEY_DISPLAY_FILTER "recent.display_filter"
34 
35 #define RECENT_KEY_COL_WIDTH "column.width"
36 
37 #define RECENT_KEY_CAPTURE_FILTER "recent.capture_filter"
38 
39 #define RECENT_KEY_REMOTE_HOST "recent.remote_host"
40 
41 typedef struct _col_width_data {
42  gint cfmt;
43  gchar *cfield;
44  gint width;
45  gchar xalign;
47 
49 #define COLUMN_XALIGN_DEFAULT 0
50 #define COLUMN_XALIGN_LEFT 'L'
51 #define COLUMN_XALIGN_CENTER 'C'
52 #define COLUMN_XALIGN_RIGHT 'R'
53 
54 typedef enum {
55  BYTES_HEX,
56  BYTES_BITS
57 } bytes_view_type;
58 
59 typedef enum {
60  BYTES_ENC_FROM_PACKET, // frame_data packet_char_enc
61  BYTES_ENC_ASCII,
62  BYTES_ENC_EBCDIC
63 } bytes_encoding_type;
64 
66 typedef struct recent_settings_tag {
67  gboolean main_toolbar_show;
68  gboolean filter_toolbar_show;
69  gboolean wireless_toolbar_show;
70  gboolean airpcap_driver_check_show;
71  gboolean packet_list_show;
72  gboolean tree_view_show;
73  gboolean byte_view_show;
74  gboolean statusbar_show;
75  gboolean packet_list_colorize;
76  ts_type gui_time_format;
77  gint gui_time_precision;
78  ts_seconds_type gui_seconds_format;
79  gint gui_zoom_level;
80  bytes_view_type gui_bytes_view;
81  bytes_encoding_type gui_bytes_encoding;
82 
83  gint gui_geometry_main_x;
84  gint gui_geometry_main_y;
85  gint gui_geometry_main_width;
86  gint gui_geometry_main_height;
87 
88  gboolean gui_geometry_main_maximized;
89 
90  gboolean has_gui_geometry_main_upper_pane; /* gui_geometry_main_upper_pane is valid */
91  gint gui_geometry_main_upper_pane;
92  gboolean has_gui_geometry_main_lower_pane; /* gui_geometry_main_lower_pane is valid */
93  gint gui_geometry_main_lower_pane;
94  gboolean has_gui_geometry_status_pane; /* gui_geometry_status_pane is valid */
95  gint gui_geometry_status_pane_left;
96  gint gui_geometry_status_pane_right;
97  gint gui_geometry_wlan_stats_pane;
98  gboolean privs_warn_if_elevated;
99  gboolean privs_warn_if_no_npf;
100  GList *col_width_list; /* column widths */
101  GList *conversation_tabs; /* enabled conversation dialog tabs */
102  GList *endpoint_tabs; /* enabled endpoint dialog tabs */
103  gchar *gui_fileopen_remembered_dir; /* folder of last capture loaded in File Open dialog */
104  gboolean gui_rlc_use_pdus_from_mac;
105  GList *custom_colors;
106  GList *gui_additional_toolbars;
107  GList *interface_toolbars;
109 
112 
114 extern void recent_init(void);
115 
117 extern void recent_cleanup(void);
118 
123 extern gboolean write_recent(void);
124 
129 extern gboolean write_profile_recent(void);
130 
137 extern gboolean recent_read_static(char **rf_path_return, int *rf_errno_return);
138 
145 extern gboolean recent_read_profile_static(char **rf_path_return, int *rf_errno_return);
146 
153 extern gboolean recent_read_dynamic(char **rf_path_return, int *rf_errno_return);
154 
164 extern int recent_set_arg(char *prefarg);
165 
170 extern gint recent_get_column_width(gint col);
171 
177 extern void recent_set_column_width(gint col, gint width);
178 
183 extern gchar recent_get_column_xalign(gint col);
184 
190 extern void recent_set_column_xalign(gint col, gchar xalign);
191 
192 /* save the window and its current geometry into the geometry hashtable */
193 extern void window_geom_save(const gchar *name, window_geometry_t *geom);
194 
195 /* load the desired geometry for this window from the geometry hashtable */
196 extern gboolean window_geom_load(const gchar *name, window_geometry_t *geom);
197 
203 extern GList *recent_get_cfilter_list(const gchar *ifname);
204 
212 extern void recent_add_cfilter(const gchar *ifname, const gchar *s);
213 
221 extern struct remote_host *recent_get_remote_host(const gchar *host);
222 
228 extern int recent_get_remote_host_list_size(void);
229 
237 extern void recent_remote_host_list_foreach(GHFunc func, gpointer user_data);
238 
242 extern void recent_free_remote_host_list(void);
243 
250 extern void recent_add_remote_host(gchar *host, struct remote_host *rh);
251 
252 #ifdef __cplusplus
253 }
254 #endif /* __cplusplus */
255 
256 #endif /* recent.h */
257 
258 /*
259  * Editor modelines - https://www.wireshark.org/tools/modelines.html
260  *
261  * Local Variables:
262  * c-basic-offset: 4
263  * tab-width: 8
264  * indent-tabs-mode: nil
265  * End:
266  *
267  * ex: set shiftwidth=4 tabstop=8 expandtab:
268  * :indentSize=4:tabSize=8:noTabs=true:
269  */
recent_settings_t recent
Definition: recent.c:74
gint recent_get_column_width(gint col)
Definition: recent.c:1395
struct recent_settings_tag recent_settings_t
gboolean recent_read_static(char **rf_path_return, int *rf_errno_return)
Definition: recent.c:1215
int recent_get_remote_host_list_size(void)
gboolean write_recent(void)
Definition: recent.c:611
void recent_set_column_xalign(gint col, gchar xalign)
Definition: recent.c:1486
struct remote_host * recent_get_remote_host(const gchar *host)
Definition: ws_ui_util.h:29
Definition: recent.h:66
gboolean write_profile_recent(void)
Definition: recent.c:738
GList * recent_get_cfilter_list(const gchar *ifname)
Definition: recent.c:317
Definition: recent.h:41
void recent_init(void)
Definition: recent.c:1523
gchar recent_get_column_xalign(gint col)
Definition: recent.c:1459
void recent_cleanup(void)
Definition: recent.c:1529
gboolean recent_read_dynamic(char **rf_path_return, int *rf_errno_return)
Definition: recent.c:1356
void recent_remote_host_list_foreach(GHFunc func, gpointer user_data)
int recent_set_arg(char *prefarg)
Definition: recent.c:1178
void recent_add_cfilter(const gchar *ifname, const gchar *s)
Definition: recent.c:336
void recent_free_remote_host_list(void)
void recent_set_column_width(gint col, gint width)
Definition: recent.c:1422
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:1265