133 char extensions[256];
⚠️‼️ Error and/or exit() when things go bad.
asciichat_error_t
Error and exit codes - unified status values (0-255)
asciichat_error_t ice_get_selected_pair(ice_candidate_t *local_candidate, ice_candidate_t *remote_candidate)
Get selected candidate pair.
ice_protocol_t
ICE candidate transport protocol.
const char * ice_protocol_name(ice_protocol_t protocol)
Get human-readable protocol name.
uint32_t ice_calculate_priority(ice_candidate_type_t type, uint16_t local_preference, uint8_t component_id)
Calculate candidate priority.
bool ice_is_connected(void)
Check ICE connection state.
ice_candidate_type_t
ICE candidate type enumeration (RFC 5245)
@ ICE_CANDIDATE_SRFLX
Server-reflexive (NAT-discovered via STUN)
@ ICE_CANDIDATE_HOST
Host candidate (local IP address)
@ ICE_CANDIDATE_RELAY
Relay candidate (TURN server)
@ ICE_CANDIDATE_PRFLX
Peer-reflexive (discovered during checks)
asciichat_error_t(* ice_send_candidate_callback_t)(const ice_candidate_t *candidate, const char *mid, void *user_data)
Callback for sending ICE candidate to peer.
asciichat_error_t ice_format_candidate(const ice_candidate_t *candidate, char *line, size_t line_size)
Format ICE candidate to attribute string.
asciichat_error_t ice_add_remote_candidate(const ice_candidate_t *candidate, const char *mid)
Add remote candidate to peer connection.
asciichat_error_t ice_parse_candidate(const char *line, ice_candidate_t *candidate)
Parse ICE candidate from attribute string.
ice_tcp_type_t
ICE candidate TCP type (if applicable)
@ ICE_TCP_TYPE_SO
Simultaneous open.
@ ICE_TCP_TYPE_ACTIVE
Actively opens connection.
@ ICE_TCP_TYPE_PASSIVE
Passively waits for connection.
const char * ice_candidate_type_name(ice_candidate_type_t type)
Get human-readable candidate type name.
asciichat_error_t ice_gather_candidates(const ice_config_t *config)
Start ICE candidate gathering.
Single ICE candidate for connectivity.
uint16_t port
Port number.
uint32_t component_id
Component (1=RTP, 2=RTCP; usually 1)
ice_candidate_type_t type
host, srflx, prflx, or relay
uint32_t priority
Candidate priority (used for preference)
uint16_t rport
Related port.
ice_protocol_t protocol
UDP or TCP.
ice_tcp_type_t tcp_type
active, passive, so
ICE gathering configuration.
void * user_data
Passed to callback.
const char * ufrag
Username fragment for ICE (from offer)
ice_send_candidate_callback_t send_callback
Called for each gathered candidate.
const char * pwd
Password for ICE (from offer)