mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
support for indexing "table[pattern] of T" with strings to get multi-matches
This commit is contained in:
parent
a5a79d3f3a
commit
699549eb45
8 changed files with 228 additions and 2 deletions
|
@ -718,6 +718,8 @@ protected:
|
|||
TableVal* table;
|
||||
};
|
||||
|
||||
class TablePatternMatcher;
|
||||
|
||||
class TableVal final : public Val, public notifier::detail::Modifiable {
|
||||
public:
|
||||
explicit TableVal(TableTypePtr t, detail::AttributesPtr attrs = nullptr);
|
||||
|
@ -863,6 +865,11 @@ public:
|
|||
// Causes an internal error if called for any other kind of table.
|
||||
TableValPtr LookupSubnetValues(const SubNetVal* s);
|
||||
|
||||
// For a table[pattern], return a vector of all yields matching
|
||||
// the given string.
|
||||
// Causes an internal error if called for any other kind of table.
|
||||
VectorValPtr LookupPattern(const StringVal* s);
|
||||
|
||||
// Sets the timestamp for the given index to network time.
|
||||
// Returns false if index does not exist.
|
||||
bool UpdateTimestamp(Val* index);
|
||||
|
@ -1032,6 +1039,7 @@ protected:
|
|||
TableValTimer* timer;
|
||||
RobustDictIterator<TableEntryVal>* expire_iterator;
|
||||
detail::PrefixTable* subnets;
|
||||
TablePatternMatcher* pattern_matcher = nullptr;
|
||||
ValPtr def_val;
|
||||
detail::ExprPtr change_func;
|
||||
std::string broker_store;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue