Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

StreamSec.Quic.ConnectionID

Feature notes: Asynchronous QUIC server and HTTP/3 component

Classes, interfaces and records

recordtQuicConnectionIDEntry

SequenceNumber: UInt64; ConnectionID, ResetToken: TBytes; Retired, Used, Advertised: Boolean; PathTag, RemoteTag: UInt64;

classtQuicPeerConnectionIDs

constructor Create(aActiveLimit: UInt64; aMaxHistory: Integer = 1024); procedure SetInitial(const aConnectionID, aResetToken: TBytes); procedure AddPreferred(const aConnectionID, aResetToken: TBytes); procedure ReceiveNew(const aFrame: tQuicFrame); function TryGet(aSequence: UInt64; out aEntry: tQuicConnectionIDEntry): Boolean; function Entry(aIndex: Integer): tQuicConnectionIDEntry; function SelectForPath(aPathTag: UInt64; out aSequence: UInt64; out aConnectionID: TBytes): Boolean; procedure MarkUsed(aSequence, aPathTag: UInt64); overload;
Selection does not consume an ID. Commit successful sends with MarkUsed. PathTag identifies both local and remote addresses for privacy; RemoteTag identifies only the peer address for reset detection. Tags are stable, caller-assigned values. An ID cannot be sent on two paths.
procedure MarkUsed(aSequence, aPathTag, aRemoteTag: UInt64); overload; procedure Retire(aSequence: UInt64); procedure RetirePath(aPathTag: UInt64); function PeekRetirement(out aFrame: tQuicFrame): Boolean;
Hand the frame to the reliable control queue before RetirementQueued. That queue owns retransmission and acknowledgement after acceptance.
procedure RetirementQueued(aSequence: UInt64); function PopRetirement(out aFrame: tQuicFrame): Boolean; function MatchStatelessReset(const aDatagram: TBytes; aRemoteTag: UInt64): Boolean;
Call on failed packet association/authentication, before rejecting its header or destination ID. Header bits are deliberately unrestricted. Only used, unretired tokens associated with RemoteTag are compared.
property Count: Integer read GetCount; property ActiveCount: Integer read GetActiveCount; property ActiveLimit: UInt64 read fActiveLimit; property RetirePriorTo: UInt64 read fRetirePriorTo;

classtQuicLocalConnectionIDs

constructor Create(const aInitialConnectionID: TBytes; aPeerLimit: UInt64; aMaxHistory: Integer = 1024); procedure SetPeerLimit(aPeerLimit: UInt64); procedure SetInitialToken(const aResetToken: TBytes); procedure Issue(const aConnectionID, aResetToken: TBytes; aRetirePriorTo: UInt64; out aFrame: tQuicFrame);
Issue commits an ID supplied by the caller's secure generator and returns a NEW_CONNECTION_ID frame for the reliable control queue. RetirePriorTo is monotone. Previously issued IDs remain acceptable until an actual RETIRE_CONNECTION_ID is received.
procedure AddPreferred(const aConnectionID, aResetToken: TBytes);
A preferred_address ID has sequence one and is counted against the peer's limit, but is delivered in the transport parameters.
procedure MarkAdvertised(aSequence: UInt64);
Initial and preferred IDs are advertised by the handshake. Commit a queued NEW_CONNECTION_ID only after its packet was actually sent.
procedure ReceiveRetire(aSequence: UInt64; const aPacketDestinationID: TBytes); function Accepts(const aConnectionID: TBytes): Boolean; function TryGet(aSequence: UInt64; out aEntry: tQuicConnectionIDEntry): Boolean; function Entry(aIndex: Integer): tQuicConnectionIDEntry; property Count: Integer read GetCount; property ActiveCount: Integer read GetActiveCount; property PeerLimit: UInt64 read fPeerLimit; property NeedsMore: Boolean read GetNeedsMore; property NextSequence: UInt64 read fNextSequence; property RetirePriorTo: UInt64 read fRetirePriorTo;

Routines