Reintroduce event groups

This started with reverting commit 52cd02173d
and then rewriting it to be per handler rather than handler identifier
and adding support for hooks as well as adding implicit module groups.
This commit is contained in:
Arne Welzel 2022-10-25 16:53:17 +02:00
parent 5aa7d80e88
commit 2ad609cbbb
30 changed files with 730 additions and 49 deletions

View file

@ -0,0 +1,33 @@
# @TEST-DOC: Hooks can be annotated with &group and work.
# @TEST-EXEC: zeek %INPUT > output
# @TEST-EXEC: btest-diff output
global the_hook: hook(c: count);
event zeek_init()
{
hook the_hook(1);
print "=== disable_event_group(my-group1)";
disable_event_group("my-group1");
hook the_hook(2);
}
hook the_hook(c: count)
{
print "the_hook without group", c;
}
hook the_hook(c: count) &group="my-group1"
{
print "the_hook with my-group1", c;
}
hook the_hook(c: count) &group="my-group2"
{
print "the_hook with my-group2", c;
}
hook the_hook(c: count) &group="my-group1" &group="my-group2"
{
print "the_hook with my-group1 and my-group2", c;
}