Wireshark 2.9.0-477-g68ec514b The Wireshark network protocol analyzer

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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 "ws_symbol_export.h"
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif /* __cplusplus */
18
19 #include <wsutil/color.h>
20
21 struct epan_dissect;
22
23 #define CONVERSATION_COLOR_PREFIX "___conversation_color_filter___"
24
28 /* Data for a color filter. */
29 typedef struct _color_filter {
30 gchar *filter_name; /* name of the filter */
31 gchar *filter_text; /* text of the filter expression */
32 color_t bg_color; /* background color for packets that match */
33 color_t fg_color; /* foreground color for packets that match */
34 gboolean disabled; /* set if the filter is disabled */
35
36 /* only used inside of color_filters.c */
37 struct epan_dfilter *c_colorfilter; /* compiled filter expression */
38
39 /* only used outside of color_filters.c (beside init) */
40 } color_filter_t;
41
48 typedef void (*color_filter_add_cb_func)(color_filter_t *colorf, gpointer user_data);
49
51 WS_DLL_PUBLIC gboolean color_filters_init(gchar** err_msg, color_filter_add_cb_func add_cb);
52
54 WS_DLL_PUBLIC gboolean color_filters_reload(gchar** err_msg, color_filter_add_cb_func add_cb);
55
57 WS_DLL_PUBLIC void color_filters_cleanup(void);
58
63 WS_DLL_PUBLIC gboolean color_filters_used(void);
64
69 WS_DLL_PUBLIC gboolean tmp_color_filters_used(void);
70
78 WS_DLL_PUBLIC gboolean
79 color_filters_set_tmp(guint8 filt_nr, const gchar *filter, gboolean disabled, gchar **err_msg);
80
86 WS_DLL_PUBLIC const color_filter_t *
87 color_filters_tmp_color(guint8 filter_num);
88
92 WS_DLL_PUBLIC gboolean
93 color_filters_reset_tmp(gchar **err_msg);
94
95 /* Prime the epan_dissect_t with all the compiler
96 * color filters of the current filter list.
97 *
98 * @param the epan dissector details
99 */
100 WS_DLL_PUBLIC void color_filters_prime_edt(struct epan_dissect *edt);
101
107 WS_DLL_PUBLIC const color_filter_t *
108 color_filters_colorize_packet(struct epan_dissect *edt);
109
115 WS_DLL_PUBLIC void color_filters_clone(gpointer user_data, color_filter_add_cb_func add_cb);
116
125 WS_DLL_PUBLIC gboolean color_filters_import(const gchar *path, gpointer user_data, gchar **err_msg, color_filter_add_cb_func add_cb);
126
134 WS_DLL_PUBLIC gboolean color_filters_read_globals(gpointer user_data, gchar** err_msg, color_filter_add_cb_func add_cb);
135
136
143 WS_DLL_PUBLIC gboolean color_filters_apply(GSList *tmp_cfl, GSList *edit_cfl, gchar** err_msg);
144
151 WS_DLL_PUBLIC gboolean color_filters_write(GSList *cfl, gchar** err_msg);
152
161 WS_DLL_PUBLIC gboolean color_filters_export(const gchar *path, GSList *cfl, gboolean only_selected, gchar** err_msg);
162
172 WS_DLL_PUBLIC color_filter_t *color_filter_new(
173 const gchar *name, const gchar *filter_string,
174 color_t *bg_color, color_t *fg_color, gboolean disabled);
175
180 WS_DLL_PUBLIC void color_filter_delete(color_filter_t *colorf);
181
186 WS_DLL_PUBLIC void color_filter_list_delete(GSList **cfl);
187
188 #ifdef __cplusplus
189 }
190 #endif /* __cplusplus */
191
192 #endif
193
194 /*
195 * Editor modelines - http://www.wireshark.org/tools/modelines.html
196 *
197 * Local variables:
198 * c-basic-offset: 4
199 * tab-width: 8
200 * indent-tabs-mode: nil
201 * End:
202 *
203 * vi: set shiftwidth=4 tabstop=8 expandtab:
204 * :indentSize=4:tabSize=8:noTabs=true:
205 */
color_filters_used
WS_DLL_PUBLIC gboolean color_filters_used(void)
Definition: color_filters.c:461
color_filters_export
WS_DLL_PUBLIC gboolean color_filters_export(const gchar *path, GSList *cfl, gboolean only_selected, gchar **err_msg)
Definition: color_filters.c:821
color_filter_new
WS_DLL_PUBLIC color_filter_t * color_filter_new(const gchar *name, const gchar *filter_string, color_t *bg_color, color_t *fg_color, gboolean disabled)
Definition: color_filters.c:57
color_filters_read_globals
WS_DLL_PUBLIC gboolean color_filters_read_globals(gpointer user_data, gchar **err_msg, color_filter_add_cb_func add_cb)
Definition: color_filters.c:677
color_filters_set_tmp
WS_DLL_PUBLIC gboolean color_filters_set_tmp(guint8 filt_nr, const gchar *filter, gboolean disabled, gchar **err_msg)
Definition: color_filters.c:128
color_filters_cleanup
WS_DLL_PUBLIC void color_filters_cleanup(void)
Definition: color_filters.c:347
color_filters_reload
WS_DLL_PUBLIC gboolean color_filters_reload(gchar **err_msg, color_filter_add_cb_func add_cb)
Definition: color_filters.c:335
color_filters_tmp_color
WS_DLL_PUBLIC const color_filter_t * color_filters_tmp_color(guint8 filter_num)
Definition: color_filters.c:180
color_filters_import
WS_DLL_PUBLIC gboolean color_filters_import(const gchar *path, gpointer user_data, gchar **err_msg, color_filter_add_cb_func add_cb)
Definition: color_filters.c:723
color_filters_init
WS_DLL_PUBLIC gboolean color_filters_init(gchar **err_msg, color_filter_add_cb_func add_cb)
Definition: color_filters.c:325
color_filters_clone
WS_DLL_PUBLIC void color_filters_clone(gpointer user_data, color_filter_add_cb_func add_cb)
Definition: color_filters.c:369
color_t
Definition: color.h:20
color_filters_write
WS_DLL_PUBLIC gboolean color_filters_write(GSList *cfl, gchar **err_msg)
Definition: color_filters.c:791
epan_dfilter
Definition: dfilter-int.h:19
color_filters_apply
WS_DLL_PUBLIC gboolean color_filters_apply(GSList *tmp_cfl, GSList *edit_cfl, gchar **err_msg)
Definition: color_filters.c:425
_color_filter
Definition: color_filters.h:29
tmp_color_filters_used
WS_DLL_PUBLIC gboolean tmp_color_filters_used(void)
Definition: color_filters.c:467
color_filter_add_cb_func
void(* color_filter_add_cb_func)(color_filter_t *colorf, gpointer user_data)
Definition: color_filters.h:48
color_filters_reset_tmp
WS_DLL_PUBLIC gboolean color_filters_reset_tmp(gchar **err_msg)
Definition: color_filters.c:197
epan_dissect
Definition: epan_dissect.h:28
color_filters_colorize_packet
WS_DLL_PUBLIC const color_filter_t * color_filters_colorize_packet(struct epan_dissect *edt)
Definition: color_filters.c:494
color_filter_delete
WS_DLL_PUBLIC void color_filter_delete(color_filter_t *colorf)
Definition: color_filters.c:212
color_filter_list_delete
WS_DLL_PUBLIC void color_filter_list_delete(GSList **cfl)
Definition: color_filters.c:231