2 * Definitions for display filters
4 * $Id: dfilter.h,v 1.18 2000/08/11 13:34:40 deniel 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.
31 /* dfilter_error_msg is NULL if there was no error during dfilter_compile,
32 * otherwise it points to a displayable error message. */
33 extern gchar *dfilter_error_msg;
34 extern gchar dfilter_error_msg_buf[1024];
40 /* space for dfilter_nodes */
41 GMemChunk *node_memchunk;
43 /* list of byte arrays we allocate during parse. We can traverse this list
44 * faster than the tree when we go back and free the byte arrays */
45 GSList *list_of_byte_arrays;
47 /* List of strings allocated during parse. */
48 GSList *list_of_strings;
52 /* Initialization of the symbol table. Called once during program startup */
53 void dfilter_init(void);
55 /* Free the memory used by the symbol table. Called at program shutdown */
56 void dfilter_cleanup(void);
58 /* Allocate and initialize new dfilter struct. Returns pointer to new dfilter */
59 dfilter* dfilter_new(void);
61 /* Frees all memory used by dfilter, and frees dfilter itself */
62 void dfilter_destroy(dfilter *df);
64 /* Compile display filter text */
65 int dfilter_compile(gchar* dfilter_text, dfilter** dfp);
67 /* Apply compiled dfilter to a proto_tree */
68 gboolean dfilter_apply(dfilter *df, proto_tree *ptree, const guint8* pd, guint pd_len);
70 #endif /* ! __DFILTER_H__ */