netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: kaber@trash.net, fw@strlen.de, arturo.borrero.glez@gmail.com
Subject: [PATCH nft 7/7] parser_bison: show all sets via list sets with no family
Date: Thu,  8 Oct 2015 22:49:30 +0200	[thread overview]
Message-ID: <1444337370-8269-8-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1444337370-8269-1-git-send-email-pablo@netfilter.org>

Default to the same behaviour that we get through `list ruleset', ie.

 # nft list sets
 table ip test1 {
        set foo {
                type ipv4_addr
        }
 }
 table ip6 test2 {
        set bar {
                type ipv6_addr
        }
 }

 # nft list sets ip
 table ip test1 {
        set foo {
                type ipv4_addr
        }
 }

 # nft list sets ip6
 table ip6 test2 {
        set bar {
                type ipv6_addr
        }
 }

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 src/parser_bison.y | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/src/parser_bison.y b/src/parser_bison.y
index 86e2dc9..98480b6 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -416,8 +416,8 @@ static void location_update(struct location *loc, struct location *rhs, int n)
 %type <cmd>			base_cmd add_cmd create_cmd insert_cmd delete_cmd list_cmd flush_cmd rename_cmd export_cmd monitor_cmd describe_cmd
 %destructor { cmd_free($$); }	base_cmd add_cmd create_cmd insert_cmd delete_cmd list_cmd flush_cmd rename_cmd export_cmd monitor_cmd describe_cmd
 
-%type <handle>			table_spec tables_spec chain_spec chain_identifier ruleid_spec ruleset_spec
-%destructor { handle_free(&$$); } table_spec tables_spec chain_spec chain_identifier ruleid_spec ruleset_spec
+%type <handle>			table_spec chain_spec chain_identifier ruleid_spec ruleset_spec
+%destructor { handle_free(&$$); } table_spec chain_spec chain_identifier ruleid_spec ruleset_spec
 %type <handle>			set_spec set_identifier
 %destructor { handle_free(&$$); } set_spec set_identifier
 %type <val>			handle_spec family_spec family_spec_explicit position_spec chain_policy
@@ -784,7 +784,7 @@ list_cmd		:	TABLE		table_spec
 			{
 				$$ = cmd_alloc(CMD_LIST, CMD_OBJ_CHAINS, &$2, &@$, NULL);
 			}
-			|	SETS		tables_spec
+			|	SETS		ruleset_spec
 			{
 				$$ = cmd_alloc(CMD_LIST, CMD_OBJ_SETS, &$2, &@$, NULL);
 			}
@@ -1195,14 +1195,6 @@ table_spec		:	family_spec	identifier
 			}
 			;
 
-tables_spec		:	family_spec
-			{
-				memset(&$$, 0, sizeof($$));
-				$$.family	= $1;
-				$$.table	= NULL;
-			}
-			;
-
 chain_spec		:	table_spec	identifier
 			{
 				$$		= $1;
-- 
2.1.4


  parent reply	other threads:[~2015-10-08 20:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08 20:49 [PATCH nft 0/7] listing command updates Pablo Neira Ayuso
2015-10-08 20:49 ` [PATCH nft 1/7] rule: display table when listing sets Pablo Neira Ayuso
2015-10-08 20:49 ` [PATCH nft 2/7] src: add `list chains' command Pablo Neira Ayuso
2015-10-08 20:49 ` [PATCH nft 3/7] rule: display table when listing one set Pablo Neira Ayuso
2015-10-08 20:49 ` [PATCH nft 4/7] evaluate: check if set exists before listing it Pablo Neira Ayuso
2015-10-08 20:49 ` [PATCH nft 5/7] rule: `list sets' only displays declaration, not definition Pablo Neira Ayuso
2015-10-08 20:49 ` [PATCH nft 6/7] rule: rework list chain Pablo Neira Ayuso
2015-10-08 20:49 ` Pablo Neira Ayuso [this message]
2015-10-09  7:09 ` [PATCH nft 0/7] listing command updates Arturo Borrero Gonzalez
2015-10-12 18:33   ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1444337370-8269-8-git-send-email-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=arturo.borrero.glez@gmail.com \
    --cc=fw@strlen.de \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).