ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
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)]
 e.g., "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]
 Argon2id hash (if has_password).
bool has_password
 Password protection flag.
bool expose_ip_publicly
 Allow IP disclosure without verification (explicit opt-in via –acds-expose-ip).
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
 Unix timestamp (ms) - absolute max lifetime (created_at + 24h).
uint64_t last_activity_at
 Unix timestamp (ms) - updated on join/leave/host updates (cleanup uses this).
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]
 First participant who created/joined the session.
bool host_established
 Whether a host has been designated (false = still negotiating).
uint8_t host_participant_id [16]
 Current host's participant_id (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
 When migration started in nanoseconds (for collection window timeout).
host_lost_candidate_t * migration_candidates [128]
 Candidates received during migration.
participant_t * participants [128]
 Participant array (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 62 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 67 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 76 of file include/ascii-chat/discovery/session.h.

◆ current_participants

uint8_t session_entry::current_participants

Active participant count.

Definition at line 69 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 77 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 73 of file include/ascii-chat/discovery/session.h.

◆ has_password

bool session_entry::has_password

Password protection flag.

Definition at line 72 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 88 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 91 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 86 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]

Current host's participant_id (valid if host_established).

Definition at line 87 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 90 of file include/ascii-chat/discovery/session.h.

◆ host_pubkey

uint8_t session_entry::host_pubkey[32]

Host's Ed25519 key.

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

◆ in_migration

bool session_entry::in_migration

Currently collecting HOST_LOST packets.

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

◆ initiator_id

uint8_t session_entry::initiator_id[16]

First participant who created/joined the session.

Definition at line 85 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 78 of file include/ascii-chat/discovery/session.h.

◆ max_participants

uint8_t session_entry::max_participants

1-128

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

Referenced by database_session_join().

◆ migration_candidates

host_lost_candidate_t* session_entry::migration_candidates[128]

Candidates received during migration.

Definition at line 96 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 95 of file include/ascii-chat/discovery/session.h.

◆ participants

participant_t* session_entry::participants[128]

Participant array (in-memory only).

Definition at line 98 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 71 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 81 of file include/ascii-chat/discovery/session.h.

◆ server_port

uint16_t session_entry::server_port

Port number for client connection.

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

◆ session_id

uint8_t session_entry::session_id[16]

UUID.

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

◆ session_string

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

e.g., "affectionate-acquaintance-acquaintance"

Definition at line 63 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 74 of file include/ascii-chat/discovery/session.h.


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