All of lore.kernel.org
 help / color / mirror / Atom feed
* [nft PATCH RFC 0/6] parser_bison: Less STRING more tokens
@ 2025-11-26 15:13 Phil Sutter
  2025-11-26 15:13 ` [nft PATCH RFC 1/6] parser_bison: Introduce tokens for monitor events Phil Sutter
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Phil Sutter @ 2025-11-26 15:13 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Florian Westphal, netfilter-devel

Introducing new tokens should be harmless as long as they are scoped
since it won't harm existing rulesets using them for user-defined names.

Leverage this to offload more input parsing to flex/bison, thereby
reducing custom code size.

This series is marked RFC mostly for the last patch which introduces an
exclusive start condition to defeat the scanner's tendency to fall back
to STRING token when one really wishes it to split up the input string
as all parts are well-defined.

The other patches are less debatable but given upstream's hesitation to
add new tokens in the past, I'd like to propose this as a formal policy
change.

Phil Sutter (6):
  parser_bison: Introduce tokens for monitor events
  parser_bison: Introduce tokens for chain types
  parser_bison: Introduce tokens for osf ttl values
  parser_bison: Introduce tokens for log levels
  parser_bison: Introduce bytes_unit
  scanner: Introduce SCANSTATE_RATE

 include/datatype.h           |   7 --
 include/parser.h             |   1 +
 include/rule.h               |  12 ++-
 src/datatype.c               |  61 -----------
 src/evaluate.c               |  22 +---
 src/parser_bison.y           | 204 +++++++++++------------------------
 src/rule.c                   |  22 +---
 src/scanner.l                |  76 ++++++++-----
 tests/py/any/limit.t         |   6 ++
 tests/py/any/limit.t.json    |  70 ++++++++++++
 tests/py/any/limit.t.payload |  20 ++++
 11 files changed, 226 insertions(+), 275 deletions(-)

-- 
2.51.0


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

end of thread, other threads:[~2025-11-28 18:11 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-26 15:13 [nft PATCH RFC 0/6] parser_bison: Less STRING more tokens Phil Sutter
2025-11-26 15:13 ` [nft PATCH RFC 1/6] parser_bison: Introduce tokens for monitor events Phil Sutter
2025-11-28 14:51   ` Florian Westphal
2025-11-28 15:13     ` Phil Sutter
2025-11-26 15:13 ` [nft PATCH RFC 2/6] parser_bison: Introduce tokens for chain types Phil Sutter
2025-11-28 15:07   ` Florian Westphal
2025-11-28 15:38     ` Phil Sutter
2025-11-26 15:13 ` [nft PATCH RFC 3/6] parser_bison: Introduce tokens for osf ttl values Phil Sutter
2025-11-28 15:14   ` Florian Westphal
2025-11-26 15:13 ` [nft PATCH RFC 4/6] parser_bison: Introduce tokens for log levels Phil Sutter
2025-11-28 15:15   ` Florian Westphal
2025-11-26 15:13 ` [nft PATCH RFC 5/6] parser_bison: Introduce bytes_unit Phil Sutter
2025-11-28 15:50   ` Florian Westphal
2025-11-26 15:13 ` [nft PATCH RFC 6/6] scanner: Introduce SCANSTATE_RATE Phil Sutter
2025-11-28 17:40   ` Florian Westphal
2025-11-28 18:07     ` Phil Sutter
2025-11-28 18:11       ` 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.