![]() |
Mads
Multi-Agent Distributed System
|
Classes | |
| struct | CheckResult |
| struct | PluginLoadFacts |
Typedefs | |
| using | CurveKeyCheck = Mads::ProbeCurveKeys |
Enumerations | |
| enum class | Status { Pass , Warn , Fail } |
Functions | |
| CheckResult | check_settings_file (const std::filesystem::path &path) |
Checks that path is a local settings file that exists and parses as valid TOML. A tcp://... URI is treated as "remote broker, not a local
file" and reported Pass with an explanatory note (broker reachability is check 2's job, not this one's). | |
| CheckResult | evaluate_broker_reachable (const std::string &uri, bool reachable, bool crypto=false) |
| CheckResult | check_broker_reachable (const std::string &uri, std::chrono::milliseconds timeout, const std::optional< CurveKeyCheck > &curve=std::nullopt) |
| CheckResult | evaluate_plugin_load (const PluginLoadFacts &facts) |
| std::optional< int > | parse_pinned_plugin_protocol (const std::string &manifest_json_text) |
Reads the plugin_protocol field out of share/plugin_deps.json's text content (already read by the caller – doctor.cpp reuses Mads::PluginMigrate::read_file() for that, the same helper src/main/plugin_migrate.hpp's own migration engine uses to load the same file). Kept as a pure string->int function so it needs no filesystem access to unit test. | |
| CheckResult | evaluate_plugin_protocol (int loaded_version, std::optional< int > pinned_version, int min_supported=kMinSupportedPluginProtocol) |
| bool | is_well_formed_curve_key (const std::string &key_line) |
| CheckResult | check_curve_keys (const CurveKeyCheck &cfg) |
Checks that a client's CURVE key files exist and are well-formed: <client>.key (secret), <client>.pub (public), and <server>.pub (the broker's public key the client needs to encrypt toward it) – exactly the three files Mads::CurveAuth::setup_curve_client(socket, client, server) (src/curve.hpp) reads. | |
| CheckResult | evaluate_port_available (const std::string &host, int port, bool in_use) |
| CheckResult | check_port_available (const std::string &host, int port, std::chrono::milliseconds timeout) |
| CheckResult | evaluate_curve_handshake (const std::string &uri, CurveProbeResult result) |
| CheckResult | check_curve_handshake (const std::string &uri, const CurveKeyCheck &cfg, std::chrono::milliseconds timeout) |
| CheckResult | evaluate_fd_limit (bool supported, uint64_t soft, uint64_t hard, std::optional< int64_t > configured) |
| CheckResult | check_fd_limit (std::optional< int64_t > configured) |
Variables | |
| constexpr int | kMinSupportedPluginProtocol = 7 |
| using Mads::Doctor::CurveKeyCheck = typedef Mads::ProbeCurveKeys |
Mirrors AgentAppT::CryptoOptions (src/agent_app.hpp): the same key_dir/client/server naming convention every mads-* executable's –crypto/–keys_dir/–key_client/–key_broker flags configure. Declared up here rather than beside check 5, because checks 2 and 5 and 7 all need it: probing a CURVE-secured broker in the clear cannot tell it apart from a broker that is down (see Mads::ProbeCurveKeys).
Definition at line 66 of file doctor_checks.hpp.
|
strong |
Outcome of a single check, mirroring the three-state model of ros2 doctor/brew doctor: Pass (nothing to do), Warn (works but worth a look), Fail (needs fixing before things will work).
| Enumerator | |
|---|---|
| Pass | |
| Warn | |
| Fail | |
Definition at line 46 of file doctor_checks.hpp.
| CheckResult Mads::Doctor::check_broker_reachable | ( | const std::string & | uri, |
| std::chrono::milliseconds | timeout, | ||
| const std::optional< CurveKeyCheck > & | curve = std::nullopt |
||
| ) |
| CheckResult Mads::Doctor::check_curve_handshake | ( | const std::string & | uri, |
| const CurveKeyCheck & | cfg, | ||
| std::chrono::milliseconds | timeout | ||
| ) |
| CheckResult Mads::Doctor::check_curve_keys | ( | const CurveKeyCheck & | cfg | ) |
Checks that a client's CURVE key files exist and are well-formed: <client>.key (secret), <client>.pub (public), and <server>.pub (the broker's public key the client needs to encrypt toward it) – exactly the three files Mads::CurveAuth::setup_curve_client(socket, client, server) (src/curve.hpp) reads.
| CheckResult Mads::Doctor::check_fd_limit | ( | std::optional< int64_t > | configured | ) |
| CheckResult Mads::Doctor::check_port_available | ( | const std::string & | host, |
| int | port, | ||
| std::chrono::milliseconds | timeout | ||
| ) |
| CheckResult Mads::Doctor::check_settings_file | ( | const std::filesystem::path & | path | ) |
Checks that path is a local settings file that exists and parses as valid TOML. A tcp://... URI is treated as "remote broker, not a local
file" and reported Pass with an explanatory note (broker reachability is check 2's job, not this one's).
| CheckResult Mads::Doctor::evaluate_broker_reachable | ( | const std::string & | uri, |
| bool | reachable, | ||
| bool | crypto = false |
||
| ) |
| CheckResult Mads::Doctor::evaluate_curve_handshake | ( | const std::string & | uri, |
| CurveProbeResult | result | ||
| ) |
| CheckResult Mads::Doctor::evaluate_fd_limit | ( | bool | supported, |
| uint64_t | soft, | ||
| uint64_t | hard, | ||
| std::optional< int64_t > | configured | ||
| ) |
| CheckResult Mads::Doctor::evaluate_plugin_load | ( | const PluginLoadFacts & | facts | ) |
| CheckResult Mads::Doctor::evaluate_plugin_protocol | ( | int | loaded_version, |
| std::optional< int > | pinned_version, | ||
| int | min_supported = kMinSupportedPluginProtocol |
||
| ) |
| CheckResult Mads::Doctor::evaluate_port_available | ( | const std::string & | host, |
| int | port, | ||
| bool | in_use | ||
| ) |
| bool Mads::Doctor::is_well_formed_curve_key | ( | const std::string & | key_line | ) |
True if key_line (one file line, already trimmed of trailing CR/LF/whitespace) is a well-formed Z85-encoded CURVE key: exactly 40 characters that libzmq's zmq_z85_decode() accepts.
| std::optional< int > Mads::Doctor::parse_pinned_plugin_protocol | ( | const std::string & | manifest_json_text | ) |
Reads the plugin_protocol field out of share/plugin_deps.json's text content (already read by the caller – doctor.cpp reuses Mads::PluginMigrate::read_file() for that, the same helper src/main/plugin_migrate.hpp's own migration engine uses to load the same file). Kept as a pure string->int function so it needs no filesystem access to unit test.
|
constexpr |
Mirrors MADS_PLUGIN_MIN_PROTOCOL in src/main/plugin_loader.cpp: the oldest plugin protocol the loaders are meant to accept. In practice a successful dry-run load (check 3) already implies at least this, since pugg::Kernel::add_server<T>() gates driver registration on the current pinned protocol (see doctor.cpp); kept here for a defensive, explicit floor rather than relying on that gate alone.
Definition at line 119 of file doctor_checks.hpp.