]> git.ipfire.org Git - thirdparty/nftables.git/commit
src: add --define key=value
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 20 Jul 2021 10:17:33 +0000 (12:17 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 20 Jul 2021 15:47:55 +0000 (17:47 +0200)
commit9edaa6a51eab49a378dd358e0b4254d0398c629f
treecb44b02953b6672d4239ec6f97c3d59de5d6cb10
parent640dc0c8a3daef65cd93868939b5a2877615f2d5
src: add --define key=value

This patch adds a new option to define variables from the command line.

 # cat test.nft
 table netdev x {
        chain y {
                type filter hook ingress devices = $dev priority 0;
                counter accept
        }
 }
 # nft --define dev="{ eth0, eth1 }" -f test.nft

You can only combine it with -f/--filename.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
doc/nft.txt
include/nftables.h
include/nftables/libnftables.h
src/libnftables.c
src/main.c
tests/shell/testcases/nft-f/0028variable_cmdline_0 [new file with mode: 0755]
tests/shell/testcases/nft-f/dumps/0028variable_cmdline_0.nft [new file with mode: 0644]