Skip to content

RFC parser_bison: Less STRING more tokens

Phil Sutter netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6parser_bison: Introduce tokens for monitor eventsinclude/rule.h src/evaluate.c src/parser_bison.y +2 more+20 -282 replies
2/6parser_bison: Introduce tokens for chain typesinclude/rule.h src/parser_bison.y src/rule.c +1 more+20 -342 replies
3/6parser_bison: Introduce tokens for osf ttl valuessrc/parser_bison.y src/scanner.l+12 -181 reply
4/6parser_bison: Introduce tokens for log levelssrc/parser_bison.y src/scanner.l+27 -281 reply
5/6parser_bison: Introduce bytes_unitinclude/datatype.h src/datatype.c src/parser_bison.y +1 more+22 -621 reply
6/6scanner: Introduce SCANSTATE_RATEinclude/datatype.h include/parser.h src/datatype.c +5 more+130 -1103 replies

Reviews trailers per patch

3 of 6 patches have a Reviewed-by or Acked-by.

PatchFlorian Westphal
1/6
2/6
3/6R-b
4/6R-b
5/6R-b
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [nft PATCH RFC 0/6] parser_bison: Less STRING more tokens

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(-)
Signature · 1 line
2.51.0