summaryrefslogtreecommitdiffstats
path: root/epan/prefs.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:53 +0000
commita86c5f7cae7ec9a3398300555a0b644689d946a1 (patch)
tree39fe4b107c71174fd1e8a8ceb9a4d2aa14116248 /epan/prefs.h
parentReleasing progress-linux version 4.2.6-1~progress7.99u1. (diff)
downloadwireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.tar.xz
wireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.zip
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/prefs.h')
-rw-r--r--epan/prefs.h309
1 files changed, 176 insertions, 133 deletions
diff --git a/epan/prefs.h b/epan/prefs.h
index 8addcf7f..a153c817 100644
--- a/epan/prefs.h
+++ b/epan/prefs.h
@@ -32,12 +32,17 @@ extern "C" {
#define TAP_UPDATE_DEFAULT_INTERVAL 3000
#define ST_DEF_BURSTRES 5
#define ST_DEF_BURSTLEN 100
-#define ST_MAX_BURSTRES 600000 /* somewhat arbirary limit of 10 minutes */
-#define ST_MAX_BURSTBUCKETS 100 /* somewhat arbirary limit - more buckets degrade performance */
+#define ST_MAX_BURSTRES 600000 /* somewhat arbitrary limit of 10 minutes */
+#define ST_MAX_BURSTBUCKETS 100 /* somewhat arbitrary limit - more buckets degrade performance */
#define DEF_GUI_DECIMAL_PLACES1 2
#define DEF_GUI_DECIMAL_PLACES2 4
#define DEF_GUI_DECIMAL_PLACES3 6
+#define CONV_DEINT_KEY_CAPFILE 0x01 /* unused yet */
+#define CONV_DEINT_KEY_INTERFACE 0x02
+#define CONV_DEINT_KEY_MAC 0x04
+#define CONV_DEINT_KEY_VLAN 0x08
+
struct epan_uat;
struct _e_addr_resolve;
@@ -60,6 +65,7 @@ char string_to_name_resolve(const char *string, struct _e_addr_resolve *name_res
*/
#define FO_STYLE_LAST_OPENED 0 /* start in last directory we looked at */
#define FO_STYLE_SPECIFIED 1 /* start in specified directory */
+#define FO_STYLE_CWD 2 /* start in current working directory at startup */
/*
* Toolbar styles.
@@ -113,6 +119,11 @@ typedef enum {
} version_info_e;
typedef enum {
+ layout_vertical,
+ layout_horizontal
+} splitter_layout_e;
+
+typedef enum {
pref_default,
pref_stashed,
pref_current
@@ -136,111 +147,117 @@ typedef enum {
typedef struct _e_prefs {
GList *col_list;
- gint num_cols;
+ int num_cols;
color_t st_client_fg, st_client_bg, st_server_fg, st_server_bg;
color_t gui_text_valid, gui_text_invalid, gui_text_deprecated;
- gboolean restore_filter_after_following_stream;
- gint gui_toolbar_main_style;
- gchar *gui_font_name;
+ bool restore_filter_after_following_stream;
+ int gui_toolbar_main_style;
+ char *gui_font_name;
color_t gui_active_fg;
color_t gui_active_bg;
- gint gui_active_style;
+ int gui_active_style;
color_t gui_inactive_fg;
color_t gui_inactive_bg;
- gint gui_inactive_style;
+ int gui_inactive_style;
color_t gui_marked_fg;
color_t gui_marked_bg;
color_t gui_ignored_fg;
color_t gui_ignored_bg;
- gchar *gui_colorized_fg;
- gchar *gui_colorized_bg;
- gboolean gui_geometry_save_position;
- gboolean gui_geometry_save_size;
- gboolean gui_geometry_save_maximized;
- guint gui_recent_df_entries_max;
- guint gui_recent_files_count_max;
- guint gui_fileopen_style;
- gchar *gui_fileopen_dir;
- guint gui_fileopen_preview;
- gchar *gui_tlskeylog_command;
- gboolean gui_ask_unsaved;
- gboolean gui_autocomplete_filter;
- gboolean gui_find_wrap;
- gchar *gui_window_title;
- gchar *gui_prepend_window_title;
- gchar *gui_start_title;
+ char *gui_colorized_fg;
+ char *gui_colorized_bg;
+ bool gui_geometry_save_position;
+ bool gui_geometry_save_size;
+ bool gui_geometry_save_maximized;
+ unsigned gui_recent_df_entries_max;
+ unsigned gui_recent_files_count_max;
+ unsigned gui_fileopen_style;
+ char *gui_fileopen_dir;
+ unsigned gui_fileopen_preview;
+ char *gui_tlskeylog_command;
+ bool gui_ask_unsaved;
+ bool gui_autocomplete_filter;
+ bool gui_find_wrap;
+ char *gui_window_title;
+ char *gui_prepend_window_title;
+ char *gui_start_title;
version_info_e gui_version_placement;
- guint gui_max_export_objects;
- guint gui_max_tree_items;
- guint gui_max_tree_depth;
+ unsigned gui_max_export_objects;
+ unsigned gui_max_tree_items;
+ unsigned gui_max_tree_depth;
+ bool gui_welcome_page_show_recent;
layout_type_e gui_layout_type;
layout_pane_content_e gui_layout_content_1;
layout_pane_content_e gui_layout_content_2;
layout_pane_content_e gui_layout_content_3;
- gchar *gui_interfaces_hide_types;
- gboolean gui_interfaces_show_hidden;
- gboolean gui_interfaces_remote_display;
- gboolean gui_io_graph_automatic_update;
- gboolean gui_io_graph_enable_legend;
- gboolean gui_packet_details_show_byteview;
- gchar *capture_device;
- gchar *capture_devices_linktypes;
- gchar *capture_devices_descr;
- gchar *capture_devices_hide;
- gchar *capture_devices_monitor_mode;
- gchar *capture_devices_buffersize;
- gchar *capture_devices_snaplen;
- gchar *capture_devices_pmode;
- gchar *capture_devices_filter; /* XXX - Mostly unused. Deprecate? */
- gboolean capture_prom_mode;
- gboolean capture_pcap_ng;
- gboolean capture_real_time;
- guint capture_update_interval;
- gboolean capture_no_interface_load;
- gboolean capture_no_extcap;
- gboolean capture_show_info;
+ splitter_layout_e gui_packet_dialog_layout;
+ char *gui_interfaces_hide_types;
+ bool gui_interfaces_show_hidden;
+ bool gui_interfaces_remote_display;
+ bool gui_io_graph_automatic_update;
+ bool gui_io_graph_enable_legend;
+ bool gui_packet_details_show_byteview;
+ char *capture_device;
+ char *capture_devices_linktypes;
+ char *capture_devices_descr;
+ char *capture_devices_hide;
+ char *capture_devices_monitor_mode;
+ char *capture_devices_buffersize;
+ char *capture_devices_snaplen;
+ char *capture_devices_pmode;
+ char *capture_devices_filter; /* XXX - Mostly unused. Deprecate? */
+ bool capture_prom_mode;
+ bool capture_monitor_mode;
+ bool capture_pcap_ng;
+ bool capture_real_time;
+ unsigned capture_update_interval;
+ bool capture_no_interface_load;
+ bool capture_no_extcap;
+ bool capture_show_info;
GList *capture_columns;
- guint tap_update_interval;
- gboolean display_hidden_proto_items;
- gboolean display_byte_fields_with_spaces;
- gboolean enable_incomplete_dissectors_check;
- gboolean incomplete_dissectors_check_debug;
- gboolean strict_conversation_tracking_heuristics;
- gboolean ignore_dup_frames;
- guint ignore_dup_frames_cache_entries;
- gboolean filter_expressions_old; /* TRUE if old filter expressions preferences were loaded. */
- gboolean gui_update_enabled;
+ unsigned tap_update_interval;
+ bool display_hidden_proto_items;
+ bool display_byte_fields_with_spaces;
+ bool enable_incomplete_dissectors_check;
+ bool incomplete_dissectors_check_debug;
+ bool strict_conversation_tracking_heuristics;
+ int conversation_deinterlacing_key;
+ bool ignore_dup_frames;
+ unsigned ignore_dup_frames_cache_entries;
+ bool filter_expressions_old; /* true if old filter expressions preferences were loaded. */
+ bool cols_hide_new; /* true if the new (index-based) gui.column.hide preference was loaded. */
+ bool gui_update_enabled;
software_update_channel_e gui_update_channel;
- gint gui_update_interval;
- gint gui_debounce_timer;
- gchar *saved_at_version;
- gboolean unknown_prefs; /* unknown or obsolete pref(s) */
- gboolean gui_packet_list_separator;
- gboolean gui_packet_header_column_definition;
- gboolean gui_packet_list_hover_style; /* Enable/Disable mouse-over colorization */
- gboolean gui_show_selected_packet;
- gboolean gui_show_file_load_time;
+ int gui_update_interval;
+ int gui_debounce_timer;
+ char *saved_at_version;
+ bool unknown_prefs; /* unknown or obsolete pref(s) */
+ bool gui_packet_list_separator;
+ bool gui_packet_header_column_definition;
+ bool gui_packet_list_hover_style; /* Enable/Disable mouse-over colorization */
+ bool gui_show_selected_packet;
+ bool gui_show_file_load_time;
elide_mode_e gui_packet_list_elide_mode;
- gboolean gui_packet_list_show_related;
- gboolean gui_packet_list_show_minimap;
- gboolean gui_packet_list_sortable;
- guint gui_packet_list_cached_rows_max;
- gint gui_decimal_places1; /* Used for type 1 calculations */
- gint gui_decimal_places2; /* Used for type 2 calculations */
- gint gui_decimal_places3; /* Used for type 3 calculations */
- gboolean gui_rtp_player_use_disk1;
- gboolean gui_rtp_player_use_disk2;
- gboolean st_enable_burstinfo;
- gboolean st_burst_showcount;
- gint st_burst_resolution;
- gint st_burst_windowlen;
- gboolean st_sort_casesensitve;
- gboolean st_sort_rng_fixorder;
- gboolean st_sort_rng_nameonly;
- gint st_sort_defcolflag;
- gboolean st_sort_defdescending;
- gboolean st_sort_showfullname;
- gboolean extcap_save_on_start;
+ bool gui_packet_list_show_related;
+ bool gui_packet_list_show_minimap;
+ bool gui_packet_list_sortable;
+ unsigned gui_packet_list_cached_rows_max;
+ int gui_decimal_places1; /* Used for type 1 calculations */
+ int gui_decimal_places2; /* Used for type 2 calculations */
+ int gui_decimal_places3; /* Used for type 3 calculations */
+ bool gui_rtp_player_use_disk1;
+ bool gui_rtp_player_use_disk2;
+ unsigned flow_graph_max_export_items;
+ bool st_enable_burstinfo;
+ bool st_burst_showcount;
+ int st_burst_resolution;
+ int st_burst_windowlen;
+ bool st_sort_casesensitve;
+ bool st_sort_rng_fixorder;
+ bool st_sort_rng_nameonly;
+ int st_sort_defcolflag;
+ bool st_sort_defdescending;
+ bool st_sort_showfullname;
+ bool extcap_save_on_start;
} e_prefs;
WS_DLL_PUBLIC e_prefs prefs;
@@ -266,9 +283,9 @@ WS_DLL_PUBLIC void prefs_reset(void);
void prefs_cleanup(void);
/** Store whether the current UI theme is dark so that we can adjust colors
-* @param is_dark set to TRUE if the UI's theme is dark
+* @param is_dark set to true if the UI's theme is dark
*/
-WS_DLL_PUBLIC void prefs_set_gui_theme_is_dark(gboolean is_dark);
+WS_DLL_PUBLIC void prefs_set_gui_theme_is_dark(bool is_dark);
/**
* Register that a protocol has preferences.
@@ -347,14 +364,14 @@ WS_DLL_PUBLIC module_t *prefs_register_protocol_obsolete(int id);
/**
* Callback function for module list scanners.
*/
-typedef guint (*module_cb)(module_t *module, gpointer user_data);
+typedef unsigned (*module_cb)(module_t *module, void *user_data);
/**
- * Returns TRUE if a preferences module has any submodules
+ * Returns true if a preferences module has any submodules
* @param module a preferences module which can be used to register a user 'preference'
- * @return TRUE if a preferences module has any submodules, otherwise FALSE
+ * @return true if a preferences module has any submodules, otherwise false
*/
-WS_DLL_PUBLIC gboolean prefs_module_has_submodules(module_t *module);
+WS_DLL_PUBLIC bool prefs_module_has_submodules(module_t *module);
/**
* Call a callback function, with a specified argument, for each module
@@ -367,7 +384,7 @@ WS_DLL_PUBLIC gboolean prefs_module_has_submodules(module_t *module);
* @param callback the callback to call
* @param user_data additional data to pass to the callback
*/
-WS_DLL_PUBLIC guint prefs_modules_foreach(module_cb callback, gpointer user_data);
+WS_DLL_PUBLIC unsigned prefs_modules_foreach(module_cb callback, void *user_data);
/**
* Call a callback function, with a specified argument, for each submodule
@@ -384,7 +401,7 @@ WS_DLL_PUBLIC guint prefs_modules_foreach(module_cb callback, gpointer user_data
* @param callback the callback to call
* @param user_data additional data to pass to the callback
*/
-WS_DLL_PUBLIC guint prefs_modules_foreach_submodules(module_t *module, module_cb callback, gpointer user_data);
+WS_DLL_PUBLIC unsigned prefs_modules_foreach_submodules(module_t *module, module_cb callback, void *user_data);
/**
* Call the "apply" callback function for each module if any of its
@@ -409,11 +426,11 @@ struct preference;
typedef struct preference pref_t;
/**
- * Returns TRUE if the provided protocol has registered preferences.
+ * Returns true if the provided protocol has registered preferences.
* @param name the name of the protocol to look up
- * @return TRUE if the given protocol has registered preferences, otherwise FALSE
+ * @return true if the given protocol has registered preferences, otherwise false
*/
-WS_DLL_PUBLIC gboolean prefs_is_registered_protocol(const char *name);
+WS_DLL_PUBLIC bool prefs_is_registered_protocol(const char *name);
/**
* Returns the module title of a registered protocol (or NULL if unknown).
@@ -461,7 +478,7 @@ WS_DLL_PUBLIC pref_t *prefs_find_preference(module_t * module, const char *pref)
* field is changed in the preference dialog box
*/
WS_DLL_PUBLIC void prefs_register_uint_preference(module_t *module, const char *name,
- const char *title, const char *description, guint base, guint *var);
+ const char *title, const char *description, unsigned base, unsigned *var);
/*
* prefs_register_ callers must conform to the following:
@@ -489,7 +506,7 @@ WS_DLL_PUBLIC void prefs_register_uint_preference(module_t *module, const char *
* field is changed in the preference dialog box
*/
WS_DLL_PUBLIC void prefs_register_bool_preference(module_t *module, const char *name,
- const char *title, const char *description, gboolean *var);
+ const char *title, const char *description, bool *var);
/**
* Register a preference with an enumerated value.
@@ -507,13 +524,13 @@ WS_DLL_PUBLIC void prefs_register_bool_preference(module_t *module, const char *
* @param var pointer to the storage location that is updated when the
* field is changed in the preference dialog box
* @param enumvals a null-terminated array of enum_val_t structures
- * @param radio_buttons TRUE if the field is to be displayed in the
+ * @param radio_buttons true if the field is to be displayed in the
* preferences dialog as a set of radio buttons,
- * FALSE if it is to be displayed as an option menu
+ * false if it is to be displayed as an option menu
*/
WS_DLL_PUBLIC void prefs_register_enum_preference(module_t *module, const char *name,
- const char *title, const char *description, gint *var,
- const enum_val_t *enumvals, gboolean radio_buttons);
+ const char *title, const char *description, int *var,
+ const enum_val_t *enumvals, bool radio_buttons);
/**
* Register a preference with a character-string value.
@@ -564,10 +581,10 @@ WS_DLL_PUBLIC void prefs_register_string_preference(module_t *module, const char
* preference registration. The passed-in string may be
* freed, but you must keep another pointer to the string
* in order to free it
- * @param for_writing TRUE to display a Save dialog, FALSE to display an Open dialog.
+ * @param for_writing true to display a Save dialog, false to display an Open dialog.
*/
WS_DLL_PUBLIC void prefs_register_filename_preference(module_t *module, const char *name,
- const char *title, const char *description, const char **var, gboolean for_writing);
+ const char *title, const char *description, const char **var, bool for_writing);
/**
* Register a preference with a directory name (string) value.
@@ -615,7 +632,7 @@ WS_DLL_PUBLIC void prefs_register_directory_preference(module_t *module, const c
*/
WS_DLL_PUBLIC void prefs_register_range_preference(module_t *module, const char *name,
const char *title, const char *description, range_t **var,
- guint32 max_value);
+ uint32_t max_value);
/**
* Register a static text 'preference'. It can be used to add some info/explanation.
@@ -738,10 +755,12 @@ void prefs_register_custom_preference(module_t *module, const char *name,
* @param var pointer to the storage location that is updated when the
* field is changed in the preference dialog box.
* @param max_value the maximum allowed value for a range (0 is the minimum)
+ * @param dissector_table the name of the dissector table
+ * @param dissector_description the handle description
*/
void prefs_register_decode_as_range_preference(module_t *module, const char *name,
const char *title, const char *description, range_t **var,
- guint32 max_value);
+ uint32_t max_value, const char *dissector_table, const char *dissector_description);
/**
* Register a preference with an password (password is never stored).
@@ -763,6 +782,30 @@ WS_DLL_PUBLIC void prefs_register_password_preference(module_t *module, const ch
const char *title, const char *description, const char **var);
/**
+ * Register a preference with a dissector name.
+ * @param module the preferences module returned by prefs_register_protocol() or
+ * prefs_register_protocol_subtree()
+ * @param name the preference's identifier. This is appended to the name of the
+ * protocol, with a "." between them, to create a unique identifier.
+ * The identifier should not include the protocol name, as the name in
+ * the preference file will already have it. Make sure that
+ * only lower-case ASCII letters, numbers, underscores and
+ * dots appear in the preference name.
+ * @param title Field's title in the preferences dialog
+ * @param description description to include in the preferences file
+ * and shown as tooltip in the GUI, or NULL
+ * @param var pointer to the storage location that is updated when the
+ * field is changed in the preference dialog box. Note that
+ * with string preferences the given pointer is overwritten
+ * with a pointer to a new copy of the string during the
+ * preference registration. The passed-in string may be
+ * freed, but you must keep another pointer to the string
+ * in order to free it
+ */
+WS_DLL_PUBLIC void prefs_register_dissector_preference(module_t *module, const char *name,
+ const char *title, const char *description, const char **var);
+
+/**
* Register a preference that used to be supported but no longer is.
*
* Note that a warning will pop up if you've saved such preference to the
@@ -797,13 +840,13 @@ WS_DLL_PUBLIC void prefs_register_obsolete_preference(module_t *module,
* @param var pointer to the storage location that is updated when the
* field is changed in the preference dialog box
* @param enumvals a null-terminated array of enum_val_t structures
- * @param radio_buttons TRUE if the field is to be displayed in the
+ * @param radio_buttons true if the field is to be displayed in the
* preferences dialog as a set of radio buttons,
- * FALSE if it is to be displayed as an option menu
+ * false if it is to be displayed as an option menu
*/
WS_DLL_PUBLIC void prefs_register_custom_preference_TCP_Analysis(module_t *module, const char *name,
- const char *title, const char *description, gint *var,
- const enum_val_t *enumvals, gboolean radio_buttons);
+ const char *title, const char *description, int *var,
+ const enum_val_t *enumvals, bool radio_buttons);
/**
* Mark a preference that affects fields change. This works for bool, enum,
@@ -823,7 +866,7 @@ WS_DLL_PUBLIC void prefs_set_preference_effect_fields(module_t *module,
const char *name);
-typedef guint (*pref_cb)(pref_t *pref, gpointer user_data);
+typedef unsigned (*pref_cb)(pref_t *pref, void *user_data);
/**
* Call a callback function, with a specified argument, for each preference
@@ -839,8 +882,8 @@ typedef guint (*pref_cb)(pref_t *pref, gpointer user_data);
* @return If any of the callbacks return a non-zero value, stop and return that
* value, otherwise return 0.
*/
-WS_DLL_PUBLIC guint prefs_pref_foreach(module_t *module, pref_cb callback,
- gpointer user_data);
+WS_DLL_PUBLIC unsigned prefs_pref_foreach(module_t *module, pref_cb callback,
+ void *user_data);
/**
* Parse through a list of comma-separated, possibly quoted strings.
@@ -852,7 +895,7 @@ WS_DLL_PUBLIC guint prefs_pref_foreach(module_t *module, pref_cb callback,
* @param str a list of comma-separated, possibly quoted strings
* @return a list of the string data, or NULL if there's an error
*/
-WS_DLL_PUBLIC GList *prefs_get_string_list(const gchar *str);
+WS_DLL_PUBLIC GList *prefs_get_string_list(const char *str);
/**
* Clear the given list of string data.
@@ -944,9 +987,9 @@ WS_DLL_PUBLIC prefs_set_pref_e prefs_set_pref(char *prefarg, char **errmsg);
* keep it from showing up in the prefrences dialog.
*
* @param pref A preference.
- * @return TRUE if the preference is obsolete, otherwise FALSE
+ * @return true if the preference is obsolete, otherwise false
*/
-gboolean prefs_get_preference_obsolete(pref_t *pref);
+bool prefs_get_preference_obsolete(pref_t *pref);
/**
* Make a preference obsolete
@@ -965,7 +1008,7 @@ prefs_set_pref_e prefs_set_preference_obsolete(pref_t *pref);
* @param pref_name the preference name, e.g. "desegment".
* @return the preference's value
*/
-WS_DLL_PUBLIC guint prefs_get_uint_value(const char *module_name, const char* pref_name);
+WS_DLL_PUBLIC unsigned prefs_get_uint_value(const char *module_name, const char* pref_name);
/**
* Get the current range preference value (maintained by pref, so it doesn't need to be freed). This allows the
@@ -979,34 +1022,34 @@ WS_DLL_PUBLIC guint prefs_get_uint_value(const char *module_name, const char* pr
WS_DLL_PUBLIC range_t* prefs_get_range_value(const char *module_name, const char* pref_name);
/**
- * Returns TRUE if the specified capture device is hidden
+ * Returns true if the specified capture device is hidden
* @param name the name of the capture device
- * @return TRUE if the specified capture device is hidden, otherwise FALSE
+ * @return true if the specified capture device is hidden, otherwise false
*/
-WS_DLL_PUBLIC gboolean prefs_is_capture_device_hidden(const char *name);
+WS_DLL_PUBLIC bool prefs_is_capture_device_hidden(const char *name);
/**
- * Returns TRUE if the given device should capture in monitor mode by default
+ * Returns true if the given device should capture in monitor mode by default
* @param name the name of the capture device
- * @return TRUE if the specified capture device should capture in monitor mode by default, otherwise FALSE
+ * @return true if the specified capture device should capture in monitor mode by default, otherwise false
*/
-WS_DLL_PUBLIC gboolean prefs_capture_device_monitor_mode(const char *name);
+WS_DLL_PUBLIC bool prefs_capture_device_monitor_mode(const char *name);
/**
- * Returns TRUE if the user has marked this column as visible
+ * Returns true if the user has marked this column as visible
*
* @param column the name of the column
- * @return TRUE if this column as visible, otherwise FALSE
+ * @return true if this column as visible, otherwise false
*/
-WS_DLL_PUBLIC gboolean prefs_capture_options_dialog_column_is_visible(const gchar *column);
+WS_DLL_PUBLIC bool prefs_capture_options_dialog_column_is_visible(const char *column);
/**
- * Returns TRUE if the layout pane content is enabled
+ * Returns true if the layout pane content is enabled
*
* @param layout_pane_content the layout pane content to check
- * @return TRUE if the layout pane content is enabled, otherwise FALSE
+ * @return true if the layout pane content is enabled, otherwise false
*/
-WS_DLL_PUBLIC gboolean prefs_has_layout_pane_content (layout_pane_content_e layout_pane_content);
+WS_DLL_PUBLIC bool prefs_has_layout_pane_content (layout_pane_content_e layout_pane_content);
#ifdef __cplusplus
}