diff --git a/quic/packets.nim b/quic/packets.nim index eede9e5..c7ca618 100644 --- a/quic/packets.nim +++ b/quic/packets.nim @@ -23,7 +23,7 @@ type of packetInitial, packet0RTT, packetHandshake, packetRetry: version*: uint32 of packetVersionNegotiation: - discard + supportedVersion*: uint32 destination*: ConnectionId source*: ConnectionId bytes: seq[byte] @@ -94,6 +94,17 @@ proc findSource(datagram: seq[byte]): Slice[int] = proc readSource(datagram: seq[byte]): ConnectionId = result = ConnectionId(datagram[datagram.findSource()]) +proc findSupportedVersion(datagram: seq[byte]): Slice[int] = + let start = datagram.findSource().b + 1 + result = start..