netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nft 1/5] parser_bison: consolidate counter grammar rule for set elements
@ 2025-03-20 12:10 Pablo Neira Ayuso
  2025-03-20 12:10 ` [PATCH nft 2/5] parser_bison: consolidate limit " Pablo Neira Ayuso
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Pablo Neira Ayuso @ 2025-03-20 12:10 UTC (permalink / raw)
  To: netfilter-devel

Use existing grammar rules to parse counters to simplify parser.

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

diff --git a/src/parser_bison.y b/src/parser_bison.y
index 4d4d39342bf7..0d37c920f00c 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -4590,16 +4590,7 @@ set_elem_stmt_list	:	set_elem_stmt
 			}
 			;
 
-set_elem_stmt		:	COUNTER	close_scope_counter
-			{
-				$$ = counter_stmt_alloc(&@$);
-			}
-			|	COUNTER	PACKETS	NUM	BYTES	NUM	close_scope_counter
-			{
-				$$ = counter_stmt_alloc(&@$);
-				$$->counter.packets = $3;
-				$$->counter.bytes = $5;
-			}
+set_elem_stmt		:	counter_stmt	close_scope_counter
 			|	LIMIT   RATE    limit_mode      limit_rate_pkts       limit_burst_pkts	close_scope_limit
 			{
 				if ($5 == 0) {
-- 
2.30.2


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

end of thread, other threads:[~2025-03-20 12:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-20 12:10 [PATCH nft 1/5] parser_bison: consolidate counter grammar rule for set elements Pablo Neira Ayuso
2025-03-20 12:10 ` [PATCH nft 2/5] parser_bison: consolidate limit " Pablo Neira Ayuso
2025-03-20 12:10 ` [PATCH nft 3/5] parser_bison: consolidate quota " Pablo Neira Ayuso
2025-03-20 12:10 ` [PATCH nft 4/5] parser_bison: consolidate last " Pablo Neira Ayuso
2025-03-20 12:10 ` [PATCH nft 5/5] parser_bison: consolidate connlimit " Pablo Neira Ayuso

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).