GH-236: Add zeek_script_loaded event, deprecate bro_script_loaded

This commit is contained in:
Jon Siwek 2019-04-19 12:00:37 -07:00
parent a994be9eeb
commit 3ea34d6ea3
11 changed files with 58 additions and 12 deletions

View file

@ -1171,11 +1171,14 @@ func_hdr:
}
| TOK_EVENT event_id func_params opt_attr
{
// Gracefully handle the deprecation of bro_init and bro_done
// Gracefully handle the deprecation of bro_init, bro_done,
// and bro_script_loaded
if ( streq("bro_init", $2->Name()) )
$2 = global_scope()->Lookup("zeek_init");
else if ( streq("bro_done", $2->Name()) )
$2 = global_scope()->Lookup("zeek_done");
else if ( streq("bro_script_loaded", $2->Name()) )
$2 = global_scope()->Lookup("zeek_script_loaded");
begin_func($2, current_module.c_str(),
FUNC_FLAVOR_EVENT, 0, $3, $4);