| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
color_filters.h
Go to the documentation of this file.
1/* color_filters.h
2 * Definitions for color filters
3 *
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10#ifndef __COLOR_FILTERS_H__
11#define __COLOR_FILTERS_H__
12
13#include <glib.h>
14
15#include "ws_symbol_export.h"
16
17#include <wsutil/color.h>
18#include <wsutil/wmem/wmem_list.h>
19
20#ifdef __cplusplus
21 extern "C" {
22#endif /* __cplusplus */
23
24 struct epan_dissect;
25
26#define COLORFILTERS_FILE_NAME "colorfilters"
27
28#define CONVERSATION_COLOR_PREFIX "___conversation_color_filter___"
33/* Data for a color filter. */
34 typedef struct _color_filter {
35 char *filter_name; /* name of the filter */
36 char *filter_text; /* text of the filter expression */
37 color_t bg_color; /* background color for packets that match */
38 color_t fg_color; /* foreground color for packets that match */
39 bool disabled; /* set if the filter is disabled */
40
41 /* only used inside of color_filters.c */
42 struct epan_dfilter *c_colorfilter; /* compiled filter expression */
43
44 /* only used outside of color_filters.c (beside init) */
45} color_filter_t;
46
53 typedef void (*color_filter_add_cb_func)(color_filter_t *colorf, void *user_data);
54
56WS_DLL_PUBLIC bool color_filters_init(char** err_msg, color_filter_add_cb_func add_cb, const char* app_env_var_prefix);
57
59WS_DLL_PUBLIC bool color_filters_reload(char** err_msg, color_filter_add_cb_func add_cb, const char* app_env_var_prefix);
60
62WS_DLL_PUBLIC void color_filters_cleanup(void);
63
68WS_DLL_PUBLIC bool color_filters_used(void);
69
74WS_DLL_PUBLIC bool tmp_color_filters_used(void);
75
81WS_DLL_PUBLIC char*
82 color_filters_get_tmp(uint8_t filt_nr);
83
91WS_DLL_PUBLIC bool
92 color_filters_set_tmp(uint8_t filt_nr, const char *filter, bool disabled, char **err_msg);
93
99WS_DLL_PUBLIC const color_filter_t *
100 color_filters_tmp_color(uint8_t filter_num);
101
105WS_DLL_PUBLIC bool
106 color_filters_reset_tmp(char **err_msg);
107
108/* Prime the epan_dissect_t with all the compiled
109 * color filters of the current filter list.
110 *
111 * @param the epan dissector details
112 */
113WS_DLL_PUBLIC void color_filters_prime_edt(struct epan_dissect *edt);
114
121WS_DLL_PUBLIC bool
122 color_filters_use_hfid(int hfid);
123
130WS_DLL_PUBLIC bool
131 color_filters_use_proto(int proto_id);
132
138WS_DLL_PUBLIC const color_filter_t *
139 color_filters_colorize_packet(struct epan_dissect *edt);
140
148WS_DLL_PUBLIC const color_filter_t *
149 color_filters_colorize_packet_all(struct epan_dissect *edt,
150 wmem_allocator_t *scope, wmem_list_t **matches);
151
157WS_DLL_PUBLIC void
158 color_filter_set_session_disabled(const char *filter_name, bool disabled);
159
165WS_DLL_PUBLIC bool
166 color_filter_is_session_disabled(const char *filter_name);
167
170WS_DLL_PUBLIC void
171 color_filter_clear_session_disabled(void);
172
177WS_DLL_PUBLIC void
178 color_filter_write_paused(const char *app_env_var_prefix);
179
184WS_DLL_PUBLIC void
185 color_filter_read_paused(const char *app_env_var_prefix);
186
191WS_DLL_PUBLIC void
192 color_filter_resume_all(const char *app_env_var_prefix);
193
199WS_DLL_PUBLIC void color_filters_clone(void *user_data, color_filter_add_cb_func add_cb);
200
209WS_DLL_PUBLIC bool color_filters_import(const char *path, void *user_data, char **err_msg, color_filter_add_cb_func add_cb);
210
219WS_DLL_PUBLIC bool color_filters_read_globals(void *user_data, char** err_msg, color_filter_add_cb_func add_cb, const char* app_env_var_prefix);
220
221
228WS_DLL_PUBLIC bool color_filters_apply(GSList *tmp_cfl, GSList *edit_cfl, char** err_msg);
229
238WS_DLL_PUBLIC bool color_filters_write(GSList *cfl, const char* app_name, const char* app_env_var_prefix, char** err_msg);
239
249WS_DLL_PUBLIC bool color_filters_export(const char *path, GSList *cfl, bool only_selected, const char* app_name, char** err_msg);
250
260WS_DLL_PUBLIC color_filter_t *color_filter_new(
261 const char *name, const char *filter_string,
262 color_t *bg_color, color_t *fg_color, bool disabled);
263
268WS_DLL_PUBLIC void color_filter_delete(color_filter_t *colorf);
269
274WS_DLL_PUBLIC void color_filter_list_delete(GSList **cfl);
275
276#ifdef __cplusplus
277}
278#endif /* __cplusplus */
279
280#endif
281
282/*
283 * Editor modelines - https://www.wireshark.org/tools/modelines.html
284 *
285 * Local variables:
286 * c-basic-offset: 4
287 * tab-width: 8
288 * indent-tabs-mode: nil
289 * End:
290 *
291 * vi: set shiftwidth=4 tabstop=8 expandtab:
292 * :indentSize=4:tabSize=8:noTabs=true:
293 */
color.h
color_filters_read_globals
WS_DLL_PUBLIC bool color_filters_read_globals(void *user_data, char **err_msg, color_filter_add_cb_func add_cb, const char *app_env_var_prefix)
Definition color_filters.c:939
color_filters_clone
WS_DLL_PUBLIC void color_filters_clone(void *user_data, color_filter_add_cb_func add_cb)
Definition color_filters.c:417
color_filter_add_cb_func
void(* color_filter_add_cb_func)(color_filter_t *colorf, void *user_data)
Definition color_filters.h:53
color_filters_colorize_packet_all
WS_DLL_PUBLIC const color_filter_t * color_filters_colorize_packet_all(struct epan_dissect *edt, wmem_allocator_t *scope, wmem_list_t **matches)
Definition color_filters.c:617
color_filters_use_hfid
WS_DLL_PUBLIC bool color_filters_use_hfid(int hfid)
Definition color_filters.c:559
color_filters_reload
WS_DLL_PUBLIC bool color_filters_reload(char **err_msg, color_filter_add_cb_func add_cb, const char *app_env_var_prefix)
Definition color_filters.c:378
color_filter_new
WS_DLL_PUBLIC color_filter_t * color_filter_new(const char *name, const char *filter_string, color_t *bg_color, color_t *fg_color, bool disabled)
Definition color_filters.c:71
color_filters_import
WS_DLL_PUBLIC bool color_filters_import(const char *path, void *user_data, char **err_msg, color_filter_add_cb_func add_cb)
Definition color_filters.c:985
color_filters_init
WS_DLL_PUBLIC bool color_filters_init(char **err_msg, color_filter_add_cb_func add_cb, const char *app_env_var_prefix)
Definition color_filters.c:361
color_filters_tmp_color
WS_DLL_PUBLIC const color_filter_t * color_filters_tmp_color(uint8_t filter_num)
Definition color_filters.c:216
color_filter_clear_session_disabled
WS_DLL_PUBLIC void color_filter_clear_session_disabled(void)
Definition color_filters.c:684
tmp_color_filters_used
WS_DLL_PUBLIC bool tmp_color_filters_used(void)
Definition color_filters.c:519
color_filter_set_session_disabled
WS_DLL_PUBLIC void color_filter_set_session_disabled(const char *filter_name, bool disabled)
Definition color_filters.c:656
color_filters_set_tmp
WS_DLL_PUBLIC bool color_filters_set_tmp(uint8_t filt_nr, const char *filter, bool disabled, char **err_msg)
Definition color_filters.c:163
color_filters_colorize_packet
WS_DLL_PUBLIC const color_filter_t * color_filters_colorize_packet(struct epan_dissect *edt)
Definition color_filters.c:592
color_filter_delete
WS_DLL_PUBLIC void color_filter_delete(color_filter_t *colorf)
Definition color_filters.c:248
color_filter_list_delete
WS_DLL_PUBLIC void color_filter_list_delete(GSList **cfl)
Definition color_filters.c:267
color_filters_used
WS_DLL_PUBLIC bool color_filters_used(void)
Definition color_filters.c:513
color_filter_read_paused
WS_DLL_PUBLIC void color_filter_read_paused(const char *app_env_var_prefix)
Definition color_filters.c:732
color_filters_apply
WS_DLL_PUBLIC bool color_filters_apply(GSList *tmp_cfl, GSList *edit_cfl, char **err_msg)
Definition color_filters.c:477
color_filter_is_session_disabled
WS_DLL_PUBLIC bool color_filter_is_session_disabled(const char *filter_name)
Definition color_filters.c:675
color_filter_resume_all
WS_DLL_PUBLIC void color_filter_resume_all(const char *app_env_var_prefix)
Definition color_filters.c:762
color_filters_use_proto
WS_DLL_PUBLIC bool color_filters_use_proto(int proto_id)
Definition color_filters.c:582
color_filters_cleanup
WS_DLL_PUBLIC void color_filters_cleanup(void)
Definition color_filters.c:390
color_filter_write_paused
WS_DLL_PUBLIC void color_filter_write_paused(const char *app_env_var_prefix)
Definition color_filters.c:705
color_filters_write
WS_DLL_PUBLIC bool color_filters_write(GSList *cfl, const char *app_name, const char *app_env_var_prefix, char **err_msg)
Definition color_filters.c:1053
color_filters_get_tmp
WS_DLL_PUBLIC char * color_filters_get_tmp(uint8_t filt_nr)
Definition color_filters.c:139
color_filters_export
WS_DLL_PUBLIC bool color_filters_export(const char *path, GSList *cfl, bool only_selected, const char *app_name, char **err_msg)
Definition color_filters.c:1083
color_filters_reset_tmp
WS_DLL_PUBLIC bool color_filters_reset_tmp(char **err_msg)
Definition color_filters.c:233
_color_filter
Definition color_filters.h:34
_wmem_allocator_t
Internal memory allocator interface used by the wmem subsystem.
Definition wmem_allocator.h:34
_wmem_list_t
Definition wmem_list.c:23
color_t
RGB color representation with 16-bit precision per channel.
Definition color.h:27
epan_dfilter
Definition dfilter-int.h:35
epan_dissect
Definition epan_dissect.h:28
wmem_list.h