2 * Declarations of routines for reading and writing the filters file.
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
11 #ifndef __UI_FILTERS_H__
12 #define __UI_FILTERS_H__
16 #endif /* __cplusplus */
19 * Old filter file name.
21 #define FILTER_FILE_NAME "filters"
24 * Capture filter file name.
26 #define CFILTER_FILE_NAME "cfilters"
29 * Display filter file name.
31 #define DFILTER_FILE_NAME "dfilters"
37 CFILTER_LIST, /* capture filter list - saved */
38 DFILTER_LIST, /* display filter list - saved */
39 CFILTER_EDITED_LIST, /* capture filter list - currently edited. GTK+ only. */
40 DFILTER_EDITED_LIST /* display filter list - currently edited. GTK+ only. */
44 * Item in a list of filters.
47 char *name; /* filter name */
48 char *strval; /* filter expression */
52 * Read in a list of filters.
54 * On error, report the error via the UI.
56 void read_filter_list(filter_list_type_t list_type);
59 * Get a pointer to the first entry in a filter list.
61 GList *get_filter_list_first(filter_list_type_t list);
64 * Add a new filter to the end of a list.
65 * Returns a pointer to the newly-added entry.
67 GList *add_to_filter_list(filter_list_type_t list, const char *name,
68 const char *expression);
71 * Remove a filter from a list.
73 void remove_from_filter_list(filter_list_type_t list, GList *fl_entry);
76 * Write out a list of filters.
78 * On error, report the error via the UI.
80 void save_filter_list(filter_list_type_t list_type);
83 * Clone the filter list so it can be edited. GTK+ only.
85 void copy_filter_list(filter_list_type_t dest_type, filter_list_type_t src_type);
88 * Free all filter lists
90 void free_filter_lists(void);
94 #endif /* __cplusplus */
96 #endif /* __UI_FILTERS_H__ */
99 * Editor modelines - http://www.wireshark.org/tools/modelines.html
104 * indent-tabs-mode: nil
107 * vi: set shiftwidth=2 tabstop=8 expandtab:
108 * :indentSize=2:tabSize=8:noTabs=true: