|
Wireshark 5.1.0
The Wireshark network protocol analyzer
|
#include <glib.h>#include "ws_symbol_export.h"Go to the source code of this file.
Classes | |
| struct | _tag_prefs |
| Display preferences for the tagging subsystem. More... | |
| struct | _tag_rule |
| Data for a single tagging rule. More... | |
Macros | |
| #define | TAGRULES_FILE_NAME "tagrules.jsonc" |
Typedefs | |
| typedef struct _tag_prefs | tag_prefs_t |
| Display preferences for the tagging subsystem. | |
| typedef struct _tag_rule | tag_rule_t |
| Data for a single tagging rule. | |
| typedef void(* | tag_rule_add_cb_func) (tag_rule_t *rule, void *user_data) |
| A tag rule was added (while importing or cloning). (tag_rules.c calls this for every rule coming in). | |
Enumerations | |
| enum | tag_link_click_mode_t { TAG_LINK_CLICK_SINGLE = 0 , TAG_LINK_CLICK_CTRL , TAG_LINK_CLICK_NONE } |
| Controls how a tag link is activated in the packet list. More... | |
Functions | |
| WS_DLL_PUBLIC void | tag_rules_init (void) |
| Initialize the tag rules subsystem (read from file). | |
| WS_DLL_PUBLIC void | tag_rules_reload (void) |
| Reload the tag rules from disk. | |
| WS_DLL_PUBLIC bool | tag_rules_write (void) |
| Write tag rules to the active profile's tagrules.jsonc file. | |
| WS_DLL_PUBLIC tag_rule_t * | tag_rule_new (const char *name, const char *filter, const char *tag_content, const char *tag_url, const char *comment) |
| Create a new tag rule (g_new0-allocated). | |
| WS_DLL_PUBLIC void | tag_rule_delete (tag_rule_t *rule) |
| Delete a single tag rule and free all its memory. | |
| WS_DLL_PUBLIC void | tag_rules_clone (tag_rule_add_cb_func cb, void *user_data) |
| Clone the currently active tag rule list. | |
| WS_DLL_PUBLIC void | tag_rules_apply (GSList *new_list) |
| Apply a new tag rule list (called when the dialog OK is pressed). | |
| WS_DLL_PUBLIC const GSList * | tag_rules_get_list (void) |
| Return the currently active tag rule list. | |
| WS_DLL_PUBLIC void | tag_rules_prime_edt (struct epan_dissect *edt) |
| Prime an epan_dissect_t with all compiled tag rule filters. | |
| WS_DLL_PUBLIC bool | tag_rules_used (void) |
| WS_DLL_PUBLIC tag_prefs_t | tag_rules_get_prefs (void) |
| Get the current display preferences. | |
| WS_DLL_PUBLIC void | tag_rules_set_prefs (const tag_prefs_t *prefs) |
| Set the display preferences (does not write to disk). | |
| WS_DLL_PUBLIC GSList * | tag_rules_read_path (const char *path, char **err_msg) |
| Read tag rules from a file into a new GSList without touching the active list. | |
| WS_DLL_PUBLIC bool | tag_rules_write_path (GSList *list, const char *path, const tag_prefs_t *prefs, char **err_msg) |
| Write a rule list to an arbitrary file path. | |
| WS_DLL_PUBLIC bool | tag_rules_export_list (GSList *list, const char *path, char **err_msg) |
| Write an arbitrary tag rule GSList to a file without touching the active list. | |
| WS_DLL_PUBLIC void | tag_rule_list_free (GSList *list) |
| Free a GSList of tag_rule_t* (e.g. one built by the model for export). | |
Tagging rules — associate user-defined tags with packets via display filters.
| #define TAGRULES_FILE_NAME "tagrules.jsonc" |
Per-profile tagrules file (JSONC).
| typedef struct _tag_prefs tag_prefs_t |
Display preferences for the tagging subsystem.
Stored in the profile's tagrules.jsonc file as a leading "prefs_for_tagging_rules" element.
| typedef void(* tag_rule_add_cb_func) (tag_rule_t *rule, void *user_data) |
A tag rule was added (while importing or cloning). (tag_rules.c calls this for every rule coming in).
| rule | the new tag rule |
| user_data | from caller |
| WS_DLL_PUBLIC void tag_rule_delete | ( | tag_rule_t * | rule | ) |
Delete a single tag rule and free all its memory.
| rule | the tag rule to free |
| WS_DLL_PUBLIC void tag_rule_list_free | ( | GSList * | list | ) |
Free a GSList of tag_rule_t* (e.g. one built by the model for export).
| list | GSList of tag_rule_t* to free; each element is also freed. |
| WS_DLL_PUBLIC tag_rule_t * tag_rule_new | ( | const char * | name, |
| const char * | filter, | ||
| const char * | tag_content, | ||
| const char * | tag_url, | ||
| const char * | comment ) |
Create a new tag rule (g_new0-allocated).
| name | Rule name (also used as frame.tag value). |
| filter | Display filter expression. |
| tag_content | Visual content for the COL_TAG column. |
| comment | Optional reference comment (may be NULL). |
| WS_DLL_PUBLIC void tag_rules_apply | ( | GSList * | new_list | ) |
Apply a new tag rule list (called when the dialog OK is pressed).
Replaces the current list with new_list and compiles all filters.
| new_list | GSList of tag_rule_t* to install as the active list. |
| WS_DLL_PUBLIC void tag_rules_clone | ( | tag_rule_add_cb_func | cb, |
| void * | user_data ) |
Clone the currently active tag rule list.
Iterates the list, clones each rule, and calls cb for each clone.
| cb | Callback invoked for each cloned rule. |
| user_data | Opaque pointer forwarded to cb. |
| WS_DLL_PUBLIC bool tag_rules_export_list | ( | GSList * | list, |
| const char * | path, | ||
| char ** | err_msg ) |
Write an arbitrary tag rule GSList to a file without touching the active list.
| list | GSList of tag_rule_t* to write (not freed by this function). |
| path | Path of the file to write. |
| err_msg | Set to a newly allocated error string on failure; caller g_frees. |
| WS_DLL_PUBLIC const GSList * tag_rules_get_list | ( | void | ) |
Return the currently active tag rule list.
| WS_DLL_PUBLIC void tag_rules_init | ( | void | ) |
Initialize the tag rules subsystem (read from file).
Loads from the active profile's tagrules.jsonc file.
< Per-profile tagrules file (JSONC).
| WS_DLL_PUBLIC void tag_rules_prime_edt | ( | struct epan_dissect * | edt | ) |
Prime an epan_dissect_t with all compiled tag rule filters.
Must be called before epan_dissect_run() so the dissector extracts all fields referenced by any tag rule filter.
| edt | The epan_dissect_t to prime. |
| WS_DLL_PUBLIC GSList * tag_rules_read_path | ( | const char * | path, |
| char ** | err_msg ) |
Read tag rules from a file into a new GSList without touching the active list.
| path | Full path to a tagrules.jsonc file. |
| err_msg | Set to error string on failure; caller g_frees. May be NULL. |
| WS_DLL_PUBLIC void tag_rules_reload | ( | void | ) |
Reload the tag rules from disk.
Frees the current list and re-runs tag_rules_init().
| WS_DLL_PUBLIC bool tag_rules_used | ( | void | ) |
Returns true if there is at least one tag rule (enabled or disabled).
| WS_DLL_PUBLIC bool tag_rules_write | ( | void | ) |
Write tag rules to the active profile's tagrules.jsonc file.
< Per-profile tagrules file (JSONC).
| WS_DLL_PUBLIC bool tag_rules_write_path | ( | GSList * | list, |
| const char * | path, | ||
| const tag_prefs_t * | prefs, | ||
| char ** | err_msg ) |
Write a rule list to an arbitrary file path.
Does not modify the active list.
| list | GSList of tag_rule_t* to write. |
| path | Full path to write. |
| prefs | Prefs to embed in the file (may be NULL for defaults). |
| err_msg | Set to error string on failure; caller g_frees. |