Lines Matching full:bio

10 #include <openssl/bio.h>
45 /* Print a non-NUL terminated string to BIO */
46 static void put_str(BIO *bio, char *str, size_t slen) in put_str() argument
51 BIO_printf(bio, "%c", str[i]); in put_str()
54 static void put_data(BIO *bio, const uint8_t *data, size_t datalen) in put_data() argument
59 BIO_printf(bio, "%02x", data[i]); in put_data()
62 static void put_conn_id(BIO *bio, QUIC_CONN_ID *id) in put_conn_id() argument
65 BIO_puts(bio, "<zero length id>"); in put_conn_id()
69 BIO_puts(bio, "0x"); in put_conn_id()
70 put_data(bio, id->id, id->id_len); in put_conn_id()
73 static void put_token(BIO *bio, const uint8_t *token, size_t token_len) in put_token() argument
76 BIO_puts(bio, "<zero length token>"); in put_token()
78 put_data(bio, token, token_len); in put_token()
81 static int frame_ack(BIO *bio, PACKET *pkt) in frame_ack() argument
103 BIO_printf(bio, " Largest acked: %llu\n", in frame_ack()
105 BIO_printf(bio, " Ack delay (raw) %llu\n", in frame_ack()
107 BIO_printf(bio, " Ack range count: %llu\n", in frame_ack()
109 BIO_printf(bio, " First ack range: %llu\n", in frame_ack()
113 BIO_printf(bio, " Gap: %llu\n", in frame_ack()
116 BIO_printf(bio, " Ack range len: %llu\n", in frame_ack()
127 static int frame_reset_stream(BIO *bio, PACKET *pkt) in frame_reset_stream() argument
134 BIO_printf(bio, " Stream id: %llu\n", in frame_reset_stream()
136 BIO_printf(bio, " App Protocol Error Code: %llu\n", in frame_reset_stream()
138 BIO_printf(bio, " Final size: %llu\n", in frame_reset_stream()
144 static int frame_stop_sending(BIO *bio, PACKET *pkt) in frame_stop_sending() argument
151 BIO_printf(bio, " Stream id: %llu\n", in frame_stop_sending()
153 BIO_printf(bio, " App Protocol Error Code: %llu\n", in frame_stop_sending()
159 static int frame_crypto(BIO *bio, PACKET *pkt) in frame_crypto() argument
166 BIO_printf(bio, " Offset: %llu\n", (unsigned long long)frame_data.offset); in frame_crypto()
167 BIO_printf(bio, " Len: %llu\n", (unsigned long long)frame_data.len); in frame_crypto()
172 static int frame_new_token(BIO *bio, PACKET *pkt) in frame_new_token() argument
180 BIO_puts(bio, " Token: "); in frame_new_token()
181 put_token(bio, token, token_len); in frame_new_token()
182 BIO_puts(bio, "\n"); in frame_new_token()
187 static int frame_stream(BIO *bio, PACKET *pkt, uint64_t frame_type) in frame_stream() argument
192 BIO_puts(bio, "Stream"); in frame_stream()
195 BIO_puts(bio, "\n"); in frame_stream()
199 BIO_puts(bio, " (Fin)\n"); in frame_stream()
203 BIO_puts(bio, " (Len)\n"); in frame_stream()
207 BIO_puts(bio, " (Len, Fin)\n"); in frame_stream()
211 BIO_puts(bio, " (Off)\n"); in frame_stream()
215 BIO_puts(bio, " (Off, Fin)\n"); in frame_stream()
219 BIO_puts(bio, " (Off, Len)\n"); in frame_stream()
223 BIO_puts(bio, " (Off, Len, Fin)\n"); in frame_stream()
233 BIO_printf(bio, " Stream id: %llu\n", in frame_stream()
235 BIO_printf(bio, " Offset: %llu\n", in frame_stream()
242 BIO_printf(bio, " Len: %llu\n", (unsigned long long)frame_data.len); in frame_stream()
244 BIO_puts(bio, " Len: <implicit length>\n"); in frame_stream()
249 static int frame_max_data(BIO *bio, PACKET *pkt) in frame_max_data() argument
256 BIO_printf(bio, " Max Data: %llu\n", (unsigned long long)max_data); in frame_max_data()
261 static int frame_max_stream_data(BIO *bio, PACKET *pkt) in frame_max_stream_data() argument
270 BIO_printf(bio, " Max Stream Data: %llu\n", in frame_max_stream_data()
276 static int frame_max_streams(BIO *bio, PACKET *pkt) in frame_max_streams() argument
283 BIO_printf(bio, " Max Streams: %llu\n", (unsigned long long)max_streams); in frame_max_streams()
288 static int frame_data_blocked(BIO *bio, PACKET *pkt) in frame_data_blocked() argument
295 BIO_printf(bio, " Max Data: %llu\n", (unsigned long long)max_data); in frame_data_blocked()
300 static int frame_stream_data_blocked(BIO *bio, PACKET *pkt) in frame_stream_data_blocked() argument
309 BIO_printf(bio, " Stream id: %llu\n", (unsigned long long)stream_id); in frame_stream_data_blocked()
310 BIO_printf(bio, " Max Data: %llu\n", (unsigned long long)max_data); in frame_stream_data_blocked()
315 static int frame_streams_blocked(BIO *bio, PACKET *pkt) in frame_streams_blocked() argument
322 BIO_printf(bio, " Max Data: %llu\n", (unsigned long long)max_data); in frame_streams_blocked()
327 static int frame_new_conn_id(BIO *bio, PACKET *pkt) in frame_new_conn_id() argument
334 BIO_printf(bio, " Sequence Number: %llu\n", in frame_new_conn_id()
336 BIO_printf(bio, " Retire prior to: %llu\n", in frame_new_conn_id()
338 BIO_puts(bio, " Connection id: "); in frame_new_conn_id()
339 put_conn_id(bio, &frame_data.conn_id); in frame_new_conn_id()
340 BIO_puts(bio, "\n Stateless Reset Token: "); in frame_new_conn_id()
341 put_data(bio, frame_data.stateless_reset.token, in frame_new_conn_id()
343 BIO_puts(bio, "\n"); in frame_new_conn_id()
348 static int frame_retire_conn_id(BIO *bio, PACKET *pkt) in frame_retire_conn_id() argument
355 BIO_printf(bio, " Sequence Number: %llu\n", (unsigned long long)seq_num); in frame_retire_conn_id()
360 static int frame_path_challenge(BIO *bio, PACKET *pkt) in frame_path_challenge() argument
367 BIO_printf(bio, " Data: %016llx\n", (unsigned long long)data); in frame_path_challenge()
372 static int frame_path_response(BIO *bio, PACKET *pkt) in frame_path_response() argument
379 BIO_printf(bio, " Data: %016llx\n", (unsigned long long)data); in frame_path_response()
384 static int frame_conn_closed(BIO *bio, PACKET *pkt) in frame_conn_closed() argument
391 BIO_printf(bio, " Error Code: %llu\n", in frame_conn_closed()
393 BIO_puts(bio, " Reason: "); in frame_conn_closed()
394 put_str(bio, frame_data.reason, frame_data.reason_len); in frame_conn_closed()
395 BIO_puts(bio, "\n"); in frame_conn_closed()
400 static int trace_frame_data(BIO *bio, PACKET *pkt) in trace_frame_data() argument
409 BIO_puts(bio, "Ping\n"); in trace_frame_data()
415 BIO_puts(bio, "Padding\n"); in trace_frame_data()
421 BIO_puts(bio, "Ack "); in trace_frame_data()
423 BIO_puts(bio, " (with ECN)\n"); in trace_frame_data()
425 BIO_puts(bio, " (without ECN)\n"); in trace_frame_data()
426 if (!frame_ack(bio, pkt)) in trace_frame_data()
431 BIO_puts(bio, "Reset stream\n"); in trace_frame_data()
432 if (!frame_reset_stream(bio, pkt)) in trace_frame_data()
437 BIO_puts(bio, "Stop sending\n"); in trace_frame_data()
438 if (!frame_stop_sending(bio, pkt)) in trace_frame_data()
443 BIO_puts(bio, "Crypto\n"); in trace_frame_data()
444 if (!frame_crypto(bio, pkt)) in trace_frame_data()
449 BIO_puts(bio, "New token\n"); in trace_frame_data()
450 if (!frame_new_token(bio, pkt)) in trace_frame_data()
463 if (!frame_stream(bio, pkt, frame_type)) in trace_frame_data()
468 BIO_puts(bio, "Max data\n"); in trace_frame_data()
469 if (!frame_max_data(bio, pkt)) in trace_frame_data()
474 BIO_puts(bio, "Max stream data\n"); in trace_frame_data()
475 if (!frame_max_stream_data(bio, pkt)) in trace_frame_data()
481 BIO_puts(bio, "Max streams "); in trace_frame_data()
483 BIO_puts(bio, " (Bidi)\n"); in trace_frame_data()
485 BIO_puts(bio, " (Uni)\n"); in trace_frame_data()
486 if (!frame_max_streams(bio, pkt)) in trace_frame_data()
491 BIO_puts(bio, "Data blocked\n"); in trace_frame_data()
492 if (!frame_data_blocked(bio, pkt)) in trace_frame_data()
497 BIO_puts(bio, "Stream data blocked\n"); in trace_frame_data()
498 if (!frame_stream_data_blocked(bio, pkt)) in trace_frame_data()
504 BIO_puts(bio, "Streams blocked"); in trace_frame_data()
506 BIO_puts(bio, " (Bidi)\n"); in trace_frame_data()
508 BIO_puts(bio, " (Uni)\n"); in trace_frame_data()
509 if (!frame_streams_blocked(bio, pkt)) in trace_frame_data()
514 BIO_puts(bio, "New conn id\n"); in trace_frame_data()
515 if (!frame_new_conn_id(bio, pkt)) in trace_frame_data()
520 BIO_puts(bio, "Retire conn id\n"); in trace_frame_data()
521 if (!frame_retire_conn_id(bio, pkt)) in trace_frame_data()
526 BIO_puts(bio, "Path challenge\n"); in trace_frame_data()
527 if (!frame_path_challenge(bio, pkt)) in trace_frame_data()
532 BIO_puts(bio, "Path response\n"); in trace_frame_data()
533 if (!frame_path_response(bio, pkt)) in trace_frame_data()
539 BIO_puts(bio, "Connection close"); in trace_frame_data()
541 BIO_puts(bio, " (app)\n"); in trace_frame_data()
543 BIO_puts(bio, " (transport)\n"); in trace_frame_data()
544 if (!frame_conn_closed(bio, pkt)) in trace_frame_data()
549 BIO_puts(bio, "Handshake done\n"); in trace_frame_data()
559 BIO_puts(bio, " <unexpected trailing frame data skipped>\n"); in trace_frame_data()
567 BIO *bio = arg; in ossl_quic_trace() local
574 BIO_puts(bio, write_p ? "Sent" : "Received"); in ossl_quic_trace()
580 BIO_printf(bio, " Datagram\n Length: %zu\n", msglen); in ossl_quic_trace()
597 BIO_puts(bio, write_p ? "Sent" : "Received"); in ossl_quic_trace()
598 BIO_puts(bio, " Packet\n"); in ossl_quic_trace()
599 BIO_printf(bio, " Packet Type: %s\n", packet_type(hdr.type)); in ossl_quic_trace()
601 BIO_printf(bio, " Version: 0x%08lx\n", in ossl_quic_trace()
603 BIO_puts(bio, " Destination Conn Id: "); in ossl_quic_trace()
604 put_conn_id(bio, &hdr.dst_conn_id); in ossl_quic_trace()
605 BIO_puts(bio, "\n"); in ossl_quic_trace()
607 BIO_puts(bio, " Source Conn Id: "); in ossl_quic_trace()
608 put_conn_id(bio, &hdr.src_conn_id); in ossl_quic_trace()
609 BIO_puts(bio, "\n"); in ossl_quic_trace()
611 BIO_printf(bio, " Payload length: %zu\n", hdr.len); in ossl_quic_trace()
613 BIO_puts(bio, " Token: "); in ossl_quic_trace()
614 put_token(bio, hdr.token, hdr.token_len); in ossl_quic_trace()
615 BIO_puts(bio, "\n"); in ossl_quic_trace()
619 BIO_puts(bio, " Packet Number: 0x"); in ossl_quic_trace()
622 BIO_printf(bio, "%02x", hdr.pn[i]); in ossl_quic_trace()
623 BIO_puts(bio, "\n"); in ossl_quic_trace()
632 BIO_puts(bio, write_p ? "Sent" : "Received"); in ossl_quic_trace()
633 BIO_puts(bio, " Frame: "); in ossl_quic_trace()
637 if (!trace_frame_data(bio, &pkt)) { in ossl_quic_trace()
638 BIO_puts(bio, " <error processing frame data>\n"); in ossl_quic_trace()