Lines Matching refs:txe

27     OSSL_LIST_MEMBER(txe, TXE);
42 DEFINE_LIST_OF(txe, TXE);
43 typedef OSSL_LIST(txe) TXE_LIST;
219 TXE *txe; in qtx_alloc_txe() local
224 txe = OPENSSL_malloc(sizeof(TXE) + alloc_len); in qtx_alloc_txe()
225 if (txe == NULL) in qtx_alloc_txe()
228 ossl_list_txe_init_elem(txe); in qtx_alloc_txe()
229 txe->alloc_len = alloc_len; in qtx_alloc_txe()
230 txe->data_len = 0; in qtx_alloc_txe()
231 return txe; in qtx_alloc_txe()
243 TXE *txe; in qtx_ensure_free_txe() local
245 txe = ossl_list_txe_head(&qtx->free); in qtx_ensure_free_txe()
246 if (txe != NULL) in qtx_ensure_free_txe()
247 return txe; in qtx_ensure_free_txe()
249 txe = qtx_alloc_txe(alloc_len); in qtx_ensure_free_txe()
250 if (txe == NULL) in qtx_ensure_free_txe()
253 ossl_list_txe_insert_tail(&qtx->free, txe); in qtx_ensure_free_txe()
254 return txe; in qtx_ensure_free_txe()
262 static TXE *qtx_resize_txe(OSSL_QTX *qtx, TXE_LIST *txl, TXE *txe, size_t n) in qtx_resize_txe() argument
267 if (txe == NULL) in qtx_resize_txe()
274 p = ossl_list_txe_prev(txe); in qtx_resize_txe()
275 ossl_list_txe_remove(txl, txe); in qtx_resize_txe()
281 txe2 = OPENSSL_realloc(txe, sizeof(TXE) + n); in qtx_resize_txe()
282 if (txe2 == NULL || txe == txe2) { in qtx_resize_txe()
284 ossl_list_txe_insert_head(txl, txe); in qtx_resize_txe()
286 ossl_list_txe_insert_after(txl, p, txe); in qtx_resize_txe()
295 if (qtx->cons == txe) in qtx_resize_txe()
307 TXE *txe, size_t n) in qtx_reserve_txe() argument
309 if (txe->alloc_len >= n) in qtx_reserve_txe()
310 return txe; in qtx_reserve_txe()
312 return qtx_resize_txe(qtx, txl, txe, n); in qtx_reserve_txe()
318 TXE *txe = ossl_list_txe_head(&qtx->pending); in qtx_pending_to_free() local
320 assert(txe != NULL); in qtx_pending_to_free()
321 ossl_list_txe_remove(&qtx->pending, txe); in qtx_pending_to_free()
323 qtx->pending_bytes -= txe->data_len; in qtx_pending_to_free()
324 ossl_list_txe_insert_tail(&qtx->free, txe); in qtx_pending_to_free()
328 static void qtx_add_to_pending(OSSL_QTX *qtx, TXE *txe) in qtx_add_to_pending() argument
330 ossl_list_txe_insert_tail(&qtx->pending, txe); in qtx_add_to_pending()
332 qtx->pending_bytes += txe->data_len; in qtx_add_to_pending()
461 static int qtx_write_hdr(OSSL_QTX *qtx, const QUIC_PKT_HDR *hdr, TXE *txe, in qtx_write_hdr() argument
466 unsigned char *data = txe_data(txe) + txe->data_len; in qtx_write_hdr()
468 if (!WPACKET_init_static_len(&wpkt, data, txe->alloc_len - txe->data_len, 0)) in qtx_write_hdr()
483 txe->data_len += l; in qtx_write_hdr()
488 static int qtx_encrypt_into_txe(OSSL_QTX *qtx, struct iovec_cur *cur, TXE *txe, in qtx_encrypt_into_txe() argument
558 if (EVP_CipherUpdate(cctx, txe_data(txe) + txe->data_len, in qtx_encrypt_into_txe()
566 memcpy(txe_data(txe) + txe->data_len, src, l); in qtx_encrypt_into_txe()
570 txe->data_len += src_len; in qtx_encrypt_into_txe()
580 el->tag_len, txe_data(txe) + txe->data_len) != 1) { in qtx_encrypt_into_txe()
585 txe->data_len += el->tag_len; in qtx_encrypt_into_txe()
599 static int qtx_write(OSSL_QTX *qtx, const OSSL_QTX_PKT *pkt, TXE *txe, in qtx_write() argument
626 orig_data_len = txe->data_len; in qtx_write()
627 space_left = txe->alloc_len - txe->data_len; in qtx_write()
683 hdr_start = txe_data(txe) + txe->data_len; in qtx_write()
684 if (!qtx_write_hdr(qtx, hdr, txe, &ptrs)) { in qtx_write()
689 hdr_len = (txe_data(txe) + txe->data_len) - hdr_start; in qtx_write()
703 memcpy(txe_data(txe) + txe->data_len, src, src_len); in qtx_write()
704 txe->data_len += src_len; in qtx_write()
708 if (!qtx_encrypt_into_txe(qtx, &cur, txe, enc_level, pkt->pn, in qtx_write()
714 assert(txe->data_len - orig_data_len == pkt_len); in qtx_write()
724 txe->data_len = orig_data_len; in qtx_write()
730 TXE *txe = qtx->cons; in qtx_ensure_cons() local
732 if (txe != NULL) in qtx_ensure_cons()
733 return txe; in qtx_ensure_cons()
735 txe = qtx_ensure_free_txe(qtx, qtx->mdpl); in qtx_ensure_cons()
736 if (txe == NULL) in qtx_ensure_cons()
739 ossl_list_txe_remove(&qtx->free, txe); in qtx_ensure_cons()
740 qtx->cons = txe; in qtx_ensure_cons()
742 txe->data_len = 0; in qtx_ensure_cons()
743 return txe; in qtx_ensure_cons()
754 static int qtx_mutate_write(OSSL_QTX *qtx, const OSSL_QTX_PKT *pkt, TXE *txe, in qtx_mutate_write() argument
773 ret = qtx_write(qtx, pkt, txe, enc_level, in qtx_mutate_write()
798 TXE *txe; in ossl_qtx_write_pkt() local
832 txe = qtx_ensure_cons(qtx); in ossl_qtx_write_pkt()
833 if (txe == NULL) in ossl_qtx_write_pkt()
840 if (!qtx_reserve_txe(qtx, NULL, txe, qtx->mdpl)) in ossl_qtx_write_pkt()
846 txe->peer = *pkt->peer; in ossl_qtx_write_pkt()
848 BIO_ADDR_clear(&txe->peer); in ossl_qtx_write_pkt()
851 txe->local = *pkt->local; in ossl_qtx_write_pkt()
853 BIO_ADDR_clear(&txe->local); in ossl_qtx_write_pkt()
856 ret = qtx_mutate_write(qtx, pkt, txe, enc_level); in ossl_qtx_write_pkt()
900 TXE *txe = qtx->cons; in ossl_qtx_finish_dgram() local
902 if (txe == NULL) in ossl_qtx_finish_dgram()
905 if (txe->data_len == 0) in ossl_qtx_finish_dgram()
910 ossl_list_txe_insert_tail(&qtx->free, txe); in ossl_qtx_finish_dgram()
912 qtx_add_to_pending(qtx, txe); in ossl_qtx_finish_dgram()
919 static void txe_to_msg(TXE *txe, BIO_MSG *msg) in txe_to_msg() argument
921 msg->data = txe_data(txe); in txe_to_msg()
922 msg->data_len = txe->data_len; in txe_to_msg()
925 = BIO_ADDR_family(&txe->peer) != AF_UNSPEC ? &txe->peer : NULL; in txe_to_msg()
927 = BIO_ADDR_family(&txe->local) != AF_UNSPEC ? &txe->local : NULL; in txe_to_msg()
936 TXE *txe; in ossl_qtx_flush_net() local
946 for (txe = ossl_list_txe_head(&qtx->pending), i = 0; in ossl_qtx_flush_net()
947 txe != NULL && i < OSSL_NELEM(msg); in ossl_qtx_flush_net()
948 txe = ossl_list_txe_next(txe), ++i) in ossl_qtx_flush_net()
949 txe_to_msg(txe, &msg[i]); in ossl_qtx_flush_net()
1003 TXE *txe = ossl_list_txe_head(&qtx->pending); in ossl_qtx_pop_net() local
1005 if (txe == NULL) in ossl_qtx_pop_net()
1008 txe_to_msg(txe, msg); in ossl_qtx_pop_net()