Ethereal-dev: [Ethereal-dev] dfilter-modifications and inclusion of lib_ethereal.so
Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.
From: Håvard H Garnes <hhg@xxxxxxxxxx>
Date: Mon, 18 Jul 2005 09:00:21 +0200
Hello. As part of mapi-development (mapi.uninett.no) I have made this patch to ethereals dfilter to extract information from packets. Ths patch also includes lib_ethereal, which was developed as part of the scampi-project (ist-scampi.org) to link an ethereal-library into mapi for packet and protocol analysis. This patch is from my point of view not intended for inclusion into ethereal as it is. However I would guess there are other uses for it, so including it into ethereal might not be a bad idea if the patch is looked over by someone with a more thorough understanding of the inner workings of ethereal. The new filter-addition is the keyword "return 'field'" which returns the field-value in place of a gboolean from dfvm_apply. As I did not have the time to find out how I could easily check if the value is a string or an int, I had to double up the code in dfilter.c (dfilter_apply_edt) to allow it to choose if it should return an int or a char*. The patch requires aclocal && automake && autoconf Håvard.
diff -ruN ../ethereal-0.10.11/Makefile.am ethereal/Makefile.am
--- ../ethereal-0.10.11/Makefile.am 2005-05-03 20:09:08.000000000 +0200
+++ ethereal/Makefile.am 2005-07-05 14:28:53.000000000 +0200
@@ -62,6 +62,7 @@
#
bin_PROGRAMS = @ethereal_bin@ @capinfos_bin@ @editcap_bin@ @mergecap_bin@ @tethereal_bin@ @dftest_bin@ @randpkt_bin@ @text2pcap_bin@
bin_SCRIPTS = @idl2eth_bin@
+lib_LTLIBRARIES = @lib_ethereal_lib@
man1_MANS = @ethereal_man@ @capinfos_man@ @editcap_man@ @mergecap_man@ @tethereal_man@ @text2pcap_man@ @idl2eth_man@
man4_MANS = @etherealfilter_man@
man_MANS =
@@ -69,6 +70,7 @@
EXTRA_PROGRAMS = ethereal tethereal capinfos editcap mergecap dftest \
randpkt text2pcap
EXTRA_SCRIPTS = idl2eth
+EXTRA_LTLIBRARIES = lib_ethereal.la
#
# Ethereal configuration files are put in $(pkgdatadir). It currently
@@ -250,6 +252,14 @@
tethereal_additional_libs = \
wiretap/libwiretap.la \
epan/libethereal.la
+
+EXTRA_LTLIBRARIES = lib_ethereal.la
+
+lib_ethereal_la_additional_libs = \
+ wiretap/libwiretap.la \
+ epan/libethereal.la \
+ epan/ftypes/libftypes.la \
+ epan/dfilter/libdfilter.la
# This is the automake dependency variable for the executable
tethereal_DEPENDENCIES = \
@@ -266,6 +276,17 @@
@PCRE_LIBS@ \
@GLIB_LIBS@ -lm \
@PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@ @ADNS_LIBS@ @KRB5_LIBS@
+
+lib_ethereal_la_DEPENDENCIES = \
+ $(lib_ethereal_la_additional_libs)
+
+lib_ethereal_la_LIBADD = \
+ $(lib_ethereal_la_additional_libs) \
+ @SNMP_LIBS@ @SSL_LIBS@ \
+ @PCRE_LIBS@ \
+ @GLIB_LIBS@ -lm \
+ @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@ @ADNS_LIBS@ @KRB5_LIBS@
+
if ENABLE_STATIC
tethereal_LDFLAGS = -Wl,-static -all-static
@@ -273,6 +294,9 @@
tethereal_LDFLAGS = -export-dynamic
endif
+
+lib_ethereal_la_LDFLAGS = -module -rpath '$(libdir)'
+
# Optional objects that I know how to build, and that are needed by
# text2pcap.
text2pcap_optional_objects = @STRERROR_O@ @STRPTIME_O@
@@ -283,6 +307,7 @@
text2pcap_LDADD = $(text2pcap_optional_objects) \
@GLIB_LIBS@ -lm
+
mergecap_DEPENDENCIES = wiretap/libwiretap.la
# This is the automake dependency variable for the executable
diff -ruN ../ethereal-0.10.11/Makefile.common ethereal/Makefile.common
--- ../ethereal-0.10.11/Makefile.common 2005-05-02 23:28:53.000000000 +0200
+++ ethereal/Makefile.common 2005-07-06 14:39:19.000000000 +0200
@@ -77,7 +77,6 @@
clopts_common.c \
conditions.c \
disabled_protos.c \
- packet-range.c \
pcap-util.c \
print.c \
ps.c \
@@ -164,6 +163,7 @@
filters.c \
g711.c \
merge.c \
+ packet-range.c \
proto_hier_stats.c \
summary.c
@@ -192,8 +192,16 @@
$(ETHEREAL_COMMON_SRC) \
$(TETHEREAL_TAP_SRC) \
capture_opts.c \
+ packet-range.c \
tethereal-tap-register.c \
tethereal.c
+
+lib_ethereal_la_SOURCES = \
+ $(ETHEREAL_COMMON_SRC) \
+ $(TETHEREAL_TAP_SRC) \
+ tethereal-tap-register.c \
+ lib_ethereal.c
+# capture_opts.c \
# text2pcap specifics
text2pcap_SOURCES = \
diff -ruN ../ethereal-0.10.11/configure.in ethereal/configure.in
--- ../ethereal-0.10.11/configure.in 2005-05-02 23:28:53.000000000 +0200
+++ ethereal/configure.in 2005-07-05 12:49:53.000000000 +0200
@@ -2,6 +2,7 @@
#
AC_INIT(etypes.h)
+
AC_PREREQ(2.52)
dnl Check for CPU / vendor / OS
@@ -19,6 +20,7 @@
AC_DEFUN([AC_PROVIDE_AC_LIBTOOL_DLOPEN], )
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
+AC_SUBST(LIBTOOL_DEPS)
AC_PROG_YACC
AM_PROG_LEX
AC_PATH_PROG(PERL, perl)
@@ -316,6 +318,15 @@
AC_ARG_ENABLE(ethereal,
[ --enable-ethereal build GTK+-based ethereal. [default=yes]],enable_ethereal=$enableval,enable_ethereal=yes)
+AC_ARG_ENABLE(lib_ethereal,
+[ --enable-lib_ethereal build lib_ethereal. [default=yes]],lib_ethereal=$enableval,enable_lib_ethereal=yes)
+if test "x$enable_lib_ethereal" = "xyes" ; then
+ lib_ethereal_lib="lib_ethereal.la"
+else
+ lib_ethereal_lib=""
+fi
+AC_SUBST(lib_ethereal_lib)
+
AC_ARG_ENABLE(gtk2,
[ --disable-gtk2 build Glib1/Gtk1+-based (t)ethereal. [default=no]],enable_gtk2=$enableval,enable_gtk2=yes)
AM_CONDITIONAL(USE_GTK2, test x$enable_gtk2 = xyes)
@@ -1298,6 +1309,7 @@
echo ""
echo "The Ethereal package has been configured with the following options."
echo " Build ethereal : $enable_ethereal"
+echo " Build lib_ethereal : $enable_lib_ethereal"
echo " Build tethereal : $enable_tethereal"
echo " Build capinfos : $enable_capinfos"
echo " Build editcap : $enable_editcap"
diff -ruN ../ethereal-0.10.11/epan/Makefile.am ethereal/epan/Makefile.am
--- ../ethereal-0.10.11/epan/Makefile.am 2005-05-02 23:28:50.000000000 +0200
+++ ethereal/epan/Makefile.am 2005-07-05 12:57:59.000000000 +0200
@@ -57,7 +57,6 @@
doxygen.cfg.in
CLEANFILES = \
- libethereal.a \
libethereal.la \
*~
@@ -66,6 +65,7 @@
#
libethereal_la_LIBADD = @G_ASCII_STRTOULL_LO@ @INET_ATON_LO@ @INET_PTON_LO@ @INET_NTOP_LO@ dfilter/libdfilter.la ftypes/libftypes.la dissectors/libdissectors.la
libethereal_la_DEPENDENCIES = @G_ASCII_STRTOULL_LO@ @INET_ATON_LO@ @INET_PTON_LO@ @INET_NTOP_LO@ dfilter/libdfilter.la ftypes/libftypes.la dissectors/libdissectors.la
+libethereal_la_LDFLAGS = -export-dynamic
tvbtest: tvbtest.o tvbuff.o except.o strutil.o
$(LINK) -o tvbtest tvbtest.o tvbuff.o except.o strutil.o `glib-config --libs`
diff -ruN ../ethereal-0.10.11/epan/dfilter/Makefile.am ethereal/epan/dfilter/Makefile.am
--- ../ethereal-0.10.11/epan/dfilter/Makefile.am 2005-05-02 23:28:08.000000000 +0200
+++ ethereal/epan/dfilter/Makefile.am 2005-07-05 12:59:14.000000000 +0200
@@ -24,7 +24,6 @@
noinst_LTLIBRARIES = libdfilter.la
CLEANFILES = \
- libdfilter.a \
libdfilter.la \
*~
@@ -56,6 +55,8 @@
sttype-test.h \
syntax-tree.c \
syntax-tree.h
+
+libdfilter_la_LDFLAGS=-export-dynamic
EXTRA_DIST = \
grammar.lemon \
diff -ruN ../ethereal-0.10.11/epan/dfilter/dfilter.c ethereal/epan/dfilter/dfilter.c
--- ../ethereal-0.10.11/epan/dfilter/dfilter.c 2005-05-02 23:28:08.000000000 +0200
+++ ethereal/epan/dfilter/dfilter.c 2005-07-07 14:20:59.000000000 +0200
@@ -44,6 +44,8 @@
static gchar dfilter_error_msg_buf[1024];
gchar *dfilter_error_msg; /* NULL when no error resulted */
+return_e return_type;
+
/* From scanner.c */
void df_scanner_text(const char *text);
void df_scanner_cleanup(void);
@@ -148,7 +150,6 @@
g_free(df);
}
-
static dfwork_t*
dfwork_new(void)
{
@@ -202,7 +203,8 @@
dfilter_error_msg = NULL;
dfw = dfwork_new();
-
+ /*printf("%s\n",text);
+ */
df_scanner_text(text);
while (1) {
@@ -307,6 +309,28 @@
return dfvm_apply(df, tree);
}
+
+gboolean
+dfilter_apply_edt_ret(dfilter_t *df, epan_dissect_t* edt,int rettype)
+{
+ char* ret;
+ if(rettype==1)
+ {
+// printf("Setter ret_type=INT\n");
+ return_type=INT;
+ }
+ else
+ {
+// printf("Setter ret_type=STRING\n");
+ return_type=STRING;
+ ret = dfvm_apply(df, edt->tree);
+// printf("Og sitter med resultatet %s\n",ret);
+ return ret;
+ }
+ return dfvm_apply(df, edt->tree);
+}
+
+
gboolean
dfilter_apply_edt(dfilter_t *df, epan_dissect_t* edt)
{
diff -ruN ../ethereal-0.10.11/epan/dfilter/dfvm.c ethereal/epan/dfilter/dfvm.c
--- ../ethereal-0.10.11/epan/dfilter/dfvm.c 2005-05-02 23:28:08.000000000 +0200
+++ ethereal/epan/dfilter/dfvm.c 2005-07-07 14:21:28.000000000 +0200
@@ -336,6 +336,7 @@
dfvm_value_t *arg1;
dfvm_value_t *arg2;
dfvm_value_t *arg3;
+ gboolean ret_val;
header_field_info *hfinfo;
g_assert(tree);
@@ -436,6 +437,32 @@
case NOT:
accum = !accum;
break;
+
+ case RT:
+ if(accum)
+ {
+ GList *list_a;
+ char* per;
+ list_a = df->registers[arg1->value.numeric];
+ unsigned long long perper;
+
+ per=list_a->data;
+ if(return_type == INT)
+ {
+ free_register_overhead(df);
+ return fvalue_get_integer(per);
+ }
+ if(return_type == STRING)
+ {
+ free_register_overhead(df);
+ return fvalue_get(per);
+ }
+ }
+ break;
case RETURN:
free_register_overhead(df);
diff -ruN ../ethereal-0.10.11/epan/dfilter/dfvm.h ethereal/epan/dfilter/dfvm.h
--- ../ethereal-0.10.11/epan/dfilter/dfvm.h 2005-05-02 23:28:08.000000000 +0200
+++ ethereal/epan/dfilter/dfvm.h 2005-07-07 11:36:21.000000000 +0200
@@ -29,6 +29,9 @@
#include "syntax-tree.h"
#include "drange.h"
+typedef enum {INT,STRING} return_e;
+extern return_e return_type;
+
typedef enum {
EMPTY,
FVALUE,
@@ -70,7 +73,8 @@
ANY_BITWISE_AND,
ANY_CONTAINS,
ANY_MATCHES,
- MK_RANGE
+ MK_RANGE,
+ RT
} dfvm_opcode_t;
diff -ruN ../ethereal-0.10.11/epan/dfilter/gencode.c ethereal/epan/dfilter/gencode.c
--- ../ethereal-0.10.11/epan/dfilter/gencode.c 2005-05-02 23:28:08.000000000 +0200
+++ ethereal/epan/dfilter/gencode.c 2005-07-04 14:59:07.000000000 +0200
@@ -157,6 +157,51 @@
static void
+gen_relation1(dfwork_t *dfw, dfvm_opcode_t op, stnode_t *st_arg1)
+{
+ sttype_id_t type1;
+ dfvm_insn_t *insn;
+ dfvm_value_t *val1;
+ dfvm_value_t *jmp1 = NULL;
+ int reg1 = -1;
+ header_field_info *hfinfo;
+
+ type1 = stnode_type_id(st_arg1);
+
+ if (type1 == STTYPE_FIELD) {
+ hfinfo = stnode_data(st_arg1);
+ reg1 = dfw_append_read_tree(dfw, hfinfo);
+
+ insn = dfvm_insn_new(IF_FALSE_GOTO);
+ jmp1 = dfvm_value_new(INSN_NUMBER);
+ insn->arg1 = jmp1;
+ dfw_append_insn(dfw, insn);
+
+ }
+ else if (type1 == STTYPE_FVALUE) {
+ reg1 = dfw_append_put_fvalue(dfw, stnode_data(st_arg1));
+ }
+ else if (type1 == STTYPE_RANGE) {
+ reg1 = dfw_append_mk_range(dfw, st_arg1);
+ }
+ else {
+ return;
+ g_assert_not_reached();
+ }
+
+
+ insn = dfvm_insn_new(op);
+ val1 = dfvm_value_new(REGISTER);
+ val1->value.numeric = reg1;
+ insn->arg1 = val1;
+ dfw_append_insn(dfw, insn);
+
+ if (jmp1) {
+ jmp1->value.numeric = dfw->next_insn_id;
+ }
+}
+
+static void
gen_relation(dfwork_t *dfw, dfvm_opcode_t op, stnode_t *st_arg1, stnode_t *st_arg2)
{
sttype_id_t type1, type2;
@@ -331,6 +376,11 @@
case TEST_OP_MATCHES:
gen_relation(dfw, ANY_MATCHES, st_arg1, st_arg2);
break;
+
+ case RET:
+ gen_relation1(dfw, RT, st_arg1);
+ break;
+
}
}
diff -ruN ../ethereal-0.10.11/epan/dfilter/grammar.c ethereal/epan/dfilter/grammar.c
--- ../ethereal-0.10.11/epan/dfilter/grammar.c 2005-06-29 15:42:45.000000000 +0200
+++ ethereal/epan/dfilter/grammar.c 2005-07-04 12:35:49.000000000 +0200
@@ -21,7 +21,7 @@
/* First off, code is include which follows the "include" declaration
** in the input file. */
#include <stdio.h>
-#line 3 "grammar.lemon"
+#line 3 "./grammar.lemon"
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -83,25 +83,25 @@
*/
/* */
#define YYCODETYPE unsigned char
-#define YYNOCODE 35
+#define YYNOCODE 36
#define YYACTIONTYPE unsigned char
#define DfilterTOKENTYPE stnode_t*
typedef union {
DfilterTOKENTYPE yy0;
- drange_node* yy25;
- GSList* yy26;
- test_op_t yy42;
- stnode_t* yy51;
- int yy69;
+ stnode_t* yy1;
+ test_op_t yy2;
+ GSList* yy7;
+ drange_node* yy45;
+ int yy71;
} YYMINORTYPE;
#define YYSTACKDEPTH 100
#define DfilterARGDECL ,dfw
#define DfilterXARGDECL dfwork_t *dfw;
#define DfilterANSIARGDECL ,dfwork_t *dfw
-#define YYNSTATE 42
-#define YYNRULE 31
-#define YYERRORSYMBOL 27
-#define YYERRSYMDT yy69
+#define YYNSTATE 44
+#define YYNRULE 32
+#define YYERRORSYMBOL 28
+#define YYERRSYMDT yy71
#define YY_NO_ACTION (YYNSTATE+YYNRULE+2)
#define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1)
#define YY_ERROR_ACTION (YYNSTATE+YYNRULE)
@@ -131,142 +131,142 @@
};
static struct yyActionEntry yyActionTable[] = {
/* State 0 */
- { 32, 3, &yyActionTable[ 2] }, /* relation_test shift 3 */
- { 33, 74, 0 }, /* sentence accept */
- { 0, 43, 0 }, /* $ reduce 1 */
+ { 0, 45, 0 }, /* $ reduce 1 */
+ { 33, 3, 0 }, /* relation_test shift 3 */
+ { 34, 77, 0 }, /* sentence accept */
{ 3, 14, 0 }, /* FIELD shift 14 */
- { 7, 5, 0 }, /* LPAREN shift 5 */
- { 21, 10, 0 }, /* TEST_NOT shift 10 */
- { 10, 28, 0 }, /* STRING shift 28 */
- { 23, 29, &yyActionTable[ 4] }, /* UNPARSED shift 29 */
- {YYNOCODE,0,0}, /* Unused */
+ { 11, 28, 0 }, /* STRING shift 28 */
{YYNOCODE,0,0}, /* Unused */
- { 26, 12, &yyActionTable[ 6] }, /* entity shift 12 */
+ { 22, 10, 0 }, /* TEST_NOT shift 10 */
+ { 7, 5, 0 }, /* LPAREN shift 5 */
+ { 24, 29, 0 }, /* UNPARSED shift 29 */
+ { 9, 41, 0 }, /* RET shift 41 */
{YYNOCODE,0,0}, /* Unused */
- { 28, 1, 0 }, /* expr shift 1 */
- { 29, 4, 0 }, /* logical_test shift 4 */
- { 30, 30, 0 }, /* range shift 30 */
+ { 27, 12, &yyActionTable[ 4] }, /* entity shift 12 */
{YYNOCODE,0,0}, /* Unused */
+ { 29, 1, 0 }, /* expr shift 1 */
+ { 30, 4, 0 }, /* logical_test shift 4 */
+ { 31, 30, 0 }, /* range shift 30 */
/* State 1 */
- { 0, 42, 0 }, /* $ reduce 0 */
+ { 12, 2, &yyActionTable[ 17] }, /* TEST_AND shift 2 */
+ { 0, 44, 0 }, /* $ reduce 0 */
{YYNOCODE,0,0}, /* Unused */
- { 22, 8, 0 }, /* TEST_OR shift 8 */
- { 11, 2, 0 }, /* TEST_AND shift 2 */
+ { 23, 8, 0 }, /* TEST_OR shift 8 */
/* State 2 */
- { 32, 3, 0 }, /* relation_test shift 3 */
- { 7, 5, 0 }, /* LPAREN shift 5 */
- { 10, 28, 0 }, /* STRING shift 28 */
- { 3, 14, 0 }, /* FIELD shift 14 */
- {YYNOCODE,0,0}, /* Unused */
- { 21, 10, 0 }, /* TEST_NOT shift 10 */
+ { 11, 28, 0 }, /* STRING shift 28 */
+ { 33, 3, 0 }, /* relation_test shift 3 */
{YYNOCODE,0,0}, /* Unused */
- { 23, 29, &yyActionTable[ 21] }, /* UNPARSED shift 29 */
+ { 3, 14, 0 }, /* FIELD shift 14 */
{YYNOCODE,0,0}, /* Unused */
{YYNOCODE,0,0}, /* Unused */
- { 26, 12, &yyActionTable[ 22] }, /* entity shift 12 */
+ { 22, 10, 0 }, /* TEST_NOT shift 10 */
+ { 7, 5, 0 }, /* LPAREN shift 5 */
+ { 24, 29, 0 }, /* UNPARSED shift 29 */
+ { 9, 41, 0 }, /* RET shift 41 */
{YYNOCODE,0,0}, /* Unused */
- { 28, 41, 0 }, /* expr shift 41 */
- { 29, 4, 0 }, /* logical_test shift 4 */
- { 30, 30, 0 }, /* range shift 30 */
+ { 27, 12, &yyActionTable[ 20] }, /* entity shift 12 */
{YYNOCODE,0,0}, /* Unused */
+ { 29, 43, 0 }, /* expr shift 43 */
+ { 30, 4, 0 }, /* logical_test shift 4 */
+ { 31, 30, 0 }, /* range shift 30 */
/* State 3 */
{YYNOCODE,0,0}, /* Unused */
/* State 4 */
{YYNOCODE,0,0}, /* Unused */
/* State 5 */
- { 32, 3, 0 }, /* relation_test shift 3 */
- { 7, 5, 0 }, /* LPAREN shift 5 */
- { 10, 28, 0 }, /* STRING shift 28 */
- { 3, 14, 0 }, /* FIELD shift 14 */
- {YYNOCODE,0,0}, /* Unused */
- { 21, 10, 0 }, /* TEST_NOT shift 10 */
+ { 11, 28, 0 }, /* STRING shift 28 */
+ { 33, 3, 0 }, /* relation_test shift 3 */
{YYNOCODE,0,0}, /* Unused */
- { 23, 29, &yyActionTable[ 39] }, /* UNPARSED shift 29 */
+ { 3, 14, 0 }, /* FIELD shift 14 */
{YYNOCODE,0,0}, /* Unused */
{YYNOCODE,0,0}, /* Unused */
- { 26, 12, &yyActionTable[ 40] }, /* entity shift 12 */
+ { 22, 10, 0 }, /* TEST_NOT shift 10 */
+ { 7, 5, 0 }, /* LPAREN shift 5 */
+ { 24, 29, 0 }, /* UNPARSED shift 29 */
+ { 9, 41, 0 }, /* RET shift 41 */
{YYNOCODE,0,0}, /* Unused */
- { 28, 6, 0 }, /* expr shift 6 */
- { 29, 4, 0 }, /* logical_test shift 4 */
- { 30, 30, 0 }, /* range shift 30 */
+ { 27, 12, &yyActionTable[ 38] }, /* entity shift 12 */
{YYNOCODE,0,0}, /* Unused */
+ { 29, 6, 0 }, /* expr shift 6 */
+ { 30, 4, 0 }, /* logical_test shift 4 */
+ { 31, 30, 0 }, /* range shift 30 */
/* State 6 */
+ { 12, 2, 0 }, /* TEST_AND shift 2 */
{YYNOCODE,0,0}, /* Unused */
- { 9, 7, 0 }, /* RPAREN shift 7 */
- { 22, 8, 0 }, /* TEST_OR shift 8 */
- { 11, 2, 0 }, /* TEST_AND shift 2 */
+ { 10, 7, 0 }, /* RPAREN shift 7 */
+ { 23, 8, 0 }, /* TEST_OR shift 8 */
/* State 7 */
{YYNOCODE,0,0}, /* Unused */
/* State 8 */
- { 32, 3, 0 }, /* relation_test shift 3 */
- { 7, 5, 0 }, /* LPAREN shift 5 */
- { 10, 28, 0 }, /* STRING shift 28 */
- { 3, 14, 0 }, /* FIELD shift 14 */
- {YYNOCODE,0,0}, /* Unused */
- { 21, 10, 0 }, /* TEST_NOT shift 10 */
+ { 11, 28, 0 }, /* STRING shift 28 */
+ { 33, 3, 0 }, /* relation_test shift 3 */
{YYNOCODE,0,0}, /* Unused */
- { 23, 29, &yyActionTable[ 60] }, /* UNPARSED shift 29 */
+ { 3, 14, 0 }, /* FIELD shift 14 */
{YYNOCODE,0,0}, /* Unused */
{YYNOCODE,0,0}, /* Unused */
- { 26, 12, &yyActionTable[ 61] }, /* entity shift 12 */
+ { 22, 10, 0 }, /* TEST_NOT shift 10 */
+ { 7, 5, 0 }, /* LPAREN shift 5 */
+ { 24, 29, 0 }, /* UNPARSED shift 29 */
+ { 9, 41, 0 }, /* RET shift 41 */
{YYNOCODE,0,0}, /* Unused */
- { 28, 9, 0 }, /* expr shift 9 */
- { 29, 4, 0 }, /* logical_test shift 4 */
- { 30, 30, 0 }, /* range shift 30 */
+ { 27, 12, &yyActionTable[ 59] }, /* entity shift 12 */
{YYNOCODE,0,0}, /* Unused */
+ { 29, 9, 0 }, /* expr shift 9 */
+ { 30, 4, 0 }, /* logical_test shift 4 */
+ { 31, 30, 0 }, /* range shift 30 */
/* State 9 */
{YYNOCODE,0,0}, /* Unused */
/* State 10 */
- { 32, 3, 0 }, /* relation_test shift 3 */
- { 7, 5, 0 }, /* LPAREN shift 5 */
- { 10, 28, 0 }, /* STRING shift 28 */
- { 3, 14, 0 }, /* FIELD shift 14 */
- {YYNOCODE,0,0}, /* Unused */
- { 21, 10, 0 }, /* TEST_NOT shift 10 */
+ { 11, 28, 0 }, /* STRING shift 28 */
+ { 33, 3, 0 }, /* relation_test shift 3 */
{YYNOCODE,0,0}, /* Unused */
- { 23, 29, &yyActionTable[ 77] }, /* UNPARSED shift 29 */
+ { 3, 14, 0 }, /* FIELD shift 14 */
{YYNOCODE,0,0}, /* Unused */
{YYNOCODE,0,0}, /* Unused */
- { 26, 12, &yyActionTable[ 78] }, /* entity shift 12 */
+ { 22, 10, 0 }, /* TEST_NOT shift 10 */
+ { 7, 5, 0 }, /* LPAREN shift 5 */
+ { 24, 29, 0 }, /* UNPARSED shift 29 */
+ { 9, 41, 0 }, /* RET shift 41 */
{YYNOCODE,0,0}, /* Unused */
- { 28, 11, 0 }, /* expr shift 11 */
- { 29, 4, 0 }, /* logical_test shift 4 */
- { 30, 30, 0 }, /* range shift 30 */
+ { 27, 12, &yyActionTable[ 76] }, /* entity shift 12 */
{YYNOCODE,0,0}, /* Unused */
+ { 29, 11, 0 }, /* expr shift 11 */
+ { 30, 4, 0 }, /* logical_test shift 4 */
+ { 31, 30, 0 }, /* range shift 30 */
/* State 11 */
{YYNOCODE,0,0}, /* Unused */
/* State 12 */
- { 16, 34, 0 }, /* TEST_GT shift 34 */
- { 17, 37, 0 }, /* TEST_LE shift 37 */
- { 18, 36, 0 }, /* TEST_LT shift 36 */
- { 19, 40, 0 }, /* TEST_MATCHES shift 40 */
- { 20, 33, 0 }, /* TEST_NE shift 33 */
- { 15, 35, 0 }, /* TEST_GE shift 35 */
+ { 32, 13, &yyActionTable[ 99] }, /* rel_op2 shift 13 */
+ { 17, 34, 0 }, /* TEST_GT shift 34 */
+ { 18, 37, 0 }, /* TEST_LE shift 37 */
+ { 19, 36, 0 }, /* TEST_LT shift 36 */
+ { 20, 40, 0 }, /* TEST_MATCHES shift 40 */
+ { 21, 33, 0 }, /* TEST_NE shift 33 */
+ { 16, 35, 0 }, /* TEST_GE shift 35 */
{YYNOCODE,0,0}, /* Unused */
{YYNOCODE,0,0}, /* Unused */
{YYNOCODE,0,0}, /* Unused */
{YYNOCODE,0,0}, /* Unused */
{YYNOCODE,0,0}, /* Unused */
{YYNOCODE,0,0}, /* Unused */
- { 12, 38, 0 }, /* TEST_BITWISE_AND shift 38 */
- { 13, 39, 0 }, /* TEST_CONTAINS shift 39 */
- { 14, 32, 0 }, /* TEST_EQ shift 32 */
- { 31, 13, &yyActionTable[ 98] }, /* rel_op2 shift 13 */
+ { 13, 38, 0 }, /* TEST_BITWISE_AND shift 38 */
+ { 14, 39, 0 }, /* TEST_CONTAINS shift 39 */
+ { 15, 32, 0 }, /* TEST_EQ shift 32 */
/* State 13 */
- { 10, 28, 0 }, /* STRING shift 28 */
- {YYNOCODE,0,0}, /* Unused */
- { 26, 31, &yyActionTable[ 109] }, /* entity shift 31 */
+ { 24, 29, 0 }, /* UNPARSED shift 29 */
+ { 11, 28, &yyActionTable[ 111] }, /* STRING shift 28 */
{ 3, 14, 0 }, /* FIELD shift 14 */
+ { 27, 31, &yyActionTable[ 110] }, /* entity shift 31 */
{YYNOCODE,0,0}, /* Unused */
{YYNOCODE,0,0}, /* Unused */
- { 30, 30, 0 }, /* range shift 30 */
- { 23, 29, 0 }, /* UNPARSED shift 29 */
+ {YYNOCODE,0,0}, /* Unused */
+ { 31, 30, 0 }, /* range shift 30 */
/* State 14 */
{ 6, 15, 0 }, /* LBRACKET shift 15 */
/* State 15 */
- { 24, 27, 0 }, /* drnode shift 27 */
- { 25, 16, &yyActionTable[ 120] }, /* drnode_list shift 16 */
{ 5, 20, &yyActionTable[ 121] }, /* INTEGER shift 20 */
+ { 25, 27, &yyActionTable[ 118] }, /* drnode shift 27 */
+ { 26, 16, 0 }, /* drnode_list shift 16 */
{ 1, 25, 0 }, /* COLON shift 25 */
/* State 16 */
{ 8, 17, &yyActionTable[ 123] }, /* RBRACKET shift 17 */
@@ -274,8 +274,8 @@
/* State 17 */
{YYNOCODE,0,0}, /* Unused */
/* State 18 */
- { 24, 19, 0 }, /* drnode shift 19 */
{ 5, 20, &yyActionTable[ 127] }, /* INTEGER shift 20 */
+ { 25, 19, &yyActionTable[ 125] }, /* drnode shift 19 */
{ 1, 25, 0 }, /* COLON shift 25 */
{YYNOCODE,0,0}, /* Unused */
/* State 19 */
@@ -324,7 +324,18 @@
/* State 40 */
{YYNOCODE,0,0}, /* Unused */
/* State 41 */
- { 22, 8, 0 }, /* TEST_OR shift 8 */
+ { 24, 29, 0 }, /* UNPARSED shift 29 */
+ { 11, 28, &yyActionTable[ 154] }, /* STRING shift 28 */
+ { 3, 14, 0 }, /* FIELD shift 14 */
+ { 27, 42, &yyActionTable[ 153] }, /* entity shift 42 */
+ {YYNOCODE,0,0}, /* Unused */
+ {YYNOCODE,0,0}, /* Unused */
+ {YYNOCODE,0,0}, /* Unused */
+ { 31, 30, 0 }, /* range shift 30 */
+/* State 42 */
+ {YYNOCODE,0,0}, /* Unused */
+/* State 43 */
+ { 23, 8, 0 }, /* TEST_OR shift 8 */
};
/* The state table contains information needed to look up the correct
@@ -345,48 +356,50 @@
YYACTIONTYPE actionDefault; /* Default action if look-ahead not found */
};
static struct yyStateEntry yyStateTable[] = {
- { &yyActionTable[0], 15, 73},
- { &yyActionTable[16], 3, 73},
- { &yyActionTable[20], 15, 73},
- { &yyActionTable[36], 0, 44},
- { &yyActionTable[37], 0, 45},
- { &yyActionTable[38], 15, 73},
- { &yyActionTable[54], 3, 73},
- { &yyActionTable[58], 0, 46},
- { &yyActionTable[59], 15, 73},
- { &yyActionTable[75], 0, 48},
- { &yyActionTable[76], 15, 73},
- { &yyActionTable[92], 0, 49},
- { &yyActionTable[93], 15, 50},
- { &yyActionTable[109], 7, 73},
- { &yyActionTable[117], 0, 51},
- { &yyActionTable[118], 3, 73},
- { &yyActionTable[122], 1, 73},
- { &yyActionTable[124], 0, 55},
- { &yyActionTable[125], 3, 73},
- { &yyActionTable[129], 0, 57},
- { &yyActionTable[130], 1, 62},
- { &yyActionTable[132], 0, 61},
- { &yyActionTable[133], 0, 58},
- { &yyActionTable[134], 0, 73},
- { &yyActionTable[135], 0, 59},
- { &yyActionTable[136], 0, 73},
- { &yyActionTable[137], 0, 60},
- { &yyActionTable[138], 0, 56},
- { &yyActionTable[139], 0, 52},
- { &yyActionTable[140], 0, 53},
- { &yyActionTable[141], 0, 54},
- { &yyActionTable[142], 0, 63},
- { &yyActionTable[143], 0, 64},
- { &yyActionTable[144], 0, 65},
- { &yyActionTable[145], 0, 66},
- { &yyActionTable[146], 0, 67},
- { &yyActionTable[147], 0, 68},
- { &yyActionTable[148], 0, 69},
- { &yyActionTable[149], 0, 70},
- { &yyActionTable[150], 0, 71},
- { &yyActionTable[151], 0, 72},
- { &yyActionTable[152], 0, 47},
+ { &yyActionTable[0], 15, 76},
+ { &yyActionTable[16], 3, 76},
+ { &yyActionTable[20], 15, 76},
+ { &yyActionTable[36], 0, 46},
+ { &yyActionTable[37], 0, 47},
+ { &yyActionTable[38], 15, 76},
+ { &yyActionTable[54], 3, 76},
+ { &yyActionTable[58], 0, 48},
+ { &yyActionTable[59], 15, 76},
+ { &yyActionTable[75], 0, 50},
+ { &yyActionTable[76], 15, 76},
+ { &yyActionTable[92], 0, 51},
+ { &yyActionTable[93], 15, 52},
+ { &yyActionTable[109], 7, 76},
+ { &yyActionTable[117], 0, 53},
+ { &yyActionTable[118], 3, 76},
+ { &yyActionTable[122], 1, 76},
+ { &yyActionTable[124], 0, 57},
+ { &yyActionTable[125], 3, 76},
+ { &yyActionTable[129], 0, 59},
+ { &yyActionTable[130], 1, 64},
+ { &yyActionTable[132], 0, 63},
+ { &yyActionTable[133], 0, 60},
+ { &yyActionTable[134], 0, 76},
+ { &yyActionTable[135], 0, 61},
+ { &yyActionTable[136], 0, 76},
+ { &yyActionTable[137], 0, 62},
+ { &yyActionTable[138], 0, 58},
+ { &yyActionTable[139], 0, 54},
+ { &yyActionTable[140], 0, 55},
+ { &yyActionTable[141], 0, 56},
+ { &yyActionTable[142], 0, 65},
+ { &yyActionTable[143], 0, 67},
+ { &yyActionTable[144], 0, 68},
+ { &yyActionTable[145], 0, 69},
+ { &yyActionTable[146], 0, 70},
+ { &yyActionTable[147], 0, 71},
+ { &yyActionTable[148], 0, 72},
+ { &yyActionTable[149], 0, 73},
+ { &yyActionTable[150], 0, 74},
+ { &yyActionTable[151], 0, 75},
+ { &yyActionTable[152], 7, 76},
+ { &yyActionTable[160], 0, 66},
+ { &yyActionTable[161], 0, 49},
};
/* The following structure represents a single element of the
@@ -453,13 +466,13 @@
static char *yyTokenName[] = {
"$", "COLON", "COMMA", "FIELD",
"HYPHEN", "INTEGER", "LBRACKET", "LPAREN",
- "RBRACKET", "RPAREN", "STRING", "TEST_AND",
- "TEST_BITWISE_AND", "TEST_CONTAINS", "TEST_EQ", "TEST_GE",
- "TEST_GT", "TEST_LE", "TEST_LT", "TEST_MATCHES",
- "TEST_NE", "TEST_NOT", "TEST_OR", "UNPARSED",
- "drnode", "drnode_list", "entity", "error",
- "expr", "logical_test", "range", "rel_op2",
- "relation_test", "sentence",
+ "RBRACKET", "RET", "RPAREN", "STRING",
+ "TEST_AND", "TEST_BITWISE_AND", "TEST_CONTAINS", "TEST_EQ",
+ "TEST_GE", "TEST_GT", "TEST_LE", "TEST_LT",
+ "TEST_MATCHES", "TEST_NE", "TEST_NOT", "TEST_OR",
+ "UNPARSED", "drnode", "drnode_list", "entity",
+ "error", "expr", "logical_test", "range",
+ "rel_op2", "relation_test", "sentence",
};
#define YYTRACE(X) if( yyTraceFILE ) fprintf(yyTraceFILE,"%sReduce [%s].\n",yyTracePrompt,X);
#else
@@ -527,49 +540,50 @@
case 21:
case 22:
case 23:
-#line 24 "grammar.lemon"
-{stnode_free((yypminor->yy0));}
-#line 532 "grammar.c"
- break;
case 24:
-#line 47 "grammar.lemon"
-{drange_node_free((yypminor->yy25));}
-#line 537 "grammar.c"
+#line 24 "./grammar.lemon"
+{stnode_free((yypminor->yy0));}
+#line 546 "grammar.c"
break;
case 25:
-#line 50 "grammar.lemon"
-{drange_node_free_list((yypminor->yy26));}
-#line 542 "grammar.c"
+#line 47 "./grammar.lemon"
+{drange_node_free((yypminor->yy45));}
+#line 551 "grammar.c"
break;
case 26:
-#line 33 "grammar.lemon"
-{stnode_free((yypminor->yy51));}
-#line 547 "grammar.c"
+#line 50 "./grammar.lemon"
+{drange_node_free_list((yypminor->yy7));}
+#line 556 "grammar.c"
break;
- case 28:
-#line 30 "grammar.lemon"
-{stnode_free((yypminor->yy51));}
-#line 552 "grammar.c"
+ case 27:
+#line 33 "./grammar.lemon"
+{stnode_free((yypminor->yy1));}
+#line 561 "grammar.c"
break;
case 29:
-#line 39 "grammar.lemon"
-{stnode_free((yypminor->yy51));}
-#line 557 "grammar.c"
+#line 30 "./grammar.lemon"
+{stnode_free((yypminor->yy1));}
+#line 566 "grammar.c"
break;
case 30:
-#line 44 "grammar.lemon"
-{stnode_free((yypminor->yy51));}
-#line 562 "grammar.c"
+#line 39 "./grammar.lemon"
+{stnode_free((yypminor->yy1));}
+#line 571 "grammar.c"
break;
- case 32:
-#line 36 "grammar.lemon"
-{stnode_free((yypminor->yy51));}
-#line 567 "grammar.c"
+ case 31:
+#line 44 "./grammar.lemon"
+{stnode_free((yypminor->yy1));}
+#line 576 "grammar.c"
break;
case 33:
-#line 27 "grammar.lemon"
-{stnode_free((yypminor->yy51));}
-#line 572 "grammar.c"
+#line 36 "./grammar.lemon"
+{stnode_free((yypminor->yy1));}
+#line 581 "grammar.c"
+ break;
+ case 34:
+#line 27 "./grammar.lemon"
+{stnode_free((yypminor->yy1));}
+#line 586 "grammar.c"
break;
default: break; /* If no destructor action specified: do nothing */
}
@@ -697,37 +711,38 @@
YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */
unsigned char nrhs; /* Number of right-hand side symbols in the rule */
} yyRuleInfo[] = {
- { 33, 1 },
- { 33, 0 },
- { 28, 1 },
- { 28, 1 },
- { 28, 3 },
- { 29, 3 },
- { 29, 3 },
- { 29, 2 },
+ { 34, 1 },
+ { 34, 0 },
{ 29, 1 },
+ { 29, 1 },
+ { 29, 3 },
+ { 30, 3 },
+ { 30, 3 },
+ { 30, 2 },
+ { 30, 1 },
+ { 27, 1 },
+ { 27, 1 },
+ { 27, 1 },
+ { 27, 1 },
+ { 31, 4 },
{ 26, 1 },
- { 26, 1 },
- { 26, 1 },
- { 26, 1 },
- { 30, 4 },
- { 25, 1 },
+ { 26, 3 },
+ { 25, 3 },
{ 25, 3 },
- { 24, 3 },
- { 24, 3 },
- { 24, 2 },
- { 24, 2 },
- { 24, 1 },
- { 32, 3 },
- { 31, 1 },
- { 31, 1 },
- { 31, 1 },
- { 31, 1 },
- { 31, 1 },
- { 31, 1 },
- { 31, 1 },
- { 31, 1 },
- { 31, 1 },
+ { 25, 2 },
+ { 25, 2 },
+ { 25, 1 },
+ { 33, 3 },
+ { 33, 2 },
+ { 32, 1 },
+ { 32, 1 },
+ { 32, 1 },
+ { 32, 1 },
+ { 32, 1 },
+ { 32, 1 },
+ { 32, 1 },
+ { 32, 1 },
+ { 32, 1 },
};
static void yy_accept(
@@ -762,270 +777,280 @@
*/
case 0:
YYTRACE("sentence ::= expr")
-#line 115 "grammar.lemon"
-{ dfw->st_root = yymsp[0].minor.yy51; }
-#line 767 "grammar.c"
+#line 116 "./grammar.lemon"
+{ dfw->st_root = yymsp[0].minor.yy1; }
+#line 782 "grammar.c"
break;
case 1:
YYTRACE("sentence ::=")
-#line 116 "grammar.lemon"
+#line 117 "./grammar.lemon"
{ dfw->st_root = NULL; }
-#line 773 "grammar.c"
+#line 788 "grammar.c"
break;
case 2:
YYTRACE("expr ::= relation_test")
-#line 118 "grammar.lemon"
-{ yygotominor.yy51 = yymsp[0].minor.yy51; }
-#line 779 "grammar.c"
+#line 119 "./grammar.lemon"
+{ yygotominor.yy1 = yymsp[0].minor.yy1; }
+#line 794 "grammar.c"
break;
case 3:
YYTRACE("expr ::= logical_test")
-#line 119 "grammar.lemon"
-{ yygotominor.yy51 = yymsp[0].minor.yy51; }
-#line 785 "grammar.c"
+#line 120 "./grammar.lemon"
+{ yygotominor.yy1 = yymsp[0].minor.yy1; }
+#line 800 "grammar.c"
break;
case 4:
YYTRACE("expr ::= LPAREN expr RPAREN")
-#line 122 "grammar.lemon"
+#line 122 "./grammar.lemon"
{
- yygotominor.yy51 = yymsp[-1].minor.yy51;
+ yygotominor.yy1 = yymsp[-1].minor.yy1;
}
-#line 793 "grammar.c"
+#line 808 "grammar.c"
yy_destructor(7,&yymsp[-2].minor);
- yy_destructor(9,&yymsp[0].minor);
+ yy_destructor(10,&yymsp[0].minor);
break;
case 5:
YYTRACE("logical_test ::= expr TEST_AND expr")
-#line 129 "grammar.lemon"
+#line 129 "./grammar.lemon"
{
- yygotominor.yy51 = stnode_new(STTYPE_TEST, NULL);
- sttype_test_set2(yygotominor.yy51, TEST_OP_AND, yymsp[-2].minor.yy51, yymsp[0].minor.yy51);
+ yygotominor.yy1 = stnode_new(STTYPE_TEST, NULL);
+ sttype_test_set2(yygotominor.yy1, TEST_OP_AND, yymsp[-2].minor.yy1, yymsp[0].minor.yy1);
}
-#line 804 "grammar.c"
- yy_destructor(11,&yymsp[-1].minor);
+#line 819 "grammar.c"
+ yy_destructor(12,&yymsp[-1].minor);
break;
case 6:
YYTRACE("logical_test ::= expr TEST_OR expr")
-#line 135 "grammar.lemon"
+#line 135 "./grammar.lemon"
{
- yygotominor.yy51 = stnode_new(STTYPE_TEST, NULL);
- sttype_test_set2(yygotominor.yy51, TEST_OP_OR, yymsp[-2].minor.yy51, yymsp[0].minor.yy51);
+ yygotominor.yy1 = stnode_new(STTYPE_TEST, NULL);
+ sttype_test_set2(yygotominor.yy1, TEST_OP_OR, yymsp[-2].minor.yy1, yymsp[0].minor.yy1);
}
-#line 814 "grammar.c"
- yy_destructor(22,&yymsp[-1].minor);
+#line 829 "grammar.c"
+ yy_destructor(23,&yymsp[-1].minor);
break;
case 7:
YYTRACE("logical_test ::= TEST_NOT expr")
-#line 141 "grammar.lemon"
+#line 141 "./grammar.lemon"
{
- yygotominor.yy51 = stnode_new(STTYPE_TEST, NULL);
- sttype_test_set1(yygotominor.yy51, TEST_OP_NOT, yymsp[0].minor.yy51);
+ yygotominor.yy1 = stnode_new(STTYPE_TEST, NULL);
+ sttype_test_set1(yygotominor.yy1, TEST_OP_NOT, yymsp[0].minor.yy1);
}
-#line 824 "grammar.c"
- yy_destructor(21,&yymsp[-1].minor);
+#line 839 "grammar.c"
+ yy_destructor(22,&yymsp[-1].minor);
break;
case 8:
YYTRACE("logical_test ::= entity")
-#line 147 "grammar.lemon"
+#line 147 "./grammar.lemon"
{
- yygotominor.yy51 = stnode_new(STTYPE_TEST, NULL);
- sttype_test_set1(yygotominor.yy51, TEST_OP_EXISTS, yymsp[0].minor.yy51);
+ yygotominor.yy1 = stnode_new(STTYPE_TEST, NULL);
+ sttype_test_set1(yygotominor.yy1, TEST_OP_EXISTS, yymsp[0].minor.yy1);
}
-#line 834 "grammar.c"
+#line 849 "grammar.c"
break;
case 9:
YYTRACE("entity ::= FIELD")
-#line 155 "grammar.lemon"
-{ yygotominor.yy51 = yymsp[0].minor.yy0; }
-#line 840 "grammar.c"
+#line 155 "./grammar.lemon"
+{ yygotominor.yy1 = yymsp[0].minor.yy0; }
+#line 855 "grammar.c"
break;
case 10:
YYTRACE("entity ::= STRING")
-#line 156 "grammar.lemon"
-{ yygotominor.yy51 = yymsp[0].minor.yy0; }
-#line 846 "grammar.c"
+#line 156 "./grammar.lemon"
+{ yygotominor.yy1 = yymsp[0].minor.yy0; }
+#line 861 "grammar.c"
break;
case 11:
YYTRACE("entity ::= UNPARSED")
-#line 157 "grammar.lemon"
-{ yygotominor.yy51 = yymsp[0].minor.yy0; }
-#line 852 "grammar.c"
+#line 157 "./grammar.lemon"
+{ yygotominor.yy1 = yymsp[0].minor.yy0; }
+#line 867 "grammar.c"
break;
case 12:
YYTRACE("entity ::= range")
-#line 158 "grammar.lemon"
-{ yygotominor.yy51 = yymsp[0].minor.yy51; }
-#line 858 "grammar.c"
+#line 158 "./grammar.lemon"
+{ yygotominor.yy1 = yymsp[0].minor.yy1; }
+#line 873 "grammar.c"
break;
case 13:
YYTRACE("range ::= FIELD LBRACKET drnode_list RBRACKET")
-#line 163 "grammar.lemon"
+#line 163 "./grammar.lemon"
{
- yygotominor.yy51 = stnode_new(STTYPE_RANGE, NULL);
- sttype_range_set(yygotominor.yy51, yymsp[-3].minor.yy0, yymsp[-1].minor.yy26);
+ yygotominor.yy1 = stnode_new(STTYPE_RANGE, NULL);
+ sttype_range_set(yygotominor.yy1, yymsp[-3].minor.yy0, yymsp[-1].minor.yy7);
/* Delete the list, but not the drange_nodes that
* the list contains. */
- g_slist_free(yymsp[-1].minor.yy26);
+ g_slist_free(yymsp[-1].minor.yy7);
}
-#line 871 "grammar.c"
+#line 886 "grammar.c"
yy_destructor(6,&yymsp[-2].minor);
yy_destructor(8,&yymsp[0].minor);
break;
case 14:
YYTRACE("drnode_list ::= drnode")
-#line 173 "grammar.lemon"
+#line 173 "./grammar.lemon"
{
- yygotominor.yy26 = g_slist_append(NULL, yymsp[0].minor.yy25);
+ yygotominor.yy7 = g_slist_append(NULL, yymsp[0].minor.yy45);
}
-#line 881 "grammar.c"
+#line 896 "grammar.c"
break;
case 15:
YYTRACE("drnode_list ::= drnode_list COMMA drnode")
-#line 178 "grammar.lemon"
+#line 178 "./grammar.lemon"
{
- yygotominor.yy26 = g_slist_append(yymsp[-2].minor.yy26, yymsp[0].minor.yy25);
+ yygotominor.yy7 = g_slist_append(yymsp[-2].minor.yy7, yymsp[0].minor.yy45);
}
-#line 889 "grammar.c"
+#line 904 "grammar.c"
yy_destructor(2,&yymsp[-1].minor);
break;
case 16:
YYTRACE("drnode ::= INTEGER COLON INTEGER")
-#line 184 "grammar.lemon"
+#line 184 "./grammar.lemon"
{
- yygotominor.yy25 = drange_node_new();
- drange_node_set_start_offset(yygotominor.yy25, stnode_value(yymsp[-2].minor.yy0));
- drange_node_set_length(yygotominor.yy25, stnode_value(yymsp[0].minor.yy0));
+ yygotominor.yy45 = drange_node_new();
+ drange_node_set_start_offset(yygotominor.yy45, stnode_value(yymsp[-2].minor.yy0));
+ drange_node_set_length(yygotominor.yy45, stnode_value(yymsp[0].minor.yy0));
stnode_free(yymsp[-2].minor.yy0);
stnode_free(yymsp[0].minor.yy0);
}
-#line 903 "grammar.c"
+#line 918 "grammar.c"
yy_destructor(1,&yymsp[-1].minor);
break;
case 17:
YYTRACE("drnode ::= INTEGER HYPHEN INTEGER")
-#line 195 "grammar.lemon"
+#line 195 "./grammar.lemon"
{
- yygotominor.yy25 = drange_node_new();
- drange_node_set_start_offset(yygotominor.yy25, stnode_value(yymsp[-2].minor.yy0));
- drange_node_set_end_offset(yygotominor.yy25, stnode_value(yymsp[0].minor.yy0));
+ yygotominor.yy45 = drange_node_new();
+ drange_node_set_start_offset(yygotominor.yy45, stnode_value(yymsp[-2].minor.yy0));
+ drange_node_set_end_offset(yygotominor.yy45, stnode_value(yymsp[0].minor.yy0));
stnode_free(yymsp[-2].minor.yy0);
stnode_free(yymsp[0].minor.yy0);
}
-#line 917 "grammar.c"
+#line 932 "grammar.c"
yy_destructor(4,&yymsp[-1].minor);
break;
case 18:
YYTRACE("drnode ::= COLON INTEGER")
-#line 207 "grammar.lemon"
+#line 207 "./grammar.lemon"
{
- yygotominor.yy25 = drange_node_new();
- drange_node_set_start_offset(yygotominor.yy25, 0);
- drange_node_set_length(yygotominor.yy25, stnode_value(yymsp[0].minor.yy0));
+ yygotominor.yy45 = drange_node_new();
+ drange_node_set_start_offset(yygotominor.yy45, 0);
+ drange_node_set_length(yygotominor.yy45, stnode_value(yymsp[0].minor.yy0));
stnode_free(yymsp[0].minor.yy0);
}
-#line 930 "grammar.c"
+#line 945 "grammar.c"
yy_destructor(1,&yymsp[-1].minor);
break;
case 19:
YYTRACE("drnode ::= INTEGER COLON")
-#line 217 "grammar.lemon"
+#line 217 "./grammar.lemon"
{
- yygotominor.yy25 = drange_node_new();
- drange_node_set_start_offset(yygotominor.yy25, stnode_value(yymsp[-1].minor.yy0));
- drange_node_set_to_the_end(yygotominor.yy25);
+ yygotominor.yy45 = drange_node_new();
+ drange_node_set_start_offset(yygotominor.yy45, stnode_value(yymsp[-1].minor.yy0));
+ drange_node_set_to_the_end(yygotominor.yy45);
stnode_free(yymsp[-1].minor.yy0);
}
-#line 943 "grammar.c"
+#line 958 "grammar.c"
yy_destructor(1,&yymsp[0].minor);
break;
case 20:
YYTRACE("drnode ::= INTEGER")
-#line 227 "grammar.lemon"
+#line 227 "./grammar.lemon"
{
- yygotominor.yy25 = drange_node_new();
- drange_node_set_start_offset(yygotominor.yy25, stnode_value(yymsp[0].minor.yy0));
- drange_node_set_length(yygotominor.yy25, 1);
+ yygotominor.yy45 = drange_node_new();
+ drange_node_set_start_offset(yygotominor.yy45, stnode_value(yymsp[0].minor.yy0));
+ drange_node_set_length(yygotominor.yy45, 1);
stnode_free(yymsp[0].minor.yy0);
}
-#line 956 "grammar.c"
+#line 971 "grammar.c"
break;
case 21:
YYTRACE("relation_test ::= entity rel_op2 entity")
-#line 239 "grammar.lemon"
+#line 239 "./grammar.lemon"
{
- yygotominor.yy51 = stnode_new(STTYPE_TEST, NULL);
- sttype_test_set2(yygotominor.yy51, yymsp[-1].minor.yy42, yymsp[-2].minor.yy51, yymsp[0].minor.yy51);
+ yygotominor.yy1 = stnode_new(STTYPE_TEST, NULL);
+ sttype_test_set2(yygotominor.yy1, yymsp[-1].minor.yy2, yymsp[-2].minor.yy1, yymsp[0].minor.yy1);
}
-#line 965 "grammar.c"
+#line 980 "grammar.c"
break;
case 22:
- YYTRACE("rel_op2 ::= TEST_EQ")
-#line 244 "grammar.lemon"
-{ yygotominor.yy42 = TEST_OP_EQ; }
-#line 971 "grammar.c"
- yy_destructor(14,&yymsp[0].minor);
+ YYTRACE("relation_test ::= RET entity")
+#line 245 "./grammar.lemon"
+{
+ yygotominor.yy1 = stnode_new(STTYPE_TEST, NULL);
+ sttype_test_set1(yygotominor.yy1, RET, yymsp[0].minor.yy1);
+}
+#line 989 "grammar.c"
+ yy_destructor(9,&yymsp[-1].minor);
break;
case 23:
- YYTRACE("rel_op2 ::= TEST_NE")
-#line 245 "grammar.lemon"
-{ yygotominor.yy42 = TEST_OP_NE; }
-#line 978 "grammar.c"
- yy_destructor(20,&yymsp[0].minor);
+ YYTRACE("rel_op2 ::= TEST_EQ")
+#line 251 "./grammar.lemon"
+{ yygotominor.yy2 = TEST_OP_EQ; }
+#line 996 "grammar.c"
+ yy_destructor(15,&yymsp[0].minor);
break;
case 24:
- YYTRACE("rel_op2 ::= TEST_GT")
-#line 246 "grammar.lemon"
-{ yygotominor.yy42 = TEST_OP_GT; }
-#line 985 "grammar.c"
- yy_destructor(16,&yymsp[0].minor);
+ YYTRACE("rel_op2 ::= TEST_NE")
+#line 252 "./grammar.lemon"
+{ yygotominor.yy2 = TEST_OP_NE; }
+#line 1003 "grammar.c"
+ yy_destructor(21,&yymsp[0].minor);
break;
case 25:
- YYTRACE("rel_op2 ::= TEST_GE")
-#line 247 "grammar.lemon"
-{ yygotominor.yy42 = TEST_OP_GE; }
-#line 992 "grammar.c"
- yy_destructor(15,&yymsp[0].minor);
+ YYTRACE("rel_op2 ::= TEST_GT")
+#line 253 "./grammar.lemon"
+{ yygotominor.yy2 = TEST_OP_GT; }
+#line 1010 "grammar.c"
+ yy_destructor(17,&yymsp[0].minor);
break;
case 26:
- YYTRACE("rel_op2 ::= TEST_LT")
-#line 248 "grammar.lemon"
-{ yygotominor.yy42 = TEST_OP_LT; }
-#line 999 "grammar.c"
- yy_destructor(18,&yymsp[0].minor);
+ YYTRACE("rel_op2 ::= TEST_GE")
+#line 254 "./grammar.lemon"
+{ yygotominor.yy2 = TEST_OP_GE; }
+#line 1017 "grammar.c"
+ yy_destructor(16,&yymsp[0].minor);
break;
case 27:
- YYTRACE("rel_op2 ::= TEST_LE")
-#line 249 "grammar.lemon"
-{ yygotominor.yy42 = TEST_OP_LE; }
-#line 1006 "grammar.c"
- yy_destructor(17,&yymsp[0].minor);
+ YYTRACE("rel_op2 ::= TEST_LT")
+#line 255 "./grammar.lemon"
+{ yygotominor.yy2 = TEST_OP_LT; }
+#line 1024 "grammar.c"
+ yy_destructor(19,&yymsp[0].minor);
break;
case 28:
- YYTRACE("rel_op2 ::= TEST_BITWISE_AND")
-#line 250 "grammar.lemon"
-{ yygotominor.yy42 = TEST_OP_BITWISE_AND; }
-#line 1013 "grammar.c"
- yy_destructor(12,&yymsp[0].minor);
+ YYTRACE("rel_op2 ::= TEST_LE")
+#line 256 "./grammar.lemon"
+{ yygotominor.yy2 = TEST_OP_LE; }
+#line 1031 "grammar.c"
+ yy_destructor(18,&yymsp[0].minor);
break;
case 29:
- YYTRACE("rel_op2 ::= TEST_CONTAINS")
-#line 251 "grammar.lemon"
-{ yygotominor.yy42 = TEST_OP_CONTAINS; }
-#line 1020 "grammar.c"
+ YYTRACE("rel_op2 ::= TEST_BITWISE_AND")
+#line 257 "./grammar.lemon"
+{ yygotominor.yy2 = TEST_OP_BITWISE_AND; }
+#line 1038 "grammar.c"
yy_destructor(13,&yymsp[0].minor);
break;
case 30:
+ YYTRACE("rel_op2 ::= TEST_CONTAINS")
+#line 258 "./grammar.lemon"
+{ yygotominor.yy2 = TEST_OP_CONTAINS; }
+#line 1045 "grammar.c"
+ yy_destructor(14,&yymsp[0].minor);
+ break;
+ case 31:
YYTRACE("rel_op2 ::= TEST_MATCHES")
-#line 252 "grammar.lemon"
-{ yygotominor.yy42 = TEST_OP_MATCHES; }
-#line 1027 "grammar.c"
- yy_destructor(19,&yymsp[0].minor);
+#line 259 "./grammar.lemon"
+{ yygotominor.yy2 = TEST_OP_MATCHES; }
+#line 1052 "grammar.c"
+ yy_destructor(20,&yymsp[0].minor);
break;
};
yygoto = yyRuleInfo[yyruleno].lhs;
@@ -1055,11 +1080,11 @@
while( yypParser->idx>=0 ) yy_pop_parser_stack(yypParser);
/* Here code is inserted which will be executed whenever the
** parser fails */
-#line 102 "grammar.lemon"
+#line 102 "./grammar.lemon"
dfw->syntax_error = TRUE;
-#line 1062 "grammar.c"
+#line 1087 "grammar.c"
}
/*
@@ -1072,7 +1097,7 @@
DfilterANSIARGDECL _U_ /* Extra arguments (if any) */
){
#define TOKEN (yyminor.yy0)
-#line 54 "grammar.lemon"
+#line 54 "./grammar.lemon"
header_field_info *hfinfo;
@@ -1116,7 +1141,7 @@
break;
}
-#line 1119 "grammar.c"
+#line 1144 "grammar.c"
}
/*
diff -ruN ../ethereal-0.10.11/epan/dfilter/grammar.h ethereal/epan/dfilter/grammar.h
--- ../ethereal-0.10.11/epan/dfilter/grammar.h 2005-06-29 10:13:29.000000000 +0200
+++ ethereal/epan/dfilter/grammar.h 2005-07-01 12:20:03.000000000 +0200
@@ -6,19 +6,19 @@
#define TOKEN_LBRACKET 6
#define TOKEN_LPAREN 7
#define TOKEN_RBRACKET 8
-#define TOKEN_RPAREN 9
-#define TOKEN_STRING 10
-#define TOKEN_TEST_AND 11
-#define TOKEN_TEST_BITWISE_AND 12
-#define TOKEN_TEST_CONTAINS 13
-#define TOKEN_TEST_EQ 14
-#define TOKEN_TEST_GE 15
-#define TOKEN_TEST_GT 16
-#define TOKEN_TEST_LE 17
-#define TOKEN_TEST_LT 18
-#define TOKEN_TEST_MATCHES 19
-#define TOKEN_TEST_NE 20
-#define TOKEN_TEST_NOT 21
-#define TOKEN_TEST_OR 22
-#define TOKEN_UNPARSED 23
-#define TOKEN_RETURN 24
+#define TOKEN_RET 9
+#define TOKEN_RPAREN 10
+#define TOKEN_STRING 11
+#define TOKEN_TEST_AND 12
+#define TOKEN_TEST_BITWISE_AND 13
+#define TOKEN_TEST_CONTAINS 14
+#define TOKEN_TEST_EQ 15
+#define TOKEN_TEST_GE 16
+#define TOKEN_TEST_GT 17
+#define TOKEN_TEST_LE 18
+#define TOKEN_TEST_LT 19
+#define TOKEN_TEST_MATCHES 20
+#define TOKEN_TEST_NE 21
+#define TOKEN_TEST_NOT 22
+#define TOKEN_TEST_OR 23
+#define TOKEN_UNPARSED 24
diff -ruN ../ethereal-0.10.11/epan/dfilter/grammar.lemon ethereal/epan/dfilter/grammar.lemon
--- ../ethereal-0.10.11/epan/dfilter/grammar.lemon 2005-05-02 23:28:08.000000000 +0200
+++ ethereal/epan/dfilter/grammar.lemon 2005-07-04 12:34:39.000000000 +0200
@@ -106,6 +106,7 @@
/* ----------------- The grammar -------------- */
/* Associativity */
+%right RET.
%left TEST_AND.
%left TEST_OR.
%nonassoc TEST_EQ TEST_NE TEST_LT TEST_LE TEST_GT TEST_GE TEST_CONTAINS TEST_MATCHES TEST_BITWISE_AND.
@@ -117,7 +118,6 @@
expr(X) ::= relation_test(R). { X = R; }
expr(X) ::= logical_test(L). { X = L; }
-
expr(X) ::= LPAREN expr(Y) RPAREN.
{
X = Y;
@@ -241,6 +241,13 @@
sttype_test_set2(T, O, E, F);
}
+relation_test(T) ::= RET entity(P).
+{
+ T = stnode_new(STTYPE_TEST, NULL);
+ sttype_test_set1(T, RET, P);
+}
+
+
rel_op2(O) ::= TEST_EQ. { O = TEST_OP_EQ; }
rel_op2(O) ::= TEST_NE. { O = TEST_OP_NE; }
rel_op2(O) ::= TEST_GT. { O = TEST_OP_GT; }
diff -ruN ../ethereal-0.10.11/epan/dfilter/scanner.c ethereal/epan/dfilter/scanner.c
--- ../ethereal-0.10.11/epan/dfilter/scanner.c 2005-05-04 23:35:23.000000000 +0200
+++ ethereal/epan/dfilter/scanner.c 2005-06-30 13:16:27.000000000 +0200
@@ -1,51 +1,86 @@
-#define yy_create_buffer df__create_buffer
-#define yy_delete_buffer df__delete_buffer
-#define yy_scan_buffer df__scan_buffer
-#define yy_scan_string df__scan_string
-#define yy_scan_bytes df__scan_bytes
-#define yy_flex_debug df__flex_debug
-#define yy_init_buffer df__init_buffer
-#define yy_flush_buffer df__flush_buffer
-#define yy_load_buffer_state df__load_buffer_state
-#define yy_switch_to_buffer df__switch_to_buffer
-#define yyin df_in
-#define yyleng df_leng
-#define yylex df_lex
-#define yyout df_out
-#define yyrestart df_restart
-#define yytext df_text
-#define yywrap df_wrap
+#line 2 "scanner.c"
-#line 20 "scanner.c"
-/* A lexical scanner generated by flex */
+#line 4 "scanner.c"
-/* Scanner skeleton version:
- * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
- */
+#define YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
+#define YY_FLEX_SUBMINOR_VERSION 31
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+/* First, we deal with platform-specific or compiler-specific issues. */
+/* begin standard C headers. */
#include <stdio.h>
-#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+/* end standard C headers. */
-/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
-#ifdef c_plusplus
-#ifndef __cplusplus
-#define __cplusplus
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t;
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX (255U)
#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX (4294967295U)
#endif
+#endif /* ! FLEXINT_H */
#ifdef __cplusplus
-#include <stdlib.h>
-
-/* Use prototypes in function declarations. */
-#define YY_USE_PROTOS
-
/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST
@@ -53,34 +88,17 @@
#if __STDC__
-#define YY_USE_PROTOS
#define YY_USE_CONST
#endif /* __STDC__ */
#endif /* ! __cplusplus */
-#ifdef __TURBOC__
- #pragma warn -rch
- #pragma warn -use
-#include <io.h>
-#include <stdlib.h>
-#define YY_USE_CONST
-#define YY_USE_PROTOS
-#endif
-
#ifdef YY_USE_CONST
#define yyconst const
#else
#define yyconst
#endif
-
-#ifdef YY_USE_PROTOS
-#define YY_PROTO(proto) proto
-#else
-#define YY_PROTO(proto) ()
-#endif
-
/* Returned upon end-of-file. */
#define YY_NULL 0
@@ -95,71 +113,71 @@
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN.
*/
-#define BEGIN yy_start = 1 + 2 *
+#define BEGIN (yy_start) = 1 + 2 *
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
-#define YY_START ((yy_start - 1) / 2)
+#define YY_START (((yy_start) - 1) / 2)
#define YYSTATE YY_START
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart( yyin )
+#define YY_NEW_FILE df_restart(df_in )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
#define YY_BUF_SIZE 16384
+#endif
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
+
+extern int df_leng;
-extern int yyleng;
-extern FILE *yyin, *yyout;
+extern FILE *df_in, *df_out;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
-/* The funky do-while in the following #define is used to turn the definition
- * int a single C statement (which needs a semi-colon terminator). This
- * avoids problems with code like:
- *
- * if ( condition_holds )
- * yyless( 5 );
- * else
- * do_something_else();
- *
- * Prior to using the do-while the compiler would get upset at the
- * "else" because it interpreted the "if" statement as being all
- * done when it reached the ';' after the yyless() call.
- */
-
-/* Return all but the first 'n' matched characters back to the input stream. */
-
+ #define YY_LESS_LINENO(n)
+
+/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
{ \
- /* Undo effects of setting up yytext. */ \
- *yy_cp = yy_hold_char; \
+ /* Undo effects of setting up df_text. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ *yy_cp = (yy_hold_char); \
YY_RESTORE_YY_MORE_OFFSET \
- yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
- YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up df_text again */ \
} \
while ( 0 )
-#define unput(c) yyunput( c, yytext_ptr )
+#define unput(c) yyunput( c, (yytext_ptr) )
/* The following is because we cannot portably get our hands on size_t
* (without autoconf's help, which isn't available because we want
* flex-generated scanners to compile on their own).
*/
-typedef unsigned int yy_size_t;
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef unsigned int yy_size_t;
+#endif
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
{
FILE *yy_input_file;
@@ -196,12 +214,16 @@
*/
int yy_at_bol;
+ int yy_bs_lineno; /**< The line count. */
+ int yy_bs_column; /**< The column count. */
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
int yy_fill_buffer;
int yy_buffer_status;
+
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
/* When an EOF's been seen but there's still some text to process
@@ -211,115 +233,152 @@
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
- * (via yyrestart()), so that the user can continue scanning by
- * just pointing yyin at a new input file.
+ * (via df_restart()), so that the user can continue scanning by
+ * just pointing df_in at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
+
};
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-static YY_BUFFER_STATE yy_current_buffer = 0;
+/* Stack of input buffers. */
+static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
+static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
+static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
/* We provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
* "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
*/
-#define YY_CURRENT_BUFFER yy_current_buffer
+#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
+ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
+ : NULL)
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
-/* yy_hold_char holds the character lost when yytext is formed. */
+/* yy_hold_char holds the character lost when df_text is formed. */
static char yy_hold_char;
-
static int yy_n_chars; /* number of characters read into yy_ch_buf */
-
-
-int yyleng;
+int df_leng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
static int yy_init = 1; /* whether we need to initialize */
static int yy_start = 0; /* start state number */
-/* Flag which is used to allow yywrap()'s to do buffer switches
- * instead of setting up a fresh yyin. A bit of a hack ...
+/* Flag which is used to allow df_wrap()'s to do buffer switches
+ * instead of setting up a fresh df_in. A bit of a hack ...
*/
static int yy_did_buffer_switch_on_eof;
-void yyrestart YY_PROTO(( FILE *input_file ));
+void df_restart (FILE *input_file );
+void df__switch_to_buffer (YY_BUFFER_STATE new_buffer );
+YY_BUFFER_STATE df__create_buffer (FILE *file,int size );
+void df__delete_buffer (YY_BUFFER_STATE b );
+void df__flush_buffer (YY_BUFFER_STATE b );
+void df_push_buffer_state (YY_BUFFER_STATE new_buffer );
+void df_pop_buffer_state (void );
+
+static void df_ensure_buffer_stack (void );
+static void df__load_buffer_state (void );
+static void df__init_buffer (YY_BUFFER_STATE b,FILE *file );
+
+#define YY_FLUSH_BUFFER df__flush_buffer(YY_CURRENT_BUFFER )
+
+YY_BUFFER_STATE df__scan_buffer (char *base,yy_size_t size );
+YY_BUFFER_STATE df__scan_string (yyconst char *yy_str );
+YY_BUFFER_STATE df__scan_bytes (yyconst char *bytes,int len );
+
+void *df_alloc (yy_size_t );
+void *df_realloc (void *,yy_size_t );
+void df_free (void * );
-void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
-void yy_load_buffer_state YY_PROTO(( void ));
-YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
-void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
-void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
-
-YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
-YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
-YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
-
-static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
-static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
-static void yy_flex_free YY_PROTO(( void * ));
-
-#define yy_new_buffer yy_create_buffer
+#define yy_new_buffer df__create_buffer
#define yy_set_interactive(is_interactive) \
{ \
- if ( ! yy_current_buffer ) \
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
- yy_current_buffer->yy_is_interactive = is_interactive; \
+ if ( ! YY_CURRENT_BUFFER ){ \
+ df_ensure_buffer_stack (); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ df__create_buffer(df_in,YY_BUF_SIZE ); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
#define yy_set_bol(at_bol) \
{ \
- if ( ! yy_current_buffer ) \
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
- yy_current_buffer->yy_at_bol = at_bol; \
+ if ( ! YY_CURRENT_BUFFER ){\
+ df_ensure_buffer_stack (); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ df__create_buffer(df_in,YY_BUF_SIZE ); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
-#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+/* Begin user sect3 */
typedef unsigned char YY_CHAR;
-FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+
+FILE *df_in = (FILE *) 0, *df_out = (FILE *) 0;
+
typedef int yy_state_type;
-extern char *yytext;
-#define yytext_ptr yytext
-static yy_state_type yy_get_previous_state YY_PROTO(( void ));
-static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
-static int yy_get_next_buffer YY_PROTO(( void ));
-static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+extern int df_lineno;
+
+int df_lineno = 1;
+
+extern char *df_text;
+#define yytext_ptr df_text
+
+static yy_state_type yy_get_previous_state (void );
+static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
+static int yy_get_next_buffer (void );
+static void yy_fatal_error (yyconst char msg[] );
/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
+ * corresponding action - sets up df_text.
*/
#define YY_DO_BEFORE_ACTION \
- yytext_ptr = yy_bp; \
- yyleng = (int) (yy_cp - yy_bp); \
- yy_hold_char = *yy_cp; \
+ (yytext_ptr) = yy_bp; \
+ df_leng = (size_t) (yy_cp - yy_bp); \
+ (yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
- yy_c_buf_p = yy_cp;
+ (yy_c_buf_p) = yy_cp;
-#define YY_NUM_RULES 44
-#define YY_END_OF_BUFFER 45
-static yyconst short int yy_accept[109] =
+#define YY_NUM_RULES 45
+#define YY_END_OF_BUFFER 46
+/* This struct is not used in this scanner,
+ but its presence is necessary. */
+struct yy_trans_info
+ {
+ flex_int32_t yy_verify;
+ flex_int32_t yy_nxt;
+ };
+static yyconst flex_int16_t yy_accept[115] =
{ 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 45, 43,
- 1, 1, 20, 35, 17, 2, 3, 42, 42, 12,
- 43, 8, 26, 42, 42, 42, 42, 42, 42, 42,
- 42, 42, 43, 34, 44, 34, 31, 27, 27, 29,
- 32, 33, 31, 30, 29, 32, 40, 36, 44, 1,
- 6, 22, 42, 42, 0, 14, 4, 10, 42, 42,
- 42, 5, 11, 9, 15, 13, 42, 7, 42, 25,
- 24, 27, 27, 0, 33, 40, 39, 37, 39, 41,
- 23, 42, 42, 42, 21, 28, 37, 38, 42, 42,
- 42, 37, 38, 42, 42, 42, 42, 42, 42, 42,
+ 0, 0, 0, 0, 0, 0, 0, 0, 46, 44,
+ 1, 1, 20, 36, 17, 2, 3, 43, 43, 12,
+ 44, 8, 27, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 44, 35, 45, 35, 32, 28, 28,
+ 30, 33, 34, 32, 31, 30, 33, 41, 37, 45,
+ 1, 6, 22, 43, 43, 0, 14, 4, 10, 43,
+ 43, 43, 5, 11, 9, 15, 13, 43, 7, 43,
+ 25, 43, 24, 28, 28, 0, 34, 41, 40, 38,
+ 40, 42, 23, 43, 43, 43, 21, 43, 29, 38,
+ 39, 43, 43, 43, 43, 38, 39, 43, 43, 43,
- 42, 19, 42, 18, 42, 42, 16, 0
+ 43, 43, 43, 43, 26, 43, 43, 19, 43, 18,
+ 43, 43, 16, 0
} ;
-static yyconst int yy_ec[256] =
+static yyconst flex_int32_t yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -333,8 +392,8 @@
22, 23, 24, 1, 25, 1, 26, 27, 28, 29,
30, 21, 31, 32, 33, 12, 12, 34, 35, 36,
- 37, 12, 38, 39, 40, 41, 12, 12, 42, 43,
- 12, 12, 1, 44, 1, 1, 1, 1, 1, 1,
+ 37, 12, 38, 39, 40, 41, 42, 12, 43, 44,
+ 12, 12, 1, 45, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -351,138 +410,149 @@
1, 1, 1, 1, 1
} ;
-static yyconst int yy_meta[45] =
+static yyconst flex_int32_t yy_meta[46] =
{ 0,
1, 1, 2, 1, 3, 1, 1, 1, 4, 5,
5, 4, 6, 7, 7, 7, 5, 1, 1, 1,
7, 1, 3, 8, 4, 7, 7, 7, 7, 7,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 1
+ 4, 4, 4, 4, 1
} ;
-static yyconst short int yy_base[120] =
+static yyconst flex_int16_t yy_base[126] =
{ 0,
- 0, 0, 42, 64, 37, 52, 41, 45, 107, 314,
- 68, 80, 83, 314, 91, 314, 314, 0, 76, 73,
- 68, 65, 314, 81, 86, 91, 96, 101, 19, 86,
- 85, 91, 33, 314, 314, 109, 314, 121, 124, 314,
- 314, 0, 314, 314, 314, 314, 0, 314, 129, 143,
- 314, 314, 0, 111, 133, 314, 314, 314, 121, 124,
- 125, 126, 127, 128, 129, 130, 133, 143, 145, 146,
- 314, 163, 166, 0, 0, 0, 314, 174, 0, 176,
- 153, 155, 163, 170, 169, 0, 187, 0, 175, 177,
- 182, 314, 314, 179, 191, 185, 187, 195, 197, 204,
-
- 200, 192, 209, 212, 213, 217, 214, 314, 258, 266,
- 274, 279, 283, 290, 297, 305, 65, 58, 48
+ 0, 0, 43, 65, 38, 53, 42, 46, 108, 344,
+ 69, 81, 84, 344, 92, 344, 344, 0, 77, 74,
+ 69, 66, 344, 82, 87, 92, 97, 102, 20, 87,
+ 86, 92, 95, 33, 344, 344, 123, 344, 126, 130,
+ 344, 344, 0, 344, 344, 344, 344, 0, 344, 133,
+ 147, 344, 344, 0, 121, 138, 344, 344, 344, 126,
+ 127, 128, 130, 131, 133, 135, 143, 145, 148, 149,
+ 150, 151, 344, 179, 182, 0, 0, 0, 344, 168,
+ 0, 185, 172, 173, 174, 177, 176, 178, 0, 173,
+ 0, 191, 196, 195, 199, 344, 344, 201, 213, 198,
+
+ 214, 204, 217, 219, 221, 227, 226, 231, 239, 233,
+ 234, 247, 241, 344, 288, 296, 304, 309, 313, 320,
+ 327, 335, 66, 59, 49
} ;
-static yyconst short int yy_def[120] =
+static yyconst flex_int16_t yy_def[126] =
{ 0,
- 108, 1, 109, 109, 110, 110, 111, 111, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 112, 113, 108,
- 108, 108, 108, 113, 113, 113, 113, 113, 28, 28,
- 28, 28, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 114, 108, 108, 108, 108, 115, 108, 116, 108,
- 108, 108, 112, 28, 108, 108, 108, 108, 28, 28,
+ 114, 1, 115, 115, 116, 116, 117, 117, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 118, 119, 114,
+ 114, 114, 114, 119, 119, 119, 119, 119, 28, 28,
+ 28, 28, 28, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 120, 114, 114, 114, 114, 121, 114, 122,
+ 114, 114, 114, 118, 28, 114, 114, 114, 114, 28,
28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
- 108, 108, 108, 117, 114, 115, 108, 108, 118, 108,
- 28, 28, 28, 28, 28, 117, 108, 119, 28, 28,
- 28, 108, 108, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 114, 114, 114, 123, 120, 121, 114, 114,
+ 124, 114, 28, 28, 28, 28, 28, 28, 123, 114,
+ 125, 28, 28, 28, 28, 114, 114, 28, 28, 28,
- 28, 28, 28, 28, 28, 28, 28, 0, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 0, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114
} ;
-static yyconst short int yy_nxt[359] =
+static yyconst flex_int16_t yy_nxt[390] =
{ 0,
10, 11, 12, 13, 14, 15, 16, 17, 18, 18,
19, 19, 10, 19, 19, 19, 18, 20, 21, 22,
19, 23, 10, 10, 19, 24, 25, 26, 19, 27,
- 28, 19, 19, 29, 30, 31, 32, 19, 19, 19,
- 19, 19, 19, 33, 35, 48, 43, 44, 65, 48,
- 36, 37, 36, 45, 93, 38, 39, 39, 40, 66,
- 46, 43, 44, 49, 88, 41, 35, 49, 45, 50,
- 50, 86, 36, 37, 36, 46, 71, 38, 39, 39,
- 40, 50, 50, 58, 53, 53, 57, 41, 55, 53,
- 53, 56, 53, 55, 53, 53, 52, 53, 55, 53,
-
- 53, 51, 53, 55, 53, 53, 108, 53, 55, 53,
- 53, 67, 53, 55, 68, 54, 59, 53, 60, 108,
- 54, 69, 72, 73, 73, 54, 54, 61, 108, 70,
- 63, 54, 108, 62, 73, 73, 73, 73, 73, 73,
- 54, 64, 78, 78, 50, 50, 80, 80, 80, 81,
- 54, 54, 108, 54, 54, 54, 54, 54, 54, 54,
- 83, 54, 54, 74, 82, 54, 54, 54, 54, 54,
- 54, 79, 54, 84, 54, 54, 73, 73, 73, 73,
- 73, 73, 54, 54, 54, 85, 54, 87, 87, 80,
- 80, 80, 54, 54, 108, 54, 89, 91, 54, 54,
-
- 92, 92, 95, 90, 54, 74, 54, 94, 54, 54,
- 54, 54, 108, 96, 99, 54, 100, 54, 97, 54,
- 54, 54, 54, 98, 54, 54, 54, 54, 103, 54,
- 101, 54, 54, 54, 105, 54, 102, 54, 54, 104,
- 54, 54, 54, 54, 54, 107, 54, 108, 106, 54,
- 108, 108, 54, 54, 54, 108, 108, 54, 34, 34,
- 34, 34, 34, 34, 34, 34, 42, 42, 42, 42,
- 42, 42, 42, 42, 47, 47, 47, 47, 47, 47,
- 47, 47, 53, 53, 108, 53, 54, 54, 54, 54,
- 75, 75, 75, 75, 108, 75, 75, 76, 76, 108,
-
- 76, 76, 76, 76, 76, 77, 108, 77, 77, 77,
- 77, 77, 77, 9, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108
+ 28, 19, 19, 29, 30, 31, 32, 19, 33, 19,
+ 19, 19, 19, 19, 34, 36, 49, 44, 45, 66,
+ 49, 37, 38, 37, 46, 97, 39, 40, 40, 41,
+ 67, 47, 44, 45, 50, 91, 42, 36, 50, 46,
+ 51, 51, 89, 37, 38, 37, 47, 73, 39, 40,
+ 40, 41, 51, 51, 59, 54, 54, 58, 42, 56,
+ 54, 54, 57, 54, 56, 54, 54, 53, 54, 56,
+
+ 54, 54, 52, 54, 56, 54, 54, 114, 54, 56,
+ 54, 54, 68, 54, 56, 69, 55, 60, 54, 61,
+ 114, 55, 70, 114, 72, 114, 55, 55, 62, 114,
+ 71, 64, 55, 114, 63, 55, 74, 75, 75, 75,
+ 75, 75, 65, 75, 75, 75, 80, 80, 51, 51,
+ 55, 82, 82, 82, 83, 55, 55, 55, 114, 55,
+ 55, 55, 55, 85, 55, 114, 55, 84, 55, 76,
+ 55, 55, 55, 55, 55, 55, 81, 55, 55, 55,
+ 55, 90, 90, 55, 114, 86, 96, 96, 55, 87,
+ 55, 88, 75, 75, 75, 75, 75, 75, 82, 82,
+
+ 82, 55, 55, 55, 94, 55, 55, 55, 114, 114,
+ 114, 114, 55, 55, 93, 92, 55, 55, 55, 95,
+ 55, 99, 76, 98, 55, 55, 100, 104, 55, 114,
+ 55, 55, 114, 106, 114, 55, 55, 101, 55, 55,
+ 102, 55, 55, 55, 55, 103, 55, 114, 55, 105,
+ 55, 109, 107, 55, 55, 55, 55, 55, 108, 55,
+ 55, 55, 55, 55, 111, 110, 55, 55, 55, 112,
+ 55, 55, 114, 55, 55, 113, 55, 114, 114, 55,
+ 114, 55, 114, 114, 114, 114, 114, 55, 35, 35,
+ 35, 35, 35, 35, 35, 35, 43, 43, 43, 43,
+
+ 43, 43, 43, 43, 48, 48, 48, 48, 48, 48,
+ 48, 48, 54, 54, 114, 54, 55, 55, 55, 55,
+ 77, 77, 77, 77, 114, 77, 77, 78, 78, 114,
+ 78, 78, 78, 78, 78, 79, 114, 79, 79, 79,
+ 79, 79, 79, 9, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 114, 114
} ;
-static yyconst short int yy_chk[359] =
+static yyconst flex_int16_t yy_chk[390] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 3, 7, 5, 5, 29, 8,
- 3, 3, 3, 5, 119, 3, 3, 3, 3, 29,
- 5, 6, 6, 7, 118, 3, 4, 8, 6, 11,
- 11, 117, 4, 4, 4, 6, 33, 4, 4, 4,
- 4, 12, 12, 22, 19, 19, 21, 4, 19, 24,
- 24, 20, 19, 24, 25, 25, 15, 24, 25, 26,
-
- 26, 13, 25, 26, 27, 27, 9, 26, 27, 28,
- 28, 30, 27, 28, 31, 30, 24, 28, 25, 0,
- 32, 31, 36, 36, 36, 31, 30, 26, 0, 32,
- 28, 32, 0, 27, 38, 38, 38, 39, 39, 39,
- 54, 28, 49, 49, 50, 50, 55, 55, 55, 59,
- 59, 54, 0, 60, 61, 62, 63, 64, 65, 66,
- 61, 59, 67, 38, 60, 61, 62, 63, 64, 65,
- 66, 49, 68, 67, 69, 70, 72, 72, 72, 73,
- 73, 73, 81, 68, 82, 69, 70, 78, 78, 80,
- 80, 80, 83, 81, 0, 82, 82, 84, 85, 84,
-
- 87, 87, 90, 83, 89, 72, 90, 89, 94, 85,
- 84, 91, 0, 91, 96, 89, 97, 90, 94, 94,
- 95, 102, 91, 95, 98, 96, 99, 97, 100, 101,
- 98, 95, 102, 100, 103, 98, 99, 99, 103, 101,
- 101, 104, 105, 107, 100, 106, 106, 0, 105, 103,
- 0, 0, 104, 105, 107, 0, 0, 106, 109, 109,
- 109, 109, 109, 109, 109, 109, 110, 110, 110, 110,
- 110, 110, 110, 110, 111, 111, 111, 111, 111, 111,
- 111, 111, 112, 112, 0, 112, 113, 113, 113, 113,
- 114, 114, 114, 114, 0, 114, 114, 115, 115, 0,
-
- 115, 115, 115, 115, 115, 116, 0, 116, 116, 116,
- 116, 116, 116, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108
+ 1, 1, 1, 1, 1, 3, 7, 5, 5, 29,
+ 8, 3, 3, 3, 5, 125, 3, 3, 3, 3,
+ 29, 5, 6, 6, 7, 124, 3, 4, 8, 6,
+ 11, 11, 123, 4, 4, 4, 6, 34, 4, 4,
+ 4, 4, 12, 12, 22, 19, 19, 21, 4, 19,
+ 24, 24, 20, 19, 24, 25, 25, 15, 24, 25,
+
+ 26, 26, 13, 25, 26, 27, 27, 9, 26, 27,
+ 28, 28, 30, 27, 28, 31, 30, 24, 28, 25,
+ 0, 32, 31, 0, 33, 0, 31, 30, 26, 0,
+ 32, 28, 32, 0, 27, 33, 37, 37, 37, 39,
+ 39, 39, 28, 40, 40, 40, 50, 50, 51, 51,
+ 55, 56, 56, 56, 60, 60, 61, 62, 0, 63,
+ 64, 55, 65, 62, 66, 0, 60, 61, 62, 39,
+ 63, 64, 67, 65, 68, 66, 50, 69, 70, 71,
+ 72, 80, 80, 67, 0, 68, 90, 90, 69, 70,
+ 71, 72, 74, 74, 74, 75, 75, 75, 82, 82,
+
+ 82, 83, 84, 85, 86, 87, 86, 88, 0, 0,
+ 0, 0, 83, 84, 85, 84, 87, 86, 88, 88,
+ 92, 93, 74, 92, 94, 93, 94, 100, 95, 0,
+ 98, 92, 0, 102, 0, 94, 93, 95, 100, 95,
+ 98, 98, 99, 101, 102, 99, 103, 0, 104, 101,
+ 105, 106, 103, 99, 101, 107, 106, 103, 104, 104,
+ 108, 105, 110, 111, 109, 107, 107, 106, 109, 111,
+ 113, 108, 0, 110, 111, 112, 112, 0, 0, 109,
+ 0, 113, 0, 0, 0, 0, 0, 112, 115, 115,
+ 115, 115, 115, 115, 115, 115, 116, 116, 116, 116,
+
+ 116, 116, 116, 116, 117, 117, 117, 117, 117, 117,
+ 117, 117, 118, 118, 0, 118, 119, 119, 119, 119,
+ 120, 120, 120, 120, 0, 120, 120, 121, 121, 0,
+ 121, 121, 121, 121, 121, 122, 0, 122, 122, 122,
+ 122, 122, 122, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 114, 114, 114, 114, 114, 114
} ;
static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;
+extern int df__flex_debug;
+int df__flex_debug = 0;
+
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
*/
@@ -490,9 +560,8 @@
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
+char *df_text;
#line 1 "./scanner.l"
-#define INITIAL 0
#line 2 "./scanner.l"
/*
* $Id: scanner.l 13892 2005-03-24 05:27:03Z guy $
@@ -556,13 +625,27 @@
static gboolean str_to_gint32(char *s, gint32* pint);
GString* quoted_string = NULL;
-#define RANGE_INT 1
-#define RANGE_PUNCT 2
+
+#line 632 "scanner.c"
+
+#define INITIAL 0
+#define RANGE_INT 1
+#define RANGE_PUNCT 2
#define DQUOTE 3
-#line 566 "scanner.c"
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#ifndef YY_EXTRA_TYPE
+#define YY_EXTRA_TYPE void *
+#endif
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -570,65 +653,30 @@
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int yywrap YY_PROTO(( void ));
+extern "C" int df_wrap (void );
#else
-extern int yywrap YY_PROTO(( void ));
-#endif
+extern int df_wrap (void );
#endif
-
-#ifndef YY_NO_UNPUT
-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
#endif
+ static void yyunput (int c,char *buf_ptr );
+
#ifndef yytext_ptr
-static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+static void yy_flex_strncpy (char *,yyconst char *,int );
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+static int yy_flex_strlen (yyconst char * );
#endif
#ifndef YY_NO_INPUT
-#ifdef __cplusplus
-static int yyinput YY_PROTO(( void ));
-#else
-static int input YY_PROTO(( void ));
-#endif
-#endif
-
-#if YY_STACK_USED
-static int yy_start_stack_ptr = 0;
-static int yy_start_stack_depth = 0;
-static int *yy_start_stack = 0;
-#ifndef YY_NO_PUSH_STATE
-static void yy_push_state YY_PROTO(( int new_state ));
-#endif
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state YY_PROTO(( void ));
-#endif
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state YY_PROTO(( void ));
-#endif
+#ifdef __cplusplus
+static int yyinput (void );
#else
-#define YY_NO_PUSH_STATE 1
-#define YY_NO_POP_STATE 1
-#define YY_NO_TOP_STATE 1
+static int input (void );
#endif
-#ifdef YY_MALLOC_DECL
-YY_MALLOC_DECL
-#else
-#if __STDC__
-#ifndef __cplusplus
-#include <stdlib.h>
-#endif
-#else
-/* Just try to get by without declaring the routines. This will fail
- * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
- * or sizeof(void*) != sizeof(int).
- */
-#endif
#endif
/* Amount of stuff to slurp up with each read. */
@@ -637,12 +685,11 @@
#endif
/* Copy whatever the last rule matched to the standard output. */
-
#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#define ECHO (void) fwrite( df_text, df_leng, 1, df_out )
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -650,21 +697,35 @@
*/
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
- if ( yy_current_buffer->yy_is_interactive ) \
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
- int c = '*', n; \
+ int c = '*'; \
+ size_t n; \
for ( n = 0; n < max_size && \
- (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+ (c = getc( df_in )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
if ( c == '\n' ) \
buf[n++] = (char) c; \
- if ( c == EOF && ferror( yyin ) ) \
+ if ( c == EOF && ferror( df_in ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
result = n; \
} \
- else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
- && ferror( yyin ) ) \
- YY_FATAL_ERROR( "input in flex scanner failed" );
+ else \
+ { \
+ errno=0; \
+ while ( (result = fread(buf, 1, max_size, df_in))==0 && ferror(df_in)) \
+ { \
+ if( errno != EINTR) \
+ { \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ break; \
+ } \
+ errno=0; \
+ clearerr(df_in); \
+ } \
+ }\
+\
+
#endif
/* No semi-colon after return; correct usage is to write "yyterminate();" -
@@ -685,14 +746,20 @@
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
#endif
+/* end tables serialization structures and prototypes */
+
/* Default declaration of generated scanner - a define so the user can
* easily add parameters.
*/
#ifndef YY_DECL
-#define YY_DECL int yylex YY_PROTO(( void ))
-#endif
+#define YY_DECL_IS_OURS 1
+
+extern int df_lex (void);
+
+#define YY_DECL int df_lex (void)
+#endif /* !YY_DECL */
-/* Code executed at the beginning of each rule, after yytext and yyleng
+/* Code executed at the beginning of each rule, after df_text and df_leng
* have been set up.
*/
#ifndef YY_USER_ACTION
@@ -707,99 +774,102 @@
#define YY_RULE_SETUP \
YY_USER_ACTION
+/** The main scanner function which does all the work.
+ */
YY_DECL
- {
+{
register yy_state_type yy_current_state;
- register char *yy_cp = NULL, *yy_bp = NULL;
+ register char *yy_cp, *yy_bp;
register int yy_act;
-
+
#line 70 "./scanner.l"
-#line 720 "scanner.c"
+#line 789 "scanner.c"
- if ( yy_init )
+ if ( (yy_init) )
{
- yy_init = 0;
+ (yy_init) = 0;
#ifdef YY_USER_INIT
YY_USER_INIT;
#endif
- if ( ! yy_start )
- yy_start = 1; /* first start state */
+ if ( ! (yy_start) )
+ (yy_start) = 1; /* first start state */
- if ( ! yyin )
- yyin = stdin;
+ if ( ! df_in )
+ df_in = stdin;
- if ( ! yyout )
- yyout = stdout;
+ if ( ! df_out )
+ df_out = stdout;
- if ( ! yy_current_buffer )
- yy_current_buffer =
- yy_create_buffer( yyin, YY_BUF_SIZE );
+ if ( ! YY_CURRENT_BUFFER ) {
+ df_ensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ df__create_buffer(df_in,YY_BUF_SIZE );
+ }
- yy_load_buffer_state();
+ df__load_buffer_state( );
}
while ( 1 ) /* loops until end-of-file is reached */
{
- yy_cp = yy_c_buf_p;
+ yy_cp = (yy_c_buf_p);
- /* Support of yytext. */
- *yy_cp = yy_hold_char;
+ /* Support of df_text. */
+ *yy_cp = (yy_hold_char);
/* yy_bp points to the position in yy_ch_buf of the start of
* the current run.
*/
yy_bp = yy_cp;
- yy_current_state = yy_start;
+ yy_current_state = (yy_start);
yy_match:
do
{
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
if ( yy_accept[yy_current_state] )
{
- yy_last_accepting_state = yy_current_state;
- yy_last_accepting_cpos = yy_cp;
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 109 )
+ if ( yy_current_state >= 115 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
- while ( yy_base[yy_current_state] != 314 );
+ while ( yy_base[yy_current_state] != 344 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
if ( yy_act == 0 )
{ /* have to back up */
- yy_cp = yy_last_accepting_cpos;
- yy_current_state = yy_last_accepting_state;
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
yy_act = yy_accept[yy_current_state];
}
YY_DO_BEFORE_ACTION;
-
do_action: /* This label is used only to access EOF actions. */
-
switch ( yy_act )
{ /* beginning of action switch */
case 0: /* must back up */
/* undo the effects of YY_DO_BEFORE_ACTION */
- *yy_cp = yy_hold_char;
- yy_cp = yy_last_accepting_cpos;
- yy_current_state = yy_last_accepting_state;
+ *yy_cp = (yy_hold_char);
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
goto yy_find_action;
case 1:
+/* rule 1 can match eol */
YY_RULE_SETUP
#line 72 "./scanner.l"
/* ignore whitespace */
@@ -926,83 +996,89 @@
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 104 "./scanner.l"
+#line 101 "./scanner.l"
+return simple(TOKEN_RET);
+ YY_BREAK
+case 27:
+YY_RULE_SETUP
+#line 105 "./scanner.l"
{
BEGIN(RANGE_INT);
return simple(TOKEN_LBRACKET);
}
YY_BREAK
-case 27:
+case 28:
YY_RULE_SETUP
-#line 109 "./scanner.l"
+#line 110 "./scanner.l"
{
BEGIN(RANGE_PUNCT);
- return set_lval_int(TOKEN_INTEGER, yytext);
+ return set_lval_int(TOKEN_INTEGER, df_text);
}
YY_BREAK
-case 28:
+case 29:
YY_RULE_SETUP
-#line 114 "./scanner.l"
+#line 115 "./scanner.l"
{
BEGIN(RANGE_PUNCT);
- return set_lval_int(TOKEN_INTEGER, yytext);
+ return set_lval_int(TOKEN_INTEGER, df_text);
}
YY_BREAK
-case 29:
+case 30:
YY_RULE_SETUP
-#line 119 "./scanner.l"
+#line 120 "./scanner.l"
{
BEGIN(RANGE_INT);
return simple(TOKEN_COLON);
}
YY_BREAK
-case 30:
+case 31:
YY_RULE_SETUP
-#line 124 "./scanner.l"
+#line 125 "./scanner.l"
{
BEGIN(RANGE_INT);
return simple(TOKEN_HYPHEN);
}
YY_BREAK
-case 31:
+case 32:
YY_RULE_SETUP
-#line 129 "./scanner.l"
+#line 130 "./scanner.l"
{
BEGIN(RANGE_INT);
return simple(TOKEN_COMMA);
}
YY_BREAK
-case 32:
+case 33:
YY_RULE_SETUP
-#line 134 "./scanner.l"
+#line 135 "./scanner.l"
{
BEGIN(INITIAL);
return simple(TOKEN_RBRACKET);
}
YY_BREAK
/* Error if none of the above while scanning a range (slice) */
-case 33:
+case 34:
+/* rule 34 can match eol */
YY_RULE_SETUP
-#line 141 "./scanner.l"
+#line 142 "./scanner.l"
{
- dfilter_fail("Invalid string \"%s\" found while scanning slice.", yytext);
+ dfilter_fail("Invalid string \"%s\" found while scanning slice.", df_text);
return SCAN_FAILED;
}
YY_BREAK
/* XXX It would be nice to be able to match an entire non-integer string,
* but beware of Flex's "match the most text" rule.
*/
-case 34:
+case 35:
YY_RULE_SETUP
-#line 150 "./scanner.l"
+#line 151 "./scanner.l"
{
- dfilter_fail("Invalid character \"%s\" found while scanning slice; expected integer.", yytext);
+ dfilter_fail("Invalid character \"%s\" found while scanning slice; expected integer.", df_text);
return SCAN_FAILED;
}
YY_BREAK
-case 35:
+case 36:
YY_RULE_SETUP
-#line 155 "./scanner.l"
+#line 156 "./scanner.l"
{
/* start quote */
/* The example of how to scan for strings was taken from
@@ -1025,7 +1101,7 @@
}
YY_BREAK
case YY_STATE_EOF(DQUOTE):
-#line 176 "./scanner.l"
+#line 177 "./scanner.l"
{
/* unterminated string */
/* The example of how to handle unclosed strings was taken from
@@ -1037,9 +1113,9 @@
return SCAN_FAILED;
}
YY_BREAK
-case 36:
+case 37:
YY_RULE_SETUP
-#line 187 "./scanner.l"
+#line 188 "./scanner.l"
{
/* end quote */
int token;
@@ -1050,88 +1126,89 @@
return token;
}
YY_BREAK
-case 37:
+case 38:
YY_RULE_SETUP
-#line 197 "./scanner.l"
+#line 198 "./scanner.l"
{
/* octal sequence */
unsigned int result;
- sscanf(yytext + 1, "%o", &result);
+ sscanf(df_text + 1, "%o", &result);
if (result > 0xff) {
g_string_free(quoted_string, TRUE);
quoted_string = NULL;
- dfilter_fail("%s is larger than 255.", yytext);
+ dfilter_fail("%s is larger than 255.", df_text);
return SCAN_FAILED;
}
g_string_append_c(quoted_string, (gchar) result);
}
YY_BREAK
-case 38:
+case 39:
YY_RULE_SETUP
-#line 210 "./scanner.l"
+#line 211 "./scanner.l"
{
/* hex sequence */
unsigned int result;
- sscanf(yytext + 2, "%x", &result);
+ sscanf(df_text + 2, "%x", &result);
g_string_append_c(quoted_string, (gchar) result);
}
YY_BREAK
-case 39:
+case 40:
YY_RULE_SETUP
-#line 218 "./scanner.l"
+#line 219 "./scanner.l"
{
/* escaped character */
- g_string_append_c(quoted_string, yytext[1]);
+ g_string_append_c(quoted_string, df_text[1]);
}
YY_BREAK
-case 40:
+case 41:
+/* rule 41 can match eol */
YY_RULE_SETUP
-#line 223 "./scanner.l"
+#line 224 "./scanner.l"
{
/* non-escaped string */
- g_string_append(quoted_string, yytext);
+ g_string_append(quoted_string, df_text);
}
YY_BREAK
-case 41:
+case 42:
YY_RULE_SETUP
-#line 230 "./scanner.l"
+#line 231 "./scanner.l"
{
/* CIDR */
- return set_lval(TOKEN_UNPARSED, yytext);
+ return set_lval(TOKEN_UNPARSED, df_text);
}
YY_BREAK
-case 42:
+case 43:
YY_RULE_SETUP
-#line 235 "./scanner.l"
+#line 236 "./scanner.l"
{
/* Is it a field name? */
header_field_info *hfinfo;
- hfinfo = proto_registrar_get_byname(yytext);
+ hfinfo = proto_registrar_get_byname(df_text);
if (hfinfo) {
/* Yes, it's a field name */
return set_lval(TOKEN_FIELD, hfinfo);
}
else {
/* No, so treat it as an unparsed string */
- return set_lval(TOKEN_UNPARSED, yytext);
+ return set_lval(TOKEN_UNPARSED, df_text);
}
}
YY_BREAK
-case 43:
+case 44:
YY_RULE_SETUP
-#line 250 "./scanner.l"
+#line 251 "./scanner.l"
{
/* Default */
- return set_lval(TOKEN_UNPARSED, yytext);
+ return set_lval(TOKEN_UNPARSED, df_text);
}
YY_BREAK
-case 44:
+case 45:
YY_RULE_SETUP
-#line 256 "./scanner.l"
+#line 257 "./scanner.l"
ECHO;
YY_BREAK
-#line 1135 "scanner.c"
+#line 1212 "scanner.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(RANGE_INT):
case YY_STATE_EOF(RANGE_PUNCT):
@@ -1140,26 +1217,26 @@
case YY_END_OF_BUFFER:
{
/* Amount of text matched not including the EOB char. */
- int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
/* Undo the effects of YY_DO_BEFORE_ACTION. */
- *yy_cp = yy_hold_char;
+ *yy_cp = (yy_hold_char);
YY_RESTORE_YY_MORE_OFFSET
- if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
{
/* We're scanning a new file or input source. It's
* possible that this happened because the user
- * just pointed yyin at a new source and called
- * yylex(). If so, then we have to assure
- * consistency between yy_current_buffer and our
+ * just pointed df_in at a new source and called
+ * df_lex(). If so, then we have to assure
+ * consistency between YY_CURRENT_BUFFER and our
* globals. Here is the right place to do so, because
* this is the first action (other than possibly a
* back-up) that will match for the new input source.
*/
- yy_n_chars = yy_current_buffer->yy_n_chars;
- yy_current_buffer->yy_input_file = yyin;
- yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = df_in;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
}
/* Note that here we test for yy_c_buf_p "<=" to the position
@@ -1169,13 +1246,13 @@
* end-of-buffer state). Contrast this with the test
* in input().
*/
- if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
{ /* This was really a NUL. */
yy_state_type yy_next_state;
- yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
+ (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
- yy_current_state = yy_get_previous_state();
+ yy_current_state = yy_get_previous_state( );
/* Okay, we're now positioned to make the NUL
* transition. We couldn't have
@@ -1188,41 +1265,41 @@
yy_next_state = yy_try_NUL_trans( yy_current_state );
- yy_bp = yytext_ptr + YY_MORE_ADJ;
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
if ( yy_next_state )
{
/* Consume the NUL. */
- yy_cp = ++yy_c_buf_p;
+ yy_cp = ++(yy_c_buf_p);
yy_current_state = yy_next_state;
goto yy_match;
}
else
{
- yy_cp = yy_c_buf_p;
+ yy_cp = (yy_c_buf_p);
goto yy_find_action;
}
}
- else switch ( yy_get_next_buffer() )
+ else switch ( yy_get_next_buffer( ) )
{
case EOB_ACT_END_OF_FILE:
{
- yy_did_buffer_switch_on_eof = 0;
+ (yy_did_buffer_switch_on_eof) = 0;
- if ( yywrap() )
+ if ( df_wrap( ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
- * yytext, we can now set up
+ * df_text, we can now set up
* yy_c_buf_p so that if some total
* hoser (like flex itself) wants to
* call the scanner after we return the
* YY_NULL, it'll still work - another
* YY_NULL will get returned.
*/
- yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
yy_act = YY_STATE_EOF(YY_START);
goto do_action;
@@ -1230,30 +1307,30 @@
else
{
- if ( ! yy_did_buffer_switch_on_eof )
+ if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
}
break;
}
case EOB_ACT_CONTINUE_SCAN:
- yy_c_buf_p =
- yytext_ptr + yy_amount_of_matched_text;
+ (yy_c_buf_p) =
+ (yytext_ptr) + yy_amount_of_matched_text;
- yy_current_state = yy_get_previous_state();
+ yy_current_state = yy_get_previous_state( );
- yy_cp = yy_c_buf_p;
- yy_bp = yytext_ptr + YY_MORE_ADJ;
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
goto yy_match;
case EOB_ACT_LAST_MATCH:
- yy_c_buf_p =
- &yy_current_buffer->yy_ch_buf[yy_n_chars];
+ (yy_c_buf_p) =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
- yy_current_state = yy_get_previous_state();
+ yy_current_state = yy_get_previous_state( );
- yy_cp = yy_c_buf_p;
- yy_bp = yytext_ptr + YY_MORE_ADJ;
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
goto yy_find_action;
}
break;
@@ -1264,8 +1341,7 @@
"fatal flex scanner internal error--no action found" );
} /* end of action switch */
} /* end of scanning one token */
- } /* end of yylex */
-
+} /* end of df_lex */
/* yy_get_next_buffer - try to read in a new buffer
*
@@ -1274,21 +1350,20 @@
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
* EOB_ACT_END_OF_FILE - end of file
*/
-
-static int yy_get_next_buffer()
- {
- register char *dest = yy_current_buffer->yy_ch_buf;
- register char *source = yytext_ptr;
+static int yy_get_next_buffer (void)
+{
+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ register char *source = (yytext_ptr);
register int number_to_move, i;
int ret_val;
- if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+ if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
YY_FATAL_ERROR(
"fatal flex scanner internal error--end of buffer missed" );
- if ( yy_current_buffer->yy_fill_buffer == 0 )
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
{ /* Don't try to fill the buffer, so this is an EOF. */
- if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
+ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
{
/* We matched a single character, the EOB, so
* treat this as a final EOF.
@@ -1308,34 +1383,30 @@
/* Try to read more data. */
/* First move last chars to start of buffer. */
- number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
+ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
- if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
/* don't do the read, it's not guaranteed to return an EOF,
* just force an EOF
*/
- yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
else
{
- int num_to_read =
- yy_current_buffer->yy_buf_size - number_to_move - 1;
+ size_t num_to_read =
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
-#ifdef YY_USES_REJECT
- YY_FATAL_ERROR(
-"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
-#else
/* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = yy_current_buffer;
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
int yy_c_buf_p_offset =
- (int) (yy_c_buf_p - b->yy_ch_buf);
+ (int) ((yy_c_buf_p) - b->yy_ch_buf);
if ( b->yy_is_our_buffer )
{
@@ -1348,8 +1419,7 @@
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
- yy_flex_realloc( (void *) b->yy_ch_buf,
- b->yy_buf_size + 2 );
+ df_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
}
else
/* Can't grow it, we don't own it. */
@@ -1359,35 +1429,35 @@
YY_FATAL_ERROR(
"fatal error - scanner input buffer overflow" );
- yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+ (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
- num_to_read = yy_current_buffer->yy_buf_size -
+ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
number_to_move - 1;
-#endif
+
}
if ( num_to_read > YY_READ_BUF_SIZE )
num_to_read = YY_READ_BUF_SIZE;
/* Read in more data. */
- YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
- yy_n_chars, num_to_read );
+ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+ (yy_n_chars), num_to_read );
- yy_current_buffer->yy_n_chars = yy_n_chars;
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
- if ( yy_n_chars == 0 )
+ if ( (yy_n_chars) == 0 )
{
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
- yyrestart( yyin );
+ df_restart(df_in );
}
else
{
ret_val = EOB_ACT_LAST_MATCH;
- yy_current_buffer->yy_buffer_status =
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
YY_BUFFER_EOF_PENDING;
}
}
@@ -1395,153 +1465,137 @@
else
ret_val = EOB_ACT_CONTINUE_SCAN;
- yy_n_chars += number_to_move;
- yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
- yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+ (yy_n_chars) += number_to_move;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
- yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+ (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
return ret_val;
- }
-
+}
/* yy_get_previous_state - get the state just before the EOB char was reached */
-static yy_state_type yy_get_previous_state()
- {
+ static yy_state_type yy_get_previous_state (void)
+{
register yy_state_type yy_current_state;
register char *yy_cp;
+
+ yy_current_state = (yy_start);
- yy_current_state = yy_start;
-
- for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+ for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
{
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
if ( yy_accept[yy_current_state] )
{
- yy_last_accepting_state = yy_current_state;
- yy_last_accepting_cpos = yy_cp;
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 109 )
+ if ( yy_current_state >= 115 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
}
return yy_current_state;
- }
-
+}
/* yy_try_NUL_trans - try to make a transition on the NUL character
*
* synopsis
* next_state = yy_try_NUL_trans( current_state );
*/
-
-#ifdef YY_USE_PROTOS
-static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
-#else
-static yy_state_type yy_try_NUL_trans( yy_current_state )
-yy_state_type yy_current_state;
-#endif
- {
+ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
+{
register int yy_is_jam;
- register char *yy_cp = yy_c_buf_p;
+ register char *yy_cp = (yy_c_buf_p);
register YY_CHAR yy_c = 1;
if ( yy_accept[yy_current_state] )
{
- yy_last_accepting_state = yy_current_state;
- yy_last_accepting_cpos = yy_cp;
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 109 )
+ if ( yy_current_state >= 115 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 108);
+ yy_is_jam = (yy_current_state == 114);
return yy_is_jam ? 0 : yy_current_state;
- }
-
+}
-#ifndef YY_NO_UNPUT
-#ifdef YY_USE_PROTOS
-static void yyunput( int c, register char *yy_bp )
-#else
-static void yyunput( c, yy_bp )
-int c;
-register char *yy_bp;
-#endif
- {
- register char *yy_cp = yy_c_buf_p;
+ static void yyunput (int c, register char * yy_bp )
+{
+ register char *yy_cp;
+
+ yy_cp = (yy_c_buf_p);
- /* undo effects of setting up yytext */
- *yy_cp = yy_hold_char;
+ /* undo effects of setting up df_text */
+ *yy_cp = (yy_hold_char);
- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
- register int number_to_move = yy_n_chars + 2;
- register char *dest = &yy_current_buffer->yy_ch_buf[
- yy_current_buffer->yy_buf_size + 2];
+ register int number_to_move = (yy_n_chars) + 2;
+ register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
register char *source =
- &yy_current_buffer->yy_ch_buf[number_to_move];
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
- while ( source > yy_current_buffer->yy_ch_buf )
+ while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
*--dest = *--source;
yy_cp += (int) (dest - source);
yy_bp += (int) (dest - source);
- yy_current_buffer->yy_n_chars =
- yy_n_chars = yy_current_buffer->yy_buf_size;
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
}
*--yy_cp = (char) c;
-
- yytext_ptr = yy_bp;
- yy_hold_char = *yy_cp;
- yy_c_buf_p = yy_cp;
- }
-#endif /* ifndef YY_NO_UNPUT */
-
+ (yytext_ptr) = yy_bp;
+ (yy_hold_char) = *yy_cp;
+ (yy_c_buf_p) = yy_cp;
+}
#ifndef YY_NO_INPUT
#ifdef __cplusplus
-static int yyinput()
+ static int yyinput (void)
#else
-static int input()
+ static int input (void)
#endif
- {
- int c;
- *yy_c_buf_p = yy_hold_char;
+{
+ int c;
+
+ *(yy_c_buf_p) = (yy_hold_char);
- if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+ if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
{
/* yy_c_buf_p now points to the character we want to return.
* If this occurs *before* the EOB characters, then it's a
* valid NUL; if not, then we've hit the end of the buffer.
*/
- if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
/* This was really a NUL. */
- *yy_c_buf_p = '\0';
+ *(yy_c_buf_p) = '\0';
else
{ /* need more input */
- int offset = yy_c_buf_p - yytext_ptr;
- ++yy_c_buf_p;
+ int offset = (yy_c_buf_p) - (yytext_ptr);
+ ++(yy_c_buf_p);
- switch ( yy_get_next_buffer() )
+ switch ( yy_get_next_buffer( ) )
{
case EOB_ACT_LAST_MATCH:
/* This happens because yy_g_n_b()
@@ -1555,16 +1609,16 @@
*/
/* Reset buffer status. */
- yyrestart( yyin );
+ df_restart(df_in );
- /* fall through */
+ /*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
- if ( yywrap() )
+ if ( df_wrap( ) )
return EOF;
- if ( ! yy_did_buffer_switch_on_eof )
+ if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
#ifdef __cplusplus
return yyinput();
@@ -1574,167 +1628,169 @@
}
case EOB_ACT_CONTINUE_SCAN:
- yy_c_buf_p = yytext_ptr + offset;
+ (yy_c_buf_p) = (yytext_ptr) + offset;
break;
}
}
}
- c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
- *yy_c_buf_p = '\0'; /* preserve yytext */
- yy_hold_char = *++yy_c_buf_p;
-
+ c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
+ *(yy_c_buf_p) = '\0'; /* preserve df_text */
+ (yy_hold_char) = *++(yy_c_buf_p);
return c;
- }
-#endif /* YY_NO_INPUT */
-
-#ifdef YY_USE_PROTOS
-void yyrestart( FILE *input_file )
-#else
-void yyrestart( input_file )
-FILE *input_file;
-#endif
- {
- if ( ! yy_current_buffer )
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+}
+#endif /* ifndef YY_NO_INPUT */
- yy_init_buffer( yy_current_buffer, input_file );
- yy_load_buffer_state();
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ *
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+ void df_restart (FILE * input_file )
+{
+
+ if ( ! YY_CURRENT_BUFFER ){
+ df_ensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ df__create_buffer(df_in,YY_BUF_SIZE );
}
+ df__init_buffer(YY_CURRENT_BUFFER,input_file );
+ df__load_buffer_state( );
+}
-#ifdef YY_USE_PROTOS
-void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
-#else
-void yy_switch_to_buffer( new_buffer )
-YY_BUFFER_STATE new_buffer;
-#endif
- {
- if ( yy_current_buffer == new_buffer )
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ *
+ */
+ void df__switch_to_buffer (YY_BUFFER_STATE new_buffer )
+{
+
+ /* TODO. We should be able to replace this entire function body
+ * with
+ * df_pop_buffer_state();
+ * df_push_buffer_state(new_buffer);
+ */
+ df_ensure_buffer_stack ();
+ if ( YY_CURRENT_BUFFER == new_buffer )
return;
- if ( yy_current_buffer )
+ if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
- *yy_c_buf_p = yy_hold_char;
- yy_current_buffer->yy_buf_pos = yy_c_buf_p;
- yy_current_buffer->yy_n_chars = yy_n_chars;
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
- yy_current_buffer = new_buffer;
- yy_load_buffer_state();
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+ df__load_buffer_state( );
/* We don't actually know whether we did this switch during
- * EOF (yywrap()) processing, but the only time this flag
- * is looked at is after yywrap() is called, so it's safe
+ * EOF (df_wrap()) processing, but the only time this flag
+ * is looked at is after df_wrap() is called, so it's safe
* to go ahead and always set it.
*/
- yy_did_buffer_switch_on_eof = 1;
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_load_buffer_state( void )
-#else
-void yy_load_buffer_state()
-#endif
- {
- yy_n_chars = yy_current_buffer->yy_n_chars;
- yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
- yyin = yy_current_buffer->yy_input_file;
- yy_hold_char = *yy_c_buf_p;
- }
+ (yy_did_buffer_switch_on_eof) = 1;
+}
+static void df__load_buffer_state (void)
+{
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+ df_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+ (yy_hold_char) = *(yy_c_buf_p);
+}
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
-#else
-YY_BUFFER_STATE yy_create_buffer( file, size )
-FILE *file;
-int size;
-#endif
- {
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ *
+ * @return the allocated buffer state.
+ */
+ YY_BUFFER_STATE df__create_buffer (FILE * file, int size )
+{
YY_BUFFER_STATE b;
-
- b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+
+ b = (YY_BUFFER_STATE) df_alloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in df__create_buffer()" );
b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
- b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+ b->yy_ch_buf = (char *) df_alloc(b->yy_buf_size + 2 );
if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in df__create_buffer()" );
b->yy_is_our_buffer = 1;
- yy_init_buffer( b, file );
+ df__init_buffer(b,file );
return b;
- }
-
+}
-#ifdef YY_USE_PROTOS
-void yy_delete_buffer( YY_BUFFER_STATE b )
-#else
-void yy_delete_buffer( b )
-YY_BUFFER_STATE b;
-#endif
- {
+/** Destroy the buffer.
+ * @param b a buffer created with df__create_buffer()
+ *
+ */
+ void df__delete_buffer (YY_BUFFER_STATE b )
+{
+
if ( ! b )
return;
- if ( b == yy_current_buffer )
- yy_current_buffer = (YY_BUFFER_STATE) 0;
+ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
- yy_flex_free( (void *) b->yy_ch_buf );
-
- yy_flex_free( (void *) b );
- }
+ df_free((void *) b->yy_ch_buf );
+ df_free((void *) b );
+}
+#ifndef __cplusplus
+extern int isatty (int );
+#endif /* __cplusplus */
+
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a df_restart() or at EOF.
+ */
+ static void df__init_buffer (YY_BUFFER_STATE b, FILE * file )
-#ifdef YY_USE_PROTOS
-void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
-#else
-void yy_init_buffer( b, file )
-YY_BUFFER_STATE b;
-FILE *file;
-#endif
-
-
- {
- yy_flush_buffer( b );
+{
+ int oerrno = errno;
+
+ df__flush_buffer(b );
b->yy_input_file = file;
b->yy_fill_buffer = 1;
-#if YY_ALWAYS_INTERACTIVE
- b->yy_is_interactive = 1;
-#else
-#if YY_NEVER_INTERACTIVE
- b->yy_is_interactive = 0;
-#else
- b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-#endif
-#endif
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_flush_buffer( YY_BUFFER_STATE b )
-#else
-void yy_flush_buffer( b )
-YY_BUFFER_STATE b;
-#endif
+ /* If b is the current buffer, then df__init_buffer was _probably_
+ * called from df_restart() or through yy_get_next_buffer.
+ * In that case, we don't want to reset the lineno or column.
+ */
+ if (b != YY_CURRENT_BUFFER){
+ b->yy_bs_lineno = 1;
+ b->yy_bs_column = 0;
+ }
+
+ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+
+ errno = oerrno;
+}
- {
- if ( ! b )
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ *
+ */
+ void df__flush_buffer (YY_BUFFER_STATE b )
+{
+ if ( ! b )
return;
b->yy_n_chars = 0;
@@ -1751,31 +1807,123 @@
b->yy_at_bol = 1;
b->yy_buffer_status = YY_BUFFER_NEW;
- if ( b == yy_current_buffer )
- yy_load_buffer_state();
+ if ( b == YY_CURRENT_BUFFER )
+ df__load_buffer_state( );
+}
+
+/** Pushes the new state onto the stack. The new state becomes
+ * the current state. This function will allocate the stack
+ * if necessary.
+ * @param new_buffer The new state.
+ *
+ */
+void df_push_buffer_state (YY_BUFFER_STATE new_buffer )
+{
+ if (new_buffer == NULL)
+ return;
+
+ df_ensure_buffer_stack();
+
+ /* This block is copied from df__switch_to_buffer. */
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ /* Only push if top exists. Otherwise, replace top. */
+ if (YY_CURRENT_BUFFER)
+ (yy_buffer_stack_top)++;
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+ /* copied from df__switch_to_buffer. */
+ df__load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
+}
+
+/** Removes and deletes the top of the stack, if present.
+ * The next element becomes the new top.
+ *
+ */
+void df_pop_buffer_state (void)
+{
+ if (!YY_CURRENT_BUFFER)
+ return;
+
+ df__delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ if ((yy_buffer_stack_top) > 0)
+ --(yy_buffer_stack_top);
+
+ if (YY_CURRENT_BUFFER) {
+ df__load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
}
+}
+/* Allocates the stack if it does not exist.
+ * Guarantees space for at least one push.
+ */
+static void df_ensure_buffer_stack (void)
+{
+ int num_to_alloc;
+
+ if (!(yy_buffer_stack)) {
+
+ /* First allocation is just for 2 elements, since we don't know if this
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
+ * immediate realloc on the next call.
+ */
+ num_to_alloc = 1;
+ (yy_buffer_stack) = (struct yy_buffer_state**)df_alloc
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+
+ memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+
+ (yy_buffer_stack_max) = num_to_alloc;
+ (yy_buffer_stack_top) = 0;
+ return;
+ }
-#ifndef YY_NO_SCAN_BUFFER
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
-#else
-YY_BUFFER_STATE yy_scan_buffer( base, size )
-char *base;
-yy_size_t size;
-#endif
- {
- YY_BUFFER_STATE b;
+ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+ /* Increase the buffer to prepare for a possible push. */
+ int grow_size = 8 /* arbitrary grow size */;
+
+ num_to_alloc = (yy_buffer_stack_max) + grow_size;
+ (yy_buffer_stack) = (struct yy_buffer_state**)df_realloc
+ ((yy_buffer_stack),
+ num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+
+ /* zero only the new slots.*/
+ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+ (yy_buffer_stack_max) = num_to_alloc;
+ }
+}
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ *
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE df__scan_buffer (char * base, yy_size_t size )
+{
+ YY_BUFFER_STATE b;
+
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
/* They forgot to leave room for the EOB's. */
return 0;
- b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+ b = (YY_BUFFER_STATE) df_alloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in df__scan_buffer()" );
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
@@ -1787,58 +1935,53 @@
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
- yy_switch_to_buffer( b );
+ df__switch_to_buffer(b );
return b;
- }
-#endif
-
-
-#ifndef YY_NO_SCAN_STRING
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
-#else
-YY_BUFFER_STATE yy_scan_string( yy_str )
-yyconst char *yy_str;
-#endif
- {
- int len;
- for ( len = 0; yy_str[len]; ++len )
- ;
-
- return yy_scan_bytes( yy_str, len );
- }
-#endif
+}
+/** Setup the input buffer state to scan a string. The next call to df_lex() will
+ * scan from a @e copy of @a str.
+ * @param str a NUL-terminated string to scan
+ *
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
+ * df__scan_bytes() instead.
+ */
+YY_BUFFER_STATE df__scan_string (yyconst char * yy_str )
+{
+
+ return df__scan_bytes(yy_str,strlen(yy_str) );
+}
-#ifndef YY_NO_SCAN_BYTES
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
-#else
-YY_BUFFER_STATE yy_scan_bytes( bytes, len )
-yyconst char *bytes;
-int len;
-#endif
- {
+/** Setup the input buffer state to scan the given bytes. The next call to df_lex() will
+ * scan from a @e copy of @a bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
+ *
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE df__scan_bytes (yyconst char * bytes, int len )
+{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
int i;
-
+
/* Get memory for full buffer, including space for trailing EOB's. */
n = len + 2;
- buf = (char *) yy_flex_alloc( n );
+ buf = (char *) df_alloc(n );
if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+ YY_FATAL_ERROR( "out of dynamic memory in df__scan_bytes()" );
for ( i = 0; i < len; ++i )
buf[i] = bytes[i];
buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
- b = yy_scan_buffer( buf, n );
+ b = df__scan_buffer(buf,n );
if ( ! b )
- YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+ YY_FATAL_ERROR( "bad buffer in df__scan_bytes()" );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
@@ -1846,148 +1989,164 @@
b->yy_is_our_buffer = 1;
return b;
- }
-#endif
-
+}
-#ifndef YY_NO_PUSH_STATE
-#ifdef YY_USE_PROTOS
-static void yy_push_state( int new_state )
-#else
-static void yy_push_state( new_state )
-int new_state;
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
#endif
- {
- if ( yy_start_stack_ptr >= yy_start_stack_depth )
- {
- yy_size_t new_size;
- yy_start_stack_depth += YY_START_STACK_INCR;
- new_size = yy_start_stack_depth * sizeof( int );
+static void yy_fatal_error (yyconst char* msg )
+{
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
+}
- if ( ! yy_start_stack )
- yy_start_stack = (int *) yy_flex_alloc( new_size );
+/* Redefine yyless() so it works in section 3 code. */
- else
- yy_start_stack = (int *) yy_flex_realloc(
- (void *) yy_start_stack, new_size );
+#undef yyless
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up df_text. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ df_text[df_leng] = (yy_hold_char); \
+ (yy_c_buf_p) = df_text + yyless_macro_arg; \
+ (yy_hold_char) = *(yy_c_buf_p); \
+ *(yy_c_buf_p) = '\0'; \
+ df_leng = yyless_macro_arg; \
+ } \
+ while ( 0 )
- if ( ! yy_start_stack )
- YY_FATAL_ERROR(
- "out of memory expanding start-condition stack" );
- }
+/* Accessor methods (get/set functions) to struct members. */
- yy_start_stack[yy_start_stack_ptr++] = YY_START;
+/** Get the current line number.
+ *
+ */
+int df_get_lineno (void)
+{
+
+ return df_lineno;
+}
- BEGIN(new_state);
- }
-#endif
+/** Get the input stream.
+ *
+ */
+FILE *df_get_in (void)
+{
+ return df_in;
+}
+/** Get the output stream.
+ *
+ */
+FILE *df_get_out (void)
+{
+ return df_out;
+}
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state()
- {
- if ( --yy_start_stack_ptr < 0 )
- YY_FATAL_ERROR( "start-condition stack underflow" );
+/** Get the length of the current token.
+ *
+ */
+int df_get_leng (void)
+{
+ return df_leng;
+}
- BEGIN(yy_start_stack[yy_start_stack_ptr]);
- }
-#endif
+/** Get the current token.
+ *
+ */
+char *df_get_text (void)
+{
+ return df_text;
+}
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state()
- {
- return yy_start_stack[yy_start_stack_ptr - 1];
- }
-#endif
+/** Set the current line number.
+ * @param line_number
+ *
+ */
+void df_set_lineno (int line_number )
+{
+
+ df_lineno = line_number;
+}
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
+/** Set the input stream. This does not discard the current
+ * input buffer.
+ * @param in_str A readable stream.
+ *
+ * @see df__switch_to_buffer
+ */
+void df_set_in (FILE * in_str )
+{
+ df_in = in_str ;
+}
-#ifdef YY_USE_PROTOS
-static void yy_fatal_error( yyconst char msg[] )
-#else
-static void yy_fatal_error( msg )
-char msg[];
-#endif
- {
- (void) fprintf( stderr, "%s\n", msg );
- exit( YY_EXIT_FAILURE );
- }
+void df_set_out (FILE * out_str )
+{
+ df_out = out_str ;
+}
+int df_get_debug (void)
+{
+ return df__flex_debug;
+}
+void df_set_debug (int bdebug )
+{
+ df__flex_debug = bdebug ;
+}
-/* Redefine yyless() so it works in section 3 code. */
+/* df_lex_destroy is for both reentrant and non-reentrant scanners. */
+int df_lex_destroy (void)
+{
+
+ /* Pop the buffer stack, destroying each element. */
+ while(YY_CURRENT_BUFFER){
+ df__delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ df_pop_buffer_state();
+ }
-#undef yyless
-#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up yytext. */ \
- yytext[yyleng] = yy_hold_char; \
- yy_c_buf_p = yytext + n; \
- yy_hold_char = *yy_c_buf_p; \
- *yy_c_buf_p = '\0'; \
- yyleng = n; \
- } \
- while ( 0 )
+ /* Destroy the stack itself. */
+ df_free((yy_buffer_stack) );
+ (yy_buffer_stack) = NULL;
+ return 0;
+}
-/* Internal utility routines. */
+/*
+ * Internal utility routines.
+ */
#ifndef yytext_ptr
-#ifdef YY_USE_PROTOS
-static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
-#else
-static void yy_flex_strncpy( s1, s2, n )
-char *s1;
-yyconst char *s2;
-int n;
-#endif
- {
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+{
register int i;
- for ( i = 0; i < n; ++i )
+ for ( i = 0; i < n; ++i )
s1[i] = s2[i];
- }
+}
#endif
#ifdef YY_NEED_STRLEN
-#ifdef YY_USE_PROTOS
-static int yy_flex_strlen( yyconst char *s )
-#else
-static int yy_flex_strlen( s )
-yyconst char *s;
-#endif
- {
+static int yy_flex_strlen (yyconst char * s )
+{
register int n;
- for ( n = 0; s[n]; ++n )
+ for ( n = 0; s[n]; ++n )
;
return n;
- }
+}
#endif
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_alloc( yy_size_t size )
-#else
-static void *yy_flex_alloc( size )
-yy_size_t size;
-#endif
- {
+void *df_alloc (yy_size_t size )
+{
return (void *) malloc( size );
- }
+}
-#ifdef YY_USE_PROTOS
-static void *yy_flex_realloc( void *ptr, yy_size_t size )
-#else
-static void *yy_flex_realloc( ptr, size )
-void *ptr;
-yy_size_t size;
-#endif
- {
+void *df_realloc (void * ptr, yy_size_t size )
+{
/* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those
* that use void* generic pointers. It works with the latter
@@ -1996,26 +2155,29 @@
* as though doing an assignment.
*/
return (void *) realloc( (char *) ptr, size );
- }
+}
-#ifdef YY_USE_PROTOS
-static void yy_flex_free( void *ptr )
-#else
-static void yy_flex_free( ptr )
-void *ptr;
-#endif
- {
- free( ptr );
- }
+void df_free (void * ptr )
+{
+ free( (char *) ptr ); /* see df_realloc() for (char *) cast */
+}
-#if YY_MAIN
-int main()
- {
- yylex();
- return 0;
- }
+#define YYTABLES_NAME "yytables"
+
+#undef YY_NEW_FILE
+#undef YY_FLUSH_BUFFER
+#undef yy_set_bol
+#undef yy_new_buffer
+#undef yy_set_interactive
+#undef yytext_ptr
+#undef YY_DO_BEFORE_ACTION
+
+#ifdef YY_DECL_IS_OURS
+#undef YY_DECL_IS_OURS
+#undef YY_DECL
#endif
-#line 256 "./scanner.l"
+#line 257 "./scanner.l"
+
static int
@@ -2041,6 +2203,7 @@
case TOKEN_TEST_NOT:
case TOKEN_TEST_AND:
case TOKEN_TEST_OR:
+ case TOKEN_RET:
break;
default:
g_assert_not_reached();
@@ -2146,3 +2309,4 @@
}
#include <lemonflex-tail.inc>
+
diff -ruN ../ethereal-0.10.11/epan/dfilter/scanner.l ethereal/epan/dfilter/scanner.l
--- ../ethereal-0.10.11/epan/dfilter/scanner.l 2005-05-02 23:28:08.000000000 +0200
+++ ethereal/epan/dfilter/scanner.l 2005-06-30 13:15:03.000000000 +0200
@@ -98,6 +98,7 @@
"and" return simple(TOKEN_TEST_AND);
"||" return simple(TOKEN_TEST_OR);
"or" return simple(TOKEN_TEST_OR);
+"return" return simple(TOKEN_RET);
@@ -278,6 +279,7 @@
case TOKEN_TEST_NOT:
case TOKEN_TEST_AND:
case TOKEN_TEST_OR:
+ case TOKEN_RET:
break;
default:
g_assert_not_reached();
diff -ruN ../ethereal-0.10.11/epan/dfilter/semcheck.c ethereal/epan/dfilter/semcheck.c
--- ../ethereal-0.10.11/epan/dfilter/semcheck.c 2005-05-02 23:28:08.000000000 +0200
+++ ethereal/epan/dfilter/semcheck.c 2005-07-04 14:53:52.000000000 +0200
@@ -816,6 +816,10 @@
case TEST_OP_UNINITIALIZED:
g_assert_not_reached();
break;
+
+ case RET:
+ check_exists(st_arg1);
+ break;
case TEST_OP_EXISTS:
check_exists(st_arg1);
diff -ruN ../ethereal-0.10.11/epan/dfilter/sttype-test.c ethereal/epan/dfilter/sttype-test.c
--- ../ethereal-0.10.11/epan/dfilter/sttype-test.c 2005-05-02 23:28:08.000000000 +0200
+++ ethereal/epan/dfilter/sttype-test.c 2005-06-30 13:28:09.000000000 +0200
@@ -72,6 +72,7 @@
g_assert_not_reached();
case TEST_OP_EXISTS:
case TEST_OP_NOT:
+ case RET:
return 1;
case TEST_OP_AND:
case TEST_OP_OR:
diff -ruN ../ethereal-0.10.11/epan/dfilter/sttype-test.h ethereal/epan/dfilter/sttype-test.h
--- ../ethereal-0.10.11/epan/dfilter/sttype-test.h 2005-05-02 23:28:08.000000000 +0200
+++ ethereal/epan/dfilter/sttype-test.h 2005-06-30 11:40:54.000000000 +0200
@@ -38,7 +38,8 @@
TEST_OP_LE,
TEST_OP_BITWISE_AND,
TEST_OP_CONTAINS,
- TEST_OP_MATCHES
+ TEST_OP_MATCHES,
+ RET
} test_op_t;
void
diff -ruN ../ethereal-0.10.11/epan/ftypes/Makefile.am ethereal/epan/ftypes/Makefile.am
--- ../ethereal-0.10.11/epan/ftypes/Makefile.am 2005-05-02 23:28:09.000000000 +0200
+++ ethereal/epan/ftypes/Makefile.am 2005-07-05 13:00:13.000000000 +0200
@@ -44,6 +44,8 @@
ftype-time.c \
ftype-tvbuff.c
+libftypes_la_LDFLAGS=-export-dynamic
+
libftypes_la_LIBADD = @GLIB_LIBS@ @PCRE_LIBS@
EXTRA_DIST = \
diff -ruN ../ethereal-0.10.11/lib_ethereal.c ethereal/lib_ethereal.c
--- ../ethereal-0.10.11/lib_ethereal.c 1970-01-01 01:00:00.000000000 +0100
+++ ethereal/lib_ethereal.c 2005-07-07 14:20:33.000000000 +0200
@@ -0,0 +1,391 @@
+/* lib_ethereal.c
+ *
+ * $Id: patch-ethereal-0.9.15,v 1.3 2003/09/30 09:14:08 jan Exp $
+ *
+ * Ethereal - Network traffic analyzer
+ * By Gerald Combs <gerald@xxxxxxxxxxxx>
+ * Copyright 1998 Gerald Combs
+ *
+ * Text-mode variant, by Gilbert Ramirez <gram@xxxxxxxxxxxxxxx>
+ * and Guy Harris <guy@xxxxxxxxxxxx>.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <locale.h>
+#include <limits.h>
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include <errno.h>
+
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#include <signal.h>
+
+#ifdef HAVE_LIBPCAP
+#include <pcap.h>
+#include <setjmp.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+
+#ifdef NEED_SNPRINTF_H
+# include "snprintf.h"
+#endif
+
+#ifdef NEED_STRERROR_H
+#include "strerror.h"
+#endif
+
+#ifdef NEED_GETOPT_H
+#include "getopt.h"
+#endif
+
+#include <glib.h>
+#include <epan/epan.h>
+#include <epan/filesystem.h>
+
+#include "globals.h"
+#include <epan/timestamp.h>
+#include <epan/packet.h>
+#include "disabled_protos.h"
+#include <epan/prefs.h>
+#include <epan/addr_resolv.h>
+#include "util.h"
+
+#ifdef HAVE_LIBPCAP
+#include "pcap-util.h"
+#endif
+
+#include <epan/conversation.h>
+#include "register.h"
+#include "conditions.h"
+#include "capture_stop_conditions.h"
+#include <epan/epan_dissect.h>
+
+#ifdef HAVE_LIBPCAP
+#include <wiretap/wtap-capture.h>
+#include <wiretap/libpcap.h>
+#endif
+
+#ifdef _WIN32
+#include "capture-wpcap.h"
+#endif
+
+
+#include "lib_ethereal.h"
+
+/*error-reporting, stolen from dftest.c*/
+static void failure_message(const char *msg_format, va_list ap);
+static void open_failure_message(const char *filename, int err,
+ gboolean for_writing);
+static void read_failure_message(const char *filename, int err);
+
+/*
+ * This is the template for the decode as option; it is shared between the
+ * various functions that output the usage for this parameter.
+ */
+
+static int real_check(guchar *user, const struct wtap_pkthdr *phdr, long offset, union wtap_pseudo_header *pseudo_header, const guchar *buf, int rettype);
+static void fill_in_fdata2(frame_data *fdata, const struct wtap_pkthdr *phdr, long offset);
+typedef struct {
+ capture_file *cf;
+ wtap_dumper *pdh;
+} cb_args_t;
+
+//capture_file cfile;
+ts_type timestamp_type = TS_RELATIVE;
+#ifdef HAVE_LIBPCAP
+typedef struct {
+ int snaplen; /* Maximum captured packet length */
+ int promisc_mode; /* Capture in promiscuous mode */
+ int autostop_count; /* Maximum packet count */
+ gboolean has_autostop_duration; /* TRUE if maximum capture duration
+ is specified */
+ gint32 autostop_duration; /* Maximum capture duration */
+ gboolean has_autostop_filesize; /* TRUE if maximum capture file size
+ is specified */
+ gint32 autostop_filesize; /* Maximum capture file size */
+ gboolean ringbuffer_on; /* TRUE if ring buffer in use */
+ guint32 ringbuffer_num_files; /* Number of ring buffer files */
+ gboolean has_ring_duration; /* TRUE if ring duration specified */
+ gint32 ringbuffer_duration; /* Switch file after n seconds */
+} capture_options;
+
+
+#ifdef SIGINFO
+static gboolean infodelay; /* if TRUE, don't print capture info in SIGINFO handler */
+static gboolean infoprint; /* if TRUE, print capture info after clearing infodelay */
+#endif /* SIGINFO */
+#endif /* HAVE_LIBPCAP */
+
+
+typedef struct _ethereal_tap_list {
+ struct _ethereal_tap_list *next;
+ char *cmd;
+ void (*func)(char *arg);
+} ethereal_tap_list;
+static ethereal_tap_list *tap_list=NULL;
+
+void
+register_ethereal_tap(char *cmd, void (*func)(char *arg))
+{
+ ethereal_tap_list *newtl;
+
+ newtl=malloc(sizeof(ethereal_tap_list));
+ newtl->next=tap_list;
+ tap_list=newtl;
+ newtl->cmd=cmd;
+ newtl->func=func;
+
+}
+
+
+static void
+clear_fdata(frame_data *fdata)
+{
+ if (fdata->pfd)
+ g_slist_free(fdata->pfd);
+}
+
+int ethereal_init(int link_type,int snaplen,struct ethereal_ses* session,char* filter)
+{
+ dfilter_t *rfcode = NULL;
+ pcap_t *pch;
+ printf("filter: %s\n",filter);
+ printf("Loading filter....\n");
+ if (!dfilter_compile(filter, &rfcode)) {
+ fprintf(stderr, "tethereal: %s\n", dfilter_error_msg);
+ return 1;
+ }
+ printf("Filter compiled\n");
+ session->link_type= wtap_pcap_encap_to_wtap_encap(link_type);
+ printf("Link Type: %d\n",session->link_type);
+ session->dfilter=(void*)rfcode;
+ init_dissection();
+ return 0;
+}
+
+static int real_check(guchar *user, const struct wtap_pkthdr *phdr, long offset, union wtap_pseudo_header *pseudo_header, const guchar *buf, int rettype)
+{
+ struct ethereal_ses* ses = (struct ethereal_ses*)user;
+ frame_data fdata;
+ int err;
+ void *passed;
+ epan_dissect_t *edt;
+ char* retur;
+ dfilter_t * rfcode=(dfilter_t *)ses->dfilter;
+ fill_in_fdata2(&fdata, phdr, 0);
+ edt = epan_dissect_new(TRUE, FALSE);
+ epan_dissect_prime_dfilter(edt, rfcode);
+ epan_dissect_run(edt, pseudo_header, buf, &fdata, NULL);
+ //printf("er i real_check og rettype == %d\n",rettype);
+ if(rettype!=-1)
+ {
+ passed = dfilter_apply_edt_ret(rfcode, edt,rettype);
+ if(rettype==2)
+ {
+ // printf("skjebnetimen\n");
+ // printf("Vi sitter fremdeles med %s, kjent som %u\n",passed,passed);
+ if(passed!=NULL)
+ {
+ retur = malloc(strlen(passed)+1);
+ strcpy(retur,passed);
+ passed = retur;
+ }
+ }
+ }
+
+ else
+ passed=dfilter_apply_edt(rfcode,edt);
+ epan_dissect_free(edt);
+ clear_fdata(&fdata);
+ //if(rettype==2)
+ // printf("Vi satser at det ikke er over %s\n",passed);
+ return passed;
+}
+
+void* ethereal_rets_check(struct ethereal_ses* session, const struct pcap_pkthdr *phdr, const char *pd)
+{
+ struct wtap_pkthdr whdr;
+ union wtap_pseudo_header pseudo_header;
+
+ int err;
+ frame_data fdata;
+ gboolean passed;
+ epan_dissect_t *edt;
+ int teller;
+ void* res;
+ /* Convert from libpcap to Wiretap format.
+ If that fails, ignore the packet (wtap_process_pcap_packet has
+ written an error message). */
+ pd = wtap_process_pcap_packet(session->link_type, phdr, pd, &pseudo_header,
+ &whdr, &err);
+ if ((phdr == NULL)||(pd==NULL)) {
+ printf("Error...\n");
+ return 0;
+ }
+ //args.cf = session->dfilter;
+ res=(void*)real_check((guchar *)session, &whdr, 0, &pseudo_header, pd,2);
+ //if(res==1)
+ //fprintf(stderr,"packet passed\n");
+
+ //if(res!=NULL)
+ // printf("Det er fremdeles ikke over %s\n",res);
+ return res;
+}
+
+
+int ethereal_reti_check(struct ethereal_ses* session, const struct pcap_pkthdr *phdr, const char *pd)
+{
+ struct wtap_pkthdr whdr;
+ union wtap_pseudo_header pseudo_header;
+
+ int err;
+ frame_data fdata;
+ gboolean passed;
+ epan_dissect_t *edt;
+ int teller;
+ int res;
+ /* Convert from libpcap to Wiretap format.
+ If that fails, ignore the packet (wtap_process_pcap_packet has
+ written an error message). */
+ pd = wtap_process_pcap_packet(session->link_type, phdr, pd, &pseudo_header,
+ &whdr, &err);
+ if ((phdr == NULL)||(pd==NULL)) {
+ printf("Error...\n");
+ return 0;
+ }
+ //args.cf = session->dfilter; ,1
+ res=real_check((guchar *)session, &whdr, 0, &pseudo_header, pd,1);
+ //if(res==1)
+ //fprintf(stderr,"packet passed\n");
+ return res;
+}
+
+
+int ethereal_check(struct ethereal_ses* session, const struct pcap_pkthdr *phdr, const char *pd)
+{
+ struct wtap_pkthdr whdr;
+ union wtap_pseudo_header pseudo_header;
+
+ int err;
+ frame_data fdata;
+ gboolean passed;
+ epan_dissect_t *edt;
+ int teller;
+ int res;
+ /* Convert from libpcap to Wiretap format.
+ If that fails, ignore the packet (wtap_process_pcap_packet has
+ written an error message). */
+ pd = wtap_process_pcap_packet(session->link_type, phdr, pd, &pseudo_header,
+ &whdr, &err);
+ if ((phdr == NULL)||(pd==NULL)) {
+ printf("Error...\n");
+ return 0;
+ }
+ //args.cf = session->dfilter;
+ res=real_check((guchar *)session, &whdr, 0, &pseudo_header, pd,-1);
+ //if(res==1)
+ //fprintf(stderr,"packet passed\n");
+ return res;
+}
+
+static void
+fill_in_fdata2(frame_data *fdata, const struct wtap_pkthdr *phdr, long offset)
+{
+ fdata->next = NULL;
+ fdata->prev = NULL;
+ fdata->pfd = NULL;
+ fdata->num = 1;
+ fdata->pkt_len = phdr->len;
+ fdata->cum_bytes = phdr->len;
+ fdata->cap_len = phdr->caplen;
+ fdata->file_off = offset;
+ fdata->lnk_t = phdr->pkt_encap;
+ fdata->abs_secs = phdr->ts.tv_sec;
+ fdata->abs_usecs = phdr->ts.tv_usec;
+ fdata->flags.passed_dfilter = 0;
+ fdata->flags.encoding = CHAR_ASCII;
+ fdata->flags.visited = 0;
+ fdata->flags.marked = 0;
+ fdata->abs_secs = phdr->ts.tv_sec;
+ fdata->abs_usecs = phdr->ts.tv_usec;
+}
+
+
+__attribute__ ((constructor))
+ void init ()
+{
+ printf("Ethereal driver initialising...\n");
+ epan_init("",register_all_protocols,register_all_protocol_handoffs,
+ failure_message,open_failure_message,read_failure_message);
+ g_resolv_flags = RESOLV_NONE;
+ printf ("Ethereal driver loaded\n");
+}
+
+__attribute__ ((destructor))
+ void fini ()
+{
+ epan_cleanup();
+ printf ("Ethereal driver unloaded\n");
+}
+
+/*
+ * General errors are reported with an console message in "dftest".
+ */
+static void
+failure_message(const char *msg_format, va_list ap)
+{
+ fprintf(stderr, "dftest: ");
+ vfprintf(stderr, msg_format, ap);
+ fprintf(stderr, "\n");
+}
+
+/*
+ * Open/create errors are reported with an console message in "dftest".
+ */
+static void
+open_failure_message(const char *filename, int err, gboolean for_writing)
+{
+ fprintf(stderr, "dftest: ");
+ fprintf(stderr, file_open_error_message(err, for_writing), filename);
+ fprintf(stderr, "\n");
+}
+
+/*
+ * Read errors are reported with an console message in "dftest".
+ */
+static void
+read_failure_message(const char *filename, int err)
+{
+ fprintf(stderr, "dftest: An error occurred while reading from the file \"%s\": %s.\n",
+ filename, strerror(err));
+}
diff -ruN ../ethereal-0.10.11/lib_ethereal.h ethereal/lib_ethereal.h
--- ../ethereal-0.10.11/lib_ethereal.h 1970-01-01 01:00:00.000000000 +0100
+++ ethereal/lib_ethereal.h 2005-07-07 11:19:41.000000000 +0200
@@ -0,0 +1,10 @@
+struct ethereal_ses
+{
+ int link_type;
+ void* dfilter;
+};
+
+int ethereal_init(int link_type,int snaplen,struct ethereal_ses* session,char*);
+int ethereal_check(struct ethereal_ses* session, const struct pcap_pkthdr *phdr, const char *pd);
+int ethereal_reti_check(struct ethereal_ses* session, const struct pcap_pkthdr *phdr, const char *pd);
+void* ethereal_rets_check(struct ethereal_ses* session, const struct pcap_pkthdr *phdr, const char *pd);
diff -ruN ../ethereal-0.10.11/wiretap/Makefile.am ethereal/wiretap/Makefile.am
--- ../ethereal-0.10.11/wiretap/Makefile.am 2005-05-02 23:28:53.000000000 +0200
+++ ethereal/wiretap/Makefile.am 2005-07-05 13:01:23.000000000 +0200
@@ -40,6 +40,8 @@
$(GENERATOR_SOURCES) \
$(NONGENERATED_HEADER_FILES)
+libwiretap_la_LDFLAGS= -export-dynamic -module
+
EXTRA_DIST = \
README.developer \
config.h.win32 \
diff -ruN ../ethereal-0.10.11/wiretap/configure.in ethereal/wiretap/configure.in
--- ../ethereal-0.10.11/wiretap/configure.in 2005-05-02 23:28:53.000000000 +0200
+++ ethereal/wiretap/configure.in 2005-07-05 13:03:28.000000000 +0200
@@ -2,12 +2,14 @@
#
AC_INIT(wtap.c)
+AC_LIBTOOL_DLOPEN
+
AC_PREREQ(2.52)
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
-AM_INIT_AUTOMAKE(libwtap.a, 0.0.0)
+AM_INIT_AUTOMAKE(libwtap.la, 0.0.0)
AM_CONFIG_HEADER(config.h)
AM_DISABLE_STATIC
- Follow-Ups:
- Prev by Date: RE: [Ethereal-dev] build asn1.dll failed
- Next by Date: [Ethereal-dev] Is it possible to set color of a particular field of a packet
- Previous by thread: [Ethereal-dev] Re: [Ethereal-cvs] rev 14946: /trunk/epan/dissectors/: packet-radius.c
- Next by thread: Re: [Ethereal-dev] dfilter-modifications and inclusion of lib_ethereal.so
- Index(es):





