|
Wireshark 4.7.0
The Wireshark network protocol analyzer
|
#include <glib.h>#include <epan/params.h>#include <epan/range.h>#include <wsutil/color.h>#include "ws_symbol_export.h"Go to the source code of this file.
Classes | |
| struct | _e_prefs |
| Global Wireshark preferences structure holding all persistent configuration settings. More... | |
Typedefs | |
| typedef struct _e_prefs | e_prefs |
| Global Wireshark preferences structure holding all persistent configuration settings. | |
| typedef struct pref_module | module_t |
| typedef unsigned(* | module_cb) (module_t *module, void *user_data) |
| typedef struct preference | pref_t |
| typedef unsigned(* | pref_cb) (pref_t *pref, void *user_data) |
Functions | |
| WS_DLL_PUBLIC char | string_to_name_resolve (const char *string, struct _e_addr_resolve *name_resolve) |
| void | prefs_init (const char **col_fmt, int num_cols) |
| Initialize preferences system. | |
| WS_DLL_PUBLIC void | prefs_reset (const char *app_env_var_prefix, const char **col_fmt, int num_cols) |
| Resets preferences to their default values. | |
| void | prefs_cleanup (void) |
| Clean up preferences. | |
| WS_DLL_PUBLIC module_t * | prefs_register_protocol (int id, void(*apply_cb)(void)) |
| WS_DLL_PUBLIC void | prefs_register_module_alias (const char *name, module_t *module) |
| Register an alias for a preference module. | |
| void | prefs_deregister_protocol (int id) |
| WS_DLL_PUBLIC module_t * | prefs_register_stat (const char *name, const char *title, const char *description, void(*apply_cb)(void)) |
| WS_DLL_PUBLIC module_t * | prefs_register_codec (const char *name, const char *title, const char *description, void(*apply_cb)(void)) |
| WS_DLL_PUBLIC module_t * | prefs_register_protocol_subtree (const char *subtree, int id, void(*apply_cb)(void)) |
| WS_DLL_PUBLIC module_t * | prefs_register_protocol_obsolete (int id) |
| WS_DLL_PUBLIC module_t * | prefs_register_module (wmem_tree_t *pref_tree, wmem_tree_t *master_pref_tree, const char *name, const char *title, const char *description, const char *help, void(*apply_cb)(void), const bool use_gui) |
| Register a module that will have preferences. Specify the module under which to register it, the name used for the module in the preferences file, the title used in the tab for it in a preferences dialog box, and a routine to call back when the preferences are applied. | |
| WS_DLL_PUBLIC bool | prefs_module_has_submodules (module_t *module) |
| WS_DLL_PUBLIC unsigned | prefs_modules_foreach (const wmem_tree_t *module, module_cb callback, void *user_data) |
| WS_DLL_PUBLIC unsigned | prefs_modules_foreach_submodules (const wmem_tree_t *module, module_cb callback, void *user_data) |
| WS_DLL_PUBLIC unsigned | prefs_modules_for_all_modules (module_cb callback, void *user_data) |
| WS_DLL_PUBLIC void | prefs_apply_all (void) |
| WS_DLL_PUBLIC void | prefs_apply (module_t *module) |
| WS_DLL_PUBLIC bool | prefs_is_registered_protocol (const char *name) |
| WS_DLL_PUBLIC const char * | prefs_get_title_by_name (const char *name) |
| WS_DLL_PUBLIC module_t * | prefs_find_module (const char *name) |
| WS_DLL_PUBLIC pref_t * | prefs_find_preference (module_t *module, const char *pref) |
| WS_DLL_PUBLIC void | prefs_register_uint_preference (module_t *module, const char *name, const char *title, const char *description, unsigned base, unsigned *var) |
| WS_DLL_PUBLIC void | prefs_register_int_preference (module_t *module, const char *name, const char *title, const char *description, int *var) |
| WS_DLL_PUBLIC void | prefs_register_float_preference (module_t *module, const char *name, const char *title, const char *description, unsigned num_decimal, double *var) |
| WS_DLL_PUBLIC void | prefs_register_bool_preference (module_t *module, const char *name, const char *title, const char *description, bool *var) |
| WS_DLL_PUBLIC void | prefs_register_enum_preference (module_t *module, const char *name, const char *title, const char *description, int *var, const enum_val_t *enumvals, bool radio_buttons) |
| WS_DLL_PUBLIC void | prefs_register_string_preference (module_t *module, const char *name, const char *title, const char *description, const char **var) |
| WS_DLL_PUBLIC void | prefs_register_filename_preference (module_t *module, const char *name, const char *title, const char *description, const char **var, bool for_writing) |
| WS_DLL_PUBLIC void | prefs_register_directory_preference (module_t *module, const char *name, const char *title, const char *description, const char **var) |
| WS_DLL_PUBLIC void | prefs_register_list_string_preference (module_t *module, const char *name, const char *title, const char *description, wmem_list_t **var) |
| WS_DLL_PUBLIC void | prefs_register_multiple_string_preference (module_t *module, const char *name, const char *title, const char *description, wmem_list_t **var) |
| WS_DLL_PUBLIC void | prefs_register_range_preference (module_t *module, const char *name, const char *title, const char *description, range_t **var, uint32_t max_value) |
| WS_DLL_PUBLIC void | prefs_register_static_text_preference (module_t *module, const char *name, const char *title, const char *description) |
| WS_DLL_PUBLIC void | prefs_register_uat_preference (module_t *module, const char *name, const char *title, const char *description, struct epan_uat *uat) |
| void | prefs_register_color_preference (module_t *module, const char *name, const char *title, const char *description, color_t *color) |
| void | prefs_register_custom_preference (module_t *module, const char *name, const char *title, const char *description, struct pref_custom_cbs *custom_cbs, void **custom_data) |
| void | prefs_register_decode_as_range_preference (module_t *module, const char *name, const char *title, const char *description, range_t **var, uint32_t max_value, const char *dissector_table, const char *dissector_description) |
| WS_DLL_PUBLIC void | prefs_register_password_preference (module_t *module, const char *name, const char *title, const char *description, const char **var) |
| WS_DLL_PUBLIC void | prefs_register_dissector_preference (module_t *module, const char *name, const char *title, const char *description, const char **var) |
| WS_DLL_PUBLIC void | prefs_register_obsolete_preference (module_t *module, const char *name) |
| Register a preference that used to be supported but no longer is. | |
| WS_DLL_PUBLIC void | prefs_register_custom_preference_TCP_Analysis (module_t *module, const char *name, const char *title, const char *description, int *var, const enum_val_t *enumvals, bool radio_buttons) |
| Register a preference with an enumerated value. | |
| WS_DLL_PUBLIC void | prefs_set_preference_effect_fields (module_t *module, const char *name) |
| Mark a preference that affects fields change. | |
| WS_DLL_PUBLIC void | prefs_set_preference_effect (module_t *module, const char *name, unsigned flags) |
| Set the effect flags for a preference in a given module. | |
| WS_DLL_PUBLIC unsigned | prefs_pref_foreach (module_t *module, pref_cb callback, void *user_data) |
| Call a callback function, with a specified argument, for each preference in a given module. | |
| WS_DLL_PUBLIC GList * | prefs_get_string_list (const char *str) |
| Parse through a list of comma-separated, possibly quoted strings. Return a list of the string data. | |
| WS_DLL_PUBLIC void | prefs_clear_string_list (GList *sl) |
| Clear the given list of string data. | |
| WS_DLL_PUBLIC const char * | prefs_pref_type_name (pref_t *pref) |
| Fetch a short preference type name, e.g. "Integer". | |
| WS_DLL_PUBLIC char * | prefs_pref_type_description (pref_t *pref) |
| Fetch a long description of the preference type. | |
| WS_DLL_PUBLIC char * | prefs_pref_to_str (pref_t *pref, pref_source_t source) |
| Fetch a string representation of the preference. | |
| WS_DLL_PUBLIC int | prefs_num_non_uat (module_t *module) |
| Fetch the number of preferences in a module that are not UATs. | |
| WS_DLL_PUBLIC bool | prefs_is_preference_obsolete (pref_t *pref) |
| Fetch whether a preference is marked obsolete. | |
| e_prefs * | read_prefs (const char *app_env_var_prefix) |
| Read the preferences file, fill in "prefs", and return a pointer to it. | |
| WS_DLL_PUBLIC int | write_prefs (const char *app_env_var_prefix, char **pf_path_return) |
| Write out "prefs" to the user's preferences file, and return 0. | |
| WS_DLL_PUBLIC void | pref_write_individual (void *data, void *user_data) |
| Callback function for writing individual preferences. | |
| WS_DLL_PUBLIC void | pref_free_individual (void *data, void *user_data) |
| Callback function for freeing individual preferences. | |
| WS_DLL_PUBLIC prefs_set_pref_e | prefs_set_pref (char *prefarg, char **errmsg) |
| WS_DLL_PUBLIC range_t * | prefs_get_range_value (const char *module_name, const char *pref_name) |
| WS_DLL_PUBLIC bool | prefs_is_capture_device_hidden (const char *name) |
| Checks if the specified capture device is hidden. | |
| WS_DLL_PUBLIC bool | prefs_capture_device_monitor_mode (const char *name) |
| Returns true if the given device should capture in monitor mode by default. | |
| WS_DLL_PUBLIC bool | prefs_capture_options_dialog_column_is_visible (const char *column) |
| Returns true if the user has marked this column as visible. | |
| WS_DLL_PUBLIC bool | prefs_has_layout_pane_content (layout_pane_content_e layout_pane_content) |
| Returns true if the layout pane content is enabled. | |
Variables | |
| WS_DLL_PUBLIC e_prefs | prefs |
Definitions for preference handling routines
Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs
SPDX-License-Identifier: GPL-2.0-or-later
| typedef unsigned(* module_cb) (module_t *module, void *user_data) |
Callback function for module list scanners.
| enum abs_time_format_e |
Controls whether absolute timestamps are rendered as ASCII in tree and column views.
| enum copy_format_e |
| enum elide_mode_e |
Multi-color stripe display mode for the packet list scrollbar and rows.
Visual style of the separator between adjacent color stripes in the packet list.
Content assigned to a single layout pane in the main window.
| enum layout_type_e |
Arrangement type of the summary, details, and hex panes in the main window.
| enum pref_source_t |
| enum prefs_set_pref_e |
| enum splitter_layout_e |
| enum version_info_e |
Controls where version information is displayed in the GUI.
| Enumerator | |
|---|---|
| version_welcome_only | Version shown on the welcome splash screen only |
| version_title_only | Version shown in the window title bar only |
| version_both | Version shown in both the welcome screen and title bar |
| version_neither | Version not shown anywhere |
| WS_DLL_PUBLIC void pref_free_individual | ( | void * | data, |
| void * | user_data | ||
| ) |
Callback function for freeing individual preferences.
| data | A preference pointer of type pref_t* |
| user_data | unused |
| WS_DLL_PUBLIC void pref_write_individual | ( | void * | data, |
| void * | user_data | ||
| ) |
Callback function for writing individual preferences.
| data | A preference pointer of type pref_t* |
| user_data | write_pref_arg_t* pointer |
| WS_DLL_PUBLIC void prefs_apply | ( | module_t * | module | ) |
Call the "apply" callback function for a specific module if any of its preferences have changed, and then clear the flag saying its preferences have changed, as the module has been notified of that fact.
| module | the module to call the 'apply' callback function for |
| WS_DLL_PUBLIC void prefs_apply_all | ( | void | ) |
Call the "apply" callback function for each module if any of its preferences have changed, and then clear the flag saying its preferences have changed, as the module has been notified of that fact.
| WS_DLL_PUBLIC bool prefs_capture_device_monitor_mode | ( | const char * | name | ) |
Returns true if the given device should capture in monitor mode by default.
| name | the name of the capture device |
| WS_DLL_PUBLIC bool prefs_capture_options_dialog_column_is_visible | ( | const char * | column | ) |
Returns true if the user has marked this column as visible.
| column | the name of the column |
| void prefs_cleanup | ( | void | ) |
Clean up preferences.
Frees memory used by proto routines. Called at program shutdown
| WS_DLL_PUBLIC void prefs_clear_string_list | ( | GList * | sl | ) |
Clear the given list of string data.
| sl | the GList to clear |
| void prefs_deregister_protocol | ( | int | id | ) |
Deregister preferences from a protocol.
| id | the value returned by "proto_register_protocol()" when the protocol was registered. |
| WS_DLL_PUBLIC module_t * prefs_find_module | ( | const char * | name | ) |
Given a module name, return a pointer to its pref_module struct, or NULL if it's not found.
| name | The preference module name. Usually the same as the protocol name, e.g. "tcp". |
Given a module and a preference name, return a pointer to the given module's given preference or NULL if it's not found.
| module | The preference module name. Usually the same as the protocol name, e.g. "tcp". |
| pref | The preference name, e.g. "desegment". |
| WS_DLL_PUBLIC range_t * prefs_get_range_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 preference structure to remain hidden from those that doesn't really need it.
| module_name | the preference module name. Usually the same as the protocol name, e.g. "tcp". |
| pref_name | the preference name, e.g. "desegment". |
| WS_DLL_PUBLIC GList * prefs_get_string_list | ( | const char * | str | ) |
Parse through a list of comma-separated, possibly quoted strings. Return a list of the string data.
Commas, whitespace, and the quotes surrounding entries are removed. Quotes and backslashes escaped with a backslash (") will remain.
| str | a list of comma-separated, possibly quoted strings |
| WS_DLL_PUBLIC const char * prefs_get_title_by_name | ( | const char * | name | ) |
Returns the module title of a registered protocol (or NULL if unknown).
| name | the name of the protocol to look up |
| WS_DLL_PUBLIC bool prefs_has_layout_pane_content | ( | layout_pane_content_e | layout_pane_content | ) |
Returns true if the layout pane content is enabled.
| layout_pane_content | the layout pane content to check |
| void prefs_init | ( | const char ** | col_fmt, |
| int | num_cols | ||
| ) |
Initialize preferences system.
Sets up memory used by proto routines. Called at program startup
| col_fmt | Array of column format strings |
| num_cols | Number of columns in the display |
Sets up memory used by proto routines. Called at program startup
| WS_DLL_PUBLIC bool prefs_is_capture_device_hidden | ( | const char * | name | ) |
Checks if the specified capture device is hidden.
| name | the name of the capture device |
| WS_DLL_PUBLIC bool prefs_is_preference_obsolete | ( | pref_t * | pref | ) |
Fetch whether a preference is marked obsolete.
| pref | A preference. |
| WS_DLL_PUBLIC bool prefs_is_registered_protocol | ( | const char * | name | ) |
Returns true if the provided protocol has registered preferences.
| name | the name of the protocol to look up |
| WS_DLL_PUBLIC bool prefs_module_has_submodules | ( | module_t * | module | ) |
Returns true if a preferences module has any submodules
| module | a preferences module which can be used to register a user 'preference' |
| WS_DLL_PUBLIC unsigned prefs_modules_for_all_modules | ( | module_cb | callback, |
| void * | user_data | ||
| ) |
Call a callback function, with a specified argument, for all modules.
Ignores "obsolete" modules; their sole purpose is to allow old preferences for dissectors that no longer have preferences to be silently ignored in preference files. Does not ignore subtrees, as this can be used when walking the display tree of modules.
| callback | the callback to call |
| user_data | additional data to pass to the callback |
| WS_DLL_PUBLIC unsigned prefs_modules_foreach | ( | const wmem_tree_t * | module, |
| module_cb | callback, | ||
| void * | user_data | ||
| ) |
Call a callback function, with a specified argument, for each module in the list of all modules. (This list does not include subtrees.)
Ignores "obsolete" modules; their sole purpose is to allow old preferences for dissectors that no longer have preferences to be silently ignored in preference files.
| module | module to act on |
| callback | the callback to call |
| user_data | additional data to pass to the callback |
| WS_DLL_PUBLIC unsigned prefs_modules_foreach_submodules | ( | const wmem_tree_t * | module, |
| module_cb | callback, | ||
| void * | user_data | ||
| ) |
Call a callback function, with a specified argument, for each submodule of a specified module. If the module is NULL, goes through the top-level list in the display tree of modules.
Ignores "obsolete" modules; their sole purpose is to allow old preferences for dissectors that no longer have preferences to be silently ignored in preference files. Does not ignore subtrees, as this can be used when walking the display tree of modules.
| module | module to walk through |
| callback | the callback to call |
| user_data | additional data to pass to the callback |
| WS_DLL_PUBLIC int prefs_num_non_uat | ( | module_t * | module | ) |
Fetch the number of preferences in a module that are not UATs.
| module | A preference module. |
| WS_DLL_PUBLIC unsigned prefs_pref_foreach | ( | module_t * | module, |
| pref_cb | callback, | ||
| void * | user_data | ||
| ) |
Call a callback function, with a specified argument, for each preference in a given module.
If any of the callbacks return a non-zero value, stop and return that value, otherwise return 0.
| module | the preferences module returned by prefs_register_protocol() or prefs_register_protocol_subtree() |
| callback | the callback to call |
| user_data | additional data to pass to the callback |
| WS_DLL_PUBLIC char * prefs_pref_to_str | ( | pref_t * | pref, |
| pref_source_t | source | ||
| ) |
Fetch a string representation of the preference.
| pref | A preference. |
| source | Which value of the preference to return, see pref_source_t. |
| WS_DLL_PUBLIC char * prefs_pref_type_description | ( | pref_t * | pref | ) |
Fetch a long description of the preference type.
| pref | A preference. |
| WS_DLL_PUBLIC const char * prefs_pref_type_name | ( | pref_t * | pref | ) |
Fetch a short preference type name, e.g. "Integer".
| pref | A preference. |
| WS_DLL_PUBLIC void prefs_register_bool_preference | ( | module_t * | module, |
| const char * | name, | ||
| const char * | title, | ||
| const char * | description, | ||
| bool * | var | ||
| ) |
Register a preference with an Boolean value.
| module | the preferences module returned by prefs_register_protocol() or prefs_register_protocol_subtree() |
| 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. |
| title | Field's title in the preferences dialog |
| description | description to include in the preferences file and shown as tooltip in the GUI, or NULL |
| var | pointer to the storage location that is updated when the field is changed in the preference dialog box |
| WS_DLL_PUBLIC module_t * prefs_register_codec | ( | const char * | name, |
| const char * | title, | ||
| const char * | description, | ||
| void(*)(void) | apply_cb | ||
| ) |
Register that a codec has preferences.
| name | is a name for the codec to use on the command line with "-o" and in preference files. |
| title | is a short human-readable name for the codec. |
| description | is a longer human-readable description of the codec. |
| apply_cb | routine to call back after we apply the preferences |
| void prefs_register_color_preference | ( | module_t * | module, |
| const char * | name, | ||
| const char * | title, | ||
| const char * | description, | ||
| color_t * | color | ||
| ) |
Register a color preference. Currently does not have any "GUI Dialog" support so the color data needs to be managed independently. Currently used by the "GUI preferences" to aid in reading/writing the preferences file, but the "data" is still managed by the specific "GUI preferences" dialog.
| module | the preferences module returned by prefs_register_protocol() or prefs_register_protocol_subtree() |
| 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. |
| title | Field's title in the preferences dialog |
| description | description to include in the preferences file and shown as tooltip in the GUI, or NULL |
| color | the color object that will be updated when the field is changed in the preference dialog box |
| void prefs_register_custom_preference | ( | module_t * | module, |
| const char * | name, | ||
| const char * | title, | ||
| const char * | description, | ||
| struct pref_custom_cbs * | custom_cbs, | ||
| void ** | custom_data | ||
| ) |
Register a custom preference. Currently does not have any "GUI Dialog" support so data needs to be managed independently. Currently used by the "GUI preferences" to aid in reading/writing the preferences file, but the "data" is still managed by the specific "GUI preferences" dialog.
| module | the preferences module returned by prefs_register_protocol() or prefs_register_protocol_subtree() |
| 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. |
| title | Field's title in the preferences dialog |
| description | description to include in the preferences file and shown as tooltip in the GUI, or NULL |
| custom_cbs | a structure with the custom preference's callbacks |
| custom_data | currently unused |
| WS_DLL_PUBLIC void prefs_register_custom_preference_TCP_Analysis | ( | module_t * | module, |
| const char * | name, | ||
| const char * | title, | ||
| const char * | description, | ||
| int * | var, | ||
| const enum_val_t * | enumvals, | ||
| bool | radio_buttons | ||
| ) |
Register a preference with an enumerated value.
| module | the preferences module returned by prefs_register_protocol() or prefs_register_protocol_subtree() |
| 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. |
| title | Field's title in the preferences dialog |
| description | description to include in the preferences file and shown as tooltip in the GUI, or NULL |
| var | pointer to the storage location that is updated when the field is changed in the preference dialog box |
| enumvals | a null-terminated array of enum_val_t structures |
| 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 |
| void prefs_register_decode_as_range_preference | ( | module_t * | module, |
| const char * | name, | ||
| const char * | title, | ||
| const char * | description, | ||
| range_t ** | var, | ||
| uint32_t | max_value, | ||
| const char * | dissector_table, | ||
| const char * | dissector_description | ||
| ) |
Register a (internal) "Decode As" preference with a ranged value.
| module | the preferences module returned by prefs_register_protocol() or prefs_register_protocol_subtree() |
| 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. |
| title | Field's title in the preferences dialog |
| description | description to include in the preferences file and shown as tooltip in the GUI, or NULL |
| var | pointer to the storage location that is updated when the field is changed in the preference dialog box. |
| max_value | the maximum allowed value for a range (0 is the minimum) |
| dissector_table | the name of the dissector table |
| dissector_description | the handle description |
| WS_DLL_PUBLIC void prefs_register_directory_preference | ( | module_t * | module, |
| const char * | name, | ||
| const char * | title, | ||
| const char * | description, | ||
| const char ** | var | ||
| ) |
Register a preference with a directory name (string) value. Directory name preferences are basically like string preferences except that the GUI gives the user the ability to browse for a directory.
| module | the preferences module returned by prefs_register_protocol() or prefs_register_protocol_subtree() |
| 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. |
| title | Field's title in the preferences dialog |
| description | description to include in the preferences file and shown as tooltip in the GUI, or NULL |
| var | pointer to the storage location that is updated when the field is changed in the preference dialog box. Note that 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 with a dissector name.
| module | the preferences module returned by prefs_register_protocol() or prefs_register_protocol_subtree() |
| 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. |
| title | Field's title in the preferences dialog |
| description | description to include in the preferences file and shown as tooltip in the GUI, or NULL |
| 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_enum_preference | ( | module_t * | module, |
| const char * | name, | ||
| const char * | title, | ||
| const char * | description, | ||
| int * | var, | ||
| const enum_val_t * | enumvals, | ||
| bool | radio_buttons | ||
| ) |
Register a preference with an enumerated value.
| module | the preferences module returned by prefs_register_protocol() or prefs_register_protocol_subtree() |
| 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. |
| title | Field's title in the preferences dialog |
| description | description to include in the preferences file and shown as tooltip in the GUI, or NULL |
| var | pointer to the storage location that is updated when the field is changed in the preference dialog box |
| enumvals | a null-terminated array of enum_val_t structures |
| 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 |
| WS_DLL_PUBLIC void prefs_register_filename_preference | ( | module_t * | module, |
| const char * | name, | ||
| const char * | title, | ||
| const char * | description, | ||
| const char ** | var, | ||
| bool | for_writing | ||
| ) |
Register a preference with a file name (string) value.
File name preferences are basically like string preferences except that the GUI gives the user the ability to browse for the file.
| module | the preferences module returned by prefs_register_protocol() or prefs_register_protocol_subtree() |
| 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. |
| title | Field's title in the preferences dialog |
| description | description to include in the preferences file and shown as tooltip in the GUI, or NULL |
| var | pointer to the storage location that is updated when the field is changed in the preference dialog box. Note that 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 |
| for_writing | true to display a Save dialog, false to display an Open dialog. |
| WS_DLL_PUBLIC void prefs_register_float_preference | ( | module_t * | module, |
| const char * | name, | ||
| const char * | title, | ||
| const char * | description, | ||
| unsigned | num_decimal, | ||
| double * | var | ||
| ) |
Register a preference with a float (double) value.
| module | the preferences module returned by prefs_register_protocol() or prefs_register_protocol_subtree() |
| 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 preference file will already have it. Make sure that only lower-case ASCII letters, numbers, underscores and dots appear in the preference name. |
| title | the title in the preferences dialog |
| description | the description included in the preferences file and shown as tooltip in the GUI, or NULL |
| num_decimal | the number of decimal places to display for a value |
| var | pointer to the storage location that is updated when the field is changed in the preference dialog box |
| WS_DLL_PUBLIC void prefs_register_int_preference | ( | module_t * | module, |
| const char * | name, | ||
| const char * | title, | ||
| const char * | description, | ||
| int * | var | ||
| ) |
Register a preference with an integer value.
| module | the preferences module returned by prefs_register_protocol() or prefs_register_protocol_subtree() |
| 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 preference file will already have it. Make sure that only lower-case ASCII letters, numbers, underscores and dots appear in the preference name. |
| title | the title in the preferences dialog |
| description | the description included in the preferences file and shown as tooltip in the GUI, or NULL |
| var | pointer to the storage location that is updated when the field is changed in the preference dialog box |
| WS_DLL_PUBLIC void prefs_register_list_string_preference | ( | module_t * | module, |
| const char * | name, | ||
| const char * | title, | ||
| const char * | description, | ||
| wmem_list_t ** | var | ||
| ) |
Register a preference with a comma-delimited string values.
This is currently not support in the UI for dissector use (internal UI preferences only)
| module | the preferences module returned by prefs_register_protocol() or prefs_register_protocol_subtree() |
| 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. |
| title | Field's title in the preferences dialog |
| description | description to include in the preferences file and shown as tooltip in the GUI, or NULL |
| var | pointer to the storage location that is updated when the field is changed in the preference dialog box. Note that the given pointer is overwritten with a pointer to a new copy of the list 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 module_t * prefs_register_module | ( | wmem_tree_t * | pref_tree, |
| wmem_tree_t * | master_pref_tree, | ||
| const char * | name, | ||
| const char * | title, | ||
| const char * | description, | ||
| const char * | help, | ||
| void(*)(void) | apply_cb, | ||
| const bool | use_gui | ||
| ) |
Register a module that will have preferences. Specify the module under which to register it, the name used for the module in the preferences file, the title used in the tab for it in a preferences dialog box, and a routine to call back when the preferences are applied.
| pref_tree | "Parent" preference tree under which to register this module. |
| master_pref_tree | List of all preference modules. |
| name | is a name for the module to use on the command line with "-o" and in preference files. |
| title | the module title in the preferences UI |
| description | the description included in the preferences file and shown as tooltip in the GUI, or NULL |
| help | The help string associated with the module, or NULL |
| apply_cb | Callback routine that is called when preferences are applied. It may be NULL, which inhibits the callback. |
| WS_DLL_PUBLIC void prefs_register_module_alias | ( | const char * | name, |
| module_t * | module | ||
| ) |
Register an alias for a preference module.
| name | the preference module's alias. Only ASCII letters, numbers, underscores, hyphens, and dots may appear in the name |
| module | the module to create an alias for |
| WS_DLL_PUBLIC void prefs_register_multiple_string_preference | ( | module_t * | module, |
| const char * | name, | ||
| const char * | title, | ||
| const char * | description, | ||
| wmem_list_t ** | var | ||
| ) |
Register a preference that has multiple string values This looks like multiple instances of the same preference in the file
This is currently not support in the UI for dissector use (internal UI preferences only)
| module | the preferences module returned by prefs_register_protocol() or prefs_register_protocol_subtree() |
| 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. |
| title | Field's title in the preferences dialog |
| description | description to include in the preferences file and shown as tooltip in the GUI, or NULL |
| var | pointer to the storage location that is updated when the field is changed in the preference dialog box. Note that the given pointer is overwritten with a pointer to a new copy of the list 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_obsolete_preference | ( | module_t * | module, |
| const char * | name | ||
| ) |
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 preference file and you subsequently take the code out. The way to make a preference obsolete is to register it with prefs_register_obsolete_preference()
| module | the preferences module returned by prefs_register_protocol() or prefs_register_protocol_subtree() |
| 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. |
| WS_DLL_PUBLIC void prefs_register_password_preference | ( | module_t * | module, |
| const char * | name, | ||
| const char * | title, | ||
| const char * | description, | ||
| const char ** | var | ||
| ) |
Register a preference with an password (password is never stored).
| module | the preferences module returned by prefs_register_protocol() or prefs_register_protocol_subtree() |
| 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 preference file will already have it. Make sure that only lower-case ASCII letters, numbers, underscores and dots appear in the preference name. |
| title | the title in the preferences dialog |
| description | the description included in the preferences file and shown as tooltip in the GUI, or NULL |
| var | pointer to the storage location that is updated when the field is changed in the preference dialog box |
| WS_DLL_PUBLIC module_t * prefs_register_protocol | ( | int | id, |
| void(*)(void) | apply_cb | ||
| ) |
Register that a protocol has preferences.
| id | the value returned by "proto_register_protocol()" when the protocol was registered. |
| apply_cb | callback routine that is called when preferences are applied. It may be NULL, which inhibits the callback. |
| WS_DLL_PUBLIC module_t * prefs_register_protocol_obsolete | ( | int | id | ) |
Register that a protocol used to have preferences but no longer does, by creating an "obsolete" module for it.
| id | the value returned by "proto_register_protocol()" when the protocol was registered. |
| WS_DLL_PUBLIC module_t * prefs_register_protocol_subtree | ( | const char * | subtree, |
| int | id, | ||
| void(*)(void) | apply_cb | ||
| ) |
Register that a protocol has preferences and group it under a single subtree
| subtree | the tree node name for grouping preferences the protocol was registered. |
| id | the value returned by "proto_register_protocol()" when the protocol was registered. |
| apply_cb | Callback routine that is called when preferences are applied. It may be NULL, which inhibits the callback. |
| WS_DLL_PUBLIC void prefs_register_range_preference | ( | module_t * | module, |
| const char * | name, | ||
| const char * | title, | ||
| const char * | description, | ||
| range_t ** | var, | ||
| uint32_t | max_value | ||
| ) |
Register a preference with a ranged value.
| module | the preferences module returned by prefs_register_protocol() or prefs_register_protocol_subtree() |
| 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. |
| title | Field's title in the preferences dialog |
| description | description to include in the preferences file and shown as tooltip in the GUI, or NULL |
| var | pointer to the storage location that is updated when the field is changed in the preference dialog box. |
| max_value | the maximum allowed value for a range (0 is the minimum) |
| WS_DLL_PUBLIC module_t * prefs_register_stat | ( | const char * | name, |
| const char * | title, | ||
| const char * | description, | ||
| void(*)(void) | apply_cb | ||
| ) |
Register that a statistical tap has preferences.
| name | the name for the tap to use on the command line with "-o" and in preference files. |
| title | is a short human-readable name for the tap. |
| description | is a longer human-readable description of the tap. |
| apply_cb | routine to call back after we apply the preferences |
| WS_DLL_PUBLIC void prefs_register_static_text_preference | ( | module_t * | module, |
| const char * | name, | ||
| const char * | title, | ||
| const char * | description | ||
| ) |
Register a static text 'preference'. It can be used to add some info/explanation.
| module | the preferences module returned by prefs_register_protocol() or prefs_register_protocol_subtree() |
| 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. |
| title | Field's title in the preferences dialog |
| description | description to include in the preferences file and shown as tooltip in the GUI, or NULL |
| WS_DLL_PUBLIC void prefs_register_string_preference | ( | module_t * | module, |
| const char * | name, | ||
| const char * | title, | ||
| const char * | description, | ||
| const char ** | var | ||
| ) |
Register a preference with a character-string value.
| module | the preferences module returned by prefs_register_protocol() or prefs_register_protocol_subtree() |
| 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. |
| title | Field's title in the preferences dialog |
| description | description to include in the preferences file and shown as tooltip in the GUI, or NULL |
| 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_uat_preference | ( | module_t * | module, |
| const char * | name, | ||
| const char * | title, | ||
| const char * | description, | ||
| struct epan_uat * | uat | ||
| ) |
Register a uat (User Accessible Table) 'preference'. It adds a button that opens the uat's window in the preferences tab of the module.
| module | the preferences module returned by prefs_register_protocol() or prefs_register_protocol_subtree() |
| 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. |
| title | Field's title in the preferences dialog |
| description | description to include in the preferences file and shown as tooltip in the GUI, or NULL |
| uat | the uat object that will be updated when the 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, | ||
| unsigned | base, | ||
| unsigned * | var | ||
| ) |
Register a preference with an unsigned integral value.
| module | the preferences module returned by prefs_register_protocol() or prefs_register_protocol_subtree() |
| 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 preference file will already have it. Make sure that only lower-case ASCII letters, numbers, underscores and dots appear in the preference name. |
| title | the title in the preferences dialog |
| description | the description included in the preferences file and shown as tooltip in the GUI, or NULL |
| base | the base the unsigned integer is expected to be in. See strtoul(3) |
| var | pointer to the storage location that is updated when the field is changed in the preference dialog box |
| WS_DLL_PUBLIC void prefs_reset | ( | const char * | app_env_var_prefix, |
| const char ** | col_fmt, | ||
| int | num_cols | ||
| ) |
Resets preferences to their default values.
Reset preferences to default values. Called at profile change
| app_env_var_prefix | Prefix for the application environment variables. |
| col_fmt | Array of column format strings. |
| num_cols | Number of columns in the format array. |
| WS_DLL_PUBLIC prefs_set_pref_e prefs_set_pref | ( | char * | prefarg, |
| char ** | errmsg | ||
| ) |
Given a string of the form "<pref name>:<pref value>", as might appear as an argument to a "-o" option, parse it and set the preference in question. Return an indication of whether it succeeded or failed in some fashion.
For syntax errors (return value PREFS_SET_SYNTAX_ERR), details (when available) are written into "errmsg" which must be freed with g_free.
| prefarg | a string of the form "<pref name>:<pref value>" |
| errmsg | storage for syntax error details |
| WS_DLL_PUBLIC void prefs_set_preference_effect | ( | module_t * | module, |
| const char * | name, | ||
| unsigned | flags | ||
| ) |
Set the effect flags for a preference in a given module.
| module | The module containing the preference. |
| name | The name of the preference to set. |
| flags | The effect flags to set. |
| WS_DLL_PUBLIC void prefs_set_preference_effect_fields | ( | module_t * | module, |
| const char * | name | ||
| ) |
Mark a preference that affects fields change.
This works for bool, enum, int, string (containing filename), range preferences. UAT is not included, because you can specified UAT_AFFECTS_FIELDS at uat_new().
| module | the preferences module returned by prefs_register_protocol() or prefs_register_protocol_subtree() |
| 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. |
|
extern |
Read the preferences file, fill in "prefs", and return a pointer to it.
If we got an error (other than "it doesn't exist") we report it through the UI.
This is called by epan_load_settings(); programs should call that rather than individually calling the routines it calls.
| app_env_var_prefix | The prefix for the application environment variable used to get the global configuration directory. |
| WS_DLL_PUBLIC char string_to_name_resolve | ( | const char * | string, |
| struct _e_addr_resolve * | name_resolve | ||
| ) |
Convert a string listing name resolution types to a bitmask of those types.
Set "*name_resolve" to the bitmask, and return '\0', on success; return the bad character in the string on error.
| string | a list of name resolution types |
| name_resolve | the bitmap of names to resolve to set |
| WS_DLL_PUBLIC int write_prefs | ( | const char * | app_env_var_prefix, |
| char ** | pf_path_return | ||
| ) |
Write out "prefs" to the user's preferences file, and return 0.
If we got an error, stuff a pointer to the path of the preferences file into "*pf_path_return", and return the errno.
| app_env_var_prefix | The prefix for the application environment variable used to get the global configuration directory. |
| pf_path_return | The path to write preferences to or NULL for stdout |