mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 19:48:20 +00:00
Add signaling of succesful initialization of plugins to NetControl.
This does not really have many user-facing changes. The one big change is that users now should initialize plugins in the NetControl::init() event instead of bro_init. Once all plugins finished initializing and the NetControl framework starts operations, the NetControl::init_done() event is raised. Rules that are sent to NetControl before the plugins have finished initializing are ignored - this is important when several plugins that require external connections have to be initialized at the beginning. Without this delay, rules could end up at the wrong plugin.
This commit is contained in:
parent
d9459fc59a
commit
42e4072673
31 changed files with 371 additions and 113 deletions
|
@ -6,7 +6,7 @@
|
|||
|
||||
@load base/frameworks/netcontrol
|
||||
|
||||
event bro_init()
|
||||
event NetControl::init()
|
||||
{
|
||||
local netcontrol_debug = NetControl::create_debug(T);
|
||||
NetControl::activate(netcontrol_debug, 0);
|
||||
|
@ -31,7 +31,7 @@ function test_mac()
|
|||
NetControl::add_rule(r);
|
||||
}
|
||||
|
||||
event bro_init() &priority=-5
|
||||
event NetControl::init_done() &priority=-5
|
||||
{
|
||||
NetControl::shunt_flow([$src_h=192.168.17.1, $src_p=32/tcp, $dst_h=192.168.17.2, $dst_p=32/tcp], 30sec);
|
||||
NetControl::drop_address(1.1.2.2, 15sec, "Hi there");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue