#ifndef HYBBX_INSTANCE_H #define HYBBX_INSTANCE_H #include "hybbx/networks.h" #include "hybbx/types.h" #ifdef __cplusplus extern "C" { #endif /** * Hardcoded network layout instance (compile-time per binary). * * hybbxd — Main (local BBX; WebSocket user path; hub + mains_proxy) * hybbxsd — Secondary (other-Main peers via mains_proxy; no user BBX) * hybbxpd — Proxy (hybrid bridge; no WebSocket; no in-process AX.25) * * SSoT: vault projects/hybbx/2026-07-16-network-layout-instances.md */ typedef enum hybbx_instance_role { HYBBX_INSTANCE_MAIN = 1, HYBBX_INSTANCE_SECONDARY = 2, HYBBX_INSTANCE_PROXY = 3 } hybbx_instance_role_t; hybbx_instance_role_t hybbx_instance_role(void); /** * Standalone Main (hybbxd + local RF on one host). * Set from INI `[instance] standalone=yes` or auto when Main INI enables local RF. */ void hybbx_instance_set_standalone(int enabled); int hybbx_instance_standalone(void); /** "hybbxd" / "hybbxsd" / "hybbxpd" */ const char *hybbx_instance_binary_name(void); /** Short role label: "Main" / "Secondary" / "Proxy". */ const char *hybbx_instance_role_name(void); /** Non-zero when this instance runs local user BBX (login/mail/chat). */ int hybbx_instance_offers_user_bbx(void); /** * Apply hard layout rules to @p networks (force/clear flags). * Logs warnings when INI requested a forbidden combination. * Returns HYBBX_OK, or HYBBX_ERR_INVALID when the role cannot start safely. */ hybbx_result_t hybbx_networks_enforce_instance(hybbx_networks_config_t *networks); /** * Non-zero when @p plugin_name may be registered/started for this instance. * Complements [networks] wanted checks. */ int hybbx_instance_plugin_allowed(const char *plugin_name); #ifdef __cplusplus } #endif #endif /* HYBBX_INSTANCE_H */