1. Overview
Desktop UI protocol client interface. Declares daemon-to-UI alerts, synchronous rule questions, heartbeat messages, connection serialization and incoming notification callbacks.
The original source path is:
include/bsc/ui/UIClient.hpp
2. Role in the Daemon
This file participates in the privileged BastionGuard Secure Connection daemon. It uses the shared bsc models and follows the daemon-wide fallback strategy: optional high-fidelity backends are used when available, while portable polling or stub behavior preserves service startup.
3. Namespaces
bsc::ui
4. Dependencies and Included Interfaces
bsc/model/Connection.hppbsc/rule/Rule.hppbsc/stats/Statistics.hppcstdintfunctionalmemoryoptionalstringvector
5. Declared Types
struct NotificationEventclass UIClientclass Impl
6. State and Data Members
The interface declares the following relevant state members:
std::string typestd::string datastd::vector<bsc::rule::Rule> rulesconst std::string& rule_name = {})class Implstd::unique_ptr<Impl> impl_
7. API and Functions
The file declares or implements the following callable entry points:
public: explicit UIClient(std::string socket_uri)void start()void stop()bool is_connected() const noexceptstd::optional<bsc::rule::Rule> ask_rule(const bsc::model::Connection& conn)bool ping(const bsc::stats::Statistics& stats)bool post_alert(const std::string& text)void set_notification_handler(std::function<void(const NotificationEvent&)> cb)explicit UIClient(std::string socket_uri)UIClient(const UIClient&) = delete
8. Constants and Compile-Time Controls
std::string& action, const std::string& rule_name = {})
9. External Resources and Protocol Values
Relevant paths, endpoints, command names or policy values referenced by this file include:
bsc/model/Connection.hppbsc/rule/Rule.hppbsc/stats/Statistics.hpp
10. Security Considerations
- The component processes privileged operating-system or network data and should run with only the capabilities required by its backend.
11. Implementation Considerations
- Shared state is protected by mutexes; callers should avoid holding external locks while invoking callbacks.
12. Licensing and Attribution
- Copyright (C) 2025–2026 Calogero Scarnà
- GPL-3.0
13. Source Metrics
| Metric | Value |
|---|---|
| File size | 1603 bytes |
| Lines | 61 |
| Detected API entries | 10 |
| Detected types | 3 |
