Documentation ¶
Index ¶
- Constants
- Variables
- func IsSupportedVersion(supported []uint32, v uint32) bool
- func ReadConnectionID(r io.Reader, len int) ([]byte, error)
- func ReadQuickVarInt(b io.ByteReader) (uint64, error)
- func ReadUint16(b io.ByteReader) (uint16, error)
- func ReadUint24(b io.ByteReader) (uint32, error)
- func ReadUint32(b io.ByteReader) (uint32, error)
- type AESHeaderProtector
- type ExtendedHeader
- type Header
- type LongHeaderOpener
- type Quic
Constants ¶
View Source
const ( VersionDraft22 uint32 = 0xfaceb001 VersionDraft27 uint32 = 0xfaceb002 VersionDraft29 uint32 = 0xff00001d VersionDraft32 uint32 = 0xff000020 VersionDraft34 uint32 = 0xff000022 VersionQ50 uint32 = 0x51303530 Version1 uint32 = 0x1 )
The version numbers, making grepping easier
Variables ¶
View Source
var SupportedVersions = []uint32{Version1, VersionDraft34, VersionDraft32, VersionDraft27, VersionDraft22, VersionDraft29, VersionQ50}
SupportedVersions lists the versions that the server supports must be in sorted descending order
View Source
var UnmarshalNoQUICError = errors.New("not a QUIC packet")
View Source
var UnmarshalNoQUICInitialError = errors.New("not an initial QUIC packet")
View Source
var UnmarshalQUICBitsError = errors.New("unknown bits in QUIC header")
View Source
var UnmarshalQUICError = errors.New("insufficient bytes to unmarshal QUIC")
View Source
var UnmarshalQUICUnsupportedVersion = errors.New("unsupported QUIC version")
Functions ¶
func IsSupportedVersion ¶
IsSupportedVersion returns true if the server supports this version
func ReadConnectionID ¶
ReadConnectionID reads a connection ID of length len from the given io.Reader. It returns io.EOF if there are not enough bytes to read.
func ReadQuickVarInt ¶
func ReadQuickVarInt(b io.ByteReader) (uint64, error)
func ReadUint32 ¶
func ReadUint32(b io.ByteReader) (uint32, error)
Types ¶
type AESHeaderProtector ¶
type AESHeaderProtector struct {
// contains filtered or unexported fields
}
func (*AESHeaderProtector) DecryptHeader ¶
func (p *AESHeaderProtector) DecryptHeader(sample []byte, firstByte *byte, hdrBytes []byte)
type ExtendedHeader ¶
ExtendedHeader is the header of a QUIC packet.
func UnpackHeader ¶
func UnpackHeader(hd *LongHeaderOpener, hdr *Header, data []byte, version uint32) (*ExtendedHeader, error)
type Header ¶
type Header struct { TypeByte byte IsLongHeader bool ParsedLen int64 Version uint32 DestConnectionID []byte SrcConnectionID []byte Length int64 Token []byte }
func (*Header) ParseExtended ¶
ParseExtended parses the version dependent part of the header. The Reader has to be set such that it points to the first byte of the header.
type LongHeaderOpener ¶
type LongHeaderOpener struct {
// contains filtered or unexported fields
}
func NewInitialAEAD ¶
func NewInitialAEAD(connID []byte, v uint32) *LongHeaderOpener
NewInitialAEAD creates a new AEAD for Initial encryption / decryption.
func (*LongHeaderOpener) DecryptHeader ¶
func (o *LongHeaderOpener) DecryptHeader(sample []byte, firstByte *byte, pnBytes []byte)
type Quic ¶
type Quic struct { Header *ExtendedHeader Hello tls.ClientHello }
Click to show internal directories.
Click to hide internal directories.