From 7a867d52e23ab785be02061550a52c914039b099 Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Tue, 13 Jun 2023 15:03:03 -0700 Subject: [PATCH] Remove script functions marked as unused (6.1 deprecations) --- scripts/base/frameworks/notice/main.zeek | 9 ---- scripts/base/frameworks/signatures/main.zeek | 7 --- scripts/base/frameworks/software/main.zeek | 5 -- .../base/frameworks/sumstats/non-cluster.zeek | 12 ----- .../frameworks/sumstats/plugins/std-dev.zeek | 5 -- .../base/protocols/ftp/utils-commands.zeek | 7 --- scripts/base/protocols/radius/consts.zeek | 8 ++-- scripts/base/protocols/smb/smb1-main.zeek | 47 ------------------- 8 files changed, 4 insertions(+), 96 deletions(-) diff --git a/scripts/base/frameworks/notice/main.zeek b/scripts/base/frameworks/notice/main.zeek index 85830ae499..14bbbeb08f 100644 --- a/scripts/base/frameworks/notice/main.zeek +++ b/scripts/base/frameworks/notice/main.zeek @@ -584,15 +584,6 @@ function is_being_suppressed(n: Notice::Info): bool return F; } -# Executes a script with all of the notice fields put into the -# new process' environment as "ZEEK_ARG_" variables. -function execute_with_notice(cmd: string, n: Notice::Info) &deprecated="Remove in v6.1. Usage testing indicates this function is unused." - { - # TODO: fix system calls - #local tgs = tags(n); - #system_env(cmd, tags); - } - function create_file_info(f: fa_file): Notice::FileInfo { local fi: Notice::FileInfo = Notice::FileInfo($fuid = f$id, diff --git a/scripts/base/frameworks/signatures/main.zeek b/scripts/base/frameworks/signatures/main.zeek index 51760b5d1f..64d5df915a 100644 --- a/scripts/base/frameworks/signatures/main.zeek +++ b/scripts/base/frameworks/signatures/main.zeek @@ -148,13 +148,6 @@ event zeek_init() &priority=5 Log::create_stream(Signatures::LOG, [$columns=Info, $ev=log_signature, $path="signatures", $policy=log_policy]); } -# Returns true if the given signature has already been triggered for the given -# [orig, resp] pair. -function has_signature_matched(id: string, orig: addr, resp: addr): bool &deprecated="Remove in v6.1. Usage testing indicates this function is unused." - { - return [orig, resp] in vert_table ? id in vert_table[orig, resp] : F; - } - event sig_summary(orig: addr, id: string, msg: string) { NOTICE([$note=Signature_Summary, $src=orig, diff --git a/scripts/base/frameworks/software/main.zeek b/scripts/base/frameworks/software/main.zeek index 7e7631a4f3..70881304c1 100644 --- a/scripts/base/frameworks/software/main.zeek +++ b/scripts/base/frameworks/software/main.zeek @@ -454,11 +454,6 @@ function cmp_versions(v1: Version, v2: Version): int return 0; } -function software_endpoint_name(id: conn_id, host: addr): string &deprecated="Remove in v6.1. Usage testing indicates this function is unused." - { - return fmt("%s %s", host, (host == id$orig_h ? "client" : "server")); - } - # 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 diff --git a/scripts/base/frameworks/sumstats/non-cluster.zeek b/scripts/base/frameworks/sumstats/non-cluster.zeek index 5bf615fcaf..47d2f29eb4 100644 --- a/scripts/base/frameworks/sumstats/non-cluster.zeek +++ b/scripts/base/frameworks/sumstats/non-cluster.zeek @@ -71,18 +71,6 @@ function data_added(ss: SumStat, key: Key, result: Result) threshold_crossed(ss, key, result); } -function request(ss_name: string): ResultTable &deprecated="Remove in v6.1. Usage testing indicates this function is unused." - { - # This only needs to be implemented this way for cluster compatibility. - return when [ss_name] ( T ) - { - if ( ss_name in result_store ) - return result_store[ss_name]; - else - return table(); - } - } - function request_key(ss_name: string, key: Key): Result { # This only needs to be implemented this way for cluster compatibility. diff --git a/scripts/base/frameworks/sumstats/plugins/std-dev.zeek b/scripts/base/frameworks/sumstats/plugins/std-dev.zeek index a181923b10..fb5e5a0b4c 100644 --- a/scripts/base/frameworks/sumstats/plugins/std-dev.zeek +++ b/scripts/base/frameworks/sumstats/plugins/std-dev.zeek @@ -23,11 +23,6 @@ function calc_std_dev(rv: ResultVal) rv$std_dev = sqrt(rv$variance); } -hook std_dev_hook(r: Reducer, val: double, obs: Observation, rv: ResultVal) &deprecated="Remove in v6.1. Usage testing indicates this function is unused." - { - calc_std_dev(rv); - } - hook register_observe_plugins() &priority=-10 { register_observe_plugin(STD_DEV, function(r: Reducer, val: double, obs: Observation, rv: ResultVal) diff --git a/scripts/base/protocols/ftp/utils-commands.zeek b/scripts/base/protocols/ftp/utils-commands.zeek index 31466970a5..d14d8da97c 100644 --- a/scripts/base/protocols/ftp/utils-commands.zeek +++ b/scripts/base/protocols/ftp/utils-commands.zeek @@ -135,10 +135,3 @@ function remove_pending_cmd(pc: PendingCmds, ca: CmdArg): bool else return F; } - -function pop_pending_cmd(pc: PendingCmds, reply_code: count, reply_msg: string): CmdArg &deprecated="Remove in v6.1. Usage testing indicates this function is unused." - { - local ca = get_pending_cmd(pc, reply_code, reply_msg); - remove_pending_cmd(pc, ca); - return ca; - } diff --git a/scripts/base/protocols/radius/consts.zeek b/scripts/base/protocols/radius/consts.zeek index 06cb014e31..8b76021947 100644 --- a/scripts/base/protocols/radius/consts.zeek +++ b/scripts/base/protocols/radius/consts.zeek @@ -182,7 +182,7 @@ const attr_types: table[count] of string = { [171] = "Delegated-IPv6-Prefix-Pool", [172] = "Stateful-IPv6-Address-Pool", [173] = "IPv6-6rd-Configuration" -} &default=function(i: count): string { return fmt("unknown-%d", i); } &deprecated="Remove in v6.1. Usage testing indicates this function is unused."; +} &default=function(i: count): string { return fmt("unknown-%d", i); } &is_used; const nas_port_types: table[count] of string = { [0] = "Async", @@ -205,7 +205,7 @@ const nas_port_types: table[count] of string = { [17] = "Cable", [18] = "Wireless - Other", [19] = "Wireless - IEEE 802.11" -} &default=function(i: count): string { return fmt("unknown-%d", i); } &deprecated="Remove in v6.1. Usage testing indicates this function is unused."; +} &default=function(i: count): string { return fmt("unknown-%d", i); } &is_used; const service_types: table[count] of string = { [1] = "Login", @@ -219,7 +219,7 @@ const service_types: table[count] of string = { [9] = "Callback NAS Prompt", [10] = "Call Check", [11] = "Callback Administrative", -} &default=function(i: count): string { return fmt("unknown-%d", i); } &deprecated="Remove in v6.1. Usage testing indicates this function is unused."; +} &default=function(i: count): string { return fmt("unknown-%d", i); } &is_used; const framed_protocol_types: table[count] of string = { [1] = "PPP", @@ -228,4 +228,4 @@ const framed_protocol_types: table[count] of string = { [4] = "Gandalf proprietary SingleLink/MultiLink protocol", [5] = "Xylogics proprietary IPX/SLIP", [6] = "X.75 Synchronous" -} &default=function(i: count): string { return fmt("unknown-%d", i); } &deprecated="Remove in v6.1. Usage testing indicates this function is unused."; +} &default=function(i: count): string { return fmt("unknown-%d", i); } &is_used; diff --git a/scripts/base/protocols/smb/smb1-main.zeek b/scripts/base/protocols/smb/smb1-main.zeek index cb6831d708..68a5ecbaee 100644 --- a/scripts/base/protocols/smb/smb1-main.zeek +++ b/scripts/base/protocols/smb/smb1-main.zeek @@ -274,50 +274,3 @@ event smb1_write_andx_request(c: connection, hdr: SMB1::Header, file_id: count, c$smb_state$pipe_map[file_id] = c$smb_state$current_file$uuid; } - -event smb_pipe_bind_ack_response(c: connection, hdr: SMB1::Header) &deprecated="Remove in v6.1. Usage testing indicates this function is unused." - { - if ( ! c$smb_state?$current_file || ! c$smb_state$current_file?$uuid ) - { - # TODO: figure out why the uuid isn't getting set sometimes. - return; - } - - c$smb_state$current_cmd$sub_command = "RPC_BIND_ACK"; - c$smb_state$current_cmd$argument = SMB::rpc_uuids[c$smb_state$current_file$uuid]; - } - -event smb_pipe_bind_request(c: connection, hdr: SMB1::Header, uuid: string, version: string) &deprecated="Remove in v6.1. Usage testing indicates this function is unused." - { - if ( ! c$smb_state?$current_file || ! c$smb_state$current_file?$uuid ) - { - # TODO: figure out why the current_file isn't getting set sometimes. - return; - } - - c$smb_state$current_cmd$sub_command = "RPC_BIND"; - c$smb_state$current_file$uuid = uuid; - c$smb_state$current_cmd$argument = fmt("%s v%s", SMB::rpc_uuids[uuid], version); - } - -event smb_pipe_request(c: connection, hdr: SMB1::Header, op_num: count) &deprecated="Remove in v6.1. Usage testing indicates this function is unused." - { - if ( ! c$smb_state?$current_file ) - { - # TODO: figure out why the current file isn't being set sometimes. - return; - } - - local f = c$smb_state$current_file; - if ( ! f?$uuid ) - { - # TODO: figure out why this is happening. - Reporter::conn_weird("smb_pipe_request_missing_uuid", c, ""); - return; - } - local arg = fmt("%s: %s", - SMB::rpc_uuids[f$uuid], - SMB::rpc_sub_cmds[f$uuid][op_num]); - - c$smb_state$current_cmd$argument = arg; - }