broker/cluster: Add cluster shims for 7.0

For making Zeek 7.0 compatible with the new Cluster::* methods coming
with Zeek 7.1/7.2.
This commit is contained in:
Arne Welzel 2025-06-06 16:37:43 +02:00
parent 4021a0c654
commit 8600cfa882
8 changed files with 143 additions and 0 deletions

View file

@ -295,6 +295,12 @@ export {
## Returns: a topic string that may used to send a message exclusively to
## a given cluster node.
global nodeid_topic: function(id: string): string;
## Delegate to Broker::__subscribe()
global subscribe: function(topic_prefix: string): bool;
## Delegate to Broker::__unsubscribe()
global unsubscribe: function(topic_prefix: string): bool;
}
# Track active nodes per type.
@ -519,3 +525,13 @@ function log(msg: string)
{
Log::write(Cluster::LOG, [$ts = network_time(), $node = node, $message = msg]);
}
function subscribe(topic_prefix: string): bool
{
return Broker::__subscribe(topic_prefix);
}
function unsubscribe(topic_prefix: string): bool
{
return Broker::__unsubscribe(topic_prefix);
}