| 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
19#ifdef __cplusplus
20 extern "C" {
21#endif /* __cplusplus */
22
23 struct epan_dissect;
24
25#define COLORFILTERS_FILE_NAME "colorfilters"
26
27#define CONVERSATION_COLOR_PREFIX "___conversation_color_filter___"
32/* Data for a color filter. */
33 typedef struct _color_filter {
34 char *filter_name; /* name of the filter */
35 char *filter_text; /* text of the filter expression */
36 color_t bg_color; /* background color for packets that match */
37 color_t fg_color; /* foreground color for packets that match */
38 bool disabled; /* set if the filter is disabled */
39
40 /* only used inside of color_filters.c */
41 struct epan_dfilter *c_colorfilter; /* compiled filter expression */
42
43 /* only used outside of color_filters.c (beside init) */
44} color_filter_t;
45
52 typedef void (*color_filter_add_cb_func)(color_filter_t *colorf, void *user_data);
53
55WS_DLL_PUBLIC bool color_filters_init(char** err_msg, color_filter_add_cb_func add_cb, const char* app_env_var_prefix);
56
58WS_DLL_PUBLIC bool color_filters_reload(char** err_msg, color_filter_add_cb_func add_cb, const char* app_env_var_prefix);
59
61WS_DLL_PUBLIC void color_filters_cleanup(void);
62
67WS_DLL_PUBLIC bool color_filters_used(void);
68
73WS_DLL_PUBLIC bool tmp_color_filters_used(void);
74
80WS_DLL_PUBLIC char*
81 color_filters_get_tmp(uint8_t filt_nr);
82
90WS_DLL_PUBLIC bool
91 color_filters_set_tmp(uint8_t filt_nr, const char *filter, bool disabled, char **err_msg);
92
98WS_DLL_PUBLIC const color_filter_t *
99 color_filters_tmp_color(uint8_t filter_num);
100
104WS_DLL_PUBLIC bool
105 color_filters_reset_tmp(char **err_msg);
106
107/* Prime the epan_dissect_t with all the compiled
108 * color filters of the current filter list.
109 *
110 * @param the epan dissector details
111 */
112WS_DLL_PUBLIC void color_filters_prime_edt(struct epan_dissect *edt);
113
120WS_DLL_PUBLIC bool
121 color_filters_use_hfid(int hfid);
122
129WS_DLL_PUBLIC bool
130 color_filters_use_proto(int proto_id);
131
137WS_DLL_PUBLIC const color_filter_t *
138 color_filters_colorize_packet(struct epan_dissect *edt);
139
145WS_DLL_PUBLIC void color_filters_clone(void *user_data, color_filter_add_cb_func add_cb);
146
155WS_DLL_PUBLIC bool color_filters_import(const char *path, void *user_data, char **err_msg, color_filter_add_cb_func add_cb);
156
165WS_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);
166
167
174WS_DLL_PUBLIC bool color_filters_apply(GSList *tmp_cfl, GSList *edit_cfl, char** err_msg);
175
184WS_DLL_PUBLIC bool color_filters_write(GSList *cfl, const char* app_name, const char* app_env_var_prefix, char** err_msg);
185
195WS_DLL_PUBLIC bool color_filters_export(const char *path, GSList *cfl, bool only_selected, const char* app_name, char** err_msg);
196
206WS_DLL_PUBLIC color_filter_t *color_filter_new(
207 const char *name, const char *filter_string,
208 color_t *bg_color, color_t *fg_color, bool disabled);
209
214WS_DLL_PUBLIC void color_filter_delete(color_filter_t *colorf);
215
220WS_DLL_PUBLIC void color_filter_list_delete(GSList **cfl);
221
222#ifdef __cplusplus
223}
224#endif /* __cplusplus */
225
226#endif
227
228/*
229 * Editor modelines - https://www.wireshark.org/tools/modelines.html
230 *
231 * Local variables:
232 * c-basic-offset: 4
233 * tab-width: 8
234 * indent-tabs-mode: nil
235 * End:
236 *
237 * vi: set shiftwidth=4 tabstop=8 expandtab:
238 * :indentSize=4:tabSize=8:noTabs=true:
239 */
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:761
color_filters_clone
WS_DLL_PUBLIC void color_filters_clone(void *user_data, color_filter_add_cb_func add_cb)
Definition color_filters.c:405
color_filter_add_cb_func
void(* color_filter_add_cb_func)(color_filter_t *colorf, void *user_data)
Definition color_filters.h:52
color_filters_use_hfid
WS_DLL_PUBLIC bool color_filters_use_hfid(int hfid)
Definition color_filters.c:547
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:371
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:807
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
tmp_color_filters_used
WS_DLL_PUBLIC bool tmp_color_filters_used(void)
Definition color_filters.c:507
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:580
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:501
color_filters_apply
WS_DLL_PUBLIC bool color_filters_apply(GSList *tmp_cfl, GSList *edit_cfl, char **err_msg)
Definition color_filters.c:465
color_filters_use_proto
WS_DLL_PUBLIC bool color_filters_use_proto(int proto_id)
Definition color_filters.c:570
color_filters_cleanup
WS_DLL_PUBLIC void color_filters_cleanup(void)
Definition color_filters.c:383
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:875
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:905
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:33
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