summaryrefslogtreecommitdiffstats
path: root/src/parser_bison.y
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2025-11-21 14:02:36 +0100
committerPhil Sutter <phil@nwl.cc>2026-01-20 16:02:06 +0100
commit9e80bfd0344cc0c05004c8cd1dd13e6cfa3df446 (patch)
tree32efe71e12bb1d2d47f1d127f51760d2892ca856 /src/parser_bison.y
parentd6d9930fc2347dd11b460f95ff22916c407a9a4b (diff)
parser_bison: Introduce tokens for monitor events
There already is a start condition for "monitor" keyword and also a DESTROY token. So just add the missing one and get rid of the intermediate string buffer. Keep checking the struct monitor::event value in eval phase just to be on the safe side. Signed-off-by: Phil Sutter <phil@nwl.cc> Reviewed-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'src/parser_bison.y')
-rw-r--r--src/parser_bison.y10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y
index 3ceef794..96d0e151 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -353,6 +353,7 @@ int nft_lex(void *, void *, void *);
%token DESCRIBE "describe"
%token IMPORT "import"
%token EXPORT "export"
+%token NEW "new"
%token DESTROY "destroy"
%token MONITOR "monitor"
@@ -985,9 +986,7 @@ int nft_lex(void *, void *, void *);
%destructor { expr_free($$); } osf_expr
%type <val> markup_format
-%type <string> monitor_event
-%destructor { free_const($$); } monitor_event
-%type <val> monitor_object monitor_format
+%type <val> monitor_event monitor_object monitor_format
%type <val> synproxy_ts synproxy_sack
@@ -1892,8 +1891,9 @@ monitor_cmd : monitor_event monitor_object monitor_format
}
;
-monitor_event : /* empty */ { $$ = NULL; }
- | STRING { $$ = $1; }
+monitor_event : /* empty */ { $$ = CMD_MONITOR_EVENT_ANY; }
+ | NEW { $$ = CMD_MONITOR_EVENT_NEW; }
+ | DESTROY { $$ = CMD_MONITOR_EVENT_DEL; }
;
monitor_object : /* empty */ { $$ = CMD_MONITOR_OBJ_ANY; }