quic-tracker: github.com/QUIC-Tracker/quic-tracker Index | Files | Directories

package quictracker

import "github.com/QUIC-Tracker/quic-tracker"

QUIC-Tracker is a test suite for QUIC, built upon a minimal client implementation in Go. It is currently draft-13 and TLS-1.3-draft-28 compatible.

The main package is a toolbox to parse and create QUIC packets of all types. More high-level client behaviours are implemented in the package agents. Several test scenarii are implemented in the package scenarii.

Architecture

QUIC-Tracker is comprised of three parts.

The first is this package, which contains types, methods and functions to parse and create QUIC packets that can be easily manipulated.

The second is the package agents, which implements all the features and behaviours of a QUIC client as asynchronous message-passing objects. These agents exchange messages through the broadcasting channels defined in the Connection struct. This allows additional behaviours to be hooked up and respond to several events that occur when the connection is active.

The third the package scenarii, which contains all the tests of the test suite. They can be ran using the scripts in the package bin/test_suite. The tests results are produced in an unified JSON format. It is described in the Trace type documentation.

QUIC-Tracker is licensed under the GNU Affero General Public License version 3. You can find its terms in the LICENSE file, or at https://www.gnu.org/licenses/agpl.txt.

Copyright (C) 2017-2018 Maxime Piraux

Index

Package Files

common.go connection.go crypto.go frames.go headers.go packets.go pcap_capture.go streams.go trace.go transport_parameters.go utils.go

Constants

const (
    MinimumInitialLength   = 1252
    MinimumInitialLengthv6 = 1232
    MaxUDPPayloadSize      = 65507
    MaximumVersion         = 0xff000012
    MinimumVersion         = 0xff000011
)
const (
    ERR_STREAM_LIMIT_ERROR = 0x04
    ERR_STREAM_STATE_ERROR = 0x05
    ERR_PROTOCOL_VIOLATION = 0x0a
)
const (
    PaddingFrameType       FrameType = 0x00
    PingType                         = 0x01
    AckType                          = 0x02
    AckECNType                       = 0x03
    ResetStreamType                  = 0x04
    StopSendingType                  = 0x05
    CryptoType                       = 0x06
    NewTokenType                     = 0x07
    StreamType                       = 0x08
    MaxDataType                      = 0x10
    MaxStreamDataType                = 0x11
    MaxStreamsType                   = 0x12
    DataBlockedType                  = 0x14
    StreamDataBlockedType            = 0x15
    StreamsBlockedType               = 0x16
    NewConnectionIdType              = 0x18
    RetireConnectionIdType           = 0x19
    PathChallengeType                = 0x1a
    PathResponseType                 = 0x1b
    ConnectionCloseType              = 0x1c
    ApplicationCloseType             = 0x1d
)
const (
    OriginalConnectionId           TransportParametersType = 0x0000
    IdleTimeout                                            = 0x0001
    StatelessResetToken                                    = 0x0002
    MaxPacketSize                                          = 0x0003
    InitialMaxData                                         = 0x0004
    InitialMaxStreamDataBidiLocal                          = 0x0005
    InitialMaxStreamDataBidiRemote                         = 0x0006
    InitialMaxStreamDataUni                                = 0x0007
    InitialMaxStreamsBidi                                  = 0x0008
    InitialMaxStreamsUni                                   = 0x0009
    AckDelayExponent                                       = 0x000a
    MaxAckDelay                                            = 0x000b
    DisableMigration                                       = 0x000c // TODO: Handle this parameter
    PreferredAddress                                       = 0x000d // TODO: Handle this parameter
)

Variables

var EncryptionLevelToPNSpace = map[EncryptionLevel]PNSpace{
    EncryptionLevelNone:        PNSpaceNoSpace,
    EncryptionLevelInitial:     PNSpaceInitial,
    EncryptionLevelHandshake:   PNSpaceHandshake,
    EncryptionLevel0RTT:        PNSpaceAppData,
    EncryptionLevel1RTT:        PNSpaceAppData,
    EncryptionLevelBest:        PNSpaceNoSpace,
    EncryptionLevelBestAppData: PNSpaceAppData,
}
var EpochToEncryptionLevel = map[pigotls.Epoch]EncryptionLevel{
    pigotls.EpochInitial:   EncryptionLevelInitial,
    pigotls.Epoch0RTT:      EncryptionLevel0RTT,
    pigotls.EpochHandshake: EncryptionLevelHandshake,
    pigotls.Epoch1RTT:      EncryptionLevel1RTT,
}
var EpochToPNSpace = map[pigotls.Epoch]PNSpace{
    pigotls.EpochInitial:   PNSpaceInitial,
    pigotls.EpochHandshake: PNSpaceHandshake,
    pigotls.Epoch0RTT:      PNSpaceAppData,
    pigotls.Epoch1RTT:      PNSpaceAppData,
}
var PNSpaceToEpoch = map[PNSpace]pigotls.Epoch{
    PNSpaceInitial:   pigotls.EpochInitial,
    PNSpaceHandshake: pigotls.EpochHandshake,
    PNSpaceAppData:   pigotls.Epoch1RTT,
}
var PNSpaceToString = map[PNSpace]string{
    PNSpaceInitial:   "Initial",
    PNSpaceHandshake: "Handshake",
    PNSpaceAppData:   "Application data",
}
var QuicALPNToken = "hq-18" // See https://www.ietf.org/mail-archive/web/quic/current/msg01882.html
var QuicH3ALPNToken = "h3-18" // See https://tools.ietf.org/html/draft-ietf-quic-http-17#section-2.1
var QuicVersion uint32 = 0xff000012 // See https://tools.ietf.org/html/draft-ietf-quic-transport-08#section-4

TODO: Reconsider the use of global variables

func EstablishUDPConnection Uses

func EstablishUDPConnection(addr *net.UDPAddr) (*net.UDPConn, error)

func GetMaxBidiClient Uses

func GetMaxBidiClient(limit uint64) uint64

func GetMaxBidiServer Uses

func GetMaxBidiServer(limit uint64) uint64

func GetMaxUniClient Uses

func GetMaxUniClient(limit uint64) uint64

func GetMaxUniServer Uses

func GetMaxUniServer(limit uint64) uint64

func GetPacketSample Uses

func GetPacketSample(header Header, packetBytes []byte) ([]byte, int)

func GitCommit Uses

func GitCommit() string

func IsBidi Uses

func IsBidi(streamId uint64) bool

func IsBidiClient Uses

func IsBidiClient(streamId uint64) bool

func IsBidiServer Uses

func IsBidiServer(streamId uint64) bool

func IsClient Uses

func IsClient(streamId uint64) bool

func IsServer Uses

func IsServer(streamId uint64) bool

func IsUni Uses

func IsUni(streamId uint64) bool

func IsUniClient Uses

func IsUniClient(streamId uint64) bool

func IsUniServer Uses

func IsUniServer(streamId uint64) bool

func Max Uses

func Max(a, b int) int

func Min Uses

func Min(a, b int) int

func NewbyteIntervalList Uses

func NewbyteIntervalList() *byteIntervalList

NewbyteIntervalList returns an initialized list.

func StartPcapCapture Uses

func StartPcapCapture(conn *Connection, netInterface string) (*exec.Cmd, error)

func StopPcapCapture Uses

func StopPcapCapture(conn *Connection, cmd *exec.Cmd) ([]byte, error)

func Uint16ToBEBytes Uses

func Uint16ToBEBytes(uint16 uint16) []byte

func Uint24ToBEBytes Uses

func Uint24ToBEBytes(uint32 uint32) []byte

func Uint32ToBEBytes Uses

func Uint32ToBEBytes(uint32 uint32) []byte

type AckECNFrame Uses

type AckECNFrame struct {
    AckFrame
    ECT0Count  uint64
    ECT1Count  uint64
    ECTCECount uint64
}

func ReadAckECNFrame Uses

func ReadAckECNFrame(buffer *bytes.Reader, conn *Connection) *AckECNFrame

func (AckECNFrame) FrameLength Uses

func (frame AckECNFrame) FrameLength() uint16

func (AckECNFrame) FrameType Uses

func (frame AckECNFrame) FrameType() FrameType

func (AckECNFrame) WriteTo Uses

func (frame AckECNFrame) WriteTo(buffer *bytes.Buffer)

type AckFrame Uses

type AckFrame struct {
    LargestAcknowledged PacketNumber
    AckDelay            uint64
    AckRangeCount       uint64
    AckRanges           []AckRange
}

func ReadAckFrame Uses

func ReadAckFrame(buffer *bytes.Reader) *AckFrame

func (AckFrame) FrameLength Uses

func (frame AckFrame) FrameLength() uint16

func (AckFrame) FrameType Uses

func (frame AckFrame) FrameType() FrameType

func (AckFrame) GetAckedPackets Uses

func (frame AckFrame) GetAckedPackets() []PacketNumber

func (AckFrame) WriteTo Uses

func (frame AckFrame) WriteTo(buffer *bytes.Buffer)

type AckRange Uses

type AckRange struct {
    Gap      uint64
    AckRange uint64
}

type ApplicationCloseFrame Uses

type ApplicationCloseFrame struct {
    // contains filtered or unexported fields
}

func NewApplicationCloseFrame Uses

func NewApplicationCloseFrame(buffer *bytes.Reader) *ApplicationCloseFrame

func (ApplicationCloseFrame) FrameLength Uses

func (frame ApplicationCloseFrame) FrameLength() uint16

func (ApplicationCloseFrame) FrameType Uses

func (frame ApplicationCloseFrame) FrameType() FrameType

func (ApplicationCloseFrame) WriteTo Uses

func (frame ApplicationCloseFrame) WriteTo(buffer *bytes.Buffer)

type Broadcaster Uses

type Broadcaster struct {
    broadcast.Broadcaster
}

func NewBroadcaster Uses

func NewBroadcaster(buflen int) Broadcaster

func (*Broadcaster) RegisterNewChan Uses

func (b *Broadcaster) RegisterNewChan(size int) chan interface{}

type ClientHelloTransportParameters Uses

type ClientHelloTransportParameters struct {
    InitialVersion uint32
    Parameters     TransportParameterList `tls:"head=2"`
}

type Connection Uses

type Connection struct {
    ServerName    string
    UdpConnection *net.UDPConn
    UseIPv6       bool
    Host          *net.UDPAddr

    Tls           *pigotls.Connection
    TLSTPHandler  *TLSTransportParameterHandler
    KeyPhaseIndex uint

    CryptoStates map[EncryptionLevel]*CryptoState

    ExporterSecret []byte

    ReceivedPacketHandler func([]byte, unsafe.Pointer)
    SentPacketHandler     func([]byte, unsafe.Pointer)

    CryptoStreams CryptoStreams // TODO: It should be a parent class without closing states
    Streams       Streams

    IncomingPackets           Broadcaster //type: Packet
    OutgoingPackets           Broadcaster //type: Packet
    IncomingPayloads          Broadcaster //type: []byte
    UnprocessedPayloads       Broadcaster //type: UnprocessedPayload
    EncryptionLevelsAvailable Broadcaster //type: DirectionalEncryptionLevel
    FrameQueue                Broadcaster //type: QueuedFrame
    TransportParameters       Broadcaster //type: QuicTransportParameters

    PreparePacket Broadcaster //type: EncryptionLevel
    StreamInput   Broadcaster //type: StreamInput

    ConnectionClosed chan bool

    OriginalDestinationCID ConnectionID
    SourceCID              ConnectionID
    DestinationCID         ConnectionID
    Version                uint32
    ALPN                   string

    Token            []byte
    ResumptionTicket []byte

    PacketNumber           map[PNSpace]PacketNumber // Stores the next PN to be sent
    LargestPNsReceived     map[PNSpace]PacketNumber // Stores the largest PN received
    LargestPNsAcknowledged map[PNSpace]PacketNumber // Stores the largest PN we have sent that were acknowledged by the peer

    AckQueue map[PNSpace][]PacketNumber // Stores the packet numbers to be acked TODO: This should be a channel actually
    Logger   *log.Logger
}

func NewConnection Uses

func NewConnection(serverName string, version uint32, ALPN string, SCID []byte, DCID []byte, udpConn *net.UDPConn, resumptionTicket []byte) *Connection

func NewDefaultConnection Uses

func NewDefaultConnection(address string, serverName string, resumptionTicket []byte, useIPv6 bool, negotiateHTTP3 bool) (*Connection, error)

func (*Connection) Close Uses

func (c *Connection) Close()

func (*Connection) CloseConnection Uses

func (c *Connection) CloseConnection(quicLayer bool, errCode uint16, reasonPhrase string)

func (*Connection) ConnectedIp Uses

func (c *Connection) ConnectedIp() net.Addr

func (*Connection) GetAckFrame Uses

func (c *Connection) GetAckFrame(space PNSpace) *AckFrame

func (*Connection) GetInitialPacket Uses

func (c *Connection) GetInitialPacket() *InitialPacket

func (*Connection) ProcessVersionNegotation Uses

func (c *Connection) ProcessVersionNegotation(vn *VersionNegotiationPacket) error

func (*Connection) SendHTTP09GETRequest Uses

func (c *Connection) SendHTTP09GETRequest(path string, streamID uint64)

func (*Connection) SendPacket Uses

func (c *Connection) SendPacket(packet Packet, level EncryptionLevel)

func (*Connection) TransitionTo Uses

func (c *Connection) TransitionTo(version uint32, ALPN string)

type ConnectionCloseFrame Uses

type ConnectionCloseFrame struct {
    ErrorCode          uint16
    ErrorFrameType     uint64
    ReasonPhraseLength uint64
    ReasonPhrase       string
}

func NewConnectionCloseFrame Uses

func NewConnectionCloseFrame(buffer *bytes.Reader) *ConnectionCloseFrame

func (ConnectionCloseFrame) FrameLength Uses

func (frame ConnectionCloseFrame) FrameLength() uint16

func (ConnectionCloseFrame) FrameType Uses

func (frame ConnectionCloseFrame) FrameType() FrameType

func (ConnectionCloseFrame) WriteTo Uses

func (frame ConnectionCloseFrame) WriteTo(buffer *bytes.Buffer)

type ConnectionID Uses

type ConnectionID []byte

func (ConnectionID) CIDL Uses

func (c ConnectionID) CIDL() uint8

type CryptoFrame Uses

type CryptoFrame struct {
    Offset     uint64
    Length     uint64
    CryptoData []byte
}

func NewCryptoFrame Uses

func NewCryptoFrame(cryptoStream *Stream, data []byte) *CryptoFrame

func ReadCryptoFrame Uses

func ReadCryptoFrame(buffer *bytes.Reader, conn *Connection) *CryptoFrame

func (CryptoFrame) FrameLength Uses

func (frame CryptoFrame) FrameLength() uint16

func (CryptoFrame) FrameType Uses

func (frame CryptoFrame) FrameType() FrameType

func (CryptoFrame) WriteTo Uses

func (frame CryptoFrame) WriteTo(buffer *bytes.Buffer)

type CryptoState Uses

type CryptoState struct {
    Read        *pigotls.AEAD
    Write       *pigotls.AEAD
    HeaderRead  *pigotls.Cipher
    HeaderWrite *pigotls.Cipher
}

func NewInitialPacketProtection Uses

func NewInitialPacketProtection(conn *Connection) *CryptoState

func NewProtectedCryptoState Uses

func NewProtectedCryptoState(tls *pigotls.Connection, readSecret []byte, writeSecret []byte) *CryptoState

func (*CryptoState) InitRead Uses

func (s *CryptoState) InitRead(tls *pigotls.Connection, readSecret []byte)

func (*CryptoState) InitWrite Uses

func (s *CryptoState) InitWrite(tls *pigotls.Connection, writeSecret []byte)

type CryptoStreams Uses

type CryptoStreams map[PNSpace]*Stream

func (CryptoStreams) Get Uses

func (s CryptoStreams) Get(space PNSpace) *Stream

type DataBlockedFrame Uses

type DataBlockedFrame struct {
    DataLimit uint64
}

func NewBlockedFrame Uses

func NewBlockedFrame(buffer *bytes.Reader) *DataBlockedFrame

func (DataBlockedFrame) FrameLength Uses

func (frame DataBlockedFrame) FrameLength() uint16

func (DataBlockedFrame) FrameType Uses

func (frame DataBlockedFrame) FrameType() FrameType

func (DataBlockedFrame) WriteTo Uses

func (frame DataBlockedFrame) WriteTo(buffer *bytes.Buffer)

type Direction Uses

type Direction string
const ToClient Direction = "to_client"
const ToServer Direction = "to_server"

type DirectionalEncryptionLevel Uses

type DirectionalEncryptionLevel struct {
    EncryptionLevel
    Read bool
}

type EncryptedExtensionsTransportParameters Uses

type EncryptedExtensionsTransportParameters struct {
    NegotiatedVersion uint32
    SupportedVersions []SupportedVersion     `tls:"head=1"`
    Parameters        TransportParameterList `tls:"head=2"`
}

type EncryptionLevel Uses

type EncryptionLevel int
const (
    EncryptionLevelNone EncryptionLevel = iota
    EncryptionLevelInitial
    EncryptionLevel0RTT
    EncryptionLevelHandshake
    EncryptionLevel1RTT
    EncryptionLevelBest        // A special flag to indicate that the best encryption level available should be used
    EncryptionLevelBestAppData // A special flag to indicate that the best app data encryption level available should be used
)

func (EncryptionLevel) String Uses

func (eL EncryptionLevel) String() string

type Frame Uses

type Frame interface {
    FrameType() FrameType
    WriteTo(buffer *bytes.Buffer)

    FrameLength() uint16
    // contains filtered or unexported methods
}

func NewFrame Uses

func NewFrame(buffer *bytes.Reader, conn *Connection) (Frame, error)

type FramePacket Uses

type FramePacket struct {
    Frames []Frame
    // contains filtered or unexported fields
}

func (*FramePacket) AddFrame Uses

func (p *FramePacket) AddFrame(frame Frame)

func (*FramePacket) Contains Uses

func (p *FramePacket) Contains(frameType FrameType) bool

func (FramePacket) Encode Uses

func (p FramePacket) Encode(payload []byte) []byte

func (FramePacket) EncodeHeader Uses

func (p FramePacket) EncodeHeader() []byte

func (*FramePacket) EncodePayload Uses

func (p *FramePacket) EncodePayload() []byte

func (*FramePacket) GetAll Uses

func (p *FramePacket) GetAll(frameType FrameType) []Frame

func (*FramePacket) GetFirst Uses

func (p *FramePacket) GetFirst(frameType FrameType) Frame

func (*FramePacket) GetFrames Uses

func (p *FramePacket) GetFrames() []Frame

func (*FramePacket) GetRetransmittableFrames Uses

func (p *FramePacket) GetRetransmittableFrames() []Frame

func (FramePacket) Header Uses

func (p FramePacket) Header() Header

func (*FramePacket) OnlyContains Uses

func (p *FramePacket) OnlyContains(frameType FrameType) bool

func (*FramePacket) Pointer Uses

func (p *FramePacket) Pointer() unsafe.Pointer

func (FramePacket) ShortString Uses

func (p FramePacket) ShortString() string

func (*FramePacket) ShouldBeAcknowledged Uses

func (p *FramePacket) ShouldBeAcknowledged() bool

type FrameType Uses

type FrameType uint64

type Framer Uses

type Framer interface {
    Packet
    GetFrames() []Frame
    AddFrame(frame Frame)
    GetRetransmittableFrames() []Frame
    Contains(frameType FrameType) bool
    OnlyContains(frameType FrameType) bool
    GetFirst(frameType FrameType) Frame
    GetAll(frameType FrameType) []Frame
}

type HandshakePacket Uses

type HandshakePacket struct {
    FramePacket
}

func NewHandshakePacket Uses

func NewHandshakePacket(conn *Connection) *HandshakePacket

func ReadHandshakePacket Uses

func ReadHandshakePacket(buffer *bytes.Reader, conn *Connection) *HandshakePacket

func (HandshakePacket) Encode Uses

func (p HandshakePacket) Encode(payload []byte) []byte

func (HandshakePacket) EncodeHeader Uses

func (p HandshakePacket) EncodeHeader() []byte

func (*HandshakePacket) EncryptionLevel Uses

func (p *HandshakePacket) EncryptionLevel() EncryptionLevel

func (HandshakePacket) Header Uses

func (p HandshakePacket) Header() Header

func (*HandshakePacket) PNSpace Uses

func (p *HandshakePacket) PNSpace() PNSpace

func (HandshakePacket) ShortString Uses

func (p HandshakePacket) ShortString() string
type Header interface {
    PacketType() PacketType
    DestinationConnectionID() ConnectionID
    PacketNumber() PacketNumber
    TruncatedPN() TruncatedPN
    EncryptionLevel() EncryptionLevel
    Encode() []byte
    HeaderLength() int
}

func ReadHeader Uses

func ReadHeader(buffer *bytes.Reader, conn *Connection) Header

type InitialPacket Uses

type InitialPacket struct {
    FramePacket
}

func NewInitialPacket Uses

func NewInitialPacket(conn *Connection) *InitialPacket

func ReadInitialPacket Uses

func ReadInitialPacket(buffer *bytes.Reader, conn *Connection) *InitialPacket

func (InitialPacket) Encode Uses

func (p InitialPacket) Encode(payload []byte) []byte

func (InitialPacket) EncodeHeader Uses

func (p InitialPacket) EncodeHeader() []byte

func (*InitialPacket) EncryptionLevel Uses

func (p *InitialPacket) EncryptionLevel() EncryptionLevel

func (*InitialPacket) GetRetransmittableFrames Uses

func (p *InitialPacket) GetRetransmittableFrames() []Frame

func (InitialPacket) Header Uses

func (p InitialPacket) Header() Header

func (*InitialPacket) PNSpace Uses

func (p *InitialPacket) PNSpace() PNSpace

func (InitialPacket) ShortString Uses

func (p InitialPacket) ShortString() string

type KeyPhaseBit Uses

type KeyPhaseBit bool
const KeyPhaseOne KeyPhaseBit = true
const KeyPhaseZero KeyPhaseBit = false

type LongHeader Uses

type LongHeader struct {
    Version        uint32
    DestinationCID ConnectionID
    SourceCID      ConnectionID
    TokenLength    VarInt
    Token          []byte
    Length         VarInt
    // contains filtered or unexported fields
}

func NewLongHeader Uses

func NewLongHeader(packetType PacketType, conn *Connection, space PNSpace) *LongHeader

func ReadLongHeader Uses

func ReadLongHeader(buffer *bytes.Reader, conn *Connection) *LongHeader

func (*LongHeader) DestinationConnectionID Uses

func (h *LongHeader) DestinationConnectionID() ConnectionID

func (*LongHeader) Encode Uses

func (h *LongHeader) Encode() []byte

func (*LongHeader) EncryptionLevel Uses

func (h *LongHeader) EncryptionLevel() EncryptionLevel

func (*LongHeader) HeaderLength Uses

func (h *LongHeader) HeaderLength() int

func (*LongHeader) PacketNumber Uses

func (h *LongHeader) PacketNumber() PacketNumber

func (*LongHeader) PacketType Uses

func (h *LongHeader) PacketType() PacketType

func (*LongHeader) TruncatedPN Uses

func (h *LongHeader) TruncatedPN() TruncatedPN

type MaxDataFrame Uses

type MaxDataFrame struct {
    MaximumData uint64
}

func NewMaxDataFrame Uses

func NewMaxDataFrame(buffer *bytes.Reader) *MaxDataFrame

func (MaxDataFrame) FrameLength Uses

func (frame MaxDataFrame) FrameLength() uint16

func (MaxDataFrame) FrameType Uses

func (frame MaxDataFrame) FrameType() FrameType

func (MaxDataFrame) WriteTo Uses

func (frame MaxDataFrame) WriteTo(buffer *bytes.Buffer)

type MaxStreamDataFrame Uses

type MaxStreamDataFrame struct {
    StreamId          uint64
    MaximumStreamData uint64
}

func NewMaxStreamDataFrame Uses

func NewMaxStreamDataFrame(buffer *bytes.Reader) *MaxStreamDataFrame

func (MaxStreamDataFrame) FrameLength Uses

func (frame MaxStreamDataFrame) FrameLength() uint16

func (MaxStreamDataFrame) FrameType Uses

func (frame MaxStreamDataFrame) FrameType() FrameType

func (MaxStreamDataFrame) WriteTo Uses

func (frame MaxStreamDataFrame) WriteTo(buffer *bytes.Buffer)

type MaxStreamsFrame Uses

type MaxStreamsFrame struct {
    StreamsType    StreamsType
    MaximumStreams uint64
}

func NewMaxStreamIdFrame Uses

func NewMaxStreamIdFrame(buffer *bytes.Reader) *MaxStreamsFrame

func (MaxStreamsFrame) FrameLength Uses

func (frame MaxStreamsFrame) FrameLength() uint16

func (MaxStreamsFrame) FrameType Uses

func (frame MaxStreamsFrame) FrameType() FrameType

func (MaxStreamsFrame) IsBidi Uses

func (frame MaxStreamsFrame) IsBidi() bool

func (MaxStreamsFrame) IsUni Uses

func (frame MaxStreamsFrame) IsUni() bool

func (MaxStreamsFrame) WriteTo Uses

func (frame MaxStreamsFrame) WriteTo(buffer *bytes.Buffer)

type NewConnectionIdFrame Uses

type NewConnectionIdFrame struct {
    Sequence            uint64
    Length              uint8
    ConnectionId        []byte
    StatelessResetToken [16]byte
}

func NewNewConnectionIdFrame Uses

func NewNewConnectionIdFrame(buffer *bytes.Reader) *NewConnectionIdFrame

func (NewConnectionIdFrame) FrameLength Uses

func (frame NewConnectionIdFrame) FrameLength() uint16

func (NewConnectionIdFrame) FrameType Uses

func (frame NewConnectionIdFrame) FrameType() FrameType

func (NewConnectionIdFrame) WriteTo Uses

func (frame NewConnectionIdFrame) WriteTo(buffer *bytes.Buffer)

type NewTokenFrame Uses

type NewTokenFrame struct {
    Token []byte
}

func ReadNewTokenFrame Uses

func ReadNewTokenFrame(buffer *bytes.Reader, conn *Connection) *NewTokenFrame

func (NewTokenFrame) FrameLength Uses

func (frame NewTokenFrame) FrameLength() uint16

func (NewTokenFrame) FrameType Uses

func (frame NewTokenFrame) FrameType() FrameType

func (NewTokenFrame) WriteTo Uses

func (frame NewTokenFrame) WriteTo(buffer *bytes.Buffer)

type PNSpace Uses

type PNSpace int
const (
    PNSpaceInitial PNSpace = iota
    PNSpaceHandshake
    PNSpaceAppData
    PNSpaceNoSpace
)

func (PNSpace) Epoch Uses

func (pns PNSpace) Epoch() pigotls.Epoch

func (PNSpace) String Uses

func (pns PNSpace) String() string

type Packet Uses

type Packet interface {
    Header() Header
    ShouldBeAcknowledged() bool // Indicates whether or not the packet type should be acknowledged by the mean of sending an ack
    EncodeHeader() []byte
    EncodePayload() []byte
    Encode([]byte) []byte
    Pointer() unsafe.Pointer
    PNSpace() PNSpace
    EncryptionLevel() EncryptionLevel
    ShortString() string
}

type PacketNumber Uses

type PacketNumber uint64

func ReadPacketNumber Uses

func ReadPacketNumber(buffer *bytes.Reader) PacketNumber

func (PacketNumber) Truncate Uses

func (p PacketNumber) Truncate(largestAcknowledged PacketNumber) TruncatedPN

type PacketNumberQueue Uses

type PacketNumberQueue []PacketNumber

func (PacketNumberQueue) Len Uses

func (a PacketNumberQueue) Len() int

func (PacketNumberQueue) Less Uses

func (a PacketNumberQueue) Less(i, j int) bool

func (PacketNumberQueue) Swap Uses

func (a PacketNumberQueue) Swap(i, j int)

type PacketType Uses

type PacketType uint8
const (
    Initial          PacketType = 0x0
    ZeroRTTProtected PacketType = 0x1
    Handshake        PacketType = 0x2
    Retry            PacketType = 0x3

    ShortHeaderPacket PacketType = 0xff // TODO: Find a way around this
)

func (PacketType) PNSpace Uses

func (t PacketType) PNSpace() PNSpace

func (PacketType) String Uses

func (t PacketType) String() string

type PaddingFrame Uses

type PaddingFrame byte

func NewPaddingFrame Uses

func NewPaddingFrame(buffer *bytes.Reader) *PaddingFrame

func (PaddingFrame) FrameLength Uses

func (frame PaddingFrame) FrameLength() uint16

func (PaddingFrame) FrameType Uses

func (frame PaddingFrame) FrameType() FrameType

func (PaddingFrame) WriteTo Uses

func (frame PaddingFrame) WriteTo(buffer *bytes.Buffer)

type PathChallenge Uses

type PathChallenge struct {
    Data [8]byte
}

func ReadPathChallenge Uses

func ReadPathChallenge(buffer *bytes.Reader) *PathChallenge

func (PathChallenge) FrameLength Uses

func (frame PathChallenge) FrameLength() uint16

func (PathChallenge) FrameType Uses

func (frame PathChallenge) FrameType() FrameType

func (PathChallenge) WriteTo Uses

func (frame PathChallenge) WriteTo(buffer *bytes.Buffer)

type PathResponse Uses

type PathResponse struct {
    Data [8]byte
}

func NewPathResponse Uses

func NewPathResponse(data [8]byte) *PathResponse

func ReadPathResponse Uses

func ReadPathResponse(buffer *bytes.Reader) *PathResponse

func (PathResponse) FrameLength Uses

func (frame PathResponse) FrameLength() uint16

func (PathResponse) FrameType Uses

func (frame PathResponse) FrameType() FrameType

func (PathResponse) WriteTo Uses

func (frame PathResponse) WriteTo(buffer *bytes.Buffer)

type PingFrame Uses

type PingFrame byte

func NewPingFrame Uses

func NewPingFrame(buffer *bytes.Reader) *PingFrame

func (PingFrame) FrameLength Uses

func (frame PingFrame) FrameLength() uint16

func (PingFrame) FrameType Uses

func (frame PingFrame) FrameType() FrameType

func (PingFrame) WriteTo Uses

func (frame PingFrame) WriteTo(buffer *bytes.Buffer)

type ProtectedPacket Uses

type ProtectedPacket struct {
    FramePacket
}

func NewProtectedPacket Uses

func NewProtectedPacket(conn *Connection) *ProtectedPacket

func ReadProtectedPacket Uses

func ReadProtectedPacket(buffer *bytes.Reader, conn *Connection) *ProtectedPacket

func (ProtectedPacket) Encode Uses

func (p ProtectedPacket) Encode(payload []byte) []byte

func (ProtectedPacket) EncodeHeader Uses

func (p ProtectedPacket) EncodeHeader() []byte

func (*ProtectedPacket) EncryptionLevel Uses

func (p *ProtectedPacket) EncryptionLevel() EncryptionLevel

func (ProtectedPacket) Header Uses

func (p ProtectedPacket) Header() Header

func (*ProtectedPacket) PNSpace Uses

func (p *ProtectedPacket) PNSpace() PNSpace

func (ProtectedPacket) ShortString Uses

func (p ProtectedPacket) ShortString() string

type QueuedFrame Uses

type QueuedFrame struct {
    Frame
    EncryptionLevel
}

type QuicTransportParameters Uses

type QuicTransportParameters struct {
    OriginalConnectionId    ConnectionID
    IdleTimeout             uint64
    StatelessResetToken     []byte
    MaxPacketSize           uint64
    MaxData                 uint64
    MaxStreamDataBidiLocal  uint64
    MaxStreamDataBidiRemote uint64
    MaxStreamDataUni        uint64
    MaxBidiStreams          uint64
    MaxUniStreams           uint64
    AckDelayExponent        uint64
    MaxAckDelay             uint64
    DisableMigration        bool
    PreferredAddress        []byte
    AdditionalParameters    TransportParameterList
    ToJSON                  map[string]interface{}
}

type ResetStream Uses

type ResetStream struct {
    StreamId             uint64
    ApplicationErrorCode uint16
    FinalSize            uint64
}

func NewResetStream Uses

func NewResetStream(buffer *bytes.Reader) *ResetStream

func (ResetStream) FrameLength Uses

func (frame ResetStream) FrameLength() uint16

func (ResetStream) FrameType Uses

func (frame ResetStream) FrameType() FrameType

func (ResetStream) WriteTo Uses

func (frame ResetStream) WriteTo(buffer *bytes.Buffer)

type RetireConnectionId Uses

type RetireConnectionId struct {
    SequenceNumber uint64
}

func ReadRetireConnectionId Uses

func ReadRetireConnectionId(buffer *bytes.Reader) *RetireConnectionId

func (RetireConnectionId) FrameLength Uses

func (frame RetireConnectionId) FrameLength() uint16

func (RetireConnectionId) FrameType Uses

func (frame RetireConnectionId) FrameType() FrameType

func (RetireConnectionId) WriteTo Uses

func (frame RetireConnectionId) WriteTo(buffer *bytes.Buffer)

type RetryPacket Uses

type RetryPacket struct {
    OriginalDestinationCID ConnectionID
    RetryToken             []byte
    // contains filtered or unexported fields
}

func ReadRetryPacket Uses

func ReadRetryPacket(buffer *bytes.Reader, conn *Connection) *RetryPacket

func (RetryPacket) Encode Uses

func (p RetryPacket) Encode(payload []byte) []byte

func (RetryPacket) EncodeHeader Uses

func (p RetryPacket) EncodeHeader() []byte

func (*RetryPacket) EncodePayload Uses

func (p *RetryPacket) EncodePayload() []byte

func (*RetryPacket) EncryptionLevel Uses

func (p *RetryPacket) EncryptionLevel() EncryptionLevel

func (*RetryPacket) GetRetransmittableFrames Uses

func (p *RetryPacket) GetRetransmittableFrames() []Frame

func (RetryPacket) Header Uses

func (p RetryPacket) Header() Header

func (*RetryPacket) PNSpace Uses

func (p *RetryPacket) PNSpace() PNSpace

func (*RetryPacket) Pointer Uses

func (p *RetryPacket) Pointer() unsafe.Pointer

func (RetryPacket) ShortString Uses

func (p RetryPacket) ShortString() string

func (*RetryPacket) ShouldBeAcknowledged Uses

func (p *RetryPacket) ShouldBeAcknowledged() bool

type Secrets Uses

type Secrets struct {
    Epoch pigotls.Epoch `json:"epoch"`
    Read  []byte        `json:"read"`
    Write []byte        `json:"write"`
}

type ShortHeader Uses

type ShortHeader struct {
    KeyPhase       KeyPhaseBit
    DestinationCID ConnectionID
    // contains filtered or unexported fields
}

func NewShortHeader Uses

func NewShortHeader(conn *Connection) *ShortHeader

func ReadShortHeader Uses

func ReadShortHeader(buffer *bytes.Reader, conn *Connection) *ShortHeader

func (*ShortHeader) DestinationConnectionID Uses

func (h *ShortHeader) DestinationConnectionID() ConnectionID

func (*ShortHeader) Encode Uses

func (h *ShortHeader) Encode() []byte

func (*ShortHeader) EncryptionLevel Uses

func (h *ShortHeader) EncryptionLevel() EncryptionLevel

func (*ShortHeader) HeaderLength Uses

func (h *ShortHeader) HeaderLength() int

func (*ShortHeader) PacketNumber Uses

func (h *ShortHeader) PacketNumber() PacketNumber

func (*ShortHeader) PacketType Uses

func (h *ShortHeader) PacketType() PacketType

func (*ShortHeader) TruncatedPN Uses

func (h *ShortHeader) TruncatedPN() TruncatedPN

type StopSendingFrame Uses

type StopSendingFrame struct {
    StreamId             uint64
    ApplicationErrorCode uint16
}

func NewStopSendingFrame Uses

func NewStopSendingFrame(buffer *bytes.Reader) *StopSendingFrame

func (StopSendingFrame) FrameLength Uses

func (frame StopSendingFrame) FrameLength() uint16

func (StopSendingFrame) FrameType Uses

func (frame StopSendingFrame) FrameType() FrameType

func (StopSendingFrame) WriteTo Uses

func (frame StopSendingFrame) WriteTo(buffer *bytes.Buffer)

type Stream Uses

type Stream struct {
    ReadOffset  uint64
    WriteOffset uint64

    ReadLimit        uint64
    ReadBufferOffset uint64
    WriteLimit       uint64
    WriteReserved    uint64

    ReadData  []byte
    WriteData []byte

    ReadChan Broadcaster

    ReadClosed       bool
    ReadCloseOffset  uint64
    WriteClosed      bool
    WriteCloseOffset uint64
    // contains filtered or unexported fields
}

func NewStream Uses

func NewStream() *Stream

type StreamDataBlockedFrame Uses

type StreamDataBlockedFrame struct {
    StreamId        uint64
    StreamDataLimit uint64
}

func NewStreamBlockedFrame Uses

func NewStreamBlockedFrame(buffer *bytes.Reader) *StreamDataBlockedFrame

func (StreamDataBlockedFrame) FrameLength Uses

func (frame StreamDataBlockedFrame) FrameLength() uint16

func (StreamDataBlockedFrame) FrameType Uses

func (frame StreamDataBlockedFrame) FrameType() FrameType

func (StreamDataBlockedFrame) WriteTo Uses

func (frame StreamDataBlockedFrame) WriteTo(buffer *bytes.Buffer)

type StreamFrame Uses

type StreamFrame struct {
    FinBit bool
    LenBit bool
    OffBit bool

    StreamId   uint64
    Offset     uint64
    Length     uint64
    StreamData []byte
}

func NewStreamFrame Uses

func NewStreamFrame(streamId, offset uint64, data []byte, finBit bool) *StreamFrame

func ReadStreamFrame Uses

func ReadStreamFrame(buffer *bytes.Reader, conn *Connection) *StreamFrame

func (StreamFrame) FrameLength Uses

func (frame StreamFrame) FrameLength() uint16

func (StreamFrame) FrameType Uses

func (frame StreamFrame) FrameType() FrameType

func (StreamFrame) WriteTo Uses

func (frame StreamFrame) WriteTo(buffer *bytes.Buffer)

type StreamInput Uses

type StreamInput struct {
    StreamId     uint64
    Data         []byte
    Close        bool
    Reset        bool
    StopSending  bool
    AppErrorCode uint16
}

type Streams Uses

type Streams struct {
    // contains filtered or unexported fields
}

func (Streams) Close Uses

func (s Streams) Close(streamId uint64)

func (Streams) Get Uses

func (s Streams) Get(streamId uint64) *Stream

func (Streams) GetAll Uses

func (s Streams) GetAll() map[uint64]*Stream

func (Streams) Has Uses

func (s Streams) Has(streamId uint64) (*Stream, bool)

func (Streams) NumberOfServerStreamsOpen Uses

func (s Streams) NumberOfServerStreamsOpen() int

func (Streams) Reset Uses

func (s Streams) Reset(streamId uint64, appErrorCode uint16)

func (Streams) Send Uses

func (s Streams) Send(streamId uint64, data []byte, close bool)

func (Streams) StopSending Uses

func (s Streams) StopSending(streamId uint64, appErrorCode uint16)

type StreamsBlockedFrame Uses

type StreamsBlockedFrame struct {
    StreamsType StreamsType
    StreamLimit uint64
}

func NewStreamIdNeededFrame Uses

func NewStreamIdNeededFrame(buffer *bytes.Reader) *StreamsBlockedFrame

func (StreamsBlockedFrame) FrameLength Uses

func (frame StreamsBlockedFrame) FrameLength() uint16

func (StreamsBlockedFrame) FrameType Uses

func (frame StreamsBlockedFrame) FrameType() FrameType

func (StreamsBlockedFrame) IsBidi Uses

func (frame StreamsBlockedFrame) IsBidi() bool

func (StreamsBlockedFrame) IsUni Uses

func (frame StreamsBlockedFrame) IsUni() bool

func (StreamsBlockedFrame) WriteTo Uses

func (frame StreamsBlockedFrame) WriteTo(buffer *bytes.Buffer)

type StreamsType Uses

type StreamsType bool
const (
    BidiStreams StreamsType = false
    UniStreams              = true
)

func (StreamsType) String Uses

func (s StreamsType) String() string

type SupportedVersion Uses

type SupportedVersion uint32

func (SupportedVersion) String Uses

func (v SupportedVersion) String() string

type TLSTransportParameterHandler Uses

type TLSTransportParameterHandler struct {
    NegotiatedVersion uint32
    InitialVersion    uint32
    QuicTransportParameters
    *EncryptedExtensionsTransportParameters
    ReceivedParameters *QuicTransportParameters
}

func NewTLSTransportParameterHandler Uses

func NewTLSTransportParameterHandler(negotiatedVersion uint32, initialVersion uint32) *TLSTransportParameterHandler

func (*TLSTransportParameterHandler) GetExtensionData Uses

func (h *TLSTransportParameterHandler) GetExtensionData() ([]byte, error)

func (*TLSTransportParameterHandler) ReceiveExtensionData Uses

func (h *TLSTransportParameterHandler) ReceiveExtensionData(data []byte) error

type Trace Uses

type Trace struct {
    Commit          string                    `json:"commit"`   // The git commit that versions the code that produced the trace
    Scenario        string                    `json:"scenario"` // The id of the scenario that produced the trace
    ScenarioVersion int                       `json:"scenario_version"`
    Host            string                    `json:"host"`       // The host against which the scenario was run
    Ip              string                    `json:"ip"`         // The IP that was resolved for the given host
    Results         map[string]interface{}    `json:"results"`    // A dictionary that allows to report scenario-specific results
    StartedAt       int64                     `json:"started_at"` // The time at which the scenario started in epoch seconds
    Duration        uint64                    `json:"duration"`   // Its duration in epoch milliseconds
    ErrorCode       uint8                     `json:"error_code"` // A scenario-specific error code that reports its verdict
    Stream          []TracePacket             `json:"stream"`     // A clear-text copy of the packets that were sent and received
    Pcap            []byte                    `json:"pcap"`       // The packet capture file associated with the trace
    ClientRandom    []byte                    `json:"client_random"`
    Secrets         map[pigotls.Epoch]Secrets `json:"secrets"`
}

Contains the result of a test run against a given host.

func NewTrace Uses

func NewTrace(scenarioName string, scenarioVersion int, host string) *Trace

func (*Trace) AddPcap Uses

func (t *Trace) AddPcap(conn *Connection, cmd *exec.Cmd) error

func (*Trace) AttachTo Uses

func (t *Trace) AttachTo(conn *Connection)

func (*Trace) Complete Uses

func (t *Trace) Complete(conn *Connection)

func (*Trace) MarkError Uses

func (t *Trace) MarkError(error uint8, message string, packet Packet)

type TracePacket Uses

type TracePacket struct {
    Direction    Direction      `json:"direction"`
    Timestamp    int64          `json:"timestamp"`
    Data         []byte         `json:"data"`
    IsOfInterest bool           `json:"is_of_interest"`
    Pointer      unsafe.Pointer `json:"-"`
}

type TransportParameter Uses

type TransportParameter struct {
    ParameterType TransportParametersType
    Value         []byte `tls:"head=2"`
}

type TransportParameterList Uses

type TransportParameterList []TransportParameter

func (*TransportParameterList) AddParameter Uses

func (list *TransportParameterList) AddParameter(p TransportParameter)

func (*TransportParameterList) GetParameter Uses

func (list *TransportParameterList) GetParameter(id TransportParametersType) []byte

type TransportParametersType Uses

type TransportParametersType uint16

type TruncatedPN Uses

type TruncatedPN struct {
    Value  uint32
    Length int
}

func ReadTruncatedPN Uses

func ReadTruncatedPN(buffer *bytes.Reader, length int) TruncatedPN

func (TruncatedPN) Encode Uses

func (t TruncatedPN) Encode() []byte

func (TruncatedPN) Join Uses

func (t TruncatedPN) Join(p PacketNumber) PacketNumber

func (*TruncatedPN) SetLength Uses

func (t *TruncatedPN) SetLength(length int)

type UnprocessedPayload Uses

type UnprocessedPayload struct {
    EncryptionLevel
    Payload []byte
}

type VarInt Uses

type VarInt struct {
    Value  uint64
    Length int
}

func NewVarInt Uses

func NewVarInt(value uint64) VarInt

func ReadVarInt Uses

func ReadVarInt(buffer *bytes.Reader) (VarInt, error)

func (VarInt) Encode Uses

func (v VarInt) Encode() []byte

type VersionNegotiationPacket Uses

type VersionNegotiationPacket struct {
    UnusedField       uint8
    Version           uint32
    DestinationCID    ConnectionID
    SourceCID         ConnectionID
    SupportedVersions []SupportedVersion
    // contains filtered or unexported fields
}

func NewVersionNegotiationPacket Uses

func NewVersionNegotiationPacket(unusedField uint8, version uint32, versions []SupportedVersion, conn *Connection) *VersionNegotiationPacket

func ReadVersionNegotationPacket Uses

func ReadVersionNegotationPacket(buffer *bytes.Reader) *VersionNegotiationPacket

func (VersionNegotiationPacket) Encode Uses

func (p VersionNegotiationPacket) Encode(payload []byte) []byte

func (VersionNegotiationPacket) EncodeHeader Uses

func (p VersionNegotiationPacket) EncodeHeader() []byte

func (*VersionNegotiationPacket) EncodePayload Uses

func (p *VersionNegotiationPacket) EncodePayload() []byte

func (*VersionNegotiationPacket) EncryptionLevel Uses

func (p *VersionNegotiationPacket) EncryptionLevel() EncryptionLevel

func (VersionNegotiationPacket) Header Uses

func (p VersionNegotiationPacket) Header() Header

func (*VersionNegotiationPacket) PNSpace Uses

func (p *VersionNegotiationPacket) PNSpace() PNSpace

func (*VersionNegotiationPacket) Pointer Uses

func (p *VersionNegotiationPacket) Pointer() unsafe.Pointer

func (VersionNegotiationPacket) ShortString Uses

func (p VersionNegotiationPacket) ShortString() string

func (*VersionNegotiationPacket) ShouldBeAcknowledged Uses

func (p *VersionNegotiationPacket) ShouldBeAcknowledged() bool

type ZeroRTTProtectedPacket Uses

type ZeroRTTProtectedPacket struct {
    FramePacket
}

func NewZeroRTTProtectedPacket Uses

func NewZeroRTTProtectedPacket(conn *Connection) *ZeroRTTProtectedPacket

func (ZeroRTTProtectedPacket) Encode Uses

func (p ZeroRTTProtectedPacket) Encode(payload []byte) []byte

func (ZeroRTTProtectedPacket) EncodeHeader Uses

func (p ZeroRTTProtectedPacket) EncodeHeader() []byte

func (*ZeroRTTProtectedPacket) EncryptionLevel Uses

func (p *ZeroRTTProtectedPacket) EncryptionLevel() EncryptionLevel

func (ZeroRTTProtectedPacket) Header Uses

func (p ZeroRTTProtectedPacket) Header() Header

func (*ZeroRTTProtectedPacket) PNSpace Uses

func (p *ZeroRTTProtectedPacket) PNSpace() PNSpace

func (ZeroRTTProtectedPacket) ShortString Uses

func (p ZeroRTTProtectedPacket) ShortString() string

Directories

PathSynopsis
agentsThis package contains pieces of behaviours that constitutes a QUIC client.
compat
http3
lib
scenariiThis package contains all the test scenarii that are part of the test suite.

Package quictracker imports 24 packages (graph) and is imported by 3 packages. Updated 2019-02-24. Refresh now. Tools for package owners.