buildCidExtension
fn
ubyte[] buildCidExtension(DtlsConnectionId cid, ubyte localCidLength = 0)Builds the connection_id extension body for ClientHello/ServerHello.
Wire format (RFC 9147 §5.6):
uint8 cid_length;
opaque cid<0..255>;The client sends the desired local CID length. The server responds with the actual CID it wants the client to use (the server's local CID).
Parameters
cid | The Connection ID to include, or DtlsConnectionId.none() to signal support without a specific CID. |
localCidLength | For ClientHello: the desired local CID length. For ServerHello: ignored (cid.bytes used directly). |
Returns
The extension body bytes ready to be wrapped with extension header.