From c156232a530b30b6668712eda22bc491b0900283 Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado Gomez" Date: Fri, 21 Aug 2020 18:40:30 +0200 Subject: src: add comment support when adding tables Adds userdata building logic if a comment is specified when creating a new table. Adds netlink userdata parsing callback function. Relies on kernel supporting userdata for nft_table. Example: > nft add table ip x { comment "test"\; } > nft list ruleset table ip x { comment "test" } Signed-off-by: Jose M. Guisado Gomez Signed-off-by: Pablo Neira Ayuso --- tests/shell/testcases/optionals/comments_table_0 | 5 +++++ tests/shell/testcases/optionals/dumps/comments_table_0.nft | 3 +++ 2 files changed, 8 insertions(+) create mode 100755 tests/shell/testcases/optionals/comments_table_0 create mode 100644 tests/shell/testcases/optionals/dumps/comments_table_0.nft (limited to 'tests/shell/testcases') diff --git a/tests/shell/testcases/optionals/comments_table_0 b/tests/shell/testcases/optionals/comments_table_0 new file mode 100755 index 00000000..a0dfd749 --- /dev/null +++ b/tests/shell/testcases/optionals/comments_table_0 @@ -0,0 +1,5 @@ +#!/bin/bash + +# comments are shown + +$NFT add table test { comment \"test_comment\"\; } diff --git a/tests/shell/testcases/optionals/dumps/comments_table_0.nft b/tests/shell/testcases/optionals/dumps/comments_table_0.nft new file mode 100644 index 00000000..32ae3c2d --- /dev/null +++ b/tests/shell/testcases/optionals/dumps/comments_table_0.nft @@ -0,0 +1,3 @@ +table ip test { + comment "test_comment" +} -- cgit v1.2.3