2 * Declarations of routines for reading and writing the filters file.
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
31 #endif /* __cplusplus */
37 CFILTER_LIST
, /* capture filter list - saved */
38 DFILTER_LIST
, /* display filter list - saved */
39 CFILTER_EDITED_LIST
, /* capture filter list - currently edited */
40 DFILTER_EDITED_LIST
/* display filter list - currently edited */
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 success, "*pref_path_return" is set to NULL.
55 * On error, "*pref_path_return" is set to point to the pathname of
56 * the file we tried to read - it should be freed by our caller -
57 * and "*errno_return" is set to the error.
59 void read_filter_list(filter_list_type_t list_type
, char **pref_path_return
,
63 * Get a pointer to the first entry in a filter list.
65 GList
*get_filter_list_first(filter_list_type_t list
);
68 * Add a new filter to the end of a list.
69 * Returns a pointer to the newly-added entry.
71 GList
*add_to_filter_list(filter_list_type_t list
, const char *name
,
72 const char *expression
);
75 * Remove a filter from a list.
77 void remove_from_filter_list(filter_list_type_t list
, GList
*fl_entry
);
80 * Write out a list of filters.
82 * On success, "*pref_path_return" is set to NULL.
83 * On error, "*pref_path_return" is set to point to the pathname of
84 * the file we tried to read - it should be freed by our caller -
85 * and "*errno_return" is set to the error.
87 void save_filter_list(filter_list_type_t list_type
, char **pref_path_return
,
91 * Clone the filter list so it can be edited.
93 void copy_filter_list(filter_list_type_t dest_type
, filter_list_type_t src_type
);
97 #endif /* __cplusplus */
99 #endif /* FILTERS_H */