diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 40f8fcb3a4..cb9bfc1b7d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: files: '^testing/btest/.*$' - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v20.1.0 + rev: v20.1.7 hooks: - id: clang-format types_or: @@ -34,7 +34,7 @@ repos: args: ["-w", "-i", "4", "-ci"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.11.4 + rev: v0.12.1 hooks: - id: ruff args: [--fix] @@ -46,7 +46,7 @@ repos: - id: cmake-format - repo: https://github.com/crate-ci/typos - rev: v1.30.1 + rev: v1.33.1 hooks: - id: typos exclude: '^(.typos.toml|src/SmithWaterman.cc|testing/.*|auxil/.*|scripts/base/frameworks/files/magic/.*|CHANGES|scripts/base/protocols/ssl/mozilla-ca-list.zeek)$' diff --git a/scripts/base/frameworks/config/input.zeek b/scripts/base/frameworks/config/input.zeek index 9796d69f57..e48bd70f45 100644 --- a/scripts/base/frameworks/config/input.zeek +++ b/scripts/base/frameworks/config/input.zeek @@ -30,7 +30,7 @@ type EventFields: record { option_val: string; }; -event config_line(description: Input::EventDescription, tpe: Input::Event, p: EventFields) +event config_line(description: Input::EventDescription, type_: Input::Event, p: EventFields) { } diff --git a/scripts/base/frameworks/intel/input.zeek b/scripts/base/frameworks/intel/input.zeek index 84c85313b5..6a660ef776 100644 --- a/scripts/base/frameworks/intel/input.zeek +++ b/scripts/base/frameworks/intel/input.zeek @@ -27,11 +27,11 @@ export { ## ## desc: The :zeek:type:`Input::EventDescription` record which generated the event. ## - ## tpe: The type of input event. + ## type_: The type of input event. ## ## item: The intel item being read (of type :zeek:type:`Intel::Item`). ## - global read_entry: event(desc: Input::EventDescription, tpe: Input::Event, item: Intel::Item); + global read_entry: event(desc: Input::EventDescription, type_: Input::Event, item: Intel::Item); ## This event is raised each time the input framework detects an error ## while reading the intel file. It can be used to implement further checks @@ -46,7 +46,7 @@ export { global read_error: event(desc: Input::EventDescription, message: string, level: Reporter::Level); } -event Intel::read_entry(desc: Input::EventDescription, tpe: Input::Event, item: Intel::Item) +event Intel::read_entry(desc: Input::EventDescription, type_: Input::Event, item: Intel::Item) { Intel::insert(item); } diff --git a/scripts/base/frameworks/openflow/cluster.zeek b/scripts/base/frameworks/openflow/cluster.zeek index 01c3116da1..3430c4a08b 100644 --- a/scripts/base/frameworks/openflow/cluster.zeek +++ b/scripts/base/frameworks/openflow/cluster.zeek @@ -76,16 +76,16 @@ event OpenFlow::cluster_flow_clear(name: string) } @endif -function register_controller(tpe: OpenFlow::Plugin, name: string, controller: Controller) +function register_controller(type_: OpenFlow::Plugin, name: string, controller: Controller) { - controller$state$_name = cat(tpe, name); - controller$state$_plugin = tpe; + controller$state$_name = cat(type_, name); + controller$state$_plugin = type_; # we only run the init functions on the manager. if ( Cluster::local_node_type() != Cluster::MANAGER ) return; - register_controller_impl(tpe, name, controller); + register_controller_impl(type_, name, controller); } function unregister_controller(controller: Controller) diff --git a/scripts/base/frameworks/openflow/main.zeek b/scripts/base/frameworks/openflow/main.zeek index 9649000b21..34dae9447d 100644 --- a/scripts/base/frameworks/openflow/main.zeek +++ b/scripts/base/frameworks/openflow/main.zeek @@ -113,12 +113,12 @@ export { ## Function to register a controller instance. This function ## is called automatically by the plugin _new functions. ## - ## tpe: Type of this plugin. + ## type_: Type of this plugin. ## ## name: Unique name of this controller instance. ## ## controller: The controller to register. - global register_controller: function(tpe: OpenFlow::Plugin, name: string, controller: Controller); + global register_controller: function(type_: OpenFlow::Plugin, name: string, controller: Controller); ## Function to unregister a controller instance. This function ## should be called when a specific controller should no longer @@ -253,7 +253,7 @@ function controller_init_done(controller: Controller) # Functions that are called from cluster.zeek and non-cluster.zeek -function register_controller_impl(tpe: OpenFlow::Plugin, name: string, controller: Controller) +function register_controller_impl(type_: OpenFlow::Plugin, name: string, controller: Controller) { if ( controller$state$_name in name_to_controller ) { diff --git a/scripts/base/frameworks/openflow/non-cluster.zeek b/scripts/base/frameworks/openflow/non-cluster.zeek index 22b5980924..b0350d3060 100644 --- a/scripts/base/frameworks/openflow/non-cluster.zeek +++ b/scripts/base/frameworks/openflow/non-cluster.zeek @@ -25,12 +25,12 @@ function flow_clear(controller: Controller): bool return F; } -function register_controller(tpe: OpenFlow::Plugin, name: string, controller: Controller) +function register_controller(type_: OpenFlow::Plugin, name: string, controller: Controller) { - controller$state$_name = cat(tpe, name); - controller$state$_plugin = tpe; + controller$state$_name = cat(type_, name); + controller$state$_plugin = type_; - register_controller_impl(tpe, name, controller); + register_controller_impl(type_, name, controller); } function unregister_controller(controller: Controller) diff --git a/scripts/base/utils/exec.zeek b/scripts/base/utils/exec.zeek index 1fa7743325..1e2f25745e 100644 --- a/scripts/base/utils/exec.zeek +++ b/scripts/base/utils/exec.zeek @@ -58,7 +58,7 @@ type FileLine: record { s: string; }; -event Exec::line(description: Input::EventDescription, tpe: Input::Event, s: string, is_stderr: bool) +event Exec::line(description: Input::EventDescription, type_: Input::Event, s: string, is_stderr: bool) { local result = results[description$name]; if ( is_stderr ) @@ -77,7 +77,7 @@ event Exec::line(description: Input::EventDescription, tpe: Input::Event, s: str } } -event Exec::file_line(description: Input::EventDescription, tpe: Input::Event, s: string) +event Exec::file_line(description: Input::EventDescription, type_: Input::Event, s: string) { local parts = split_string1(description$name, /_/); local name = parts[0]; diff --git a/src/Val.cc b/src/Val.cc index d531edd8fa..dfb36dcae3 100644 --- a/src/Val.cc +++ b/src/Val.cc @@ -2229,7 +2229,7 @@ bool TableVal::UpdateTimestamp(Val* index) { ListValPtr TableVal::RecreateIndex(const detail::HashKey& k) const { return GetTableHash()->RecoverVals(k); } -void TableVal::CallChangeFunc(const ValPtr& index, const ValPtr& old_value, OnChangeType tpe) { +void TableVal::CallChangeFunc(const ValPtr& index, const ValPtr& old_value, OnChangeType type) { if ( ! change_func || ! index || in_change_func ) return; @@ -2258,7 +2258,7 @@ void TableVal::CallChangeFunc(const ValPtr& index, const ValPtr& old_value, OnCh vl.emplace_back(NewRef{}, this); - switch ( tpe ) { + switch ( type ) { case ELEMENT_NEW: vl.emplace_back(BifType::Enum::TableChange->GetEnumVal(BifEnum::TableChange::TABLE_ELEMENT_NEW)); break; @@ -2290,7 +2290,7 @@ void TableVal::CallChangeFunc(const ValPtr& index, const ValPtr& old_value, OnCh in_change_func = false; } -void TableVal::SendToStore(const Val* index, const TableEntryVal* new_entry_val, OnChangeType tpe) { +void TableVal::SendToStore(const Val* index, const TableEntryVal* new_entry_val, OnChangeType type) { if ( broker_store.empty() || ! index ) return; @@ -2316,7 +2316,7 @@ void TableVal::SendToStore(const Val* index, const TableEntryVal* new_entry_val, return; } - switch ( tpe ) { + switch ( type ) { case ELEMENT_NEW: case ELEMENT_CHANGED: { std::optional expiry; diff --git a/src/Val.h b/src/Val.h index aad9a7d321..5f2fc740a6 100644 --- a/src/Val.h +++ b/src/Val.h @@ -1067,10 +1067,10 @@ protected: enum OnChangeType : uint8_t { ELEMENT_NEW, ELEMENT_CHANGED, ELEMENT_REMOVED, ELEMENT_EXPIRED }; // Calls &change_func. - void CallChangeFunc(const ValPtr& index, const ValPtr& old_value, OnChangeType tpe); + void CallChangeFunc(const ValPtr& index, const ValPtr& old_value, OnChangeType type); // Sends data on to backing Broker Store - void SendToStore(const Val* index, const TableEntryVal* new_entry_val, OnChangeType tpe); + void SendToStore(const Val* index, const TableEntryVal* new_entry_val, OnChangeType type); unsigned int ComputeFootprint(std::unordered_set* analyzed_vals) const override; diff --git a/src/analyzer/protocol/ssl/spicy/SSL.evt b/src/analyzer/protocol/ssl/spicy/SSL.evt index d9fd2e5789..cf27baa238 100644 --- a/src/analyzer/protocol/ssl/spicy/SSL.evt +++ b/src/analyzer/protocol/ssl/spicy/SSL.evt @@ -79,7 +79,7 @@ on SSL::PSKKeyExchangeModes -> event ssl_extension_psk_key_exchange_modes($conn, on SSL::Alert_message -> event ssl_alert($conn, SSL::get_direction(sh), self.level, self.description); -on SSL::Heartbeat -> event ssl_heartbeat($conn, SSL::get_direction(sh), length, self.tpe, self.payload_length, self.data); +on SSL::Heartbeat -> event ssl_heartbeat($conn, SSL::get_direction(sh), length, self.type_, self.payload_length, self.data); on SSL::CertificateStatus -> event ssl_stapled_ocsp($conn, $is_orig, self.response); diff --git a/src/analyzer/protocol/ssl/spicy/SSL.spicy b/src/analyzer/protocol/ssl/spicy/SSL.spicy index f89b81b191..1b6f12b3f6 100644 --- a/src/analyzer/protocol/ssl/spicy/SSL.spicy +++ b/src/analyzer/protocol/ssl/spicy/SSL.spicy @@ -856,7 +856,7 @@ function determine_encryption_on(pr: PlaintextRecord, content_type: uint8, hands } type Heartbeat = unit(sh: Share, length: uint16) { - tpe: uint8; + type_: uint8; payload_length: uint16; # don't trust this one - there might still be people testing. data: bytes &size=(length - 3); };