mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
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:
parent
5aa7d80e88
commit
2ad609cbbb
30 changed files with 730 additions and 49 deletions
33
testing/btest/core/event-groups/hooks-basic.zeek
Normal file
33
testing/btest/core/event-groups/hooks-basic.zeek
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue