diff --git a/scripts/base/frameworks/config/main.zeek b/scripts/base/frameworks/config/main.zeek index 47525ee7b7..76744a9c4f 100644 --- a/scripts/base/frameworks/config/main.zeek +++ b/scripts/base/frameworks/config/main.zeek @@ -57,7 +57,7 @@ global option_cache: table[string] of OptionCacheValue; global Config::cluster_set_option: event(ID: string, val: any, location: string); -function broadcast_option(ID: string, val: any, location: string) +function broadcast_option(ID: string, val: any, location: string) &is_used { # There's not currently a common topic to broadcast to as then enabling # implicit Broker forwarding would cause a routing loop. @@ -145,7 +145,7 @@ function format_value(value: any) : string return cat(value); } -function config_option_changed(ID: string, new_value: any, location: string): any +function config_option_changed(ID: string, new_value: any, location: string): any &is_used { local log = Info($ts=network_time(), $id=ID, $old_value=format_value(lookup_ID(ID)), $new_value=format_value(new_value)); if ( location != "" ) diff --git a/scripts/base/frameworks/control/main.zeek b/scripts/base/frameworks/control/main.zeek index 20cb93c234..61bee75f37 100644 --- a/scripts/base/frameworks/control/main.zeek +++ b/scripts/base/frameworks/control/main.zeek @@ -74,7 +74,7 @@ export { global shutdown_response: event(); } -event terminate_event() +event terminate_event() &is_used { terminate(); } diff --git a/scripts/base/frameworks/logging/main.zeek b/scripts/base/frameworks/logging/main.zeek index 6c57173a47..1e611b5d75 100644 --- a/scripts/base/frameworks/logging/main.zeek +++ b/scripts/base/frameworks/logging/main.zeek @@ -587,7 +587,7 @@ global filters: table[ID, string] of Filter; module Log; # Used internally by the log manager. -function __default_rotation_postprocessor(info: RotationInfo) : bool +function __default_rotation_postprocessor(info: RotationInfo) : bool &is_used { if ( info$writer in default_rotation_postprocessors ) return default_rotation_postprocessors[info$writer](info); diff --git a/scripts/base/frameworks/software/main.zeek b/scripts/base/frameworks/software/main.zeek index b6a86ba644..a4a26fcc72 100644 --- a/scripts/base/frameworks/software/main.zeek +++ b/scripts/base/frameworks/software/main.zeek @@ -459,8 +459,9 @@ function software_endpoint_name(id: conn_id, host: addr): string return fmt("%s %s", host, (host == id$orig_h ? "client" : "server")); } -# Convert a version into a string "a.b.c-x". -function software_fmt_version(v: Version): string +# Convert a version into a string "a.b.c-x". Marked "&is_used" because +# while the base scripts don't call it, the optional policy/ scripts do. +function software_fmt_version(v: Version): string &is_used { return fmt("%s%s%s%s%s", v?$major ? fmt("%d", v$major) : "0", @@ -470,8 +471,8 @@ function software_fmt_version(v: Version): string v?$addl ? fmt("-%s", v$addl) : ""); } -# Convert a software into a string "name a.b.cx". -function software_fmt(i: Info): string +# Convert a software into a string "name a.b.cx". Same as above re "&is_used". +function software_fmt(i: Info): string &is_used { return fmt("%s %s", i$name, software_fmt_version(i$version)); } diff --git a/scripts/base/frameworks/sumstats/main.zeek b/scripts/base/frameworks/sumstats/main.zeek index 8f8638b57b..feb8154ff3 100644 --- a/scripts/base/frameworks/sumstats/main.zeek +++ b/scripts/base/frameworks/sumstats/main.zeek @@ -330,7 +330,7 @@ function compose_resultvals(rv1: ResultVal, rv2: ResultVal): ResultVal return result; } -function compose_results(r1: Result, r2: Result): Result +function compose_results(r1: Result, r2: Result): Result &is_used { local result: Result = table(); diff --git a/scripts/base/misc/find-filtered-trace.zeek b/scripts/base/misc/find-filtered-trace.zeek index 7d25e70a6f..511db74b10 100644 --- a/scripts/base/misc/find-filtered-trace.zeek +++ b/scripts/base/misc/find-filtered-trace.zeek @@ -13,7 +13,7 @@ export { global enable: bool = T &redef; } -function should_detect(): bool +function should_detect(): bool &is_used { local args = zeek_args(); diff --git a/scripts/base/protocols/ftp/main.zeek b/scripts/base/protocols/ftp/main.zeek index 9c00dbb475..f9da769fea 100644 --- a/scripts/base/protocols/ftp/main.zeek +++ b/scripts/base/protocols/ftp/main.zeek @@ -71,7 +71,7 @@ event zeek_init() &priority=5 # Establish the variable for tracking expected connections. global ftp_data_expected: table[addr, port] of Info &read_expire=5mins; -function minimize_info(info: Info): Info +function minimize_info(info: Info): Info &is_used { # Just minimal data for sending to other remote Zeek processes. # Generally, only data that's consistent across an entire FTP session or @@ -103,7 +103,7 @@ const directory_cmds = { ["XPWD", 257], }; -function ftp_relay_topic(): string +function ftp_relay_topic(): string &is_used { local rval = Cluster::rr_topic(Cluster::proxy_pool, "ftp_transfer_rr_key"); @@ -176,7 +176,7 @@ function ftp_message(s: Info) delete s$data_channel; } -event sync_add_expected_data(s: Info, chan: ExpectedDataChannel) +event sync_add_expected_data(s: Info, chan: ExpectedDataChannel) &is_used { @if ( Cluster::local_node_type() == Cluster::PROXY || Cluster::local_node_type() == Cluster::MANAGER ) @@ -189,7 +189,7 @@ event sync_add_expected_data(s: Info, chan: ExpectedDataChannel) @endif } -event sync_remove_expected_data(resp_h: addr, resp_p: port) +event sync_remove_expected_data(resp_h: addr, resp_p: port) &is_used { @if ( Cluster::local_node_type() == Cluster::PROXY || Cluster::local_node_type() == Cluster::MANAGER ) diff --git a/scripts/base/protocols/irc/dcc-send.zeek b/scripts/base/protocols/irc/dcc-send.zeek index 965f76b7fd..9687a4698e 100644 --- a/scripts/base/protocols/irc/dcc-send.zeek +++ b/scripts/base/protocols/irc/dcc-send.zeek @@ -33,7 +33,7 @@ export { global dcc_expected_transfers: table[addr, port] of Info &read_expire=5mins; -function dcc_relay_topic(): string +function dcc_relay_topic(): string &is_used { local rval = Cluster::rr_topic(Cluster::proxy_pool, "dcc_transfer_rr_key"); @@ -44,7 +44,7 @@ function dcc_relay_topic(): string return rval; } -event dcc_transfer_add(host: addr, p: port, info: Info) +event dcc_transfer_add(host: addr, p: port, info: Info) &is_used { @if ( Cluster::local_node_type() == Cluster::PROXY || Cluster::local_node_type() == Cluster::MANAGER ) @@ -56,7 +56,7 @@ event dcc_transfer_add(host: addr, p: port, info: Info) @endif } -event dcc_transfer_remove(host: addr, p: port) +event dcc_transfer_remove(host: addr, p: port) &is_used { @if ( Cluster::local_node_type() == Cluster::PROXY || Cluster::local_node_type() == Cluster::MANAGER )