set the Long Header packet type based on the state of the handshake

This commit is contained in:
Marten Seemann
2017-10-27 08:39:06 +07:00
parent a65929f6cf
commit 3f62ea8673
14 changed files with 205 additions and 22 deletions

View File

@@ -21,6 +21,24 @@ const (
PacketNumberLen6 PacketNumberLen = 6
)
// The PacketType is the Long Header Type (only used for the IETF draft header format)
type PacketType uint8
const (
// PacketTypeVersionNegotiation is the packet type of a Version Negotiation packet
PacketTypeVersionNegotiation PacketType = 1
// PacketTypeClientInitial is the packet type of a Client Initial packet
PacketTypeClientInitial PacketType = 2
// PacketTypeServerStatelessRetry is the packet type of a Server Stateless Retry packet
PacketTypeServerStatelessRetry PacketType = 3
// PacketTypeServerCleartext is the packet type of a Server Cleartext packet
PacketTypeServerCleartext PacketType = 4
// PacketTypeClientCleartext is the packet type of a Client Cleartext packet
PacketTypeClientCleartext PacketType = 5
// PacketType0RTT is the packet type of a 0-RTT packet
PacketType0RTT PacketType = 6
)
// A ConnectionID in QUIC
type ConnectionID uint64