Lines Matching refs:ch
32 static int depack_do_implicit_stream_create(QUIC_CHANNEL *ch,
44 static int depack_do_frame_ping(PACKET *pkt, QUIC_CHANNEL *ch, in depack_do_frame_ping() argument
50 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_ping()
57 ossl_quic_tx_packetiser_schedule_ack_eliciting(ch->txp, enc_level); in depack_do_frame_ping()
61 static int depack_do_frame_ack(PACKET *pkt, QUIC_CHANNEL *ch, in depack_do_frame_ack() argument
69 uint32_t ack_delay_exp = ch->rx_ack_delay_exp; in depack_do_frame_ack()
76 if (ch->num_ack_range_scratch < (size_t)total_ranges) { in depack_do_frame_ack()
77 if ((p = OPENSSL_realloc(ch->ack_range_scratch, in depack_do_frame_ack()
82 ch->ack_range_scratch = p; in depack_do_frame_ack()
83 ch->num_ack_range_scratch = (size_t)total_ranges; in depack_do_frame_ack()
86 ack.ack_ranges = ch->ack_range_scratch; in depack_do_frame_ack()
93 && (qpacket->key_epoch < ossl_qrx_get_key_epoch(ch->qrx) in depack_do_frame_ack()
94 || ch->rxku_expected) in depack_do_frame_ack()
95 && ack.ack_ranges[0].end >= ch->txku_pn) { in depack_do_frame_ack()
117 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_ack()
126 if (!ossl_ackm_on_rx_ack_frame(ch->ackm, &ack, in depack_do_frame_ack()
130 ++ch->diag_num_rx_ack; in depack_do_frame_ack()
134 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_ack()
142 QUIC_CHANNEL *ch, in depack_do_frame_reset_stream() argument
150 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_reset_stream()
157 if (!depack_do_implicit_stream_create(ch, frame_data.stream_id, in depack_do_frame_reset_stream()
166 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_reset_stream()
186 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_reset_stream()
196 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_reset_stream()
209 ossl_quic_stream_map_notify_reset_recv_part(&ch->qsm, stream, in depack_do_frame_reset_stream()
213 ossl_quic_stream_map_update_state(&ch->qsm, stream); in depack_do_frame_reset_stream()
218 QUIC_CHANNEL *ch, in depack_do_frame_stop_sending() argument
225 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_stop_sending()
232 if (!depack_do_implicit_stream_create(ch, frame_data.stream_id, in depack_do_frame_stop_sending()
241 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_stop_sending()
257 ossl_quic_stream_map_reset_stream_send_part(&ch->qsm, stream, in depack_do_frame_stop_sending()
262 static int depack_do_frame_crypto(PACKET *pkt, QUIC_CHANNEL *ch, in depack_do_frame_crypto() argument
274 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_crypto()
284 rstream = ch->crypto_recv[ackm_data->pkt_space]; in depack_do_frame_crypto()
293 rxfc = &ch->crypto_rxfc[ackm_data->pkt_space]; in depack_do_frame_crypto()
297 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_crypto()
305 ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_CRYPTO_BUFFER_EXCEEDED, in depack_do_frame_crypto()
313 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_crypto()
320 ch->did_crypto_frame = 1; in depack_do_frame_crypto()
326 static int depack_do_frame_new_token(PACKET *pkt, QUIC_CHANNEL *ch, in depack_do_frame_new_token() argument
333 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_new_token()
346 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_new_token()
363 static int depack_do_implicit_stream_create(QUIC_CHANNEL *ch, in depack_do_implicit_stream_create() argument
374 stream = ossl_quic_stream_map_get_by_id(&ch->qsm, stream_id); in depack_do_implicit_stream_create()
398 peer_role = ch->is_server in depack_do_implicit_stream_create()
416 ? &ch->next_remote_stream_ordinal_uni in depack_do_implicit_stream_create()
417 : &ch->next_remote_stream_ordinal_bidi; in depack_do_implicit_stream_create()
421 ? &ch->max_streams_uni_rxfc in depack_do_implicit_stream_create()
422 : &ch->max_streams_bidi_rxfc; in depack_do_implicit_stream_create()
427 ossl_quic_channel_raise_protocol_error(ch, in depack_do_implicit_stream_create()
435 ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_STREAM_LIMIT_ERROR, in depack_do_implicit_stream_create()
450 stream = ossl_quic_channel_new_stream_remote(ch, cur_stream_id); in depack_do_implicit_stream_create()
452 ossl_quic_channel_raise_protocol_error(ch, in depack_do_implicit_stream_create()
466 ? &ch->next_local_stream_ordinal_uni in depack_do_implicit_stream_create()
467 : &ch->next_local_stream_ordinal_bidi; in depack_do_implicit_stream_create()
474 ossl_quic_channel_raise_protocol_error(ch, in depack_do_implicit_stream_create()
494 static int depack_do_frame_stream(PACKET *pkt, QUIC_CHANNEL *ch, in depack_do_frame_stream() argument
509 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_stream()
516 if (!depack_do_implicit_stream_create(ch, frame_data.stream_id, in depack_do_frame_stream()
528 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_stream()
540 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_stream()
550 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_stream()
583 ossl_quic_stream_map_notify_size_known_recv_part(&ch->qsm, stream, in depack_do_frame_stream()
612 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_stream()
627 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_stream()
635 ossl_quic_stream_map_notify_totally_received(&ch->qsm, stream); in depack_do_frame_stream()
644 QUIC_CHANNEL *ch = arg; in update_streams() local
646 ossl_quic_stream_map_update_state(&ch->qsm, s); in update_streams()
651 QUIC_CHANNEL *ch = arg; in update_streams_bidi() local
656 ossl_quic_stream_map_update_state(&ch->qsm, s); in update_streams_bidi()
661 QUIC_CHANNEL *ch = arg; in update_streams_uni() local
666 ossl_quic_stream_map_update_state(&ch->qsm, s); in update_streams_uni()
669 static int depack_do_frame_max_data(PACKET *pkt, QUIC_CHANNEL *ch, in depack_do_frame_max_data() argument
675 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_max_data()
682 ossl_quic_txfc_bump_cwm(&ch->conn_txfc, max_data); in depack_do_frame_max_data()
683 ossl_quic_stream_map_visit(&ch->qsm, update_streams, ch); in depack_do_frame_max_data()
688 QUIC_CHANNEL *ch, in depack_do_frame_max_stream_data() argument
697 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_max_stream_data()
704 if (!depack_do_implicit_stream_create(ch, stream_id, in depack_do_frame_max_stream_data()
713 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_max_stream_data()
722 ossl_quic_stream_map_update_state(&ch->qsm, stream); in depack_do_frame_max_stream_data()
727 QUIC_CHANNEL *ch, in depack_do_frame_max_streams() argument
734 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_max_streams()
742 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_max_streams()
751 if (max_streams > ch->max_local_streams_bidi) in depack_do_frame_max_streams()
752 ch->max_local_streams_bidi = max_streams; in depack_do_frame_max_streams()
755 ossl_quic_stream_map_visit(&ch->qsm, update_streams_bidi, ch); in depack_do_frame_max_streams()
758 if (max_streams > ch->max_local_streams_uni) in depack_do_frame_max_streams()
759 ch->max_local_streams_uni = max_streams; in depack_do_frame_max_streams()
762 ossl_quic_stream_map_visit(&ch->qsm, update_streams_uni, ch); in depack_do_frame_max_streams()
765 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_max_streams()
776 QUIC_CHANNEL *ch, in depack_do_frame_data_blocked() argument
782 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_data_blocked()
794 QUIC_CHANNEL *ch, in depack_do_frame_stream_data_blocked() argument
803 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_stream_data_blocked()
814 if (!depack_do_implicit_stream_create(ch, stream_id, in depack_do_frame_stream_data_blocked()
828 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_stream_data_blocked()
841 QUIC_CHANNEL *ch, in depack_do_frame_streams_blocked() argument
848 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_streams_blocked()
862 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_streams_blocked()
874 QUIC_CHANNEL *ch, in depack_do_frame_new_conn_id() argument
880 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_new_conn_id()
887 ossl_quic_channel_on_new_conn_id(ch, &frame_data); in depack_do_frame_new_conn_id()
893 QUIC_CHANNEL *ch, in depack_do_frame_retire_conn_id() argument
899 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_retire_conn_id()
919 if (!ch->is_server) { in depack_do_frame_retire_conn_id()
920 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_retire_conn_id()
936 QUIC_CHANNEL *ch, in depack_do_frame_path_challenge() argument
945 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_path_challenge()
973 if (!ossl_quic_cfq_add_frame(ch->cfq, 0, QUIC_PN_SPACE_APP, in depack_do_frame_path_challenge()
984 ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_INTERNAL_ERROR, in depack_do_frame_path_challenge()
991 QUIC_CHANNEL *ch, in depack_do_frame_path_response() argument
997 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_path_response()
1009 static int depack_do_frame_conn_close(PACKET *pkt, QUIC_CHANNEL *ch, in depack_do_frame_conn_close() argument
1015 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_conn_close()
1022 ossl_quic_channel_on_remote_conn_close(ch, &frame_data); in depack_do_frame_conn_close()
1027 QUIC_CHANNEL *ch, in depack_do_frame_handshake_done() argument
1032 ossl_quic_channel_raise_protocol_error(ch, in depack_do_frame_handshake_done()
1039 ossl_quic_channel_on_handshake_confirmed(ch); in depack_do_frame_handshake_done()
1045 static int depack_process_frames(QUIC_CHANNEL *ch, PACKET *pkt, in depack_process_frames() argument
1058 ossl_quic_channel_raise_protocol_error(ch, in depack_process_frames()
1071 if (ch->msg_callback != NULL) in depack_process_frames()
1075 ossl_quic_channel_raise_protocol_error(ch, in depack_process_frames()
1083 ossl_quic_channel_raise_protocol_error(ch, in depack_process_frames()
1111 if (!depack_do_frame_ping(pkt, ch, enc_level, ackm_data)) in depack_process_frames()
1124 ossl_quic_channel_raise_protocol_error(ch, in depack_process_frames()
1130 if (!depack_do_frame_ack(pkt, ch, packet_space, received, in depack_process_frames()
1139 ossl_quic_channel_raise_protocol_error(ch, in depack_process_frames()
1146 if (!depack_do_frame_reset_stream(pkt, ch, ackm_data)) in depack_process_frames()
1153 ossl_quic_channel_raise_protocol_error(ch, in depack_process_frames()
1160 if (!depack_do_frame_stop_sending(pkt, ch, ackm_data)) in depack_process_frames()
1166 ossl_quic_channel_raise_protocol_error(ch, in depack_process_frames()
1172 if (!depack_do_frame_crypto(pkt, ch, parent_pkt, ackm_data, &datalen)) in depack_process_frames()
1178 ossl_quic_channel_raise_protocol_error(ch, in depack_process_frames()
1184 if (!depack_do_frame_new_token(pkt, ch, ackm_data)) in depack_process_frames()
1199 ossl_quic_channel_raise_protocol_error(ch, in depack_process_frames()
1205 if (!depack_do_frame_stream(pkt, ch, parent_pkt, ackm_data, in depack_process_frames()
1214 ossl_quic_channel_raise_protocol_error(ch, in depack_process_frames()
1220 if (!depack_do_frame_max_data(pkt, ch, ackm_data)) in depack_process_frames()
1227 ossl_quic_channel_raise_protocol_error(ch, in depack_process_frames()
1233 if (!depack_do_frame_max_stream_data(pkt, ch, ackm_data)) in depack_process_frames()
1242 ossl_quic_channel_raise_protocol_error(ch, in depack_process_frames()
1248 if (!depack_do_frame_max_streams(pkt, ch, ackm_data, in depack_process_frames()
1257 ossl_quic_channel_raise_protocol_error(ch, in depack_process_frames()
1263 if (!depack_do_frame_data_blocked(pkt, ch, ackm_data)) in depack_process_frames()
1270 ossl_quic_channel_raise_protocol_error(ch, in depack_process_frames()
1276 if (!depack_do_frame_stream_data_blocked(pkt, ch, ackm_data)) in depack_process_frames()
1285 ossl_quic_channel_raise_protocol_error(ch, in depack_process_frames()
1291 if (!depack_do_frame_streams_blocked(pkt, ch, ackm_data, in depack_process_frames()
1300 ossl_quic_channel_raise_protocol_error(ch, in depack_process_frames()
1305 if (!depack_do_frame_new_conn_id(pkt, ch, ackm_data)) in depack_process_frames()
1312 ossl_quic_channel_raise_protocol_error(ch, in depack_process_frames()
1318 if (!depack_do_frame_retire_conn_id(pkt, ch, ackm_data)) in depack_process_frames()
1325 ossl_quic_channel_raise_protocol_error(ch, in depack_process_frames()
1331 if (!depack_do_frame_path_challenge(pkt, ch, ackm_data)) in depack_process_frames()
1338 ossl_quic_channel_raise_protocol_error(ch, in depack_process_frames()
1344 if (!depack_do_frame_path_response(pkt, ch, ackm_data)) in depack_process_frames()
1352 ossl_quic_channel_raise_protocol_error(ch, in depack_process_frames()
1361 if (!depack_do_frame_conn_close(pkt, ch, frame_type)) in depack_process_frames()
1368 ossl_quic_channel_raise_protocol_error(ch, in depack_process_frames()
1374 if (!depack_do_frame_handshake_done(pkt, ch, ackm_data)) in depack_process_frames()
1380 ossl_quic_channel_raise_protocol_error(ch, in depack_process_frames()
1387 if (ch->msg_callback != NULL) { in depack_process_frames()
1400 ch->msg_callback(0, OSSL_QUIC1_VERSION, ctype, sof, framelen, in depack_process_frames()
1401 ch->msg_callback_ssl, ch->msg_callback_arg); in depack_process_frames()
1409 int ossl_quic_handle_frames(QUIC_CHANNEL *ch, OSSL_QRX_PKT *qpacket) in ossl_quic_handle_frames() argument
1423 if (ch == NULL) in ossl_quic_handle_frames()
1426 ch->did_crypto_frame = 0; in ossl_quic_handle_frames()
1449 || !depack_process_frames(ch, &pkt, qpacket, in ossl_quic_handle_frames()
1464 ossl_ackm_on_rx_packet(ch->ackm, &ackm_data); in ossl_quic_handle_frames()