ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
acip_client_callbacks_t Struct Reference

Client-side packet handler callbacks. More...

#include <include/ascii-chat/network/acip/handlers.h>

Data Fields

void(* on_ascii_frame )(const ascii_frame_packet_t *header, const void *frame_data, size_t data_len, void *ctx)
 Called when ASCII frame received from server.
 
void(* on_audio )(const void *audio_data, size_t audio_len, void *ctx)
 Called when raw audio received from server.
 
void(* on_audio_batch )(const audio_batch_packet_t *header, const float *samples, size_t num_samples, void *ctx)
 Called when audio batch received from server.
 
void(* on_audio_opus )(const void *opus_data, size_t opus_len, void *ctx)
 Called when Opus audio received from server.
 
void(* on_audio_opus_batch )(const void *batch_data, size_t batch_len, void *ctx)
 Called when Opus batch received from server.
 
void(* on_server_state )(const server_state_packet_t *state, void *ctx)
 Called when server state update received.
 
void(* on_error )(const error_packet_t *header, const char *message, void *ctx)
 Called when error message received.
 
void(* on_remote_log )(const remote_log_packet_t *header, const char *message, void *ctx)
 Called when remote log received.
 
void(* on_ping )(void *ctx)
 Called when ping received (should send pong)
 
void(* on_pong )(void *ctx)
 Called when pong received.
 
void(* on_clear_console )(void *ctx)
 Called when server requests console clear.
 
void(* on_crypto_rekey_request )(const void *payload, size_t payload_len, void *ctx)
 Called when server sends crypto rekey request.
 
void(* on_crypto_rekey_response )(const void *payload, size_t payload_len, void *ctx)
 Called when server sends crypto rekey response.
 
void(* on_webrtc_sdp )(const acip_webrtc_sdp_t *sdp, size_t total_len, void *ctx)
 Called when WebRTC SDP offer/answer received.
 
void(* on_webrtc_ice )(const acip_webrtc_ice_t *ice, size_t total_len, void *ctx)
 Called when WebRTC ICE candidate received.
 
void(* on_session_joined )(const acip_session_joined_t *joined, void *ctx)
 Called when ACDS session join response received (Phase 3 WebRTC integration)
 
void(* on_crypto_parameters )(packet_type_t type, const void *payload, size_t payload_len, void *ctx)
 Called when server sends CRYPTO_PARAMETERS (algorithm negotiation)
 
void(* on_crypto_key_exchange_init )(packet_type_t type, const void *payload, size_t payload_len, void *ctx)
 Called when server sends KEY_EXCHANGE_INIT (crypto handshake)
 
void(* on_crypto_auth_challenge )(packet_type_t type, const void *payload, size_t payload_len, void *ctx)
 Called when server sends AUTH_CHALLENGE (crypto handshake)
 
void(* on_crypto_server_auth_resp )(packet_type_t type, const void *payload, size_t payload_len, void *ctx)
 Called when server sends SERVER_AUTH_RESP (crypto handshake mutual auth)
 
void(* on_crypto_auth_failed )(packet_type_t type, const void *payload, size_t payload_len, void *ctx)
 Called when server sends AUTH_FAILED (crypto handshake failure)
 
void(* on_crypto_handshake_complete )(packet_type_t type, const void *payload, size_t payload_len, void *ctx)
 Called when server sends HANDSHAKE_COMPLETE (crypto handshake success)
 
void * app_ctx
 Application context (passed to all callbacks)
 

Detailed Description

Client-side packet handler callbacks.

Applications implement these callbacks to handle incoming packets. NULL callbacks are skipped (no-op).

Definition at line 51 of file handlers.h.

Field Documentation

◆ app_ctx

void* acip_client_callbacks_t::app_ctx

Application context (passed to all callbacks)

Definition at line 119 of file handlers.h.

◆ on_ascii_frame

void(* acip_client_callbacks_t::on_ascii_frame) (const ascii_frame_packet_t *header, const void *frame_data, size_t data_len, void *ctx)

Called when ASCII frame received from server.

Definition at line 53 of file handlers.h.

◆ on_audio

void(* acip_client_callbacks_t::on_audio) (const void *audio_data, size_t audio_len, void *ctx)

Called when raw audio received from server.

Definition at line 56 of file handlers.h.

◆ on_audio_batch

void(* acip_client_callbacks_t::on_audio_batch) (const audio_batch_packet_t *header, const float *samples, size_t num_samples, void *ctx)

Called when audio batch received from server.

Definition at line 59 of file handlers.h.

◆ on_audio_opus

void(* acip_client_callbacks_t::on_audio_opus) (const void *opus_data, size_t opus_len, void *ctx)

Called when Opus audio received from server.

Definition at line 62 of file handlers.h.

◆ on_audio_opus_batch

void(* acip_client_callbacks_t::on_audio_opus_batch) (const void *batch_data, size_t batch_len, void *ctx)

Called when Opus batch received from server.

Definition at line 65 of file handlers.h.

◆ on_clear_console

void(* acip_client_callbacks_t::on_clear_console) (void *ctx)

Called when server requests console clear.

Definition at line 83 of file handlers.h.

◆ on_crypto_auth_challenge

void(* acip_client_callbacks_t::on_crypto_auth_challenge) (packet_type_t type, const void *payload, size_t payload_len, void *ctx)

Called when server sends AUTH_CHALLENGE (crypto handshake)

Definition at line 107 of file handlers.h.

◆ on_crypto_auth_failed

void(* acip_client_callbacks_t::on_crypto_auth_failed) (packet_type_t type, const void *payload, size_t payload_len, void *ctx)

Called when server sends AUTH_FAILED (crypto handshake failure)

Definition at line 113 of file handlers.h.

◆ on_crypto_handshake_complete

void(* acip_client_callbacks_t::on_crypto_handshake_complete) (packet_type_t type, const void *payload, size_t payload_len, void *ctx)

Called when server sends HANDSHAKE_COMPLETE (crypto handshake success)

Definition at line 116 of file handlers.h.

◆ on_crypto_key_exchange_init

void(* acip_client_callbacks_t::on_crypto_key_exchange_init) (packet_type_t type, const void *payload, size_t payload_len, void *ctx)

Called when server sends KEY_EXCHANGE_INIT (crypto handshake)

Definition at line 104 of file handlers.h.

◆ on_crypto_parameters

void(* acip_client_callbacks_t::on_crypto_parameters) (packet_type_t type, const void *payload, size_t payload_len, void *ctx)

Called when server sends CRYPTO_PARAMETERS (algorithm negotiation)

Definition at line 101 of file handlers.h.

◆ on_crypto_rekey_request

void(* acip_client_callbacks_t::on_crypto_rekey_request) (const void *payload, size_t payload_len, void *ctx)

Called when server sends crypto rekey request.

Definition at line 86 of file handlers.h.

◆ on_crypto_rekey_response

void(* acip_client_callbacks_t::on_crypto_rekey_response) (const void *payload, size_t payload_len, void *ctx)

Called when server sends crypto rekey response.

Definition at line 89 of file handlers.h.

◆ on_crypto_server_auth_resp

void(* acip_client_callbacks_t::on_crypto_server_auth_resp) (packet_type_t type, const void *payload, size_t payload_len, void *ctx)

Called when server sends SERVER_AUTH_RESP (crypto handshake mutual auth)

Definition at line 110 of file handlers.h.

◆ on_error

void(* acip_client_callbacks_t::on_error) (const error_packet_t *header, const char *message, void *ctx)

Called when error message received.

Definition at line 71 of file handlers.h.

◆ on_ping

void(* acip_client_callbacks_t::on_ping) (void *ctx)

Called when ping received (should send pong)

Definition at line 77 of file handlers.h.

◆ on_pong

void(* acip_client_callbacks_t::on_pong) (void *ctx)

Called when pong received.

Definition at line 80 of file handlers.h.

◆ on_remote_log

void(* acip_client_callbacks_t::on_remote_log) (const remote_log_packet_t *header, const char *message, void *ctx)

Called when remote log received.

Definition at line 74 of file handlers.h.

◆ on_server_state

void(* acip_client_callbacks_t::on_server_state) (const server_state_packet_t *state, void *ctx)

Called when server state update received.

Definition at line 68 of file handlers.h.

◆ on_session_joined

void(* acip_client_callbacks_t::on_session_joined) (const acip_session_joined_t *joined, void *ctx)

Called when ACDS session join response received (Phase 3 WebRTC integration)

Definition at line 98 of file handlers.h.

◆ on_webrtc_ice

void(* acip_client_callbacks_t::on_webrtc_ice) (const acip_webrtc_ice_t *ice, size_t total_len, void *ctx)

Called when WebRTC ICE candidate received.

Definition at line 95 of file handlers.h.

◆ on_webrtc_sdp

void(* acip_client_callbacks_t::on_webrtc_sdp) (const acip_webrtc_sdp_t *sdp, size_t total_len, void *ctx)

Called when WebRTC SDP offer/answer received.

Definition at line 92 of file handlers.h.


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