path: root/include/rule.h
diff options
authorDavid Fabian <>2018-01-22 14:02:11 +0100
committerPablo Neira Ayuso <>2018-02-26 18:50:37 +0100
commit5a5cdd5d42f0aa8fc78ac1ff81a423fc40072fea (patch)
treef923979c1d84e13e40d8cfdc929804d6fab89e47 /include/rule.h
parentd3d2c4bd782368e9024d88795659325372b99ed8 (diff)
Added undefine/redefine keywords
This is a small patch to nft which adds two new keywords - undefine and redefine. undefine simply undefines a variable from the current scope. redefine allows one to change a variable definition. We have a firewall written in bash (using iptables) that is organized by customer VLANs. Each VLAN has its own set of bash variables holding things like uplink iface names, gateway IPs, etc. We want to rewrite the firewall to nftables but are stuck on the fact that nft variables cannot be overridden in the same scope. We have each VLAN configuration in a separate file containing pre/post-routing, input, output and forward rules,and we include those files to a master firewall configuration. One solution is to rename all the variables with some VLAN specific (pre/su)ffix. But that is cumbersome. Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'include/rule.h')
1 files changed, 1 insertions, 0 deletions
diff --git a/include/rule.h b/include/rule.h
index d9c172dd..531222ce 100644
--- a/include/rule.h
+++ b/include/rule.h
@@ -82,6 +82,7 @@ struct symbol {
extern void symbol_bind(struct scope *scope, const char *identifier,
struct expr *expr);
+extern int symbol_unbind(struct scope *scope, const char *identifier);
extern struct symbol *symbol_lookup(const struct scope *scope,
const char *identifier);