Skip to contentSkip to conversation

document nft statements undefine/redefine

PATCH Applied Pierre Ducroquet 2 participants 2 messages Feb 7, 2022 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 document nft statements undefine/redefine

Hi

I found out that two statements, undefine and redefine, have been added to the nft language a while ago (2018) but not documented then.
Cf. https://patchwork.ozlabs.org/project/netfilter-devel/patch/
3622208.jy4NlOniyd@voxel/

The attached patch adds a basic documentation of this feature.

Regards

Pierre

From 81bd851db3e6bae98ac9385ecf404696346d91bf Mon Sep 17 00:00:00 2001
From: Pierre Ducroquet <[email protected]>
Date: Mon, 7 Feb 2022 10:48:11 +0100
Subject: [PATCH] Document the undefine and redefine syntax

---
 doc/nft.txt | 6 ++++++
 1 file changed, 6 insertions(+)
doc/nft.txt +6 -0
index 7240deaa..f7a53ac9 100644
@@ -170,17 +170,23 @@ SYMBOLIC VARIABLES
 ~~~~~~~~~~~~~~~~~~
 [verse]
 *define* 'variable' *=* 'expr'
+*undefine* 'variable'
+*redefine* 'variable' *=* 'expr'
 *$variable*
 
 Symbolic variables can be defined using the *define* statement. Variable
 references are expressions and can be used to initialize other variables. The scope
 of a definition is the current block and all blocks contained within.
+Symbolic variables can be undefined using the *undefine* statement, and modified
+using the *redefine* statement.
 
 .Using symbolic variables
 ---------------------------------------
 define int_if1 = eth0
 define int_if2 = eth1
 define int_ifs = { $int_if1, $int_if2 }
+redefine int_if2 = wlan0
+undefine int_if2
 
 filter input iif $int_ifs accept
 ---------------------------------------
Signature · 1 line
2.34.1