From 5c40780440c0e8661fc7cfcec72dab48b934631d Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Fri, 20 Mar 2009 08:12:18 +0100 Subject: Add support for scoping and symbol binding As a first step towards stand-alone sets, add support for scoping and binding symbols. This will be used for user-defined constants, as well as declarations of modifiable (stand-alone) sets once the kernel side is ready. Scopes are currently limited to three nesting levels: the global scope, table block scopes and chain block scopes. Signed-off-by: Patrick McHardy --- include/parser.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/parser.h') diff --git a/include/parser.h b/include/parser.h index a47bd0f0..f5dd6f4b 100644 --- a/include/parser.h +++ b/include/parser.h @@ -2,6 +2,7 @@ #define NFTABLES_PARSER_H #include +#include // FIXME #define MAX_INCLUDE_DEPTH 16 #define TABSIZE 8 @@ -10,12 +11,19 @@ #define YYLTYPE_IS_TRIVIAL 0 #define YYENABLE_NLS 0 +#define SCOPE_NEST_MAX 3 + struct parser_state { struct input_descriptor *indesc; struct input_descriptor indescs[MAX_INCLUDE_DEPTH]; unsigned int indesc_idx; struct list_head *msgs; + + struct scope top_scope; + struct scope *scopes[SCOPE_NEST_MAX]; + unsigned int scope; + struct list_head cmds; }; -- cgit v1.2.3