OSSL_TIME (*now)(void *arg); /* Callback to get current time. */
void *now_arg;
+ /* Message callback related arguments */
+ ossl_msg_cb msg_callback;
+ void *msg_callback_arg;
+ SSL *msg_callback_s;
+
/*
* Injected dependencies - crypto streams.
*
txp_args.cc_data = ch->cc_data;
txp_args.now = get_time;
txp_args.now_arg = ch;
+ /* Callback related arguments */
+ txp_args.msg_callback = ch->msg_callback;
+ txp_args.msg_callback_arg = ch->msg_callback_arg;
+ txp_args.msg_callback_s = ch->msg_callback_s;
+
for (pn_space = QUIC_PN_SPACE_INITIAL; pn_space < QUIC_PN_SPACE_NUM; ++pn_space) {
ch->crypto_send[pn_space] = ossl_quic_sstream_new(INIT_CRYPTO_BUF_LEN);
if (ch->crypto_send[pn_space] == NULL)
return 0;
}
+ if (h->txp->args.msg_callback != NULL && l > 0) {
+ uint64_t ftype;
+ int ctype = SSL3_RT_QUIC_FRAME_FULL;
+ PACKET pkt;
+
+ if (!PACKET_buf_init(&pkt, h->txn.data, l)
+ || !ossl_quic_wire_peek_frame_header(&pkt, &ftype)) {
+ tx_helper_end(h, 0);
+ return 0;
+ }
+
+ if (ftype == OSSL_QUIC_FRAME_TYPE_PADDING)
+ ctype = SSL3_RT_QUIC_FRAME_PADDING;
+ else if (OSSL_QUIC_FRAME_TYPE_IS_STREAM(ftype)
+ || ftype == OSSL_QUIC_FRAME_TYPE_CRYPTO)
+ ctype = SSL3_RT_QUIC_FRAME_HEADER;
+
+ h->txp->args.msg_callback(1, OSSL_QUIC1_VERSION, ctype, h->txn.data, l,
+ h->txp->args.msg_callback_s,
+ h->txp->args.msg_callback_arg);
+ }
+
h->scratch_bytes += l;
tx_helper_end(h, 1);
return 1;