ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
include/ascii-chat/discovery/session.h
Go to the documentation of this file.
1#pragma once
2
12#include <stdint.h>
13#include <stdbool.h>
14#include "../discovery/strings.h"
15
19#if !defined(MAX_PARTICIPANTS)
20#define MAX_PARTICIPANTS 16
21#endif
22
26typedef struct {
28 uint8_t identity_pubkey[32];
31
45
88
unsigned short uint16_t
Definition common.h:57
unsigned int uint32_t
Definition common.h:58
unsigned long long uint64_t
Definition common.h:59
unsigned char uint8_t
Definition common.h:56
#define MAX_PARTICIPANTS
Maximum participants per session.
struct session_entry session_entry_t
Session entry data structure.
void session_entry_destroy(session_entry_t *entry)
Free a session entry and all its resources.
uint8_t participant_id[16]
ClangTool/LibTooling compatibility shim for stdbool.h.
#define SESSION_STRING_BUFFER_SIZE
Host migration state for collecting HOST_LOST packets.
uint8_t connection_type
How they can be reached.
uint32_t rtt_to_acds_ns
Latency to ACDS in nanoseconds.
uint8_t nat_quality_tier
NAT tier for this participant.
Participant in a session.
uint64_t joined_at
Unix timestamp (ms)
Session entry data structure.
bool expose_ip_publicly
Allow IP disclosure without verification (explicit opt-in via –acds-expose-ip)
bool has_password
Password protection flag.
char server_address[64]
IPv4/IPv6 address or hostname.
uint8_t max_participants
1-8
uint8_t host_pubkey[32]
Host's Ed25519 key.
participant_t * participants[16]
Participant array (in-memory only)
uint8_t initiator_id[16]
First participant who created/joined the session.
uint16_t host_port
Host's port (valid if host_established)
uint8_t host_participant_id[16]
Current host's participant_id (valid if host_established)
bool host_established
Whether a host has been designated (false = still negotiating)
bool in_migration
Currently collecting HOST_LOST packets.
char session_string[(38+1)]
e.g., "affectionate-acquaintance-acquaintance"
uint8_t session_id[16]
UUID.
char password_hash[128]
Argon2id hash (if has_password)
uint64_t created_at
Unix timestamp (ms) - when session was created.
host_lost_candidate_t * migration_candidates[16]
Candidates received during migration.
char host_address[64]
Host's reachable address (valid if host_established)
uint64_t migration_start_ns
When migration started in nanoseconds (for collection window timeout)
uint64_t expires_at
Unix timestamp (ms) - absolute max lifetime (created_at + 24h)
uint8_t capabilities
bit 0: video, bit 1: audio
uint8_t session_type
acds_session_type_t: 0=DIRECT_TCP, 1=WEBRTC
uint64_t last_activity_at
Unix timestamp (ms) - updated on join/leave/host updates (cleanup uses this)
uint16_t server_port
Port number for client connection.
uint8_t current_participants
Active participant count.
uint8_t host_connection_type
acip_connection_type_t: how to reach host