Skip to content

transport/xqc_conn.h

Classes

Name
structxqc_trans_settings_t
structxqc_conn_flow_ctl_t
structxqc_hs_buffer_t
structxqc_key_update_ctx_t
structxqc_ping_record_s
structxqc_connection_s

Types

Name
enumxqc_conn_state_t
enumxqc_conn_flag_shift_t
enumxqc_conn_flag_t
typedef struct xqc_ping_record_sxqc_ping_record_t

Functions

Name
const char *xqc_conn_flag_2_str(xqc_connection_t * conn, xqc_conn_flag_t conn_flag)
const char *xqc_conn_state_2_str(xqc_conn_state_t state)
voidxqc_conn_init_flow_ctl(xqc_connection_t * conn)
xqc_connection_t *xqc_conn_create(xqc_engine_t * engine, xqc_cid_t * dcid, xqc_cid_t * scid, const xqc_conn_settings_t * settings, void * user_data, xqc_conn_type_t type)
xqc_connection_t *xqc_conn_server_create(xqc_engine_t * engine, const struct sockaddr * local_addr, socklen_t local_addrlen, const struct sockaddr * peer_addr, socklen_t peer_addrlen, xqc_cid_t * dcid, xqc_cid_t * scid, xqc_conn_settings_t * settings, void * user_data)
voidxqc_conn_destroy(xqc_connection_t * xc)
xqc_int_txqc_conn_client_on_alpn(xqc_connection_t * conn, const unsigned char * alpn, size_t alpn_len)
xqc_int_txqc_conn_server_on_alpn(xqc_connection_t * conn, const unsigned char * alpn, size_t alpn_len)
ssize_txqc_path_send_one_packet(xqc_connection_t * conn, xqc_path_ctx_t * path, xqc_packet_out_t * packet_out)
voidxqc_conn_send_packets(xqc_connection_t * conn)
voidxqc_conn_send_packets_batch(xqc_connection_t * conn)
voidxqc_conn_check_path_utilization(xqc_connection_t * conn)
uint64_txqc_conn_get_unscheduled_bytes(xqc_connection_t * conn)
xqc_int_txqc_conn_enc_packet(xqc_connection_t * conn, xqc_path_ctx_t * path, xqc_packet_out_t * packet_out, char * enc_pkt, size_t enc_pkt_cap, size_t * enc_pkt_len, xqc_usec_t current_time)
voidxqc_conn_transmit_pto_probe_packets(xqc_connection_t * conn)
voidxqc_conn_transmit_pto_probe_packets_batch(xqc_connection_t * conn)
voidxqc_conn_retransmit_lost_packets(xqc_connection_t * conn)
voidxqc_conn_retransmit_lost_packets_batch(xqc_connection_t * conn)
xqc_int_txqc_path_send_ping_to_probe(xqc_path_ctx_t * path, xqc_pkt_num_space_t pns, xqc_path_specified_flag_t flag)
voidxqc_path_send_one_or_two_ack_elicit_pkts(xqc_path_ctx_t * path, xqc_pkt_num_space_t pns)
voidxqc_conn_send_one_ack_eliciting_pkt(xqc_connection_t * conn, xqc_pkt_num_space_t pns)
xqc_int_txqc_conn_check_handshake_completed(xqc_connection_t * conn)
xqc_int_txqc_conn_is_handshake_confirmed(xqc_connection_t * conn)
xqc_int_txqc_conn_immediate_close(xqc_connection_t * conn)
xqc_int_txqc_conn_send_retry(xqc_connection_t * conn, unsigned char * token, unsigned token_len)
xqc_int_txqc_conn_version_check(xqc_connection_t * c, uint32_t version)
xqc_int_txqc_conn_send_version_negotiation(xqc_connection_t * c)
xqc_int_txqc_conn_check_token(xqc_connection_t * conn, const unsigned char * token, unsigned token_len)
voidxqc_conn_gen_token(xqc_connection_t * conn, unsigned char * token, unsigned * token_len)
xqc_int_txqc_conn_early_data_reject(xqc_connection_t * conn)
xqc_int_txqc_conn_early_data_accept(xqc_connection_t * conn)
xqc_bool_txqc_conn_is_ready_to_send_early_data(xqc_connection_t * conn)
xqc_int_txqc_conn_handshake_complete(xqc_connection_t * conn)
xqc_int_txqc_conn_buff_undecrypt_packet_in(xqc_packet_in_t * packet_in, xqc_connection_t * conn, xqc_encrypt_level_t encrypt_level)
xqc_int_txqc_conn_process_undecrypt_packet_in(xqc_connection_t * conn, xqc_encrypt_level_t encrypt_level)
voidxqc_conn_buff_1rtt_packet(xqc_connection_t * conn, xqc_packet_out_t * po)
voidxqc_conn_buff_1rtt_packets(xqc_connection_t * conn)
voidxqc_conn_write_buffed_1rtt_packets(xqc_connection_t * conn)
xqc_usec_txqc_conn_next_wakeup_time(xqc_connection_t * conn)
char *xqc_local_addr_str(xqc_engine_t * engine, const struct sockaddr * local_addr, socklen_t local_addrlen)
char *xqc_peer_addr_str(xqc_engine_t * engine, const struct sockaddr * peer_addr, socklen_t peer_addrlen)
char *xqc_conn_addr_str(xqc_connection_t * conn)
char *xqc_path_addr_str(xqc_path_ctx_t * path)
voidxqc_conn_process_undecrypt_packets(xqc_connection_t * conn)
xqc_int_txqc_conn_has_undecrypt_packets(xqc_connection_t * conn)
xqc_int_txqc_conn_process_packet(xqc_connection_t * c, const unsigned char * packet_in_buf, size_t packet_in_size, xqc_usec_t recv_time)
voidxqc_conn_process_packet_recved_path(xqc_connection_t * conn, xqc_cid_t * scid, size_t packet_in_size, xqc_usec_t recv_time)
xqc_int_txqc_conn_check_handshake_complete(xqc_connection_t * conn)
xqc_int_txqc_conn_get_available_path_id(xqc_connection_t * conn, uint64_t * path_id)
xqc_int_txqc_conn_try_add_new_conn_id(xqc_connection_t * conn, uint64_t retire_prior_to)
xqc_int_txqc_conn_check_dcid(xqc_connection_t * conn, xqc_cid_t * dcid)
voidxqc_conn_destroy_cids(xqc_connection_t * conn)
xqc_int_txqc_conn_update_user_scid(xqc_connection_t * conn)
xqc_int_txqc_conn_set_cid_retired_ts(xqc_connection_t * conn, xqc_cid_inner_t * inner_cid)
xqc_bool_txqc_conn_peer_complete_address_validation(xqc_connection_t * c)
xqc_bool_txqc_conn_has_hsk_keys(xqc_connection_t * c)
void *xqc_conn_get_user_data(xqc_connection_t * c)
xqc_int_txqc_conn_get_local_transport_params(xqc_connection_t * conn, xqc_transport_params_t * params)
xqc_int_txqc_conn_set_early_remote_transport_params(xqc_connection_t * conn, const xqc_transport_params_t * params)
xqc_int_txqc_conn_encode_local_tp(xqc_connection_t * conn, uint8_t * dst, size_t dst_cap, size_t * dst_len)
xqc_int_txqc_conn_on_recv_retry(xqc_connection_t * conn, xqc_cid_t * retry_scid)
xqc_msec_txqc_conn_get_idle_timeout(xqc_connection_t * conn)
xqc_int_txqc_conn_confirm_key_update(xqc_connection_t * conn)
voidxqc_conn_decrease_unacked_stream_ref(xqc_connection_t * conn, xqc_packet_out_t * packet_out)
voidxqc_conn_increase_unacked_stream_ref(xqc_connection_t * conn, xqc_packet_out_t * packet_out)
voidxqc_conn_update_stream_stats_on_sent(xqc_connection_t * conn, xqc_send_ctl_t * ctl, xqc_packet_out_t * packet_out, xqc_usec_t now)
xqc_usec_txqc_conn_get_max_pto(xqc_connection_t * conn)
uint32_txqc_conn_get_max_pto_backoff(xqc_connection_t * conn, uint8_t available_only)
voidxqc_conn_ptmud_probing(xqc_connection_t * conn)
xqc_usec_txqc_conn_get_min_srtt(xqc_connection_t * conn, xqc_bool_t available_only)
xqc_usec_txqc_conn_get_max_srtt(xqc_connection_t * conn)
voidxqc_conn_check_app_limit(xqc_connection_t * conn)
voidxqc_conn_timer_expire(xqc_connection_t * conn, xqc_usec_t now)
voidxqc_conn_closing(xqc_connection_t * conn)
voidxqc_conn_closing_notify(xqc_connection_t * conn)
xqc_int_txqc_conn_send_path_challenge(xqc_connection_t * conn, xqc_path_ctx_t * path)
intxqc_conn_buff_0rtt_datagram(xqc_connection_t * conn, void * data, size_t data_len, uint64_t dgram_id, xqc_data_qos_level_t qos_level)
voidxqc_conn_destroy_0rtt_datagram_buffer_list(xqc_connection_t * conn)
voidxqc_conn_resend_0rtt_datagram(xqc_connection_t * conn)
xqc_gp_timer_id_txqc_conn_register_gp_timer(xqc_connection_t * conn, char * timer_name, xqc_gp_timer_timeout_pt cb, void * user_data)
voidxqc_conn_unregister_gp_timer(xqc_connection_t * conn, xqc_gp_timer_id_t gp_timer_id)
xqc_int_txqc_conn_gp_timer_set(xqc_connection_t * conn, xqc_gp_timer_id_t gp_timer_id, xqc_usec_t expire_time)
xqc_int_txqc_conn_gp_timer_unset(xqc_connection_t * conn, xqc_gp_timer_id_t gp_timer_id)
xqc_int_txqc_conn_gp_timer_get_info(xqc_connection_t * conn, xqc_gp_timer_id_t gp_timer_id, xqc_bool_t * is_set, xqc_usec_t * expire_time)
voidxqc_conn_schedule_packets_to_paths(xqc_connection_t * conn)
voidxqc_conn_encode_transport_state(xqc_connection_t * conn, char * buf, size_t buf_sz)
xqc_uint_txqc_conn_get_mss(xqc_connection_t * conn)
xqc_int_txqc_conn_handle_stateless_reset(xqc_connection_t * conn, const uint8_t * sr_token)
xqc_int_txqc_conn_handle_deprecated_stateless_reset(xqc_connection_t * conn, const xqc_cid_t * scid)
voidxqc_conn_try_to_update_mss(xqc_connection_t * conn)
voidxqc_conn_get_stats_internal(xqc_connection_t * conn, xqc_conn_stats_t * stats)
xqc_ping_record_t *xqc_conn_create_ping_record(xqc_connection_t * conn)
voidxqc_conn_destroy_ping_record(xqc_ping_record_t * pr)
voidxqc_conn_destroy_ping_notification_list(xqc_connection_t * conn)
xqc_int_txqc_conn_send_ping_internal(xqc_connection_t * conn, void * ping_user_data, xqc_bool_t notify)
voidxqc_conn_encode_mp_settings(xqc_connection_t * conn, char * buf, size_t buf_sz)
voidxqc_path_send_packets(xqc_connection_t * conn, xqc_path_ctx_t * path, xqc_list_head_t * head, int congest, xqc_send_type_t send_type)
xqc_int_txqc_conn_try_to_enable_multipath(xqc_connection_t * conn)
xqc_int_txqc_conn_add_path_cid_sets(xqc_connection_t * conn, uint32_t start, uint32_t end)

Attributes

Name
const uint32_tMAX_RSP_CONN_CLOSE_CNT
xqc_conn_settings_tinternal_default_conn_settings
const xqc_tls_callbacks_txqc_conn_tls_cbs
const xqc_h3_conn_settings_tdefault_local_h3_conn_settings

Defines

Name
XQC_MAX_DATAGRAM_REDUNDANCY
XQC_MIN_DATAGRAM_REDUNDANT_PROBE_INTERVAL
XQC_FC_INIT_RTT
XQC_MIN_RECV_WINDOW
XQC_MIN_STANDBY_RPOBE_TIMEOUT
XQC_TOKEN_EXPIRE_DELTA
XQC_TOKEN_UPDATE_DELTA
XQC_MAX_PACKET_PROCESS_BATCH
XQC_MAX_RECV_WINDOW
XQC_MP_SETTINGS_STR_LEN
XQC_DEBUG_PRINT
XQC_CONN_CLOSE_MSG(conn, msg)
XQC_CONN_ERR(conn, err)
XQC_CONN_IMMEDIATE_CLOSE_FLAGS

Types Documentation

enum xqc_conn_state_t

EnumeratorValueDescription
XQC_CONN_STATE_SERVER_INIT0
XQC_CONN_STATE_SERVER_INITIAL_RECVD1
XQC_CONN_STATE_SERVER_INITIAL_SENT2
XQC_CONN_STATE_SERVER_HANDSHAKE_SENT3
XQC_CONN_STATE_SERVER_HANDSHAKE_RECVD4
XQC_CONN_STATE_CLIENT_INIT5
XQC_CONN_STATE_CLIENT_INITIAL_SENT6
XQC_CONN_STATE_CLIENT_INITIAL_RECVD7
XQC_CONN_STATE_CLIENT_HANDSHAKE_RECVD8
XQC_CONN_STATE_CLIENT_HANDSHAKE_SENT9
XQC_CONN_STATE_ESTABED10
XQC_CONN_STATE_CLOSING11
XQC_CONN_STATE_DRAINING12
XQC_CONN_STATE_CLOSED13
XQC_CONN_STATE_N14

enum xqc_conn_flag_shift_t

EnumeratorValueDescription
XQC_CONN_FLAG_WAIT_WAKEUP_SHIFT0
XQC_CONN_FLAG_HANDSHAKE_COMPLETED_SHIFT1
XQC_CONN_FLAG_CAN_SEND_1RTT_SHIFT2
XQC_CONN_FLAG_TICKING_SHIFT3
XQC_CONN_FLAG_ACK_HAS_GAP_SHIFT4
XQC_CONN_FLAG_TIME_OUT_SHIFT5
XQC_CONN_FLAG_ERROR_SHIFT6
XQC_CONN_FLAG_DATA_BLOCKED_SHIFT7
XQC_CONN_FLAG_DCID_OK_SHIFT8
XQC_CONN_FLAG_TOKEN_OK_SHIFT9
XQC_CONN_FLAG_HAS_0RTT_SHIFT10
XQC_CONN_FLAG_0RTT_OK_SHIFT11
XQC_CONN_FLAG_0RTT_REJ_SHIFT12
XQC_CONN_FLAG_UPPER_CONN_EXIST_SHIFT13
XQC_CONN_FLAG_INIT_RECVD_SHIFT14
XQC_CONN_FLAG_NEED_RUN_SHIFT15
XQC_CONN_FLAG_PING_SHIFT16
XQC_CONN_FLAG_HSK_ACKED_SHIFT17
XQC_CONN_FLAG_RESERVE_SHIFT18
XQC_CONN_FLAG_HANDSHAKE_DONE_RECVD_SHIFT19
XQC_CONN_FLAG_UPDATE_NEW_TOKEN_SHIFT20
XQC_CONN_FLAG_VERSION_NEGOTIATION_SHIFT21
XQC_CONN_FLAG_HANDSHAKE_CONFIRMED_SHIFT22
XQC_CONN_FLAG_HANDSHAKE_DONE_ACKED_SHIFT23
XQC_CONN_FLAG_ADDR_VALIDATED_SHIFT24
XQC_CONN_FLAG_NEW_CID_ACKED_SHIFT25
XQC_CONN_FLAG_LINGER_CLOSING_SHIFT26
XQC_CONN_FLAG_RETRY_RECVD_SHIFT27
XQC_CONN_FLAG_TLS_CH_SHIFT28
XQC_CONN_FLAG_TLS_HSK_COMPLETED_SHIFT29
XQC_CONN_FLAG_RECV_NEW_PATH_SHIFT30
XQC_CONN_FLAG_VALIDATE_REBINDING_SHIFT31
XQC_CONN_FLAG_CONN_CLOSING_NOTIFY_SHIFT32
XQC_CONN_FLAG_CONN_CLOSING_NOTIFIED_SHIFT33
XQC_CONN_FLAG_DGRAM_WAIT_FOR_1RTT_SHIFT34
XQC_CONN_FLAG_LOCAL_TP_UPDATED_SHIFT35
XQC_CONN_FLAG_PMTUD_PROBING_SHIFT36
XQC_CONN_FLAG_NO_DGRAM_NOTIFIED_SHIFT37
XQC_CONN_FLAG_DGRAM_MSS_NOTIFY_SHIFT38
XQC_CONN_FLAG_MP_WAIT_SCID_SHIFT39
XQC_CONN_FLAG_MP_WAIT_DCID_SHIFT40
XQC_CONN_FLAG_MP_READY_NOTIFY_SHIFT41
XQC_CONN_FLAG_HANDSHAKE_DONE_SENT_SHIFT42
XQC_CONN_FLAG_SHIFT_NUM43

enum xqc_conn_flag_t

EnumeratorValueDescription
XQC_CONN_FLAG_WAIT_WAKEUP1ULL << XQC_CONN_FLAG_WAIT_WAKEUP_SHIFT
XQC_CONN_FLAG_HANDSHAKE_COMPLETED1ULL << XQC_CONN_FLAG_HANDSHAKE_COMPLETED_SHIFT
XQC_CONN_FLAG_CAN_SEND_1RTT1ULL << XQC_CONN_FLAG_CAN_SEND_1RTT_SHIFT
XQC_CONN_FLAG_TICKING1ULL << XQC_CONN_FLAG_TICKING_SHIFT
XQC_CONN_FLAG_ACK_HAS_GAP1ULL << XQC_CONN_FLAG_ACK_HAS_GAP_SHIFT
XQC_CONN_FLAG_TIME_OUT1ULL << XQC_CONN_FLAG_TIME_OUT_SHIFT
XQC_CONN_FLAG_ERROR1ULL << XQC_CONN_FLAG_ERROR_SHIFT
XQC_CONN_FLAG_DATA_BLOCKED1ULL << XQC_CONN_FLAG_DATA_BLOCKED_SHIFT
XQC_CONN_FLAG_DCID_OK1ULL << XQC_CONN_FLAG_DCID_OK_SHIFT
XQC_CONN_FLAG_TOKEN_OK1ULL << XQC_CONN_FLAG_TOKEN_OK_SHIFT
XQC_CONN_FLAG_HAS_0RTT1ULL << XQC_CONN_FLAG_HAS_0RTT_SHIFT
XQC_CONN_FLAG_0RTT_OK1ULL << XQC_CONN_FLAG_0RTT_OK_SHIFT
XQC_CONN_FLAG_0RTT_REJ1ULL << XQC_CONN_FLAG_0RTT_REJ_SHIFT
XQC_CONN_FLAG_UPPER_CONN_EXIST1ULL << XQC_CONN_FLAG_UPPER_CONN_EXIST_SHIFT
XQC_CONN_FLAG_INIT_RECVD1ULL << XQC_CONN_FLAG_INIT_RECVD_SHIFT
XQC_CONN_FLAG_NEED_RUN1ULL << XQC_CONN_FLAG_NEED_RUN_SHIFT
XQC_CONN_FLAG_PING1ULL << XQC_CONN_FLAG_PING_SHIFT
XQC_CONN_FLAG_HSK_ACKED1ULL << XQC_CONN_FLAG_HSK_ACKED_SHIFT
XQC_CONN_FLAG_RESERVE1ULL << XQC_CONN_FLAG_RESERVE_SHIFT
XQC_CONN_FLAG_HANDSHAKE_DONE_RECVD1ULL << XQC_CONN_FLAG_HANDSHAKE_DONE_RECVD_SHIFT
XQC_CONN_FLAG_UPDATE_NEW_TOKEN1ULL << XQC_CONN_FLAG_UPDATE_NEW_TOKEN_SHIFT
XQC_CONN_FLAG_VERSION_NEGOTIATION1ULL << XQC_CONN_FLAG_VERSION_NEGOTIATION_SHIFT
XQC_CONN_FLAG_HANDSHAKE_CONFIRMED1ULL << XQC_CONN_FLAG_HANDSHAKE_CONFIRMED_SHIFT
XQC_CONN_FLAG_HANDSHAKE_DONE_ACKED1ULL << XQC_CONN_FLAG_HANDSHAKE_DONE_ACKED_SHIFT
XQC_CONN_FLAG_ADDR_VALIDATED1ULL << XQC_CONN_FLAG_ADDR_VALIDATED_SHIFT
XQC_CONN_FLAG_LINGER_CLOSING1ULL << XQC_CONN_FLAG_LINGER_CLOSING_SHIFT
XQC_CONN_FLAG_RETRY_RECVD1ULL << XQC_CONN_FLAG_RETRY_RECVD_SHIFT
XQC_CONN_FLAG_TLS_CH_RECVD1ULL << XQC_CONN_FLAG_TLS_CH_SHIFT
XQC_CONN_FLAG_TLS_HSK_COMPLETED1ULL << XQC_CONN_FLAG_TLS_HSK_COMPLETED_SHIFT
XQC_CONN_FLAG_RECV_NEW_PATH1ULL << XQC_CONN_FLAG_RECV_NEW_PATH_SHIFT
XQC_CONN_FLAG_VALIDATE_REBINDING1ULL << XQC_CONN_FLAG_VALIDATE_REBINDING_SHIFT
XQC_CONN_FLAG_CLOSING_NOTIFY1ULL << XQC_CONN_FLAG_CONN_CLOSING_NOTIFY_SHIFT
XQC_CONN_FLAG_CLOSING_NOTIFIED1ULL << XQC_CONN_FLAG_CONN_CLOSING_NOTIFIED_SHIFT
XQC_CONN_FLAG_DGRAM_WAIT_FOR_1RTT1ULL << XQC_CONN_FLAG_DGRAM_WAIT_FOR_1RTT_SHIFT
XQC_CONN_FLAG_LOCAL_TP_UPDATED1ULL << XQC_CONN_FLAG_LOCAL_TP_UPDATED_SHIFT
XQC_CONN_FLAG_PMTUD_PROBING1ULL << XQC_CONN_FLAG_PMTUD_PROBING_SHIFT
XQC_CONN_FLAG_NO_DGRAM_NOTIFIED1ULL << XQC_CONN_FLAG_NO_DGRAM_NOTIFIED_SHIFT
XQC_CONN_FLAG_DGRAM_MSS_NOTIFY1ULL << XQC_CONN_FLAG_DGRAM_MSS_NOTIFY_SHIFT
XQC_CONN_FLAG_MP_WAIT_MP_READY1ULL << XQC_CONN_FLAG_MP_WAIT_MP_READY_SHIFT
XQC_CONN_FLAG_MP_READY_NOTIFY1ULL << XQC_CONN_FLAG_MP_READY_NOTIFY_SHIFT
XQC_CONN_FLAG_HANDSHAKE_DONE_SENT1ULL << XQC_CONN_FLAG_HANDSHAKE_DONE_SENT_SHIFT

typedef xqc_ping_record_t

cpp
typedef struct xqc_ping_record_s xqc_ping_record_t;

Functions Documentation

function xqc_conn_flag_2_str

cpp
const char * xqc_conn_flag_2_str(
    xqc_connection_t * conn,
    xqc_conn_flag_t conn_flag
)

function xqc_conn_state_2_str

cpp
const char * xqc_conn_state_2_str(
    xqc_conn_state_t state
)

function xqc_conn_init_flow_ctl

cpp
void xqc_conn_init_flow_ctl(
    xqc_connection_t * conn
)

function xqc_conn_create

cpp
xqc_connection_t * xqc_conn_create(
    xqc_engine_t * engine,
    xqc_cid_t * dcid,
    xqc_cid_t * scid,
    const xqc_conn_settings_t * settings,
    void * user_data,
    xqc_conn_type_t type
)

function xqc_conn_server_create

cpp
xqc_connection_t * xqc_conn_server_create(
    xqc_engine_t * engine,
    const struct sockaddr * local_addr,
    socklen_t local_addrlen,
    const struct sockaddr * peer_addr,
    socklen_t peer_addrlen,
    xqc_cid_t * dcid,
    xqc_cid_t * scid,
    xqc_conn_settings_t * settings,
    void * user_data
)

function xqc_conn_destroy

cpp
void xqc_conn_destroy(
    xqc_connection_t * xc
)

function xqc_conn_client_on_alpn

cpp
xqc_int_t xqc_conn_client_on_alpn(
    xqc_connection_t * conn,
    const unsigned char * alpn,
    size_t alpn_len
)

function xqc_conn_server_on_alpn

cpp
xqc_int_t xqc_conn_server_on_alpn(
    xqc_connection_t * conn,
    const unsigned char * alpn,
    size_t alpn_len
)

function xqc_path_send_one_packet

cpp
ssize_t xqc_path_send_one_packet(
    xqc_connection_t * conn,
    xqc_path_ctx_t * path,
    xqc_packet_out_t * packet_out
)

function xqc_conn_send_packets

cpp
void xqc_conn_send_packets(
    xqc_connection_t * conn
)

function xqc_conn_send_packets_batch

cpp
void xqc_conn_send_packets_batch(
    xqc_connection_t * conn
)

function xqc_conn_check_path_utilization

cpp
void xqc_conn_check_path_utilization(
    xqc_connection_t * conn
)

function xqc_conn_get_unscheduled_bytes

cpp
uint64_t xqc_conn_get_unscheduled_bytes(
    xqc_connection_t * conn
)

function xqc_conn_enc_packet

cpp
xqc_int_t xqc_conn_enc_packet(
    xqc_connection_t * conn,
    xqc_path_ctx_t * path,
    xqc_packet_out_t * packet_out,
    char * enc_pkt,
    size_t enc_pkt_cap,
    size_t * enc_pkt_len,
    xqc_usec_t current_time
)

function xqc_conn_transmit_pto_probe_packets

cpp
void xqc_conn_transmit_pto_probe_packets(
    xqc_connection_t * conn
)

function xqc_conn_transmit_pto_probe_packets_batch

cpp
void xqc_conn_transmit_pto_probe_packets_batch(
    xqc_connection_t * conn
)

function xqc_conn_retransmit_lost_packets

cpp
void xqc_conn_retransmit_lost_packets(
    xqc_connection_t * conn
)

function xqc_conn_retransmit_lost_packets_batch

cpp
void xqc_conn_retransmit_lost_packets_batch(
    xqc_connection_t * conn
)

function xqc_path_send_ping_to_probe

cpp
xqc_int_t xqc_path_send_ping_to_probe(
    xqc_path_ctx_t * path,
    xqc_pkt_num_space_t pns,
    xqc_path_specified_flag_t flag
)

function xqc_path_send_one_or_two_ack_elicit_pkts

cpp
void xqc_path_send_one_or_two_ack_elicit_pkts(
    xqc_path_ctx_t * path,
    xqc_pkt_num_space_t pns
)

function xqc_conn_send_one_ack_eliciting_pkt

cpp
void xqc_conn_send_one_ack_eliciting_pkt(
    xqc_connection_t * conn,
    xqc_pkt_num_space_t pns
)

function xqc_conn_check_handshake_completed

cpp
xqc_int_t xqc_conn_check_handshake_completed(
    xqc_connection_t * conn
)

function xqc_conn_is_handshake_confirmed

cpp
xqc_int_t xqc_conn_is_handshake_confirmed(
    xqc_connection_t * conn
)

function xqc_conn_immediate_close

cpp
xqc_int_t xqc_conn_immediate_close(
    xqc_connection_t * conn
)

function xqc_conn_send_retry

cpp
xqc_int_t xqc_conn_send_retry(
    xqc_connection_t * conn,
    unsigned char * token,
    unsigned token_len
)

function xqc_conn_version_check

cpp
xqc_int_t xqc_conn_version_check(
    xqc_connection_t * c,
    uint32_t version
)

function xqc_conn_send_version_negotiation

cpp
xqc_int_t xqc_conn_send_version_negotiation(
    xqc_connection_t * c
)

function xqc_conn_check_token

cpp
xqc_int_t xqc_conn_check_token(
    xqc_connection_t * conn,
    const unsigned char * token,
    unsigned token_len
)

function xqc_conn_gen_token

cpp
void xqc_conn_gen_token(
    xqc_connection_t * conn,
    unsigned char * token,
    unsigned * token_len
)

function xqc_conn_early_data_reject

cpp
xqc_int_t xqc_conn_early_data_reject(
    xqc_connection_t * conn
)

function xqc_conn_early_data_accept

cpp
xqc_int_t xqc_conn_early_data_accept(
    xqc_connection_t * conn
)

function xqc_conn_is_ready_to_send_early_data

cpp
xqc_bool_t xqc_conn_is_ready_to_send_early_data(
    xqc_connection_t * conn
)

function xqc_conn_handshake_complete

cpp
xqc_int_t xqc_conn_handshake_complete(
    xqc_connection_t * conn
)

function xqc_conn_buff_undecrypt_packet_in

cpp
xqc_int_t xqc_conn_buff_undecrypt_packet_in(
    xqc_packet_in_t * packet_in,
    xqc_connection_t * conn,
    xqc_encrypt_level_t encrypt_level
)

function xqc_conn_process_undecrypt_packet_in

cpp
xqc_int_t xqc_conn_process_undecrypt_packet_in(
    xqc_connection_t * conn,
    xqc_encrypt_level_t encrypt_level
)

function xqc_conn_buff_1rtt_packet

cpp
void xqc_conn_buff_1rtt_packet(
    xqc_connection_t * conn,
    xqc_packet_out_t * po
)

function xqc_conn_buff_1rtt_packets

cpp
void xqc_conn_buff_1rtt_packets(
    xqc_connection_t * conn
)

function xqc_conn_write_buffed_1rtt_packets

cpp
void xqc_conn_write_buffed_1rtt_packets(
    xqc_connection_t * conn
)

function xqc_conn_next_wakeup_time

cpp
xqc_usec_t xqc_conn_next_wakeup_time(
    xqc_connection_t * conn
)

function xqc_local_addr_str

cpp
char * xqc_local_addr_str(
    xqc_engine_t * engine,
    const struct sockaddr * local_addr,
    socklen_t local_addrlen
)

function xqc_peer_addr_str

cpp
char * xqc_peer_addr_str(
    xqc_engine_t * engine,
    const struct sockaddr * peer_addr,
    socklen_t peer_addrlen
)

function xqc_conn_addr_str

cpp
char * xqc_conn_addr_str(
    xqc_connection_t * conn
)

function xqc_path_addr_str

cpp
char * xqc_path_addr_str(
    xqc_path_ctx_t * path
)

function xqc_conn_process_undecrypt_packets

cpp
static inline void xqc_conn_process_undecrypt_packets(
    xqc_connection_t * conn
)

function xqc_conn_has_undecrypt_packets

cpp
static inline xqc_int_t xqc_conn_has_undecrypt_packets(
    xqc_connection_t * conn
)

function xqc_conn_process_packet

cpp
xqc_int_t xqc_conn_process_packet(
    xqc_connection_t * c,
    const unsigned char * packet_in_buf,
    size_t packet_in_size,
    xqc_usec_t recv_time
)

function xqc_conn_process_packet_recved_path

cpp
void xqc_conn_process_packet_recved_path(
    xqc_connection_t * conn,
    xqc_cid_t * scid,
    size_t packet_in_size,
    xqc_usec_t recv_time
)

function xqc_conn_check_handshake_complete

cpp
xqc_int_t xqc_conn_check_handshake_complete(
    xqc_connection_t * conn
)

function xqc_conn_get_available_path_id

cpp
xqc_int_t xqc_conn_get_available_path_id(
    xqc_connection_t * conn,
    uint64_t * path_id
)

function xqc_conn_try_add_new_conn_id

cpp
xqc_int_t xqc_conn_try_add_new_conn_id(
    xqc_connection_t * conn,
    uint64_t retire_prior_to
)

function xqc_conn_check_dcid

cpp
xqc_int_t xqc_conn_check_dcid(
    xqc_connection_t * conn,
    xqc_cid_t * dcid
)

function xqc_conn_destroy_cids

cpp
void xqc_conn_destroy_cids(
    xqc_connection_t * conn
)

function xqc_conn_update_user_scid

cpp
xqc_int_t xqc_conn_update_user_scid(
    xqc_connection_t * conn
)

function xqc_conn_set_cid_retired_ts

cpp
xqc_int_t xqc_conn_set_cid_retired_ts(
    xqc_connection_t * conn,
    xqc_cid_inner_t * inner_cid
)

function xqc_conn_peer_complete_address_validation

cpp
xqc_bool_t xqc_conn_peer_complete_address_validation(
    xqc_connection_t * c
)

function xqc_conn_has_hsk_keys

cpp
xqc_bool_t xqc_conn_has_hsk_keys(
    xqc_connection_t * c
)

function xqc_conn_get_user_data

cpp
void * xqc_conn_get_user_data(
    xqc_connection_t * c
)

function xqc_conn_get_local_transport_params

cpp
xqc_int_t xqc_conn_get_local_transport_params(
    xqc_connection_t * conn,
    xqc_transport_params_t * params
)

function xqc_conn_set_early_remote_transport_params

cpp
xqc_int_t xqc_conn_set_early_remote_transport_params(
    xqc_connection_t * conn,
    const xqc_transport_params_t * params
)

function xqc_conn_encode_local_tp

cpp
xqc_int_t xqc_conn_encode_local_tp(
    xqc_connection_t * conn,
    uint8_t * dst,
    size_t dst_cap,
    size_t * dst_len
)

function xqc_conn_on_recv_retry

cpp
xqc_int_t xqc_conn_on_recv_retry(
    xqc_connection_t * conn,
    xqc_cid_t * retry_scid
)

function xqc_conn_get_idle_timeout

cpp
xqc_msec_t xqc_conn_get_idle_timeout(
    xqc_connection_t * conn
)

function xqc_conn_confirm_key_update

cpp
xqc_int_t xqc_conn_confirm_key_update(
    xqc_connection_t * conn
)

function xqc_conn_decrease_unacked_stream_ref

cpp
void xqc_conn_decrease_unacked_stream_ref(
    xqc_connection_t * conn,
    xqc_packet_out_t * packet_out
)

function xqc_conn_increase_unacked_stream_ref

cpp
void xqc_conn_increase_unacked_stream_ref(
    xqc_connection_t * conn,
    xqc_packet_out_t * packet_out
)

function xqc_conn_update_stream_stats_on_sent

cpp
void xqc_conn_update_stream_stats_on_sent(
    xqc_connection_t * conn,
    xqc_send_ctl_t * ctl,
    xqc_packet_out_t * packet_out,
    xqc_usec_t now
)

function xqc_conn_get_max_pto

cpp
xqc_usec_t xqc_conn_get_max_pto(
    xqc_connection_t * conn
)

function xqc_conn_get_max_pto_backoff

cpp
uint32_t xqc_conn_get_max_pto_backoff(
    xqc_connection_t * conn,
    uint8_t available_only
)

function xqc_conn_ptmud_probing

cpp
void xqc_conn_ptmud_probing(
    xqc_connection_t * conn
)

function xqc_conn_get_min_srtt

cpp
xqc_usec_t xqc_conn_get_min_srtt(
    xqc_connection_t * conn,
    xqc_bool_t available_only
)

function xqc_conn_get_max_srtt

cpp
xqc_usec_t xqc_conn_get_max_srtt(
    xqc_connection_t * conn
)

function xqc_conn_check_app_limit

cpp
void xqc_conn_check_app_limit(
    xqc_connection_t * conn
)

function xqc_conn_timer_expire

cpp
void xqc_conn_timer_expire(
    xqc_connection_t * conn,
    xqc_usec_t now
)

function xqc_conn_closing

cpp
void xqc_conn_closing(
    xqc_connection_t * conn
)

function xqc_conn_closing_notify

cpp
void xqc_conn_closing_notify(
    xqc_connection_t * conn
)

function xqc_conn_send_path_challenge

cpp
xqc_int_t xqc_conn_send_path_challenge(
    xqc_connection_t * conn,
    xqc_path_ctx_t * path
)

function xqc_conn_buff_0rtt_datagram

cpp
int xqc_conn_buff_0rtt_datagram(
    xqc_connection_t * conn,
    void * data,
    size_t data_len,
    uint64_t dgram_id,
    xqc_data_qos_level_t qos_level
)

function xqc_conn_destroy_0rtt_datagram_buffer_list

cpp
void xqc_conn_destroy_0rtt_datagram_buffer_list(
    xqc_connection_t * conn
)

function xqc_conn_resend_0rtt_datagram

cpp
void xqc_conn_resend_0rtt_datagram(
    xqc_connection_t * conn
)

function xqc_conn_register_gp_timer

cpp
xqc_gp_timer_id_t xqc_conn_register_gp_timer(
    xqc_connection_t * conn,
    char * timer_name,
    xqc_gp_timer_timeout_pt cb,
    void * user_data
)

function xqc_conn_unregister_gp_timer

cpp
void xqc_conn_unregister_gp_timer(
    xqc_connection_t * conn,
    xqc_gp_timer_id_t gp_timer_id
)

function xqc_conn_gp_timer_set

cpp
xqc_int_t xqc_conn_gp_timer_set(
    xqc_connection_t * conn,
    xqc_gp_timer_id_t gp_timer_id,
    xqc_usec_t expire_time
)

function xqc_conn_gp_timer_unset

cpp
xqc_int_t xqc_conn_gp_timer_unset(
    xqc_connection_t * conn,
    xqc_gp_timer_id_t gp_timer_id
)

function xqc_conn_gp_timer_get_info

cpp
xqc_int_t xqc_conn_gp_timer_get_info(
    xqc_connection_t * conn,
    xqc_gp_timer_id_t gp_timer_id,
    xqc_bool_t * is_set,
    xqc_usec_t * expire_time
)

function xqc_conn_schedule_packets_to_paths

cpp
void xqc_conn_schedule_packets_to_paths(
    xqc_connection_t * conn
)

function xqc_conn_encode_transport_state

cpp
void xqc_conn_encode_transport_state(
    xqc_connection_t * conn,
    char * buf,
    size_t buf_sz
)

function xqc_conn_get_mss

cpp
static inline xqc_uint_t xqc_conn_get_mss(
    xqc_connection_t * conn
)

function xqc_conn_handle_stateless_reset

cpp
xqc_int_t xqc_conn_handle_stateless_reset(
    xqc_connection_t * conn,
    const uint8_t * sr_token
)

function xqc_conn_handle_deprecated_stateless_reset

cpp
xqc_int_t xqc_conn_handle_deprecated_stateless_reset(
    xqc_connection_t * conn,
    const xqc_cid_t * scid
)

function xqc_conn_try_to_update_mss

cpp
void xqc_conn_try_to_update_mss(
    xqc_connection_t * conn
)

function xqc_conn_get_stats_internal

cpp
void xqc_conn_get_stats_internal(
    xqc_connection_t * conn,
    xqc_conn_stats_t * stats
)

function xqc_conn_create_ping_record

cpp
xqc_ping_record_t * xqc_conn_create_ping_record(
    xqc_connection_t * conn
)

function xqc_conn_destroy_ping_record

cpp
void xqc_conn_destroy_ping_record(
    xqc_ping_record_t * pr
)

function xqc_conn_destroy_ping_notification_list

cpp
void xqc_conn_destroy_ping_notification_list(
    xqc_connection_t * conn
)

function xqc_conn_send_ping_internal

cpp
xqc_int_t xqc_conn_send_ping_internal(
    xqc_connection_t * conn,
    void * ping_user_data,
    xqc_bool_t notify
)

function xqc_conn_encode_mp_settings

cpp
void xqc_conn_encode_mp_settings(
    xqc_connection_t * conn,
    char * buf,
    size_t buf_sz
)

function xqc_path_send_packets

cpp
void xqc_path_send_packets(
    xqc_connection_t * conn,
    xqc_path_ctx_t * path,
    xqc_list_head_t * head,
    int congest,
    xqc_send_type_t send_type
)

function xqc_conn_try_to_enable_multipath

cpp
xqc_int_t xqc_conn_try_to_enable_multipath(
    xqc_connection_t * conn
)

function xqc_conn_add_path_cid_sets

cpp
xqc_int_t xqc_conn_add_path_cid_sets(
    xqc_connection_t * conn,
    uint32_t start,
    uint32_t end
)

Attributes Documentation

variable MAX_RSP_CONN_CLOSE_CNT

cpp
static const uint32_t MAX_RSP_CONN_CLOSE_CNT = 3;

variable internal_default_conn_settings

cpp
xqc_conn_settings_t internal_default_conn_settings;

variable xqc_conn_tls_cbs

cpp
const xqc_tls_callbacks_t xqc_conn_tls_cbs;

variable default_local_h3_conn_settings

cpp
const xqc_h3_conn_settings_t default_local_h3_conn_settings;

Macros Documentation

define XQC_MAX_DATAGRAM_REDUNDANCY

cpp
#define XQC_MAX_DATAGRAM_REDUNDANCY 2

Copyright: Copyright (c) 2022, Alibaba Group Holding Limited

define XQC_MIN_DATAGRAM_REDUNDANT_PROBE_INTERVAL

cpp
#define XQC_MIN_DATAGRAM_REDUNDANT_PROBE_INTERVAL 30000 /* 30ms min probing interval */

define XQC_FC_INIT_RTT

cpp
#define XQC_FC_INIT_RTT 60000

define XQC_MIN_RECV_WINDOW

cpp
#define XQC_MIN_RECV_WINDOW (63000) /* ~ 1MBps when RTT = 60ms */

define XQC_MIN_STANDBY_RPOBE_TIMEOUT

cpp
#define XQC_MIN_STANDBY_RPOBE_TIMEOUT 500 /* 500ms */

define XQC_TOKEN_EXPIRE_DELTA

cpp
#define XQC_TOKEN_EXPIRE_DELTA (7 * 24 * 60 * 60)           /* expire in N seconds */

define XQC_TOKEN_UPDATE_DELTA

cpp
#define XQC_TOKEN_UPDATE_DELTA (XQC_TOKEN_EXPIRE_DELTA / 2) /* early update */

define XQC_MAX_PACKET_PROCESS_BATCH

cpp
#define XQC_MAX_PACKET_PROCESS_BATCH 100

define XQC_MAX_RECV_WINDOW

cpp
#define XQC_MAX_RECV_WINDOW (16 * 1024 * 1024)

define XQC_MP_SETTINGS_STR_LEN

cpp
#define XQC_MP_SETTINGS_STR_LEN (30)

define XQC_DEBUG_PRINT

cpp
#define XQC_DEBUG_PRINT

define XQC_CONN_CLOSE_MSG

cpp
#define XQC_CONN_CLOSE_MSG(
    conn,
    msg
)
    do {          \
    if ((conn)->conn_close_msg == NULL) {           \
        (conn)->conn_close_msg = (msg);             \
    }                                               \
} while(0)                                          \

define XQC_CONN_ERR

cpp
#define XQC_CONN_ERR(
    conn,
    err
)
    do {                \
    if ((conn)->conn_err == 0) {                    \
        (conn)->conn_err = (err);                   \
        XQC_CONN_CLOSE_MSG(conn, "local error");    \
        (conn)->conn_flag |= XQC_CONN_FLAG_ERROR;   \
        xqc_conn_closing(conn);                     \
        xqc_log((conn)->log, XQC_LOG_ERROR, "|conn:%p|err:0x%xi|%s|", (conn), (uint64_t)(err), xqc_conn_addr_str(conn)); \
    }                                               \
} while(0)                                          \

define XQC_CONN_IMMEDIATE_CLOSE_FLAGS

cpp
#define XQC_CONN_IMMEDIATE_CLOSE_FLAGS (XQC_CONN_FLAG_ERROR)

Updated on 2024-11-19 at 20:49:45 +0800