A new type of DCERPC over SMB transport.
[obnox/wireshark/wip.git] / filters.h
1 /* filters.c
2  * Declarations of routines for reading and writing the filters file.
3  *
4  * $Id: filters.h,v 1.2 2001/01/28 09:13:07 guy Exp $
5  *
6  * Ethereal - Network traffic analyzer
7  * By Gerald Combs <gerald@zing.org>
8  * Copyright 1998 Gerald Combs
9  *
10  * 
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.
15  * 
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.
20  * 
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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24  */
25
26 /*
27  * Filter lists.
28  */
29 typedef enum {
30         CFILTER_LIST,   /* capture filter list */
31         DFILTER_LIST    /* display filter list */
32 } filter_list_type_t;
33
34 /*
35  * Item in a list of filters.
36  */
37 typedef struct {
38   char *name;           /* filter name */
39   char *strval;         /* filter expression */
40 } filter_def;
41
42 /*
43  * Read in a list of filters.
44  *
45  * On success, "*pref_path_return" is set to NULL.
46  * On error, "*pref_path_return" is set to point to the pathname of
47  * the file we tried to read - it should be freed by our caller -
48  * and "*errno_return" is set to the error.
49  */
50 void read_filter_list(filter_list_type_t list, char **pref_path_return,
51     int *errno_return);
52
53 /*
54  * Get a pointer to the first entry in a filter list.
55  */
56 GList *get_filter_list_first(filter_list_type_t list);
57
58 /*
59  * Add a new filter to the end of a list.
60  * Returns a pointer to the newly-added entry.
61  */
62 GList *add_to_filter_list(filter_list_type_t list, char *name,
63     char *expression);
64
65 /*
66  * Remove a filter from a list.
67  */
68 void remove_from_filter_list(filter_list_type_t list, GList *fl_entry);
69
70 /*
71  * Write out a list of filters.
72  *
73  * On success, "*pref_path_return" is set to NULL.
74  * On error, "*pref_path_return" is set to point to the pathname of
75  * the file we tried to read - it should be freed by our caller -
76  * and "*errno_return" is set to the error.
77  */
78 void save_filter_list(filter_list_type_t list, char **pref_path_return,
79     int *errno_return);