diff --git a/scripts/base/frameworks/cluster/main.zeek b/scripts/base/frameworks/cluster/main.zeek index 45aff74d70..af2b96f0d6 100644 --- a/scripts/base/frameworks/cluster/main.zeek +++ b/scripts/base/frameworks/cluster/main.zeek @@ -211,12 +211,6 @@ export { ## Returns: The :zeek:type:`Cluster::NodeType` the calling node acts as. global local_node_type: function(): NodeType; - ## This gives the value for the number of workers currently connected to, - ## and it's maintained internally by the cluster framework. It's - ## primarily intended for use by managers to find out how many workers - ## should be responding to requests. - global worker_count: count = 0 &deprecated="Remove in v6.1. Active worker count can be obtained via get_active_node_count(Cluster::WORKER)"; - ## The cluster layout definition. This should be placed into a filter ## named cluster-layout.zeek somewhere in the ZEEKPATH. It will be ## automatically loaded if the CLUSTER_NODE environment variable is set. @@ -372,11 +366,6 @@ event Cluster::hello(name: string, id: string) &priority=10 if ( n$node_type !in active_node_ids ) active_node_ids[n$node_type] = set(); add active_node_ids[n$node_type][id]; - -@pragma push ignore-deprecations - if ( n$node_type == WORKER ) - worker_count = get_active_node_count(WORKER); -@pragma pop ignore-deprecations } event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string) &priority=10 @@ -398,11 +387,6 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string) &priority=1 delete n$id; delete active_node_ids[n$node_type][endpoint$id]; -@pragma push ignore-deprecations - if ( n$node_type == WORKER ) - worker_count = get_active_node_count(WORKER); -@pragma pop ignore-deprecations - event Cluster::node_down(node_name, endpoint$id); break; } diff --git a/scripts/base/init-bare.zeek b/scripts/base/init-bare.zeek index ec809377de..3461a54146 100644 --- a/scripts/base/init-bare.zeek +++ b/scripts/base/init-bare.zeek @@ -623,10 +623,6 @@ type fa_metadata: record { inferred: bool &default=T; }; -## Same as :zeek:see:`Analyzer::disabling_analyzer`, but deprecated due -## to living in the global namespace. -type disabling_analyzer: hook(c: connection, atype: AllAnalyzers::Tag, aid: count) &redef &deprecated="Remove in v6.1. Use Analyzer::disabling_analyzer() instead."; - module Analyzer; export { ## A hook taking a connection, analyzer tag and analyzer id that can be @@ -1136,7 +1132,7 @@ type entropy_test_result: record { ## Return type for from_json BIF. ## ## .. zeek:see:: from_json -type from_json_result: record { +type from_json_result: record { v: any &optional; ##< Parsed value. valid: bool; ##< True if parsing was successful. }; @@ -4780,7 +4776,6 @@ export { type SNMP::BulkPDU: record { request_id: int; non_repeaters: count; - max_repititions: count &deprecated="Remove in v6.1. Use max_repetitions instead"; max_repetitions: count; bindings: SNMP::Bindings; }; @@ -5201,21 +5196,6 @@ export { ## Setting this to zero will disable all types of tunnel decapsulation. const max_depth: count = 2 &redef; - ## Toggle whether to do IPv{4,6}-in-IPv{4,6} decapsulation. - const enable_ip = T &redef &deprecated="Remove in v6.1. Tunnel analyzers can be toggled with enable_analyzer()/disable_analyzer() or disabled through Analyzer::disabled_analyzers"; - - ## Toggle whether to do IPv{4,6}-in-AYIYA decapsulation. - const enable_ayiya = T &redef &deprecated="Remove in v6.1. Tunnel analyzers can be toggled with enable_analyzer()/disable_analyzer() or disabled through Analyzer::disabled_analyzers"; - - ## Toggle whether to do IPv6-in-Teredo decapsulation. - const enable_teredo = T &redef &deprecated="Remove in v6.1. Tunnel analyzers can be toggled with enable_analyzer()/disable_analyzer() or disabled through Analyzer::disabled_analyzers"; - - ## Toggle whether to do GTPv1 decapsulation. - const enable_gtpv1 = T &redef &deprecated="Remove in v6.1. Tunnel analyzers can be toggled with enable_analyzer()/disable_analyzer() or disabled through Analyzer::disabled_analyzers"; - - ## Toggle whether to do GRE decapsulation. - const enable_gre = T &redef &deprecated="Remove in v6.1. Tunnel analyzers can be toggled with enable_analyzer()/disable_analyzer() or disabled through Analyzer::disabled_analyzers"; - ## With this set, the Teredo analyzer waits until it sees both sides ## of a connection using a valid Teredo encapsulation before issuing ## a :zeek:see:`analyzer_confirmation`. If it's false, the first diff --git a/src/3rdparty b/src/3rdparty index 410ada8bbe..c2763e952e 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 410ada8bbe5839807a459a99c1b77221f790f1be +Subproject commit c2763e952ea899f86bec2b60f840d38861cefd03 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 627bb17c57..413f0639fb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -422,7 +422,6 @@ set(MAIN_SRCS digest.h) set(THIRD_PARTY_SRCS - 3rdparty/bro_inet_ntop.c # Remove in v6.1. 3rdparty/zeek_inet_ntop.c 3rdparty/bsd-getopt-long.c 3rdparty/ConvertUTF.c @@ -622,7 +621,6 @@ install( install( FILES ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/ConvertUTF.h - ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/bro_inet_ntop.h # Remove in v6.1 ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/zeek_inet_ntop.h ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/bsd-getopt-long.h ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/modp_numtoa.h diff --git a/src/Dict.h b/src/Dict.h index d33e6d597b..e61faf5c66 100644 --- a/src/Dict.h +++ b/src/Dict.h @@ -169,13 +169,6 @@ public: 0 == memcmp(GetKey(), arg_key, key_size); } - template - [[deprecated("Remove in v6.1. Access the value in the entry directly.")]] T* GetValue() const - { - static_assert(std::is_same_v, "Type of DictEntry and type requested are different"); - return value; - } - bool operator==(const DictEntry& r) const { return Equal(r.GetKey(), r.key_size, r.hash); } bool operator!=(const DictEntry& r) const { return ! Equal(r.GetKey(), r.key_size, r.hash); } }; diff --git a/src/Expr.h b/src/Expr.h index 73658b6e47..97127629b0 100644 --- a/src/Expr.h +++ b/src/Expr.h @@ -106,8 +106,6 @@ enum ExprTag : int #define NUM_EXPRS (int(EXPR_NOP) + 1) }; -using BroExprTag [[deprecated("Remove in v6.1. Use ExprTag.")]] = ExprTag; - extern const char* expr_name(ExprTag t); class AddToExpr; diff --git a/src/Obj.cc b/src/Obj.cc index 47bbf1462d..1bf384aeb4 100644 --- a/src/Obj.cc +++ b/src/Obj.cc @@ -60,17 +60,7 @@ int Obj::suppress_errors = 0; Obj::~Obj() { if ( notify_plugins ) - { -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - PLUGIN_HOOK_VOID(HOOK_BRO_OBJ_DTOR, HookBroObjDtor(this)); -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif PLUGIN_HOOK_VOID(HOOK_OBJ_DTOR, HookObjDtor(this)); - } delete location; } diff --git a/src/Type.cc b/src/Type.cc index 97542ee008..c07a7b5fec 100644 --- a/src/Type.cc +++ b/src/Type.cc @@ -1398,18 +1398,6 @@ void RecordType::AddFieldsDirectly(const type_decl_list& others, bool add_log_at num_fields = types->length(); } -void RecordType::Create(std::vector>& r) const - { - for ( auto& di : deferred_inits ) - if ( di ) - r.push_back(di->Generate()); - else - r.push_back(std::nullopt); - - for ( auto& ci : creation_inits ) - r[ci.first] = ci.second->Generate(); - } - void RecordType::DescribeFields(ODesc* d) const { if ( d->IsReadable() ) @@ -2692,31 +2680,6 @@ TypePtr merge_types(const TypePtr& arg_t1, const TypePtr& arg_t2) } } -TypePtr merge_type_list(detail::ListExpr* elements) - { - TypeList* tl_type = elements->GetType()->AsTypeList(); - const auto& tl = tl_type->GetTypes(); - - if ( tl.size() < 1 ) - { - reporter->Error("no type can be inferred for empty list"); - return nullptr; - } - - auto t = tl[0]; - - if ( tl.size() == 1 ) - return t; - - for ( size_t i = 1; t && i < tl.size(); ++i ) - t = merge_types(t, tl[i]); - - if ( ! t ) - reporter->Error("inconsistent types in list"); - - return t; - } - TypePtr maximal_type(detail::ListExpr* elements) { TypeList* tl_type = elements->GetType()->AsTypeList(); diff --git a/src/Type.h b/src/Type.h index be7667d8bf..020ab6e358 100644 --- a/src/Type.h +++ b/src/Type.h @@ -688,15 +688,6 @@ public: void AddFieldsDirectly(const type_decl_list& types, bool add_log_attr = false); - /** - * - * Populates a new instance of the record with its initial values. - * @param r The record's underlying value vector. - */ - [[deprecated("Remove in v6.1. Construct a corresponding RecordVal and build vector from " - "GetFieldAs() calls.")]] void - Create(std::vector>& r) const; - void DescribeReST(ODesc* d, bool roles_only = false) const override; void DescribeFields(ODesc* d) const; void DescribeFieldsReST(ODesc* d, bool func_args) const; @@ -949,12 +940,6 @@ extern TypeTag max_type(TypeTag t1, TypeTag t2); // an error message) if the types are incompatible. TypePtr merge_types(const TypePtr& t1, const TypePtr& t2); -// Given a list of expressions, returns a (ref'd) type reflecting -// a merged type consistent across all of them, or nil if this -// cannot be done. -[[deprecated("Remove in v6.1. Use maximal_type() if possible. See GH-2604.")]] TypePtr -merge_type_list(detail::ListExpr* elements); - // Given a list of expressions, returns the maximal type consistent across // all of them, or nil if this cannot be done. "Maximal" incorporates // notions of arithmetic coercion, but otherwise requires type-equivalence. diff --git a/src/UID.h b/src/UID.h index 326d568f9f..31ed6efae5 100644 --- a/src/UID.h +++ b/src/UID.h @@ -98,5 +98,3 @@ inline UID& UID::operator=(const UID& other) } } // namespace zeek - -constexpr int BRO_UID_LEN [[deprecated("Remove in v6.1. Use zeek::UID_LEN")]] = zeek::UID_LEN; diff --git a/src/ZeekString.h b/src/ZeekString.h index 2775bb30d9..c1b56c8e49 100644 --- a/src/ZeekString.h +++ b/src/ZeekString.h @@ -104,9 +104,6 @@ public: static constexpr int ZEEK_STRING_LITERAL = // as in a Zeek string literal ESC_ESC | ESC_QUOT | ESC_HEX; - static constexpr int BRO_STRING_LITERAL - [[deprecated("Remove in v6.1. Use ZEEK_STRING_LITERAL.")]] = ZEEK_STRING_LITERAL; - // Renders a string into a newly allocated character array that // you have to delete[]. You can combine the render styles given // above to achieve the representation you desire. If you pass a diff --git a/src/analyzer/protocol/snmp/snmp-analyzer.pac b/src/analyzer/protocol/snmp/snmp-analyzer.pac index 6291f39781..9ba78073c0 100644 --- a/src/analyzer/protocol/snmp/snmp-analyzer.pac +++ b/src/analyzer/protocol/snmp/snmp-analyzer.pac @@ -195,9 +195,7 @@ zeek::RecordValPtr build_bulk_pdu(const GetBulkRequestPDU* pdu) rv->Assign(0, asn1_integer_to_val(pdu->request_id(), zeek::TYPE_INT)); rv->Assign(1, asn1_integer_to_val(pdu->non_repeaters(), zeek::TYPE_COUNT)); rv->Assign(2, asn1_integer_to_val(pdu->max_repetitions(), zeek::TYPE_COUNT)); - // Remove in v6.1: Misspelled repititions/repetitions backwards compat - rv->Assign(3, asn1_integer_to_val(pdu->max_repetitions(), zeek::TYPE_COUNT)); - rv->Assign(4, build_bindings(pdu->var_bindings())); + rv->Assign(3, build_bindings(pdu->var_bindings())); return rv; } %} diff --git a/src/analyzer/protocol/tcp/ContentLine.h b/src/analyzer/protocol/tcp/ContentLine.h index e3bf59516a..92cc4c84c1 100644 --- a/src/analyzer/protocol/tcp/ContentLine.h +++ b/src/analyzer/protocol/tcp/ContentLine.h @@ -22,11 +22,6 @@ public: void SuppressWeirds(bool enable) { suppress_weirds = enable; }; - [[deprecated("Remove in v6.1. Use SuppressWeirds() instead.")]] void SupressWeirds(bool enable) - { - SuppressWeirds(enable); - } - // If enabled, flag (first) line with embedded NUL. Default off. void SetIsNULSensitive(bool enable) { flag_NULs = enable; } diff --git a/src/const.bif b/src/const.bif index 55d5222f47..1ae177335d 100644 --- a/src/const.bif +++ b/src/const.bif @@ -23,11 +23,6 @@ const NFS3::return_data_max: count; const NFS3::return_data_first_only: bool; const Tunnel::max_depth: count; -const Tunnel::enable_ip: bool; -const Tunnel::enable_ayiya: bool; -const Tunnel::enable_teredo: bool; -const Tunnel::enable_gtpv1: bool; -const Tunnel::enable_gre: bool; const Tunnel::delay_teredo_confirmation: bool; const Tunnel::delay_gtp_confirmation: bool; const Tunnel::ip_tunnel_timeout: interval; diff --git a/src/packet_analysis/protocol/ayiya/AYIYA.cc b/src/packet_analysis/protocol/ayiya/AYIYA.cc index f1ff574e56..3ed64df1e4 100644 --- a/src/packet_analysis/protocol/ayiya/AYIYA.cc +++ b/src/packet_analysis/protocol/ayiya/AYIYA.cc @@ -10,9 +10,6 @@ AYIYAAnalyzer::AYIYAAnalyzer() : zeek::packet_analysis::Analyzer("AYIYA") { } bool AYIYAAnalyzer::AnalyzePacket(size_t len, const uint8_t* data, Packet* packet) { - if ( ! BifConst::Tunnel::enable_ayiya ) - return false; - // AYIYA always comes from a TCP or UDP connection, which means that session // should always be valid and always be a connection. Return a weird if we // didn't have a session stored. @@ -83,9 +80,6 @@ bool AYIYAAnalyzer::AnalyzePacket(size_t len, const uint8_t* data, Packet* packe bool AYIYAAnalyzer::DetectProtocol(size_t len, const uint8_t* data, Packet* packet) { - if ( ! BifConst::Tunnel::enable_ayiya ) - return false; - // These magic numbers are based on the old DPD entry, which was based on... something? return len >= 3 && data[1] == 0x52 && data[2] == 0x11; } diff --git a/src/packet_analysis/protocol/gre/GRE.cc b/src/packet_analysis/protocol/gre/GRE.cc index 9c1cf311ed..95f77f4dd3 100644 --- a/src/packet_analysis/protocol/gre/GRE.cc +++ b/src/packet_analysis/protocol/gre/GRE.cc @@ -46,12 +46,6 @@ bool GREAnalyzer::AnalyzePacket(size_t len, const uint8_t* data, Packet* packet) return false; } - if ( ! BifConst::Tunnel::enable_gre ) - { - Weird("GRE_tunnel", packet); - return false; - } - if ( len < gre_header_len() ) { Weird("truncated_GRE", packet); diff --git a/src/packet_analysis/protocol/iptunnel/IPTunnel.cc b/src/packet_analysis/protocol/iptunnel/IPTunnel.cc index 1bfb69b09d..83032b90c9 100644 --- a/src/packet_analysis/protocol/iptunnel/IPTunnel.cc +++ b/src/packet_analysis/protocol/iptunnel/IPTunnel.cc @@ -28,12 +28,6 @@ bool IPTunnelAnalyzer::AnalyzePacket(size_t len, const uint8_t* data, Packet* pa return false; } - if ( ! BifConst::Tunnel::enable_ip ) - { - Weird("IP_tunnel", packet); - return false; - } - if ( packet->encap && packet->encap->Depth() >= BifConst::Tunnel::max_depth ) { Weird("exceeded_tunnel_max_depth", packet); diff --git a/src/packet_analysis/protocol/teredo/Teredo.cc b/src/packet_analysis/protocol/teredo/Teredo.cc index efab374028..e487441227 100644 --- a/src/packet_analysis/protocol/teredo/Teredo.cc +++ b/src/packet_analysis/protocol/teredo/Teredo.cc @@ -153,9 +153,6 @@ TeredoAnalyzer::TeredoAnalyzer() : zeek::packet_analysis::Analyzer("TEREDO") bool TeredoAnalyzer::AnalyzePacket(size_t len, const uint8_t* data, Packet* packet) { - if ( ! BifConst::Tunnel::enable_teredo ) - return false; - // Teredo always comes from a UDP connection, which means that session should always // be valid and always be a connection. Store this off for the span of the // processing so that it can be used for other things. Return a weird if we didn't @@ -267,9 +264,6 @@ bool TeredoAnalyzer::AnalyzePacket(size_t len, const uint8_t* data, Packet* pack bool TeredoAnalyzer::DetectProtocol(size_t len, const uint8_t* data, Packet* packet) { - if ( ! BifConst::Tunnel::enable_teredo ) - return false; - // Do some fast checks that must be true before moving to more complicated ones. // Mostly this avoids doing the regex below if we can help it. if ( (len < 40) || ((len > 8) && ((data[0] >> 4) != 6) && diff --git a/src/plugin/Manager.cc b/src/plugin/Manager.cc index 12884fdc6b..3d4f84b653 100644 --- a/src/plugin/Manager.cc +++ b/src/plugin/Manager.cc @@ -699,11 +699,6 @@ void Manager::RequestEvent(EventHandlerPtr handler, Plugin* plugin) handler->SetGenerateAlways(); } -void Manager::RequestBroObjDtor(Obj* obj, Plugin* plugin) - { - obj->NotifyPluginsOnDtor(); - } - void Manager::RequestObjDtor(Obj* obj, Plugin* plugin) { obj->NotifyPluginsOnDtor(); @@ -922,57 +917,6 @@ void Manager::HookUpdateNetworkTime(double network_time) const MetaHookPost(HOOK_UPDATE_NETWORK_TIME, args, HookArgument()); } -void Manager::HookBroObjDtor(void* obj) const - { - HookArgumentList args; - - if ( HavePluginForHook(META_HOOK_PRE) ) - { - args.push_back(HookArgument(obj)); -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - MetaHookPre(HOOK_BRO_OBJ_DTOR, args); -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif - } - -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - hook_list* l = hooks[HOOK_BRO_OBJ_DTOR]; -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif - - if ( l ) - for ( hook_list::iterator i = l->begin(); i != l->end(); ++i ) - { - Plugin* p = (*i).second; -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - p->HookBroObjDtor(obj); -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif - } - - if ( HavePluginForHook(META_HOOK_POST) ) -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - MetaHookPost(HOOK_BRO_OBJ_DTOR, args, HookArgument()); -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif - } - void Manager::HookObjDtor(void* obj) const { HookArgumentList args; diff --git a/src/plugin/Manager.h b/src/plugin/Manager.h index 7278a1b582..d11cef0a06 100644 --- a/src/plugin/Manager.h +++ b/src/plugin/Manager.h @@ -217,18 +217,6 @@ public: */ void RequestEvent(EventHandlerPtr handler, Plugin* plugin); - /** - * Register interest in the destruction of a Obj instance. When Zeek's - * reference counting triggers the objects destructor to run, the \a - * HookBroObjDtor will be called. - * - * @param handler The object being interested in. - * - * @param plugin The plugin expressing interest. - */ - [[deprecated("Remove in v6.1. Use RequestObjDtor.")]] void RequestBroObjDtor(Obj* obj, - Plugin* plugin); - /** * Register interest in the destruction of a Obj instance. When Zeek's * reference counting triggers the objects destructor to run, the \a @@ -332,12 +320,6 @@ public: */ void HookDrainEvents() const; - /** - * Hook that informs plugins that an Obj is being destroyed. Will be - * called only for objects that a plugin has expressed interest in. - */ - [[deprecated("Remove in v6.1. Use HookObjDtor.")]] void HookBroObjDtor(void* obj) const; - /** * Hook that informs plugins that an Obj is being destroyed. Will be * called only for objects that a plugin has expressed interest in. diff --git a/src/plugin/Plugin.cc b/src/plugin/Plugin.cc index af005a40f9..21fbf37341 100644 --- a/src/plugin/Plugin.cc +++ b/src/plugin/Plugin.cc @@ -27,7 +27,6 @@ const char* hook_name(HookType h) "QueueEvent", "DrainEvents", "UpdateNetworkTime", - "BroObjDtor", "SetupAnalyzerTree", "LogInit", "LogWrite", @@ -381,18 +380,6 @@ void Plugin::RequestEvent(EventHandlerPtr handler) plugin_mgr->RequestEvent(handler, this); } -void Plugin::RequestBroObjDtor(Obj* obj) - { -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - plugin_mgr->RequestBroObjDtor(obj, this); -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif - } - void Plugin::RequestObjDtor(Obj* obj) { plugin_mgr->RequestObjDtor(obj, this); @@ -427,8 +414,6 @@ void Plugin::HookUpdateNetworkTime(double network_time) { } void Plugin::HookSetupAnalyzerTree(Connection* conn) { } -void Plugin::HookBroObjDtor(void* obj) { } - void Plugin::HookObjDtor(void* obj) { } void Plugin::HookLogInit(const std::string& writer, const std::string& instantiating_filter, diff --git a/src/plugin/Plugin.h b/src/plugin/Plugin.h index d4f34f28ff..89c0d3515a 100644 --- a/src/plugin/Plugin.h +++ b/src/plugin/Plugin.h @@ -18,8 +18,6 @@ // building Zeek itself. #ifndef ZEEK_PLUGIN_SKIP_VERSION_CHECK #include "zeek/zeek-version.h" -// Remove the BRO define in v6.1. -#define BRO_PLUGIN_BRO_VERSION ZEEK_VERSION_FUNCTION #define ZEEK_PLUGIN_ZEEK_VERSION ZEEK_VERSION_FUNCTION #endif @@ -77,7 +75,6 @@ enum HookType HOOK_QUEUE_EVENT, //< Activates Plugin::HookQueueEvent(). HOOK_DRAIN_EVENTS, //< Activates Plugin::HookDrainEvents(). HOOK_UPDATE_NETWORK_TIME, //< Activates Plugin::HookUpdateNetworkTime(). - HOOK_BRO_OBJ_DTOR [[deprecated("Remove in v6.1. Use HOOK_OBJ_DTOR.")]], HOOK_SETUP_ANALYZER_TREE, //< Activates Plugin::HookAddToAnalyzerTree(). HOOK_LOG_INIT, //< Activates Plugin::HookLogInit(). HOOK_LOG_WRITE, //< Activates Plugin::HookLogWrite(). @@ -126,10 +123,6 @@ public: // We force this to inline so that the API version gets hardcoded // into the external plugin. (Technically, it's not a "force", just a // strong hint.). The attribute seems generally available. -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif inline Configuration() __attribute__((always_inline)) { // Only bake in a ZEEK_PLUGIN_ZEEK_VERSION reference into external plugins. The @@ -138,55 +131,30 @@ public: // CMakeLists.txt file for the Zeek::Internal target, which only exists when // building Zeek itself. #ifndef ZEEK_PLUGIN_SKIP_VERSION_CHECK - bro_version = ZEEK_PLUGIN_ZEEK_VERSION; zeek_version = ZEEK_PLUGIN_ZEEK_VERSION; #endif } -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif Configuration(Configuration&& c) { - bro_version = std::move(c.bro_version); zeek_version = std::move(c.zeek_version); name = std::move(c.name); description = std::move(c.description); version = std::move(c.version); } -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif Configuration(const Configuration& c) { - bro_version = c.bro_version; zeek_version = c.zeek_version; name = c.name; description = c.description; version = c.version; } -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif Configuration& operator=(Configuration&& c) { - bro_version = std::move(c.bro_version); zeek_version = std::move(c.zeek_version); name = std::move(c.name); @@ -195,17 +163,9 @@ public: return *this; } -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif Configuration& operator=(const Configuration& c) { - bro_version = c.bro_version; zeek_version = c.zeek_version; name = c.name; @@ -214,24 +174,8 @@ public: return *this; } -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif ~Configuration() { } -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif - - /** - * One can assign ZEEK_PLUGIN_ZEEK_VERSION to this to catch - * version mismatches at link(!) time. - */ - [[deprecated("Remove in v6.1. Use zeek_version.")]] std::function bro_version; /** * One can assign ZEEK_PLUGIN_ZEEK_VERSION to this to catch @@ -847,11 +791,6 @@ public: */ bool LoadZeekFile(const std::string& file); - [[deprecated("Remove in v6.1. Use LoadZeekFile.")]] bool LoadBroFile(const std::string& file) - { - return LoadZeekFile(file); - } - protected: friend class Manager; @@ -936,17 +875,6 @@ protected: */ void RequestEvent(EventHandlerPtr handler); - /** - * Registers interest in the destruction of a Obj instance. When - * Zeek's reference counting triggers the objects destructor to run, - * \a HookBroObjDtor will be called. - * - * Note that this can get expensive if triggered for many objects. - * - * @param obj The object being interested in. - */ - [[deprecated("Remove in v6.1. Use RequestObjDtor.")]] void RequestBroObjDtor(Obj* obj); - /** * Registers interest in the destruction of a Obj instance. When * Zeek's reference counting triggers the objects destructor to run, @@ -1092,18 +1020,6 @@ protected: */ virtual void HookSetupAnalyzerTree(Connection* conn); - /** - * Hook for destruction of objects registered with - * RequestBroObjDtor(). When Zeek's reference counting triggers the - * objects destructor to run, this method will be run. It may also - * run for other objects that this plugin has not registered for. - * - * @param obj A pointer to the object being destroyed. Note that the - * object is already considered invalid and the pointer must not be - * dereferenced. - */ - [[deprecated("Remove in v6.1. Use HookObjDtor.")]] virtual void HookBroObjDtor(void* obj); - /** * Hook for destruction of objects registered with * RequestObjDtor(). When Zeek's reference counting triggers the @@ -1276,8 +1192,3 @@ private: } // namespace plugin } // namespace zeek - -// Increase this when making incompatible changes to the plugin API. Note -// that the constant is never used in C code. It's picked up on by CMake. -constexpr int BRO_PLUGIN_API_VERSION - [[deprecated("Remove in v6.1. Use zeek::PLUGIN_API_VERSION")]] = zeek::PLUGIN_API_VERSION; diff --git a/src/util.h b/src/util.h index fda04cc899..9376f008d4 100644 --- a/src/util.h +++ b/src/util.h @@ -102,8 +102,6 @@ inline constexpr std::string_view path_list_separator = ":"; using zeek_int_t = int64_t; using zeek_uint_t = uint64_t; -using bro_int_t [[deprecated("Remove in v6.1. Use zeek_int_t.")]] = zeek_int_t; -using bro_uint_t [[deprecated("Remove in v6.1. Use zeek_uint_t.")]] = zeek_uint_t; #ifndef HAVE_STRCASESTR extern char* strcasestr(const char* s, const char* find); diff --git a/src/zeek.bif b/src/zeek.bif index 1ad2324e04..f1ddc87274 100644 --- a/src/zeek.bif +++ b/src/zeek.bif @@ -4270,7 +4270,7 @@ static bool mmdb_try_open_asn () ## ## Returns: A boolean indicating whether the db was successfully opened. ## -## .. zeek:see:: lookup_asn lookup_autonomous_system +## .. zeek:see:: lookup_autonomous_system function mmdb_open_location_db%(f: string%) : bool %{ #ifdef USE_GEOIP @@ -4280,14 +4280,14 @@ function mmdb_open_location_db%(f: string%) : bool #endif %} -## Initializes MMDB for later use of lookup_asn or lookup_autonomous_system. +## Initializes MMDB for later use of lookup_autonomous_system. ## Requires Zeek to be built with ``libmaxminddb``. ## ## f: The filename of the MaxMind ASN DB. ## ## Returns: A boolean indicating whether the db was successfully opened. ## -## .. zeek:see:: lookup_asn lookup_autonomous_system +## .. zeek:see:: lookup_autonomous_system function mmdb_open_asn_db%(f: string%) : bool %{ #ifdef USE_GEOIP @@ -4304,7 +4304,7 @@ function mmdb_open_asn_db%(f: string%) : bool ## ## Returns: A record with country, region, city, latitude, and longitude. ## -## .. zeek:see:: lookup_asn lookup_autonomous_system +## .. zeek:see:: lookup_autonomous_system function lookup_location%(a: addr%) : geo_location %{ static auto geo_location = zeek::id::find_type("geo_location"); @@ -4383,62 +4383,6 @@ function lookup_location%(a: addr%) : geo_location return location; %} -## Performs an ASN lookup of an IP address. -## Requires Zeek to be built with ``libmaxminddb``. -## -## a: The IP address to lookup. -## -## Returns: The number of the ASN that contains the IP address. -## -## .. zeek:see:: lookup_location lookup_autonomous_system -function lookup_asn%(a: addr%) : count &deprecated="Remove in v6.1. Functionality is now handled by lookup_autonomous_system()." - %{ -#ifdef USE_GEOIP - mmdb_check_asn(); - if ( ! mmdb_asn ) - { - if ( ! mmdb_try_open_asn() ) - { - if ( ! did_mmdb_asn_db_error ) - { - did_mmdb_asn_db_error = true; - zeek::emit_builtin_error("Failed to open GeoIP ASN database"); - } - - return zeek::val_mgr->Count(0); - } - } - - MMDB_lookup_result_s result; - - if ( mmdb_lookup_asn(a->AsAddr(), result) ) - { - MMDB_entry_data_s entry_data; - int status; - - // Get Autonomous System Number - status = MMDB_get_value(&result.entry, &entry_data, - "autonomous_system_number", nullptr); - auto asn = mmdb_getvalue(&entry_data, status, MMDB_DATA_TYPE_UINT32); - return asn == nullptr ? zeek::val_mgr->Count(0) : asn; - } - -#else // not USE_GEOIP - static int missing_geoip_reported = 0; - - if ( ! missing_geoip_reported ) - { - zeek::emit_builtin_error("Zeek was not configured for GeoIP ASN support"); - missing_geoip_reported = 1; - } -#endif - - // We can get here even if we have GeoIP support, if we weren't - // able to initialize it or it didn't return any information for - // the address. - return zeek::val_mgr->Count(0); - %} - ## Performs an lookup of AS number & organization of an IP address. ## Requires Zeek to be built with ``libmaxminddb``. ## @@ -4446,7 +4390,7 @@ function lookup_asn%(a: addr%) : count &deprecated="Remove in v6.1. Functionali ## ## Returns: A record with autonomous system number and organization that contains *a*. ## -## .. zeek:see:: lookup_location lookup_asn +## .. zeek:see:: lookup_location function lookup_autonomous_system%(a: addr%) : geo_autonomous_system %{ static auto geo_autonomous_system = zeek::id::find_type("geo_autonomous_system"); @@ -4682,9 +4626,7 @@ function disable_analyzer%(cid: conn_id, aid: count, err_if_no_conn: bool &defau return zeek::val_mgr->False(); } - // Remove in v6.1: Global disabling_analyzer is to be removed. - static auto disabling_analyzer_hook = id::find_func("disabling_analyzer"); - static auto analyzer_disabling_analyzer_hook = id::find_func("Analyzer::disabling_analyzer"); + static auto disabling_analyzer_hook = id::find_func("Analyzer::disabling_analyzer"); if ( disabling_analyzer_hook ) { @@ -4694,14 +4636,6 @@ function disable_analyzer%(cid: conn_id, aid: count, err_if_no_conn: bool &defau return zeek::val_mgr->False(); } - if ( analyzer_disabling_analyzer_hook ) - { - auto hook_rval = analyzer_disabling_analyzer_hook->Invoke(c->GetVal(), a->GetAnalyzerTag().AsVal(), - zeek::val_mgr->Count(aid)); - if ( hook_rval && ! hook_rval->AsBool() ) - return zeek::val_mgr->False(); - } - if ( prevent ) a->Parent()->PreventChildren(a->GetAnalyzerTag()); diff --git a/testing/btest/Baseline/plugins.hooks/output b/testing/btest/Baseline/plugins.hooks/output index 80897d1755..e520223373 100644 --- a/testing/btest/Baseline/plugins.hooks/output +++ b/testing/btest/Baseline/plugins.hooks/output @@ -4858,7 +4858,6 @@ 0.000000 | HookQueueEvent NetControl::init() 0.000000 | HookQueueEvent filter_change_tracking() 0.000000 | HookQueueEvent zeek_init() -XXXXXXXXXX.XXXXXX MetaHookPost BroObjDtor() -> XXXXXXXXXX.XXXXXX MetaHookPost CallFunction(Broker::__flush_logs, , ()) -> XXXXXXXXXX.XXXXXX MetaHookPost CallFunction(Broker::flush_logs, , ()) -> XXXXXXXXXX.XXXXXX MetaHookPost CallFunction(Broker::log_flush, , ()) -> @@ -4877,7 +4876,6 @@ XXXXXXXXXX.XXXXXX MetaHookPost QueueEvent(new_connection([id=[orig_h=141.142. XXXXXXXXXX.XXXXXX MetaHookPost QueueEvent(run_sync_hook()) -> false XXXXXXXXXX.XXXXXX MetaHookPost SetupAnalyzerTree(XXXXXXXXXX.XXXXXX(XXXXXXXXXX.XXXXXX) TCP 141.142.228.5:59856 -> 192.150.187.43:80) -> XXXXXXXXXX.XXXXXX MetaHookPost UpdateNetworkTime(XXXXXXXXXX.XXXXXX) -> -XXXXXXXXXX.XXXXXX MetaHookPre BroObjDtor() XXXXXXXXXX.XXXXXX MetaHookPre CallFunction(Broker::__flush_logs, , ()) XXXXXXXXXX.XXXXXX MetaHookPre CallFunction(Broker::flush_logs, , ()) XXXXXXXXXX.XXXXXX MetaHookPre CallFunction(Broker::log_flush, , ()) @@ -4896,7 +4894,6 @@ XXXXXXXXXX.XXXXXX MetaHookPre QueueEvent(new_connection([id=[orig_h=141.142. XXXXXXXXXX.XXXXXX MetaHookPre QueueEvent(run_sync_hook()) XXXXXXXXXX.XXXXXX MetaHookPre SetupAnalyzerTree(XXXXXXXXXX.XXXXXX(XXXXXXXXXX.XXXXXX) TCP 141.142.228.5:59856 -> 192.150.187.43:80) XXXXXXXXXX.XXXXXX MetaHookPre UpdateNetworkTime(XXXXXXXXXX.XXXXXX) -XXXXXXXXXX.XXXXXX | HookBroObjDtor XXXXXXXXXX.XXXXXX | HookObjDtor XXXXXXXXXX.XXXXXX | HookUpdateNetworkTime XXXXXXXXXX.XXXXXX XXXXXXXXXX.XXXXXX | HookCallFunction Broker::__flush_logs() diff --git a/testing/btest/plugins/hooks-plugin/src/Plugin.cc b/testing/btest/plugins/hooks-plugin/src/Plugin.cc index 99cf4eafd9..b8a4d812be 100644 --- a/testing/btest/plugins/hooks-plugin/src/Plugin.cc +++ b/testing/btest/plugins/hooks-plugin/src/Plugin.cc @@ -58,7 +58,6 @@ zeek::plugin::Configuration Plugin::Configure() EnableHook(zeek::plugin::HOOK_UPDATE_NETWORK_TIME); EnableHook(zeek::plugin::META_HOOK_PRE); EnableHook(zeek::plugin::META_HOOK_POST); - EnableHook(zeek::plugin::HOOK_BRO_OBJ_DTOR); EnableHook(zeek::plugin::HOOK_SETUP_ANALYZER_TREE); EnableHook(zeek::plugin::HOOK_LOG_INIT); EnableHook(zeek::plugin::HOOK_LOG_WRITE); @@ -166,7 +165,7 @@ bool Plugin::HookQueueEvent(zeek::Event* event) fprintf(stderr, "%.6f %-15s %s\n", zeek::run_state::network_time, "| RequestObjDtor", d.Description()); - RequestBroObjDtor(event); + RequestObjDtor(event); i = 1; } @@ -184,11 +183,6 @@ void Plugin::HookUpdateNetworkTime(double network_time) zeek::run_state::network_time); } -void Plugin::HookBroObjDtor(void* obj) - { - fprintf(stderr, "%.6f %-15s\n", zeek::run_state::network_time, "| HookBroObjDtor"); - } - void Plugin::HookObjDtor(void* obj) { fprintf(stderr, "%.6f %-15s\n", zeek::run_state::network_time, "| HookObjDtor"); diff --git a/testing/btest/plugins/hooks-plugin/src/Plugin.h b/testing/btest/plugins/hooks-plugin/src/Plugin.h index 21727786dd..30f42a11ec 100644 --- a/testing/btest/plugins/hooks-plugin/src/Plugin.h +++ b/testing/btest/plugins/hooks-plugin/src/Plugin.h @@ -20,7 +20,6 @@ protected: bool HookQueueEvent(zeek::Event* event) override; void HookDrainEvents() override; void HookUpdateNetworkTime(double network_time) override; - void HookBroObjDtor(void* obj) override; void HookObjDtor(void* obj) override; void HookLogInit(const std::string& writer, const std::string& instantiating_filter, bool local, bool remote, const zeek::logging::WriterBackend::WriterInfo& info,