ascii-chat
Binary v0.16.50-198-g78f51665f
Library lib/v0.3.2-2240-g78f51665f
Video chat in your terminal
Loading...
Searching...
No Matches
peer_manager.c File Reference

Go to the source code of this file.

Data Structures

struct  peer_entry_t
 webrtc peer manager is intentionally a small, concrete record. Fields such as role, Config Module, signaling, peers give callers the identity and current value they need. It is normally borrowed from, or owned by, the surrounding subsystem—not independently managed. More...
struct  pending_ice_candidate
 Hash-table record for one negotiated WebRTC participant. More...
struct  webrtc_peer_manager
 For pending ice candidate, this is the live record that ties candidate, mid, next together. The owning code creates it, updates it while work is active, and releases its handles and pointed-to storage before freeing the record. More...

Macros

#define NETWORK_WEBRTC_PEER_MANAGER_REMOTE_ICE_UFRAG_BUFFER_SIZE   257
#define NETWORK_WEBRTC_PEER_MANAGER_INCOMING_ICE_UFRAG_BUFFER_SIZE   257
#define NETWORK_WEBRTC_PEER_MANAGER_HEX_BUFFER_SIZE   64
#define NETWORK_WEBRTC_PEER_MANAGER_ASCII_BUFFER_SIZE   20
#define MAX_PENDING_ICE_CANDIDATES   64

Typedefs

typedef struct pending_ice_candidate pending_ice_candidate_t
 Hash-table record for one negotiated WebRTC participant.
typedef struct webrtc_peer_manager webrtc_peer_manager_t
 For pending ice candidate, this is the live record that ties candidate, mid, next together. The owning code creates it, updates it while work is active, and releases its handles and pointed-to storage before freeing the record.

Functions

asciichat_error_t webrtc_peer_manager_dispatch_ready (webrtc_peer_manager_t *manager)
asciichat_error_t webrtc_peer_manager_create (const webrtc_peer_manager_config_t *config, const webrtc_signaling_callbacks_t *signaling_callbacks, webrtc_peer_manager_t **manager_out)
 Create a WebRTC peer manager.
void webrtc_peer_manager_destroy (webrtc_peer_manager_t *manager)
 Destroy peer manager and close all connections.
asciichat_error_t webrtc_peer_manager_handle_sdp (webrtc_peer_manager_t *manager, const acip_webrtc_sdp_t *sdp)
 Handle incoming SDP message from ACDS.
asciichat_error_t webrtc_peer_manager_handle_ice (webrtc_peer_manager_t *manager, const acip_webrtc_ice_t *ice)
 Handle incoming ICE candidate from ACDS.
asciichat_error_t webrtc_peer_manager_connect (webrtc_peer_manager_t *manager, const uint8_t session_id[16], const uint8_t participant_id[16])
 Initiate connection to remote peer (joiner role only).
bool webrtc_peer_manager_get_state (webrtc_peer_manager_t *manager, const uint8_t participant_id[16], webrtc_state_t *state_out)
asciichat_error_t webrtc_peer_manager_remove_peer (webrtc_peer_manager_t *manager, const uint8_t participant_id[16])
int webrtc_peer_manager_check_gathering_timeouts (webrtc_peer_manager_t *manager, uint32_t timeout_ms)
 Report slow ICE gathering and remove failed connections.

Macro Definition Documentation

◆ MAX_PENDING_ICE_CANDIDATES

#define MAX_PENDING_ICE_CANDIDATES   64

Definition at line 94 of file peer_manager.c.

◆ NETWORK_WEBRTC_PEER_MANAGER_ASCII_BUFFER_SIZE

#define NETWORK_WEBRTC_PEER_MANAGER_ASCII_BUFFER_SIZE   20

Definition at line 18 of file peer_manager.c.

Referenced by webrtc_peer_manager_handle_ice().

◆ NETWORK_WEBRTC_PEER_MANAGER_HEX_BUFFER_SIZE

#define NETWORK_WEBRTC_PEER_MANAGER_HEX_BUFFER_SIZE   64

Definition at line 17 of file peer_manager.c.

Referenced by webrtc_peer_manager_handle_ice().

◆ NETWORK_WEBRTC_PEER_MANAGER_INCOMING_ICE_UFRAG_BUFFER_SIZE

#define NETWORK_WEBRTC_PEER_MANAGER_INCOMING_ICE_UFRAG_BUFFER_SIZE   257

Definition at line 16 of file peer_manager.c.

Referenced by webrtc_peer_manager_handle_sdp().

◆ NETWORK_WEBRTC_PEER_MANAGER_REMOTE_ICE_UFRAG_BUFFER_SIZE

#define NETWORK_WEBRTC_PEER_MANAGER_REMOTE_ICE_UFRAG_BUFFER_SIZE   257

Definition at line 15 of file peer_manager.c.

Typedef Documentation

◆ pending_ice_candidate_t

Hash-table record for one negotiated WebRTC participant.