Lines Matching full:txp

55      * Opaque initial token blob provided by caller. TXP frees using the
63 /* Subcomponents of the TXP that we own. */
128 OSSL_QUIC_TX_PACKETISER *txp; member
139 * Number of scratch bytes in txp->scratch we have used so far. Some iovecs
156 * entries valid in txp->iovec.
189 static int tx_helper_init(struct tx_helper *h, OSSL_QUIC_TX_PACKETISER *txp, in tx_helper_init() argument
195 h->txp = txp; in tx_helper_init()
207 if (max_ppl > h->txp->el[enc_level].scratch_len) { in tx_helper_init()
210 scratch = OPENSSL_realloc(h->txp->el[enc_level].scratch, max_ppl); in tx_helper_init()
214 h->txp->el[enc_level].scratch = scratch; in tx_helper_init()
215 h->txp->el[enc_level].scratch_len = max_ppl; in tx_helper_init()
226 h->txp = NULL; in tx_helper_cleanup()
244 * - Control frame data appended into txp->scratch using tx_helper_begin and
252 struct txp_el *el = &h->txp->el[h->enc_level]; in tx_helper_append_iovec()
291 struct txp_el *el = &h->txp->el[h->enc_level]; in tx_helper_begin()
357 if (h->txp->msg_callback != NULL && l > 0) { in tx_helper_commit()
374 h->txp->msg_callback(1, OSSL_QUIC1_VERSION, ctype, h->txn.data, l, in tx_helper_commit()
375 h->txp->msg_callback_ssl, in tx_helper_commit()
376 h->txp->msg_callback_arg); in tx_helper_commit()
428 static int txp_should_try_staging(OSSL_QUIC_TX_PACKETISER *txp,
433 static size_t txp_determine_pn_len(OSSL_QUIC_TX_PACKETISER *txp);
434 static int txp_determine_ppl_from_pl(OSSL_QUIC_TX_PACKETISER *txp,
439 static size_t txp_get_mdpl(OSSL_QUIC_TX_PACKETISER *txp);
440 static int txp_generate_for_el(OSSL_QUIC_TX_PACKETISER *txp,
443 static int txp_pkt_init(struct txp_pkt *pkt, OSSL_QUIC_TX_PACKETISER *txp,
446 static void txp_pkt_cleanup(struct txp_pkt *pkt, OSSL_QUIC_TX_PACKETISER *txp);
448 OSSL_QUIC_TX_PACKETISER *txp);
450 OSSL_QUIC_TX_PACKETISER *txp, size_t num_bytes);
451 static int txp_pkt_commit(OSSL_QUIC_TX_PACKETISER *txp, struct txp_pkt *pkt,
453 static uint32_t txp_determine_archetype(OSSL_QUIC_TX_PACKETISER *txp,
462 * @param txp A pointer to the OSSL_QUIC_TX_PACKETISER structure to update.
464 void ossl_quic_tx_packetiser_set_validated(OSSL_QUIC_TX_PACKETISER *txp) in ossl_quic_tx_packetiser_set_validated() argument
466 txp->unvalidated_credit = SIZE_MAX; in ossl_quic_tx_packetiser_set_validated()
481 * @param txp A pointer to the OSSL_QUIC_TX_PACKETISER structure to update.
484 void ossl_quic_tx_packetiser_add_unvalidated_credit(OSSL_QUIC_TX_PACKETISER *txp, in ossl_quic_tx_packetiser_add_unvalidated_credit() argument
487 if (txp->unvalidated_credit != SIZE_MAX) { in ossl_quic_tx_packetiser_add_unvalidated_credit()
488 if ((SIZE_MAX - txp->unvalidated_credit) > (credit * 3)) in ossl_quic_tx_packetiser_add_unvalidated_credit()
489 txp->unvalidated_credit += credit * 3; in ossl_quic_tx_packetiser_add_unvalidated_credit()
491 txp->unvalidated_credit = SIZE_MAX - 1; in ossl_quic_tx_packetiser_add_unvalidated_credit()
505 * @param txp A pointer to the OSSL_QUIC_TX_PACKETISER structure to update.
508 void ossl_quic_tx_packetiser_consume_unvalidated_credit(OSSL_QUIC_TX_PACKETISER *txp, in ossl_quic_tx_packetiser_consume_unvalidated_credit() argument
511 if (txp->unvalidated_credit != SIZE_MAX) { in ossl_quic_tx_packetiser_consume_unvalidated_credit()
512 if (txp->unvalidated_credit < credit) in ossl_quic_tx_packetiser_consume_unvalidated_credit()
513 txp->unvalidated_credit = 0; in ossl_quic_tx_packetiser_consume_unvalidated_credit()
515 txp->unvalidated_credit -= credit; in ossl_quic_tx_packetiser_consume_unvalidated_credit()
527 * @param txp A pointer to the OSSL_QUIC_TX_PACKETISER structure to check.
532 int ossl_quic_tx_packetiser_check_unvalidated_credit(OSSL_QUIC_TX_PACKETISER *txp, in ossl_quic_tx_packetiser_check_unvalidated_credit() argument
535 return (txp->unvalidated_credit > req_credit); in ossl_quic_tx_packetiser_check_unvalidated_credit()
540 OSSL_QUIC_TX_PACKETISER *txp; in ossl_quic_tx_packetiser_new() local
557 txp = OPENSSL_zalloc(sizeof(*txp)); in ossl_quic_tx_packetiser_new()
558 if (txp == NULL) in ossl_quic_tx_packetiser_new()
561 txp->args = *args; in ossl_quic_tx_packetiser_new()
562 txp->last_tx_time = ossl_time_zero(); in ossl_quic_tx_packetiser_new()
564 if (!ossl_quic_fifd_init(&txp->fifd, in ossl_quic_tx_packetiser_new()
565 txp->args.cfq, txp->args.ackm, txp->args.txpim, in ossl_quic_tx_packetiser_new()
566 get_sstream_by_id, txp, in ossl_quic_tx_packetiser_new()
567 on_regen_notify, txp, in ossl_quic_tx_packetiser_new()
568 on_confirm_notify, txp, in ossl_quic_tx_packetiser_new()
569 on_sstream_updated, txp, in ossl_quic_tx_packetiser_new()
572 OPENSSL_free(txp); in ossl_quic_tx_packetiser_new()
576 return txp; in ossl_quic_tx_packetiser_new()
579 void ossl_quic_tx_packetiser_free(OSSL_QUIC_TX_PACKETISER *txp) in ossl_quic_tx_packetiser_free() argument
583 if (txp == NULL) in ossl_quic_tx_packetiser_free()
586 ossl_quic_tx_packetiser_set_initial_token(txp, NULL, 0, NULL, NULL); in ossl_quic_tx_packetiser_free()
587 ossl_quic_fifd_cleanup(&txp->fifd); in ossl_quic_tx_packetiser_free()
588 OPENSSL_free(txp->conn_close_frame.reason); in ossl_quic_tx_packetiser_free()
593 OPENSSL_free(txp->el[enc_level].iovec); in ossl_quic_tx_packetiser_free()
594 OPENSSL_free(txp->el[enc_level].scratch); in ossl_quic_tx_packetiser_free()
597 OPENSSL_free(txp); in ossl_quic_tx_packetiser_free()
648 int ossl_quic_tx_packetiser_set_initial_token(OSSL_QUIC_TX_PACKETISER *txp, in ossl_quic_tx_packetiser_set_initial_token() argument
654 if (!txp_check_token_len(token_len, txp_get_mdpl(txp))) in ossl_quic_tx_packetiser_set_initial_token()
657 if (txp->initial_token != NULL && txp->initial_token_free_cb != NULL) in ossl_quic_tx_packetiser_set_initial_token()
658 txp->initial_token_free_cb(txp->initial_token, txp->initial_token_len, in ossl_quic_tx_packetiser_set_initial_token()
659 txp->initial_token_free_cb_arg); in ossl_quic_tx_packetiser_set_initial_token()
661 txp->initial_token = token; in ossl_quic_tx_packetiser_set_initial_token()
662 txp->initial_token_len = token_len; in ossl_quic_tx_packetiser_set_initial_token()
663 txp->initial_token_free_cb = free_cb; in ossl_quic_tx_packetiser_set_initial_token()
664 txp->initial_token_free_cb_arg = free_cb_arg; in ossl_quic_tx_packetiser_set_initial_token()
668 int ossl_quic_tx_packetiser_set_protocol_version(OSSL_QUIC_TX_PACKETISER *txp, in ossl_quic_tx_packetiser_set_protocol_version() argument
671 txp->args.protocol_version = protocol_version; in ossl_quic_tx_packetiser_set_protocol_version()
675 int ossl_quic_tx_packetiser_set_cur_dcid(OSSL_QUIC_TX_PACKETISER *txp, in ossl_quic_tx_packetiser_set_cur_dcid() argument
683 txp->args.cur_dcid = *dcid; in ossl_quic_tx_packetiser_set_cur_dcid()
687 int ossl_quic_tx_packetiser_set_cur_scid(OSSL_QUIC_TX_PACKETISER *txp, in ossl_quic_tx_packetiser_set_cur_scid() argument
695 txp->args.cur_scid = *scid; in ossl_quic_tx_packetiser_set_cur_scid()
699 /* Change the destination L4 address the TXP uses to send datagrams. */
700 int ossl_quic_tx_packetiser_set_peer(OSSL_QUIC_TX_PACKETISER *txp, in ossl_quic_tx_packetiser_set_peer() argument
704 BIO_ADDR_clear(&txp->args.peer); in ossl_quic_tx_packetiser_set_peer()
708 return BIO_ADDR_copy(&txp->args.peer, peer); in ossl_quic_tx_packetiser_set_peer()
711 void ossl_quic_tx_packetiser_set_ack_tx_cb(OSSL_QUIC_TX_PACKETISER *txp, in ossl_quic_tx_packetiser_set_ack_tx_cb() argument
717 txp->ack_tx_cb = cb; in ossl_quic_tx_packetiser_set_ack_tx_cb()
718 txp->ack_tx_cb_arg = cb_arg; in ossl_quic_tx_packetiser_set_ack_tx_cb()
721 void ossl_quic_tx_packetiser_set_qlog_cb(OSSL_QUIC_TX_PACKETISER *txp, in ossl_quic_tx_packetiser_set_qlog_cb() argument
725 ossl_quic_fifd_set_qlog_cb(&txp->fifd, get_qlog_cb, get_qlog_cb_arg); in ossl_quic_tx_packetiser_set_qlog_cb()
729 int ossl_quic_tx_packetiser_discard_enc_level(OSSL_QUIC_TX_PACKETISER *txp, in ossl_quic_tx_packetiser_discard_enc_level() argument
738 txp->args.crypto[ossl_quic_enc_level_to_pn_space(enc_level)] = NULL; in ossl_quic_tx_packetiser_discard_enc_level()
743 void ossl_quic_tx_packetiser_notify_handshake_complete(OSSL_QUIC_TX_PACKETISER *txp) in ossl_quic_tx_packetiser_notify_handshake_complete() argument
745 txp->handshake_complete = 1; in ossl_quic_tx_packetiser_notify_handshake_complete()
748 void ossl_quic_tx_packetiser_schedule_handshake_done(OSSL_QUIC_TX_PACKETISER *txp) in ossl_quic_tx_packetiser_schedule_handshake_done() argument
750 txp->want_handshake_done = 1; in ossl_quic_tx_packetiser_schedule_handshake_done()
753 void ossl_quic_tx_packetiser_schedule_ack_eliciting(OSSL_QUIC_TX_PACKETISER *txp, in ossl_quic_tx_packetiser_schedule_ack_eliciting() argument
756 txp->force_ack_eliciting |= (1UL << pn_space); in ossl_quic_tx_packetiser_schedule_ack_eliciting()
759 void ossl_quic_tx_packetiser_schedule_ack(OSSL_QUIC_TX_PACKETISER *txp, in ossl_quic_tx_packetiser_schedule_ack() argument
762 txp->want_ack |= (1UL << pn_space); in ossl_quic_tx_packetiser_schedule_ack()
775 int ossl_quic_tx_packetiser_generate(OSSL_QUIC_TX_PACKETISER *txp, in ossl_quic_tx_packetiser_generate() argument
784 * - The TXP is only concerned with generating encrypted packets; in ossl_quic_tx_packetiser_generate()
863 uint64_t cc_limit = txp->args.cc_method->get_tx_allowance(txp->args.cc_data); in ossl_quic_tx_packetiser_generate()
878 ossl_qtx_finish_dgram(txp->args.qtx); in ossl_quic_tx_packetiser_generate()
881 archetype = txp_determine_archetype(txp, cc_limit); in ossl_quic_tx_packetiser_generate()
892 if (!txp_should_try_staging(txp, enc_level, archetype, cc_limit, in ossl_quic_tx_packetiser_generate()
896 if (!txp_pkt_init(&pkt[enc_level], txp, enc_level, archetype, in ossl_quic_tx_packetiser_generate()
905 rc = txp_generate_for_el(txp, &pkt[enc_level], in ossl_quic_tx_packetiser_generate()
948 txp_pkt_postgen_update_pkt_overhead(&pkt[enc_level], txp); in ossl_quic_tx_packetiser_generate()
956 if (!txp_pkt_append_padding(&pkt[pad_el], txp, deficit)) in ossl_quic_tx_packetiser_generate()
994 if (!ossl_quic_tx_packetiser_check_unvalidated_credit(txp, in ossl_quic_tx_packetiser_generate()
999 ossl_quic_tx_packetiser_consume_unvalidated_credit(txp, pkt[enc_level].h.bytes_appended); in ossl_quic_tx_packetiser_generate()
1001 rc = txp_pkt_commit(txp, &pkt[enc_level], archetype, in ossl_quic_tx_packetiser_generate()
1027 ossl_qtx_finish_dgram(txp->args.qtx); in ossl_quic_tx_packetiser_generate()
1032 txp_pkt_cleanup(&pkt[enc_level], txp); in ossl_quic_tx_packetiser_generate()
1307 static int txp_determine_geometry(OSSL_QUIC_TX_PACKETISER *txp, in txp_determine_geometry() argument
1323 phdr->pn_len = txp_determine_pn_len(txp); in txp_determine_geometry()
1327 phdr->version = txp->args.protocol_version; in txp_determine_geometry()
1328 phdr->dst_conn_id = txp->args.cur_dcid; in txp_determine_geometry()
1329 phdr->src_conn_id = txp->args.cur_scid; in txp_determine_geometry()
1354 phdr->token = txp->initial_token; in txp_determine_geometry()
1355 phdr->token_len = txp->initial_token_len; in txp_determine_geometry()
1367 mdpl = txp_get_mdpl(txp); in txp_determine_geometry()
1380 if (!txp_determine_ppl_from_pl(txp, cmpl, enc_level, hdr_len, &geom->cmppl)) in txp_determine_geometry()
1389 static uint32_t txp_determine_archetype(OSSL_QUIC_TX_PACKETISER *txp, in txp_determine_archetype() argument
1393 = ossl_ackm_get0_probe_request(txp->args.ackm); in txp_determine_archetype()
1424 static int txp_should_try_staging(OSSL_QUIC_TX_PACKETISER *txp, in txp_should_try_staging() argument
1434 if (!ossl_qtx_is_enc_level_provisioned(txp->args.qtx, enc_level)) in txp_should_try_staging()
1481 = ossl_ackm_get0_probe_request(txp->args.ackm); in txp_should_try_staging()
1492 if (a.allow_crypto && sstream_is_pending(txp->args.crypto[pn_space])) in txp_should_try_staging()
1496 if (a.allow_ack && (ossl_ackm_is_ack_desired(txp->args.ackm, pn_space) in txp_should_try_staging()
1497 || (txp->want_ack & (1UL << pn_space)) != 0)) in txp_should_try_staging()
1502 && (txp->force_ack_eliciting & (1UL << pn_space)) != 0) in txp_should_try_staging()
1506 if (a.allow_conn_fc && (txp->want_max_data in txp_should_try_staging()
1507 || ossl_quic_rxfc_has_cwm_changed(txp->args.conn_rxfc, 0))) in txp_should_try_staging()
1512 && (txp->want_max_streams_bidi in txp_should_try_staging()
1513 || ossl_quic_rxfc_has_cwm_changed(txp->args.max_streams_bidi_rxfc, in txp_should_try_staging()
1515 || txp->want_max_streams_uni in txp_should_try_staging()
1516 || ossl_quic_rxfc_has_cwm_changed(txp->args.max_streams_uni_rxfc, in txp_should_try_staging()
1521 if (a.allow_handshake_done && txp->want_handshake_done) in txp_should_try_staging()
1525 if (a.allow_conn_close && txp->want_conn_close && in txp_should_try_staging()
1537 for (cfq_item = ossl_quic_cfq_get_priority_head(txp->args.cfq, pn_space); in txp_should_try_staging()
1566 if (a.allow_stream_rel && txp->handshake_complete) { in txp_should_try_staging()
1578 ossl_quic_stream_iter_init(&it, txp->args.qsm, 0); in txp_should_try_staging()
1596 static size_t txp_determine_pn_len(OSSL_QUIC_TX_PACKETISER *txp) in txp_determine_pn_len() argument
1602 static int txp_determine_ppl_from_pl(OSSL_QUIC_TX_PACKETISER *txp, in txp_determine_ppl_from_pl() argument
1613 if (!ossl_qtx_calculate_plaintext_payload_len(txp->args.qtx, enc_level, in txp_determine_ppl_from_pl()
1621 static size_t txp_get_mdpl(OSSL_QUIC_TX_PACKETISER *txp) in txp_get_mdpl() argument
1623 return ossl_qtx_get_mdpl(txp->args.qtx); in txp_get_mdpl()
1629 OSSL_QUIC_TX_PACKETISER *txp = arg; in get_sstream_by_id() local
1633 return txp->args.crypto[pn_space]; in get_sstream_by_id()
1635 s = ossl_quic_stream_map_get_by_id(txp->args.qsm, stream_id); in get_sstream_by_id()
1645 OSSL_QUIC_TX_PACKETISER *txp = arg; in on_regen_notify() local
1649 txp->want_handshake_done = 1; in on_regen_notify()
1652 txp->want_max_data = 1; in on_regen_notify()
1655 txp->want_max_streams_bidi = 1; in on_regen_notify()
1658 txp->want_max_streams_uni = 1; in on_regen_notify()
1661 txp->want_ack |= (1UL << pkt->ackm_pkt.pkt_space); in on_regen_notify()
1666 = ossl_quic_stream_map_get_by_id(txp->args.qsm, stream_id); in on_regen_notify()
1672 ossl_quic_stream_map_update_state(txp->args.qsm, s); in on_regen_notify()
1678 = ossl_quic_stream_map_get_by_id(txp->args.qsm, stream_id); in on_regen_notify()
1683 ossl_quic_stream_map_schedule_stop_sending(txp->args.qsm, s); in on_regen_notify()
1689 = ossl_quic_stream_map_get_by_id(txp->args.qsm, stream_id); in on_regen_notify()
1695 ossl_quic_stream_map_update_state(txp->args.qsm, s); in on_regen_notify()
1704 static int txp_need_ping(OSSL_QUIC_TX_PACKETISER *txp, in txp_need_ping() argument
1710 || (txp->force_ack_eliciting & (1UL << pn_space)) != 0); in txp_need_ping()
1713 static int txp_pkt_init(struct txp_pkt *pkt, OSSL_QUIC_TX_PACKETISER *txp, in txp_pkt_init() argument
1719 if (!txp_determine_geometry(txp, archetype, enc_level, in txp_pkt_init()
1727 if (!tx_helper_init(&pkt->h, txp, enc_level, in txp_pkt_init()
1729 txp_need_ping(txp, pn_space, &pkt->geom.adata) ? 1 : 0)) in txp_pkt_init()
1739 static void txp_pkt_cleanup(struct txp_pkt *pkt, OSSL_QUIC_TX_PACKETISER *txp) in txp_pkt_cleanup() argument
1748 ossl_quic_txpim_pkt_release(txp->args.txpim, pkt->tpkt); in txp_pkt_cleanup()
1754 OSSL_QUIC_TX_PACKETISER *txp) in txp_pkt_postgen_update_pkt_overhead() argument
1781 if (!ossl_qtx_calculate_ciphertext_payload_len(txp->args.qtx, pkt->h.enc_level, in txp_pkt_postgen_update_pkt_overhead()
1798 OSSL_QUIC_TX_PACKETISER *txp = arg; in on_confirm_notify() local
1804 = ossl_quic_stream_map_get_by_id(txp->args.qsm, stream_id); in on_confirm_notify()
1810 ossl_quic_stream_map_update_state(txp->args.qsm, s); in on_confirm_notify()
1816 = ossl_quic_stream_map_get_by_id(txp->args.qsm, stream_id); in on_confirm_notify()
1825 ossl_quic_stream_map_notify_reset_stream_acked(txp->args.qsm, s); in on_confirm_notify()
1826 ossl_quic_stream_map_update_state(txp->args.qsm, s); in on_confirm_notify()
1836 OSSL_QUIC_TX_PACKETISER *txp, size_t num_bytes) in txp_pkt_append_padding() argument
1869 OSSL_QUIC_TX_PACKETISER *txp = arg; in on_sstream_updated() local
1872 s = ossl_quic_stream_map_get_by_id(txp->args.qsm, stream_id); in on_sstream_updated()
1876 ossl_quic_stream_map_update_state(txp->args.qsm, s); in on_sstream_updated()
1883 static int try_commit_conn_close(OSSL_QUIC_TX_PACKETISER *txp, size_t n) in try_commit_conn_close() argument
1888 if (txp->closing_bytes_recv == 0) in try_commit_conn_close()
1903 res = txp->closing_bytes_xmit + n <= txp->closing_bytes_recv * 3; in try_commit_conn_close()
1909 if (res && txp->closing_bytes_recv != 0) in try_commit_conn_close()
1910 txp->closing_bytes_xmit += n; in try_commit_conn_close()
1915 OSSL_QUIC_TX_PACKETISER *txp, size_t n) in ossl_quic_tx_packetiser_record_received_closing_bytes() argument
1917 txp->closing_bytes_recv += n; in ossl_quic_tx_packetiser_record_received_closing_bytes()
1920 static int txp_generate_pre_token(OSSL_QUIC_TX_PACKETISER *txp, in txp_generate_pre_token() argument
1938 && (((txp->want_ack & (1UL << pn_space)) != 0) in txp_generate_pre_token()
1939 || ossl_ackm_is_ack_desired(txp->args.ackm, pn_space)) in txp_generate_pre_token()
1940 && (ack = ossl_ackm_get_ack_frame(txp->args.ackm, pn_space)) != NULL) { in txp_generate_pre_token()
1951 txp->args.ack_delay_exponent, in txp_generate_pre_token()
1961 if (txp->ack_tx_cb != NULL) in txp_generate_pre_token()
1962 txp->ack_tx_cb(&ack2, pn_space, txp->ack_tx_cb_arg); in txp_generate_pre_token()
1969 if (a->allow_conn_close && txp->want_conn_close && chosen_for_conn_close) { in txp_generate_pre_token()
1971 OSSL_QUIC_FRAME_CONN_CLOSE f, *pf = &txp->conn_close_frame; in txp_generate_pre_token()
2004 && try_commit_conn_close(txp, l)) { in txp_generate_pre_token()
2136 static int txp_generate_crypto_frames(OSSL_QUIC_TX_PACKETISER *txp, in txp_generate_crypto_frames() argument
2161 if (!ossl_quic_sstream_get_stream_frame(txp->args.crypto[pn_space], in txp_generate_crypto_frames()
2190 if (!txp_el_ensure_iovec(&txp->el[enc_level], h->num_iovec + 3)) in txp_generate_crypto_frames()
2231 static int txp_plan_stream_chunk(OSSL_QUIC_TX_PACKETISER *txp, in txp_plan_stream_chunk() argument
2284 static int txp_generate_stream_frames(OSSL_QUIC_TX_PACKETISER *txp, in txp_generate_stream_frames() argument
2321 if (!txp_plan_stream_chunk(txp, h, sstream, stream_txfc, i, &chunks[i], in txp_generate_stream_frames()
2360 if (!txp_plan_stream_chunk(txp, h, sstream, stream_txfc, i + 1, in txp_generate_stream_frames()
2436 if (!txp_el_ensure_iovec(&txp->el[enc_level], h->num_iovec + 3)) in txp_generate_stream_frames()
2500 static int txp_generate_stream_related(OSSL_QUIC_TX_PACKETISER *txp, in txp_generate_stream_related() argument
2512 for (ossl_quic_stream_iter_init(&it, txp->args.qsm, 1); in txp_generate_stream_related()
2640 if (!txp_generate_stream_frames(txp, pkt, in txp_generate_stream_related()
2666 static int txp_generate_for_el(OSSL_QUIC_TX_PACKETISER *txp, in txp_generate_for_el() argument
2689 if (!ossl_quic_pn_valid(txp->next_pn[pn_space])) in txp_generate_for_el()
2695 if ((pkt->tpkt = tpkt = ossl_quic_txpim_pkt_alloc(txp->args.txpim)) == NULL) in txp_generate_for_el()
2706 if (a.allow_handshake_done && txp->want_handshake_done in txp_generate_for_el()
2728 && (txp->want_max_data in txp_generate_for_el()
2729 || ossl_quic_rxfc_has_cwm_changed(txp->args.conn_rxfc, 0)) in txp_generate_for_el()
2732 uint64_t cwm = ossl_quic_rxfc_get_cwm(txp->args.conn_rxfc); in txp_generate_for_el()
2752 && (txp->want_max_streams_bidi in txp_generate_for_el()
2753 || ossl_quic_rxfc_has_cwm_changed(txp->args.max_streams_bidi_rxfc, 0)) in txp_generate_for_el()
2757 = ossl_quic_rxfc_get_cwm(txp->args.max_streams_bidi_rxfc); in txp_generate_for_el()
2778 && (txp->want_max_streams_uni in txp_generate_for_el()
2779 || ossl_quic_rxfc_has_cwm_changed(txp->args.max_streams_uni_rxfc, 0)) in txp_generate_for_el()
2783 = ossl_quic_rxfc_get_cwm(txp->args.max_streams_uni_rxfc); in txp_generate_for_el()
2803 for (cfq_item = ossl_quic_cfq_get_priority_head(txp->args.cfq, pn_space); in txp_generate_for_el()
2831 if (txp_generate_pre_token(txp, pkt, in txp_generate_for_el()
2877 if (txp_generate_pre_token(txp, pkt, in txp_generate_for_el()
2884 if (!txp_generate_crypto_frames(txp, pkt, &have_ack_eliciting)) in txp_generate_for_el()
2888 if (a.allow_stream_rel && txp->handshake_complete) in txp_generate_for_el()
2889 if (!txp_generate_stream_related(txp, pkt, in txp_generate_for_el()
2897 if (!have_ack_eliciting && txp_need_ping(txp, pn_space, &a)) { in txp_generate_for_el()
2927 tpkt->ackm_pkt.pkt_num = txp->next_pn[pn_space]; in txp_generate_for_el()
2934 tpkt->ackm_pkt.time = txp->args.now(txp->args.now_arg); in txp_generate_for_el()
2947 ossl_quic_txpim_pkt_release(txp->args.txpim, tpkt); in txp_generate_for_el()
2984 static int txp_pkt_commit(OSSL_QUIC_TX_PACKETISER *txp, in txp_pkt_commit() argument
3008 txpkt.iovec = txp->el[enc_level].iovec; in txp_pkt_commit()
3011 txpkt.peer = BIO_ADDR_family(&txp->args.peer) == AF_UNSPEC in txp_pkt_commit()
3012 ? NULL : &txp->args.peer; in txp_pkt_commit()
3013 txpkt.pn = txp->next_pn[pn_space]; in txp_pkt_commit()
3033 if (!ossl_quic_fifd_pkt_commit(&txp->fifd, tpkt)) in txp_pkt_commit()
3047 ++txp->next_pn[pn_space]; in txp_pkt_commit()
3051 if (!ossl_qtx_write_pkt(txp->args.qtx, &txpkt)) in txp_pkt_commit()
3089 ossl_quic_stream_map_update_state(txp->args.qsm, stream); in txp_pkt_commit()
3098 ossl_quic_stream_map_notify_all_data_sent(txp->args.qsm, stream); in txp_pkt_commit()
3103 txp->force_ack_eliciting &= ~(1UL << pn_space); in txp_pkt_commit()
3106 txp->want_handshake_done = 0; in txp_pkt_commit()
3109 txp->want_max_data = 0; in txp_pkt_commit()
3110 ossl_quic_rxfc_has_cwm_changed(txp->args.conn_rxfc, 1); in txp_pkt_commit()
3114 txp->want_max_streams_bidi = 0; in txp_pkt_commit()
3115 ossl_quic_rxfc_has_cwm_changed(txp->args.max_streams_bidi_rxfc, 1); in txp_pkt_commit()
3119 txp->want_max_streams_uni = 0; in txp_pkt_commit()
3120 ossl_quic_rxfc_has_cwm_changed(txp->args.max_streams_uni_rxfc, 1); in txp_pkt_commit()
3124 txp->want_ack &= ~(1UL << pn_space); in txp_pkt_commit()
3127 txp->want_conn_close = 0; in txp_pkt_commit()
3135 = ossl_ackm_get0_probe_request(txp->args.ackm); in txp_pkt_commit()
3172 int ossl_quic_tx_packetiser_schedule_conn_close(OSSL_QUIC_TX_PACKETISER *txp, in ossl_quic_tx_packetiser_schedule_conn_close() argument
3177 size_t max_reason_len = txp_get_mdpl(txp) / 2; in ossl_quic_tx_packetiser_schedule_conn_close()
3179 if (txp->want_conn_close) in ossl_quic_tx_packetiser_schedule_conn_close()
3195 txp->conn_close_frame = *f; in ossl_quic_tx_packetiser_schedule_conn_close()
3196 txp->conn_close_frame.reason = reason; in ossl_quic_tx_packetiser_schedule_conn_close()
3197 txp->conn_close_frame.reason_len = reason_len; in ossl_quic_tx_packetiser_schedule_conn_close()
3198 txp->want_conn_close = 1; in ossl_quic_tx_packetiser_schedule_conn_close()
3202 void ossl_quic_tx_packetiser_set_msg_callback(OSSL_QUIC_TX_PACKETISER *txp, in ossl_quic_tx_packetiser_set_msg_callback() argument
3206 txp->msg_callback = msg_callback; in ossl_quic_tx_packetiser_set_msg_callback()
3207 txp->msg_callback_ssl = msg_callback_ssl; in ossl_quic_tx_packetiser_set_msg_callback()
3210 void ossl_quic_tx_packetiser_set_msg_callback_arg(OSSL_QUIC_TX_PACKETISER *txp, in ossl_quic_tx_packetiser_set_msg_callback_arg() argument
3213 txp->msg_callback_arg = msg_callback_arg; in ossl_quic_tx_packetiser_set_msg_callback_arg()
3216 QUIC_PN ossl_quic_tx_packetiser_get_next_pn(OSSL_QUIC_TX_PACKETISER *txp, in ossl_quic_tx_packetiser_get_next_pn() argument
3222 return txp->next_pn[pn_space]; in ossl_quic_tx_packetiser_get_next_pn()
3225 OSSL_TIME ossl_quic_tx_packetiser_get_deadline(OSSL_QUIC_TX_PACKETISER *txp) in ossl_quic_tx_packetiser_get_deadline() argument
3228 * TXP-specific deadline computations which rely on TXP innards. This is in in ossl_quic_tx_packetiser_get_deadline()
3244 if (ossl_qtx_is_enc_level_provisioned(txp->args.qtx, enc_level)) { in ossl_quic_tx_packetiser_get_deadline()
3247 ossl_ackm_get_ack_deadline(txp->args.ackm, pn_space)); in ossl_quic_tx_packetiser_get_deadline()
3251 if (txp->args.cc_method->get_tx_allowance(txp->args.cc_data) == 0) in ossl_quic_tx_packetiser_get_deadline()
3253 txp->args.cc_method->get_wakeup_deadline(txp->args.cc_data)); in ossl_quic_tx_packetiser_get_deadline()