| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions
prefs-int.h File Reference
`#include <stdio.h>`
`#include "ws_symbol_export.h"`
`#include <epan/wmem_scopes.h>`

Go to the source code of this file.

## Classes
struct | pref_module
struct | write_pref_arg_t
struct | pref_custom_cbs
struct | pref_unstash_data

## Typedefs
typedef void(* | pref_custom_free_cb) (pref_t *pref)
typedef void(* | pref_custom_reset_cb) (pref_t *pref)
typedef prefs_set_pref_e(* | pref_custom_set_cb) (pref_t *pref, const char *value, unsigned int *changed_flags)
typedef const char *(* | pref_custom_type_name_cb) (void)
typedef char *(* | pref_custom_type_description_cb) (void)
typedef bool(* | pref_custom_is_default_cb) (pref_t *pref)
typedef char *(* | pref_custom_to_str_cb) (pref_t *pref, bool default_val)
typedef prefs_set_pref_e(* | pref_set_pair_cb) (char *key, const char *value, void *private_data, bool return_range_errors)
typedef struct pref_unstash_data | pref_unstash_data_t

## Enumerations
enum | pref_type_e { PREF_UINT , PREF_BOOL , PREF_ENUM , PREF_STRING , PREF_RANGE , PREF_STATIC_TEXT , PREF_UAT , PREF_SAVE_FILENAME , PREF_COLOR , PREF_CUSTOM , PREF_DIRNAME , PREF_DECODE_AS_RANGE , PREF_OPEN_FILENAME , PREF_PASSWORD , PREF_PROTO_TCP_SNDAMB_ENUM , PREF_DISSECTOR }

## Functions
WS_DLL_PUBLIC const char * | prefs_get_description (pref_t *pref)
WS_DLL_PUBLIC const char * | prefs_get_title (pref_t *pref)
WS_DLL_PUBLIC const char * | prefs_get_name (pref_t *pref)
WS_DLL_PUBLIC int | prefs_get_type (pref_t *pref)
WS_DLL_PUBLIC uint32_t | prefs_get_max_value (pref_t *pref)
WS_DLL_PUBLIC unsigned int | prefs_get_effect_flags (pref_t *pref)
WS_DLL_PUBLIC void | prefs_set_effect_flags (pref_t *pref, unsigned int flags)
WS_DLL_PUBLIC void | prefs_set_effect_flags_by_name (module_t *module, const char *pref, unsigned int flags)
WS_DLL_PUBLIC unsigned int | prefs_get_module_effect_flags (module_t *module)
WS_DLL_PUBLIC void | prefs_set_module_effect_flags (module_t *module, unsigned int flags)
WS_DLL_PUBLIC bool | prefs_set_range_value_work (pref_t *pref, const char *value, bool return_range_errors, unsigned int *changed_flags)
WS_DLL_PUBLIC unsigned int | prefs_set_stashed_range_value (pref_t *pref, const char *value)
WS_DLL_PUBLIC void | prefs_range_add_value (pref_t *pref, uint32_t val)
WS_DLL_PUBLIC void | prefs_range_remove_value (pref_t *pref, uint32_t val)
WS_DLL_PUBLIC unsigned int | prefs_set_bool_value (pref_t *pref, bool value, pref_source_t source)
WS_DLL_PUBLIC bool | prefs_get_bool_value (pref_t *pref, pref_source_t source)
WS_DLL_PUBLIC void | prefs_invert_bool_value (pref_t *pref, pref_source_t source)
WS_DLL_PUBLIC unsigned int | prefs_set_uint_value (pref_t *pref, unsigned value, pref_source_t source)
WS_DLL_PUBLIC unsigned | prefs_get_uint_base (pref_t *pref)
WS_DLL_PUBLIC unsigned | prefs_get_uint_value (pref_t *pref, pref_source_t source)
WS_DLL_PUBLIC unsigned int | prefs_set_enum_value (pref_t *pref, int value, pref_source_t source)
WS_DLL_PUBLIC unsigned int | prefs_set_enum_string_value (pref_t *pref, const char *value, pref_source_t source)
WS_DLL_PUBLIC int | prefs_get_enum_value (pref_t *pref, pref_source_t source)
WS_DLL_PUBLIC const enum_val_t * | prefs_get_enumvals (pref_t *pref)
WS_DLL_PUBLIC bool | prefs_get_enum_radiobuttons (pref_t *pref)
WS_DLL_PUBLIC bool | prefs_set_color_value (pref_t *pref, color_t value, pref_source_t source)
WS_DLL_PUBLIC color_t * | prefs_get_color_value (pref_t *pref, pref_source_t source)
WS_DLL_PUBLIC unsigned int | prefs_set_custom_value (pref_t *pref, const char *value, pref_source_t source)
WS_DLL_PUBLIC unsigned int | prefs_set_string_value (pref_t *pref, const char *value, pref_source_t source)
WS_DLL_PUBLIC const char * | prefs_get_string_value (pref_t *pref, pref_source_t source)
WS_DLL_PUBLIC struct epan_uat * | prefs_get_uat_value (pref_t *pref)
WS_DLL_PUBLIC bool | prefs_set_range_value (pref_t *pref, range_t *value, pref_source_t source)
WS_DLL_PUBLIC range_t * | prefs_get_range_value_real (pref_t *pref, pref_source_t source)
WS_DLL_PUBLIC bool | prefs_add_decode_as_value (pref_t *pref, unsigned value, bool replace)
WS_DLL_PUBLIC bool | prefs_remove_decode_as_value (pref_t *pref, unsigned value, bool set_default)
WS_DLL_PUBLIC unsigned int | prefs_set_password_value (pref_t *pref, const char *value, pref_source_t source)
WS_DLL_PUBLIC const char * | prefs_get_password_value (pref_t *pref, pref_source_t source)
WS_DLL_PUBLIC bool | prefs_add_list_value (pref_t *pref, void *value, pref_source_t source)
WS_DLL_PUBLIC GList * | prefs_get_list_value (pref_t *pref, pref_source_t source)
WS_DLL_PUBLIC void | reset_pref (pref_t *pref)
WS_DLL_PUBLIC int | read_prefs_file (const char *pf_path, FILE *pf, pref_set_pair_cb pref_set_pair_fct, void *private_data)
WS_DLL_PUBLIC void | prefs_read_module (const char *name, const char *app_env_var_prefix)
WS_DLL_PUBLIC bool | prefs_pref_is_default (pref_t *pref)
WS_DLL_PUBLIC unsigned | pref_stash (pref_t *pref, void *unused)
WS_DLL_PUBLIC unsigned | pref_unstash (pref_t *pref, void *unstash_data_p)
WS_DLL_PUBLIC unsigned | pref_clean_stash (pref_t *pref, void *unused)
WS_DLL_PUBLIC void | reset_stashed_pref (pref_t *pref)
WS_DLL_PUBLIC char * | join_string_list (GList *sl)

## Typedef Documentation

## ◆ pref_set_pair_cb

typedef prefs_set_pref_e(* pref_set_pair_cb) (char *key, const char *value, void *private_data, bool return_range_errors)

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.

Returns
  an indication of whether it succeeded or failed in some fashion.

## Function Documentation

## ◆ join_string_list()

WS_DLL_PUBLIC char * join_string_list | ( | GList * | sl | ) |

Convert a string list preference to a preference string.

Given a GList of char pointers, create a quoted, comma-separated string. Should be used with prefs_get_string_list() and prefs_clear_string_list().

Parameters

  sl | String list.

Returns
  Quoted, joined, and wrapped string. May be empty.

## ◆ pref_clean_stash()

WS_DLL_PUBLIC unsigned pref_clean_stash | ( | pref_t * | pref,
|  | void * | unused
| ) |  |

Clean up a stashed preference. Can be called from prefs_pref_foreach().

Parameters

  pref | A preference.
  unused | unused

Returns
  Always returns 0.

## ◆ pref_stash()

WS_DLL_PUBLIC unsigned pref_stash | ( | pref_t * | pref,
|  | void * | unused
| ) |  |

"Stash" a preference. Copy a preference to its stashed value. Can be called from prefs_pref_foreach().

Parameters

  pref | A preference.
  unused | unused

## ◆ pref_unstash()

WS_DLL_PUBLIC unsigned pref_unstash | ( | pref_t * | pref,
|  | void * | unstash_data_p
| ) |  |

"Unstash" a preference. Set a preference to its stashed value. Can be called from prefs_pref_foreach().

Parameters

  pref | A preference.
  unstash_data_p | A pointer to a pref_unstash_data_t structure.

Returns
  Always returns 0.

## ◆ prefs_get_effect_flags()

WS_DLL_PUBLIC unsigned int prefs_get_effect_flags | ( | pref_t * | pref | ) |

Fetch flags that show the effect of the preference

Parameters

  pref | A preference.

Returns
  A bitmask of the types of things the preference will effect.

## ◆ prefs_get_module_effect_flags()

WS_DLL_PUBLIC unsigned int prefs_get_module_effect_flags | ( | module_t * | module | ) |

Fetch flags that show module's preferences effect The flag values of the module will be applied to any individual preferences of the module when they are created

Parameters

  module | A preference module.

Returns
  A bitmask of the types of things the module's preferences will effect.

## ◆ prefs_range_add_value()

WS_DLL_PUBLIC void prefs_range_add_value | ( | pref_t * | pref,
|  | uint32_t | val
| ) |  |

Add a range value of a range preference.

## ◆ prefs_range_remove_value()

WS_DLL_PUBLIC void prefs_range_remove_value | ( | pref_t * | pref,
|  | uint32_t | val
| ) |  |

Remove a range value of a range preference.

## ◆ prefs_read_module()

WS_DLL_PUBLIC void prefs_read_module | ( | const char * | name,
|  | const char * | app_env_var_prefix
| ) |  |

Given a module name, read the preferences associated with only that module. Checks for a file in the personal configuration directory named after the module with a ".cfg" extension added first.

Parameters

  name | The preference module name, e.g. "extcap".

## ◆ prefs_set_effect_flags()

WS_DLL_PUBLIC void prefs_set_effect_flags | ( | pref_t * | pref,
|  | unsigned int | flags
| ) |  |

Set flags for the effect of the preference The intention is to distinguish preferences that affect dissection from those that don't. A bitmask was added to provide greater flexibility in the types of effects preferences can have.

Parameters

  pref | A preference.
  flags | Bitmask of flags to apply to preference. Note that flags must be non-zero to ensure preference is properly saved to disk.

## ◆ prefs_set_effect_flags_by_name()

WS_DLL_PUBLIC void prefs_set_effect_flags_by_name | ( | module_t * | module,
|  | const char * | pref,
|  | unsigned int | flags
| ) |  |

Same as prefs_set_effect_flags, just different way to get preference

## ◆ prefs_set_module_effect_flags()

WS_DLL_PUBLIC void prefs_set_module_effect_flags | ( | module_t * | module,
|  | unsigned int | flags
| ) |  |

Set flags for module's preferences effect The intention is to distinguish preferences that affect dissection from those that don't. Since modules are a grouping of preferences, it's likely that a whole module will want the same flags for its preferences. The flag values of the module will be applied to any individual preferences of the module when they are created

Parameters

  module | A preference module.
  flags | Bitmask of flags to apply to module. Note that flags must be non-zero to ensure preferences are properly saved to disk.

## ◆ read_prefs_file()

WS_DLL_PUBLIC int read_prefs_file | ( | const char * | pf_path,
|  | FILE * | pf,
|  | pref_set_pair_cb | pref_set_pair_fct,
|  | void * | private_data
| ) |  |

read the preferences file (or similar) and call the callback function to set each key/value pair found

## ◆ reset_stashed_pref()

WS_DLL_PUBLIC void reset_stashed_pref | ( | pref_t * | pref | ) |

Set a stashed preference to its default value.

Parameters

  pref | A preference.