1bd2f04754364c427097ad4441b65fd77f5dfcd0
[obnox/wireshark/wip.git] / epan / dfilter / dfilter-int.h
1 /*
2  * $Id: dfilter-int.h,v 1.5 2002/01/21 07:37:37 guy Exp $
3  *
4  * Ethereal - Network traffic analyzer
5  * By Gerald Combs <gerald@ethereal.com>
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
31 /* Passed back to user */
32 struct _dfilter_t {
33         GPtrArray       *insns;
34         int             num_registers;
35         GList           **registers;
36         gboolean        *attempted_load;
37     int         *interesting_fields;
38     int         num_interesting_fields;
39 };
40
41 typedef struct {
42         /* Syntax Tree stuff */
43         stnode_t        *st_root;
44         gboolean        syntax_error;
45         GPtrArray       *insns;
46         GHashTable      *loaded_fields;
47         GHashTable      *interesting_fields;
48         int             next_insn_id;
49         int             next_register;
50 } dfwork_t;
51
52 /* Constructor/Destructor prototypes for Lemon Parser */
53 void *DfilterAlloc(void* (*)(gulong));
54 void DfilterFree(void*, void (*)(void *));
55 void Dfilter(void*, int, stnode_t*, dfwork_t*);
56
57 /* Scanner's lval */
58 extern stnode_t *df_lval;
59
60 /* Given a field abbreviation, returns the proto ID, or -1 if
61  * it doesn't exist. */
62 header_field_info*
63 dfilter_lookup_token(char *abbrev);
64
65 /* Set dfilter_error_msg_buf and dfilter_error_msg */
66 void
67 dfilter_fail(char *format, ...);
68
69
70 #endif