Event: Deprecate default network timestamp metadata

This deprecates the Event constructor and the ``ts`` parameter of Enqueue()
Instead, versions are introduced that take a detail::MetadataVectorPtr which
can hold the network timestamp metadata and is meant to be allocated by the
caller instead of automatically during Enqueue() or within the Event
constructor.

This also introduces a BifConst ``EventMetadata::add_network_timestamp`` to
opt-in adding network timestamps to events globally. It's disabled by
default as there are not a lot of known use cases that need this.
This commit is contained in:
Arne Welzel 2025-05-21 16:20:31 +02:00
parent 12c523f3f7
commit 53b0f0ad64
13 changed files with 167 additions and 10 deletions

View file

@ -592,6 +592,15 @@ export {
id: EventMetadata::ID; ##< The registered :zeek:see:`EventMetadata::ID` value.
val: any; ##< The value. Its type matches what was passed to :zeek:see:`EventMetadata::register`.
};
## Add network timestamp metadata to all events.
##
## Adding network timestamp metadata affects local and
## remote events. Events scheduled have a network timestamp
## of when the scheduled timer was supposed to expire, which
## might be a value before the network_time() when the event
## was actually dispatched.
const add_network_timestamp: bool = F &redef;
}
module FTP;