mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
Use better data structure for storing BPF filters.
This commit is contained in:
parent
17bc615467
commit
c22a6f67d2
3 changed files with 22 additions and 16 deletions
|
@ -21,6 +21,15 @@ module Pcap;
|
|||
## pcap_error
|
||||
function precompile_pcap_filter%(id: PcapFilterID, s: string%): bool
|
||||
%{
|
||||
if ( id->AsEnum() >= 100 )
|
||||
{
|
||||
// We use a vector as underlying data structure for fast
|
||||
// lookups and limit the ID space so that that doesn't grow too
|
||||
// large.
|
||||
builtin_error(fmt("PCAP filter ids must remain below 100 (is %ld)", id->AsInt()));
|
||||
return new Val(false, TYPE_BOOL);
|
||||
}
|
||||
|
||||
bool success = true;
|
||||
|
||||
const iosource::Manager::PktSrcList& pkt_srcs(iosource_mgr->GetPktSrcs());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue