Skip to main content

Module capture

Module capture 

Available on crate features quic and std only.
Expand description

Reading a first flight back from the wire: what any observer sees, and what one that can open the Initial packets sees.

The pipeline here needs no cryptography of its own: it splits datagrams, and — given a KeyProvider — removes Initial protection, reassembles the ClientHello and reads the transport parameters. Initial keys derive from the destination connection ID and version salt (RFC 9001 §5.2), so both a passive observer and the destination server can supply them; the keys themselves come from the engine’s TLS backend behind that seam.

Most callers hand a client’s first datagrams (the ones sent before it hears from the server) and a KeyProvider to first_flight, which runs the whole pipeline and returns a FirstFlight summary to fingerprint or turn into a crate::profile::QuicProfile. The steps are also public for finer control: observe splits one datagram with no keys; ObservedDatagram::unprotect_initials opens that datagram’s Initial packets into InitialPackets; client_hello takes those InitialPackets from across the whole flight and reassembles the ClientHello from their CRYPTO frames; transport_parameters reads it, and version_information pulls the negotiated/available versions out of those. So the packets client_hello wants are simply the InitialPackets unprotect_initials returned.

Structs§

CaptureCompleteness
Which parts of an observation are suitable as exact comparison inputs.
CaptureLimits
Retention and work budgets for a first-flight observation.
ClientHelloAssembly
Reassembles a client’s ClientHello from CRYPTO data taken in fragment by fragment, in any order and with any retransmissions.
FirstFlight
What a client’s first flight looks like, as the profile tests compare it.
InitialKeys
The Initial keys that open one direction of a captured flight.
InitialPacket
An Initial packet after its protection is removed.
ObservedDatagram
A datagram split into its packets.
ObservedPacket
One packet of a datagram as an observer without keys sees it.
QuicObservation
A bounded server observation of one attempt, including its Retry lineage.
RawParameter
A transport parameter as it was sent: identifier and raw value, in wire order.
TransportParameterIter
A bounded borrowed reader for transport parameters in their original wire order.

Enums§

CaptureError
Why a datagram or packet could not be read.
ObservedFrame
A frame as an observer with Initial keys sees it; consecutive PADDING bytes are one run.
PacketKind
What kind of packet a header announces (RFC 8999 §5, RFC 9000 §17).

Traits§

KeyProvider
Supplies the Initial keys needed to open a captured first flight.

Functions§

client_hello
The ClientHello reassembled from Initial packets, when the CRYPTO data covers it from offset zero through its length.
client_hello_with_limits
Reassemble a bounded ClientHello, including for caller-supplied packet records. Missing handshake data returns Ok(None). Malformed data, contradictory retransmissions, and exhausted budgets return an error.
first_flight
Read a client’s first flight: the datagrams it sent before hearing from the server.
first_flight_with_limits
Read a flight with explicit budgets applied before retaining peer-controlled data.
observe
Split a datagram into packets using only the invariant layout (RFC 8999 §5) and each version’s type bits and Length fields. A short header takes the rest of the datagram; bytes after a packet that cannot start another one are reported as trailing.
observe_with_limits
Split one datagram under explicit local observation budgets.
transport_parameters
The transport parameters of a ClientHello handshake message, in the order they were sent.
transport_parameters_from_hello
Read parameter values from an already parsed hello without parsing it again.
transport_parameters_iter_from_hello
Borrow each transport parameter body in wire order, with byte and entry limits. Values are slices of the parsed ClientHello; the reader copies none of their contents.
transport_parameters_with_limits
Read ordered parameter values under a byte and entry budget.
version_information
The version_information parameter among parameters, decoded as a client’s.