All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch] document nft statements undefine/redefine
@ 2022-02-07 10:46 Pierre Ducroquet
  2022-02-07 13:56 ` Florian Westphal
  0 siblings, 1 reply; 2+ messages in thread
From: Pierre Ducroquet @ 2022-02-07 10:46 UTC (permalink / raw)
  To: netfilter-devel


[-- Attachment #1.1: Type: text/plain, Size: 312 bytes --]

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

[-- Attachment #1.2: 0001-Document-the-undefine-and-redefine-syntax.patch --]
[-- Type: text/x-patch, Size: 1197 bytes --]

From 81bd851db3e6bae98ac9385ecf404696346d91bf Mon Sep 17 00:00:00 2001
From: Pierre Ducroquet <pducroquet@entrouvert.com>
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(+)

diff --git a/doc/nft.txt b/doc/nft.txt
index 7240deaa..f7a53ac9 100644
--- a/doc/nft.txt
+++ b/doc/nft.txt
@@ -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
 ---------------------------------------
-- 
2.34.1


[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch] document nft statements undefine/redefine
  2022-02-07 10:46 [Patch] document nft statements undefine/redefine Pierre Ducroquet
@ 2022-02-07 13:56 ` Florian Westphal
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Westphal @ 2022-02-07 13:56 UTC (permalink / raw)
  To: Pierre Ducroquet; +Cc: netfilter-devel

Pierre Ducroquet <pducroquet@entrouvert.com> wrote:
> 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.

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-07 14:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-07 10:46 [Patch] document nft statements undefine/redefine Pierre Ducroquet
2022-02-07 13:56 ` Florian Westphal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.