name change
[obnox/wireshark/wip.git] / epan / dfilter / dfilter-int.h
1 /*
2  * $Id$
3  *
4  * Wireshark - Network traffic analyzer
5  * By Gerald Combs <gerald@wireshark.org>
6  * Copyright 2001 Gerald Combs
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21  */
22
23 #ifndef DFILTER_INT_H
24 #define DFILTER_INT_H
25
26 #include "dfilter.h"
27 #include "syntax-tree.h"
28
29 #include <epan/proto.h>
30 #include <stdio.h>
31
32 /* Passed back to user */
33 struct _dfilter_t {
34         GPtrArray       *insns;
35         int             num_registers;
36         GList           **registers;
37         gboolean        *attempted_load;
38         int             *interesting_fields;
39         int             num_interesting_fields;
40 };
41
42 typedef struct {
43         /* Syntax Tree stuff */
44         stnode_t        *st_root;
45         gboolean        syntax_error;
46         GPtrArray       *insns;
47         GHashTable      *loaded_fields;
48         GHashTable      *interesting_fields;
49         int             next_insn_id;
50         int             next_register;
51 } dfwork_t;
52
53 /* Constructor/Destructor prototypes for Lemon Parser */
54 void *DfilterAlloc(void* (*)(gulong));
55 void DfilterFree(void*, void (*)(void *));
56 void Dfilter(void*, int, stnode_t*, dfwork_t*);
57
58 /* Scanner's lval */
59 extern stnode_t *df_lval;
60
61 /* Return value for error in scanner. */
62 #define SCAN_FAILED     -1      /* not 0, as that means end-of-input */
63
64 /* Set dfilter_error_msg_buf and dfilter_error_msg */
65 void
66 dfilter_fail(const char *format, ...);
67
68 void
69 DfilterTrace(FILE *TraceFILE, char *zTracePrompt);
70
71 #endif