2 * Definitions for display filters
4 * $Id: dfilter.h,v 1.15 2000/01/15 00:22:30 gram 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.
33 /* dfilter_error_msg is NULL if there was no error during dfilter_compile,
34 * otherwise it points to a displayable error message. */
35 extern gchar *dfilter_error_msg;
36 extern gchar dfilter_error_msg_buf[1024];
42 /* space for dfilter_nodes */
43 GMemChunk *node_memchunk;
45 /* list of byte arrays we allocate during parse. We can traverse this list
46 * faster than the tree when we go back and free the byte arrays */
47 GSList *list_of_byte_arrays;
50 /* Initialization of the symbol table. Called once during program startup */
51 void dfilter_init(void);
53 /* Free the memory used by the symbol table. Called at program shutdown */
54 void dfilter_cleanup(void);
56 /* Allocate and initialize new dfilter struct. Returns pointer to new dfilter */
57 dfilter* dfilter_new(void);
59 /* Frees all memory used by dfilter, and frees dfilter itself */
60 void dfilter_destroy(dfilter *df);
62 /* Compile display filter text */
63 int dfilter_compile(gchar* dfilter_text, dfilter** dfp);
65 /* Apply compiled dfilter to a proto_tree */
66 gboolean dfilter_apply(dfilter *df, proto_tree *ptree, const guint8* pd);
68 #endif /* ! __DFILTER_H__ */