diff --git a/scripts/policy/frameworks/cluster/agent/api.zeek b/scripts/policy/frameworks/cluster/agent/api.zeek index 02b3b28ea9..460c106b9b 100644 --- a/scripts/policy/frameworks/cluster/agent/api.zeek +++ b/scripts/policy/frameworks/cluster/agent/api.zeek @@ -56,7 +56,7 @@ export { ## reqid: the request identifier used in the request event. ## ## result: a :zeek:see:`ClusterController::Types::Result` record. Its data - ## member is a vector of :zeek:see:`ClusterController::Types::NodeState` + ## member is a vector of :zeek:see:`ClusterController::Types::NodeStatus` ## records, covering the nodes at this instance. The result may also ## indicate failure, with error messages indicating what went wrong. ## diff --git a/scripts/policy/frameworks/cluster/agent/main.zeek b/scripts/policy/frameworks/cluster/agent/main.zeek index 9376ae967c..7abd263d56 100644 --- a/scripts/policy/frameworks/cluster/agent/main.zeek +++ b/scripts/policy/frameworks/cluster/agent/main.zeek @@ -13,10 +13,15 @@ module ClusterAgent::Runtime; -# Request state specific to supervisor interactions -type SupervisorState: record { - node: string; -}; +# This export is mainly to appease Zeekygen's need to understand redefs of the +# Request record below. Without it, it fails to establish link targets for the +# tucked-on types. +export { + ## Request state specific to the agent's Supervisor interactions. + type SupervisorState: record { + node: string; ##< Name of the node the Supervisor is acting on. + }; +} redef record ClusterController::Request::Request += { supervisor_state: SupervisorState &optional; diff --git a/scripts/policy/frameworks/cluster/controller/api.zeek b/scripts/policy/frameworks/cluster/controller/api.zeek index 4ed77ffdb2..ce0ebe31c5 100644 --- a/scripts/policy/frameworks/cluster/controller/api.zeek +++ b/scripts/policy/frameworks/cluster/controller/api.zeek @@ -73,7 +73,7 @@ export { ## ## result: a :zeek:type`vector` of :zeek:see:`ClusterController::Types::Result` ## records. Each record covers one cluster instance. Each record's data - ## member is a vector of :zeek:see:`ClusterController::Types::NodeState` + ## member is a vector of :zeek:see:`ClusterController::Types::NodeStatus` ## records, covering the nodes at that instance. Results may also indicate ## failure, with error messages indicating what went wrong. global get_nodes_response: event(reqid: string, diff --git a/scripts/policy/frameworks/cluster/controller/main.zeek b/scripts/policy/frameworks/cluster/controller/main.zeek index 3e93d715fd..4e7d261b2c 100644 --- a/scripts/policy/frameworks/cluster/controller/main.zeek +++ b/scripts/policy/frameworks/cluster/controller/main.zeek @@ -15,19 +15,31 @@ module ClusterController::Runtime; -# Request state specific to the set_configuration request/response events -type SetConfigurationState: record { - config: ClusterController::Types::Configuration; - requests: set[string] &default=set(); -}; +# This export is mainly to appease Zeekygen's need to understand redefs of the +# Request record below. Without it, it fails to establish link targets for the +# tucked-on types. +export { + ## Request state specific to + ## :zeek:see:`ClusterController::API::set_configuration_request` and + ## :zeek:see:`ClusterController::API::set_configuration_response`. + type SetConfigurationState: record { + ## The cluster configuration established with this request + config: ClusterController::Types::Configuration; + ## Request state for every controller/agent transaction. + requests: set[string] &default=set(); + }; -# Request state specific to the get_nodes request/response events -type GetNodesState: record { - requests: set[string] &default=set(); -}; + ## Request state specific to + ## :zeek:see:`ClusterController::API::get_nodes_request` and + ## :zeek:see:`ClusterController::API::get_nodes_response`. + type GetNodesState: record { + ## Request state for every controller/agent transaction. + requests: set[string] &default=set(); + }; -# Dummy state for testing events. -type TestState: record { }; + ## Dummy state for internal state-keeping test cases. + type TestState: record { }; +} redef record ClusterController::Request::Request += { set_configuration_state: SetConfigurationState &optional; diff --git a/scripts/policy/frameworks/cluster/controller/request.zeek b/scripts/policy/frameworks/cluster/controller/request.zeek index d7bca5d1a3..06f23b67da 100644 --- a/scripts/policy/frameworks/cluster/controller/request.zeek +++ b/scripts/policy/frameworks/cluster/controller/request.zeek @@ -8,7 +8,12 @@ module ClusterController::Request; export { - ## Request records track each request's state. + ## Request records track state associated with a request/response event + ## pair. Calls to + ## :zeek:see:`ClusterController::Request::create` establish such state + ## when an entity sends off a request event, while + ## :zeek:see:`ClusterController::Request::finish` clears the state when + ## a corresponding response event comes in, or the state times out. type Request: record { ## Each request has a hopfully unique ID provided by the requester. id: string;