ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
include/ascii-chat/discovery/session.h
Go to the documentation of this file.
1
2
3/* Storage capacities in elements; text buffers include the terminating NUL. */
4
7#include <ascii-chat/common.h>
8#pragma once
9
18
19#include <stdint.h>
20#include <stdbool.h>
22
29
38
52
100
#define ACIP_ADDRESS_SIZE
Definition acds_sizes.h:7
#define ACIP_PASSWORD_HASH_SIZE
Definition acds_sizes.h:9
⚙️ Common definitions, error codes, macros, and types shared throughout the application
unsigned short uint16_t
Definition common.h:61
unsigned int uint32_t
Definition common.h:62
unsigned long long uint64_t
Definition common.h:63
unsigned char uint8_t
Definition common.h:60
#define MAX_SESSION_PARTICIPANTS
#define SESSION_ID_SIZE
struct session_entry session_entry_t
Persisted discovery-session record used to admit and route participants.
void session_entry_destroy(session_entry_t *entry)
Free a session entry and all its resources.
#define ED25519_PUBLIC_KEY_SIZE
Ed25519 public key size in bytes.
Definition sizes.h:33
#define SESSION_STRING_BUFFER_SIZE
Host migration state for collecting HOST_LOST packets.
uint8_t connection_type
How they can be reached.
uint8_t participant_id[16]
Participant proposing new host.
uint32_t rtt_to_acds_ns
Latency to ACDS in nanoseconds.
uint8_t nat_quality_tier
NAT tier for this participant.
Host migration state for collecting HOST_LOST packets.
uint8_t identity_pubkey[32]
Ed25519 public key.
uint64_t joined_at
Unix timestamp (ms).
Persisted discovery-session record used to admit and route participants.
bool expose_ip_publicly
Allow IP disclosure without verification (explicit opt-in via –acds-expose-ip).
bool has_password
Password protection flag.
uint8_t max_participants
1-128
uint8_t host_pubkey[32]
Host's Ed25519 key.
participant_t * participants[128]
Participant array (in-memory only).
char host_address[ACIP_ADDRESS_SIZE]
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).
char server_address[ACIP_ADDRESS_SIZE]
IPv4/IPv6 address or hostname.
bool in_migration
Currently collecting HOST_LOST packets.
char session_string[(38+1)]
e.g., "affectionate-acquaintance-acquaintance"
char password_hash[ACIP_PASSWORD_HASH_SIZE]
Argon2id hash (if has_password).
uint8_t session_id[16]
UUID.
uint64_t created_at
Unix timestamp (ms) - when session was created.
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.
host_lost_candidate_t * migration_candidates[128]
Candidates received during migration.
uint8_t host_connection_type
acip_connection_type_t: how to reach host