%code requires { #include "conf_ast.h" } %{ /* * AIDE (Advanced Intrusion Detection Environment) * * Copyright (C) 1999-2006, 2010-2013, 2015-2016, 2019-2025 Rami Lehti, * Pablo Virolainen, Richard van den Berg, Hannes von Haugwitz * * 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., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include "attributes.h" #include #include #include "log.h" #include "rx_rule.h" #include "conf_lex.h" DB_ATTR_TYPE retval=0; #include "conf_ast.h" extern int conflex(void); void conferror(ast**, const char *); %} %union { char* s; config_option option; bool_operator operator; ast* ast; if_condition* if_cond; bool_expression* bool_expr; attribute_expression* attr_expr; restriction_expression* rs_expr; ft_restriction_expression* ft_rs_expr; string_expression* string_expr; } %token TDEFINE "@@define" %token TUNDEFINE "@@undef" %token TIFDEF "@@ifdef" %token TIFNDEF "@@ifndef" %token TIFNHOST "@@ifnhost" %token TIFHOST "@@ifhost" %token TIF "@@if" %token TBOOLNOT "not" %token TBOOLFUNC "boolean function" %token TBOOLOP "boolean operator" %token TELSE "@@else" %token TENDIF "@@endif" %token TINCLUDE "@@include" %token TXINCLUDE "@@x_include" %token TSETENV "@@x_include_setenv" %token TGROUP "group name" %token TSTRING "string" %token TEXPR "group" %token TVARIABLE "variable name" %token TSPACE "whitespace" %token TNEWLINE "new line" /* File rule */ %token TSELRXRULE "regular rule" %token TEQURXRULE "equals rule" %token TRECNEGRXRULE "recursive negative rule" %token TNONRECNEGRXRULE "non-recursive negative rule" %token