mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 13:08:20 +00:00
Support explicit disabling of file analyzers
This commit is contained in:
parent
8c4092a0ad
commit
737d2c390b
9 changed files with 145 additions and 6 deletions
|
@ -38,6 +38,37 @@ function Files::__set_reassembly_buffer%(file_id: string, max: count%): bool
|
|||
return zeek::val_mgr->Bool(result);
|
||||
%}
|
||||
|
||||
## :zeek:see:`Files::enable_analyzer`.
|
||||
function Files::__enable_analyzer%(tag: Files::Tag%) : bool
|
||||
%{
|
||||
auto c = zeek::file_mgr->Lookup(tag->AsEnumVal());
|
||||
|
||||
if ( ! c )
|
||||
return zeek::val_mgr->False();
|
||||
|
||||
c->SetEnabled(true);
|
||||
return zeek::val_mgr->True();
|
||||
%}
|
||||
|
||||
## :zeek:see:`Files::disable_analyzer`.
|
||||
function Files::__disable_analyzer%(tag: Files::Tag%) : bool
|
||||
%{
|
||||
auto c = zeek::file_mgr->Lookup(tag->AsEnumVal());
|
||||
|
||||
if ( ! c )
|
||||
return zeek::val_mgr->False();
|
||||
|
||||
c->SetEnabled(false);
|
||||
return zeek::val_mgr->True();
|
||||
%}
|
||||
|
||||
## :zeek:see:`Files::analyzer_enabled`.
|
||||
function Files::__analyzer_enabled%(tag: Files::Tag%) : bool
|
||||
%{
|
||||
auto c = zeek::file_mgr->Lookup(tag->AsEnumVal());
|
||||
return zeek::val_mgr->Bool(c && c->Enabled());
|
||||
%}
|
||||
|
||||
## :zeek:see:`Files::add_analyzer`.
|
||||
function Files::__add_analyzer%(file_id: string, tag: Files::Tag, args: any%): bool
|
||||
%{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue