buildCidRecordHeader

fnubyte[] buildCidRecordHeader(ubyte contentType, ushort epoch, ulong seqNum, DtlsConnectionId cid, ushort payloadLen)

Builds a DTLS 1.3 record header with optional CID.

Per RFC 9147 §4.2.2 there is no CID-length byte on the wire: the connection ID bytes are carried directly and the receiver slices its own negotiated CID length.

Parameters

contentTypeRecord content type.
epochRecord epoch.
seqNum48-bit sequence number.
cidConnection ID to include (none = no CID field).
payloadLenPayload length.

Returns

Serialized record header bytes.