2 * Definitions for display filters
4 * $Id: dfilter.h,v 1.14 1999/10/12 05:00:47 guy Exp $
6 * Ethereal - Network traffic analyzer
7 * By Gerald Combs <gerald@zing.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 /* dfilter_error_msg is NULL if there was no error during dfilter_compile,
30 * otherwise it points to a displayable error message. */
31 extern gchar *dfilter_error_msg;
32 extern gchar dfilter_error_msg_buf[1024];
38 /* space for dfilter_nodes */
39 GMemChunk *node_memchunk;
41 /* list of byte arrays we allocate during parse. We can traverse this list
42 * faster than the tree when we go back and free the byte arrays */
43 GSList *list_of_byte_arrays;
46 /* Initialization of the symbol table. Called once during program startup */
47 void dfilter_init(void);
49 /* Free the memory used by the symbol table. Called at program shutdown */
50 void dfilter_cleanup(void);
52 /* Allocate and initialize new dfilter struct. Returns pointer to new dfilter */
53 dfilter* dfilter_new(void);
55 /* Frees all memory used by dfilter, and frees dfilter itself */
56 void dfilter_destroy(dfilter *df);
58 /* Compile display filter text */
59 int dfilter_compile(gchar* dfilter_text, dfilter** dfp);
61 /* Apply compiled dfilter to a proto_tree */
62 gboolean dfilter_apply(dfilter *df, proto_tree *ptree, const guint8* pd);
64 #endif /* ! __DFILTER_H__ */