43#include <ascii-chat/network/rate_limit/rate_limit.h>
44#include <ascii-chat/network/tcp/server.h>
45#include <ascii-chat/audio/mixer.h>
46#include <ascii-chat/crypto/key_types.h>
47#include <ascii-chat/session/host.h>
48#include <ascii-chat/options/options.h>
Per-client state management and lifecycle orchestration.
size_t g_num_whitelisted_clients
Number of whitelisted clients.
bool g_server_encryption_enabled
Server encryption enabled flag.
public_key_t g_client_whitelist[MAX_CLIENTS]
Whitelist of allowed client public keys.
private_key_t g_server_private_key
Server's private key.
private_key_t g_server_identity_keys[MAX_IDENTITY_KEYS]
Array of server identity keys.
size_t g_num_server_identity_keys
Number of server identity keys in use.
rate_limiter_t * g_rate_limiter
Global connection rate limiter.
mixer_t *volatile g_audio_mixer
Global audio mixer.
int server_main(void)
Server mode entry point for unified binary.
rwlock_t g_client_manager_rwlock
Read-write lock protecting client manager.
atomic_bool g_server_should_exit
Server shutdown flag.
client_manager_t g_client_manager
Global client manager.
Server performance statistics tracking.
Global client manager structure for server-side client coordination.
Server context - encapsulates all server state.
tcp_server_t * tcp_server
TCP server managing connections.
session_host_t * session_host
Session host for discovery mode support.
bool encryption_enabled
Whether encryption is enabled.
client_manager_t * client_manager
Client registry and state.
mixer_t * audio_mixer
Multi-client audio mixer.
size_t num_whitelisted_clients
Number of whitelisted clients.
mutex_t * stats_mutex
Mutex protecting stats.
public_key_t * client_whitelist
Whitelisted client public keys.
rwlock_t * client_manager_rwlock
RW lock protecting client manager.
atomic_bool * server_should_exit
Shutdown flag.
private_key_t * server_private_key
Server's private key.
server_stats_t * stats
Server statistics.
rate_limiter_t * rate_limiter
Connection and packet rate limiter.
Server performance statistics structure.
Internal session host structure.