summaryrefslogtreecommitdiffstats
path: root/include/rule.h
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 /include/rule.h
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 'include/rule.h')
-rw-r--r--include/rule.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/include/rule.h b/include/rule.h
index e8b3c037..e67a0152 100644
--- a/include/rule.h
+++ b/include/rule.h
@@ -739,15 +739,23 @@ enum {
CMD_MONITOR_OBJ_MAX
};
+enum cmd_monitor_event {
+ CMD_MONITOR_EVENT_ANY,
+ CMD_MONITOR_EVENT_NEW,
+ CMD_MONITOR_EVENT_DEL
+};
+#define CMD_MONITOR_EVENT_MAX (CMD_MONITOR_EVENT_DEL + 1)
+
struct monitor {
- struct location location;
- uint32_t format;
- uint32_t flags;
- uint32_t type;
- const char *event;
+ struct location location;
+ uint32_t format;
+ uint32_t flags;
+ uint32_t type;
+ enum cmd_monitor_event event;
};
-struct monitor *monitor_alloc(uint32_t format, uint32_t type, const char *event);
+struct monitor *monitor_alloc(uint32_t format, uint32_t type,
+ enum cmd_monitor_event event);
void monitor_free(struct monitor *m);
#define NFT_NLATTR_LOC_MAX 32