RFC parser_bison: Less STRING more tokens
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest6 patches 10 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | parser_bison: Introduce tokens for monitor eventsinclude/ src/ src/ +2 more | +20 | 2 replies | |
| 2/6 | parser_bison: Introduce tokens for chain typesinclude/ src/ src/ +1 more | +20 | 2 replies | |
| 3/6 | parser_bison: Introduce tokens for osf ttl valuessrc/ src/ | +12 | 1 reply | |
| 4/6 | parser_bison: Introduce tokens for log levelssrc/ src/ | +27 | 1 reply | |
| 5/6 | parser_bison: Introduce bytes_unitinclude/ src/ src/ +1 more | +22 | 1 reply | |
| 6/6 | scanner: Introduce SCANSTATE_RATEinclude/ include/ src/ +5 more | +130 | 3 replies |
Reviews trailers per patch
3 of 6 patches have a Reviewed-by or Acked-by.
| Patch | Florian Westphal |
|---|---|
| 1/6 | |
| 2/6 | |
| 3/6 | R-b |
| 4/6 | R-b |
| 5/6 | R-b |
| 6/6 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
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