mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 17:48:21 +00:00
Add bif that allows searching for all matching subnets in table.
Example: global test: set[subnet] = { 10.0.0.0/8, 10.1.0.0/16, 10.2.0.0/16, 10.2.0.2/31 } print matching_subnets(10.2.0.2/32, test); -> [10.2.0.2/31, 10.2.0.0/16, 10.0.0.0/8]
This commit is contained in:
parent
42e4072673
commit
562e5a9f63
10 changed files with 274 additions and 11 deletions
|
@ -814,6 +814,11 @@ public:
|
|||
int Size() const { return AsTable()->Length(); }
|
||||
int RecursiveSize() const;
|
||||
|
||||
// Returns the Prefix table used inside the table (if present).
|
||||
// This allows us to do more direct queries to this specialized
|
||||
// type that the general Table API does not allow.
|
||||
const PrefixTable* Subnets() const { return subnets; }
|
||||
|
||||
void Describe(ODesc* d) const override;
|
||||
|
||||
void InitTimer(double delay);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue