From 878cc0e4e863e6b2c9fa71f791d35245b3ddbdb2 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Fri, 20 Mar 2009 08:34:59 +0100 Subject: Add support for user-defined symbolic constants User-defined constants can be used like this: define allowed_hosts = { 192.168.0.0/24, 10.0.0.20-10.0.0.30 } define udp_services = domain define tcp_services = { ssh, domain } ip saddr $allowed_hosts udp dport $udp_services counter accept ip saddr $allowed_hosts tcp dport $tcp_services counter accept Recursive definitions are possible, but currently not fully handled. Anything requiring transformations (sets using ranges) can not be used more than once currently since the expressions need to be COW'ed previously. Signed-off-by: Patrick McHardy --- include/expression.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/expression.h b/include/expression.h index e9d21cfc..d4222060 100644 --- a/include/expression.h +++ b/include/expression.h @@ -55,6 +55,7 @@ enum expr_types { enum ops { OP_INVALID, + OP_IMPLICIT, /* Unary operations */ OP_HTON, OP_NTOH, @@ -172,6 +173,7 @@ struct expr { struct { /* EXPR_SYMBOL */ const struct datatype *sym_type; + const struct scope *scope; const char *identifier; }; struct { -- cgit v1.2.3