3 * Declarations of routines for reading and writing the filters file.
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 #ifndef __FILTER_FILES_H__
13 #define __FILTER_FILES_H__
15 #include <wireshark.h>
19 #endif /* __cplusplus */
22 * Capture filter file name.
24 #define CFILTER_FILE_NAME "cfilters"
27 * Display filter file name.
29 #define DFILTER_FILE_NAME "dfilters"
32 * Display filter file name.
34 #define DMACROS_FILE_NAME "dmacros"
40 CFILTER_LIST
, /* capture filter list - saved */
41 DFILTER_LIST
, /* display filter list - saved */
42 DMACROS_LIST
, /* display filter macro list - saved */
46 * Item in a list of filters.
49 char *name
; /* filter name */
50 char *strval
; /* filter expression */
54 filter_list_type_t type
;
59 * Read in a list of filters.
61 * On error, report the error via the UI.
65 filter_list_t
*ws_filter_list_read(filter_list_type_t list_type
);
68 * Add a new filter to the end of a list.
69 * Returns a pointer to the newly-added entry.
72 void ws_filter_list_add(filter_list_t
*list
, const char *name
,
73 const char *expression
);
76 * Find a filter in a list by name.
77 * Returns a pointer to the found entry.
80 GList
*ws_filter_list_find(filter_list_t
*list
, const char *name
);
83 * Remove a filter from a list.
86 bool ws_filter_list_remove(filter_list_t
*list
, const char *name
);
89 * Write out a list of filters.
91 * On error, report the error via the UI.
94 void ws_filter_list_write(filter_list_t
*list
);
97 * Free all filter lists
100 void ws_filter_list_free(filter_list_t
*list
);
104 #endif /* __cplusplus */
106 #endif /* __FILTER_FILES_H__ */