Skip to main content

Crate quic_parser

Crate quic_parser 

Source
Expand description

Zero-copy QUIC Initial packet parser with optional payload decryption.

This crate provides three layers of functionality:

Layer 1 — Header parsing (always available, zero dependencies beyond thiserror): parse QUIC Initial packet headers, peek at connection IDs, and decode varints.

Layer 2 — Decryption (requires ring or aws-lc-rs feature): derive keys and decrypt Initial packet payloads for QUIC v1 and v2.

Layer 3 — Frame extraction (requires ring or aws-lc-rs feature): extract CRYPTO frames from decrypted payloads and reassemble them into a contiguous byte stream suitable for TLS ClientHello parsing.

Structs§

CryptoFrame
A single CRYPTO frame extracted from decrypted QUIC payload.
InitialHeader
Parsed QUIC Initial packet header with zero-copy references into the original packet buffer.

Enums§

Error
Errors that can occur during QUIC packet parsing and decryption.

Functions§

decrypt_initial
Decrypt a QUIC Initial packet payload.
parse_crypto_frames
Parse all CRYPTO frames from a decrypted Initial packet payload.
parse_initial
Parse a QUIC Long Header Initial packet from a raw datagram.
peek_long_header_dcid
Extract the Destination Connection ID from a QUIC Long Header packet without performing a full parse.
peek_short_header_dcid
Extract the Destination Connection ID from a QUIC Short Header packet.
read_varint
Decode a QUIC variable-length integer from the start of buf.
reassemble_crypto_stream
Reassemble CRYPTO frames into a contiguous byte stream.