ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
session_entry Struct Reference

Persisted discovery-session record used to admit and route participants. More...

#include <include/ascii-chat/discovery/session.h>

Data Fields

char session_string [(38+1)]
 "affectionate-acquaintance-acquaintance"
uint8_t session_id [16]
 UUID.
uint8_t host_pubkey [32]
 Host's Ed25519 key.
uint8_t capabilities
 bit 0: video, bit 1: audio
uint8_t max_participants
 1-128
uint8_t current_participants
 Active participant count.
char password_hash [ACIP_PASSWORD_HASH_SIZE]
bool has_password
 Password protection flag.
bool expose_ip_publicly
uint8_t session_type
 acds_session_type_t: 0=DIRECT_TCP, 1=WEBRTC
uint64_t created_at
 Unix timestamp (ms) - when session was created.
uint64_t expires_at
uint64_t last_activity_at
char server_address [ACIP_ADDRESS_SIZE]
 IPv4/IPv6 address or hostname.
uint16_t server_port
 Port number for client connection.
uint8_t initiator_id [16]
 created/joined the session
bool host_established
uint8_t host_participant_id [16]
 (valid if host_established)
char host_address [ACIP_ADDRESS_SIZE]
uint16_t host_port
 Host's port (valid if host_established).
uint8_t host_connection_type
 acip_connection_type_t: how to reach host
bool in_migration
 Currently collecting HOST_LOST packets.
uint64_t migration_start_ns
host_lost_candidate_t * migration_candidates [128]
 during migration
participant_t * participants [128]
 (in-memory only)

Detailed Description

Persisted discovery-session record used to admit and route participants.

It stores the human-readable session string and UUID, host identity, capabilities and participant counts, password and IP-disclosure policy, session type, and creation/activity expiry timestamps. The database owns the durable record; callers use it as a validated value when loading or updating a session.

Definition at line 68 of file include/ascii-chat/discovery/session.h.

Field Documentation

◆ capabilities

uint8_t session_entry::capabilities

bit 0: video, bit 1: audio

Definition at line 75 of file include/ascii-chat/discovery/session.h.

◆ created_at

uint64_t session_entry::created_at

Unix timestamp (ms) - when session was created.

Definition at line 86 of file include/ascii-chat/discovery/session.h.

◆ current_participants

uint8_t session_entry::current_participants

Active participant count.

Definition at line 77 of file include/ascii-chat/discovery/session.h.

Referenced by database_session_join().

◆ expires_at

uint64_t session_entry::expires_at

Unix timestamp (ms) - absolute max lifetime (created_at + 24h)

Definition at line 87 of file include/ascii-chat/discovery/session.h.

◆ expose_ip_publicly

bool session_entry::expose_ip_publicly

Allow IP disclosure without verification (explicit opt-in via –acds-expose-ip)

Definition at line 82 of file include/ascii-chat/discovery/session.h.

◆ has_password

bool session_entry::has_password

Password protection flag.

Definition at line 81 of file include/ascii-chat/discovery/session.h.

Referenced by database_session_join().

◆ host_address

char session_entry::host_address[ACIP_ADDRESS_SIZE]

Host's reachable address (valid if host_established)

Definition at line 104 of file include/ascii-chat/discovery/session.h.

◆ host_connection_type

uint8_t session_entry::host_connection_type

acip_connection_type_t: how to reach host

Definition at line 107 of file include/ascii-chat/discovery/session.h.

◆ host_established

bool session_entry::host_established

Whether a host has been designated (false = still negotiating)

Definition at line 99 of file include/ascii-chat/discovery/session.h.

Referenced by acds_send_current_host().

◆ host_participant_id

uint8_t session_entry::host_participant_id[16]

(valid if host_established)

Current host's participant_id

Definition at line 102 of file include/ascii-chat/discovery/session.h.

◆ host_port

uint16_t session_entry::host_port

Host's port (valid if host_established).

Definition at line 106 of file include/ascii-chat/discovery/session.h.

◆ host_pubkey

uint8_t session_entry::host_pubkey[32]

Host's Ed25519 key.

Definition at line 74 of file include/ascii-chat/discovery/session.h.

◆ in_migration

bool session_entry::in_migration

Currently collecting HOST_LOST packets.

Definition at line 110 of file include/ascii-chat/discovery/session.h.

◆ initiator_id

uint8_t session_entry::initiator_id[16]

created/joined the session

First participant who

Definition at line 97 of file include/ascii-chat/discovery/session.h.

◆ last_activity_at

uint64_t session_entry::last_activity_at

Unix timestamp (ms) - updated on join/leave/host updates (cleanup uses this)

Definition at line 89 of file include/ascii-chat/discovery/session.h.

◆ max_participants

uint8_t session_entry::max_participants

1-128

Definition at line 76 of file include/ascii-chat/discovery/session.h.

Referenced by database_session_join().

◆ migration_candidates

host_lost_candidate_t* session_entry::migration_candidates[128]

during migration

Candidates received

Definition at line 114 of file include/ascii-chat/discovery/session.h.

◆ migration_start_ns

uint64_t session_entry::migration_start_ns

When migration started in nanoseconds (for collection window timeout)

Definition at line 111 of file include/ascii-chat/discovery/session.h.

◆ participants

participant_t* session_entry::participants[128]

(in-memory only)

Participant array

Definition at line 117 of file include/ascii-chat/discovery/session.h.

Referenced by session_entry_destroy().

◆ password_hash

char session_entry::password_hash[ACIP_PASSWORD_HASH_SIZE]

Argon2id hash (if has_password)

Definition at line 79 of file include/ascii-chat/discovery/session.h.

Referenced by database_session_join().

◆ server_address

char session_entry::server_address[ACIP_ADDRESS_SIZE]

IPv4/IPv6 address or hostname.

Definition at line 93 of file include/ascii-chat/discovery/session.h.

◆ server_port

uint16_t session_entry::server_port

Port number for client connection.

Definition at line 94 of file include/ascii-chat/discovery/session.h.

◆ session_id

uint8_t session_entry::session_id[16]

UUID.

Definition at line 72 of file include/ascii-chat/discovery/session.h.

◆ session_string

char session_entry::session_string[(38+1)]

"affectionate-acquaintance-acquaintance"

e.g.,

Definition at line 69 of file include/ascii-chat/discovery/session.h.

◆ session_type

uint8_t session_entry::session_type

acds_session_type_t: 0=DIRECT_TCP, 1=WEBRTC

Definition at line 84 of file include/ascii-chat/discovery/session.h.


The documentation for this struct was generated from the following file: