mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 12:08:20 +00:00
Add column to packet_filter.log for failure reason
This commit is contained in:
parent
82adecb2ad
commit
5e4db6d0c4
8 changed files with 50 additions and 33 deletions
|
@ -112,6 +112,18 @@ function error%(%): string
|
|||
return zeek::make_intrusive<zeek::StringVal>("no error");
|
||||
%}
|
||||
|
||||
function get_filter_state_string%(id: PcapFilterID%): string
|
||||
%{
|
||||
zeek::iosource::PktSrc* ps = zeek::iosource_mgr->GetPktSrc();
|
||||
if ( ps )
|
||||
{
|
||||
if ( auto filter = ps->GetBPFFilter(id->AsInt()) )
|
||||
return zeek::make_intrusive<zeek::StringVal>(filter->GetStateMessage());
|
||||
}
|
||||
|
||||
return zeek::make_intrusive<zeek::StringVal>("<unknown>");
|
||||
%}
|
||||
|
||||
function findalldevs%(%): Pcap::Interfaces
|
||||
%{
|
||||
pcap_if_t* alldevs;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue