Documentation ¶
Overview ¶
Maxime Piraux's master's thesis Copyright (C) 2017-2018 Maxime Piraux This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Maxime Piraux's master's thesis Copyright (C) 2017-2018 Maxime Piraux This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Maxime Piraux's master's thesis Copyright (C) 2017-2018 Maxime Piraux This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Maxime Piraux's master's thesis Copyright (C) 2017-2018 Maxime Piraux This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Maxime Piraux's master's thesis Copyright (C) 2017-2018 Maxime Piraux This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Maxime Piraux's master's thesis Copyright (C) 2017-2018 Maxime Piraux This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Maxime Piraux's master's thesis Copyright (C) 2017-2018 Maxime Piraux This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Maxime Piraux's master's thesis Copyright (C) 2017-2018 Maxime Piraux This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Maxime Piraux's master's thesis Copyright (C) 2017-2018 Maxime Piraux This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- Variables
- func DecodePacketNumber(buffer *bytes.Reader) uint32
- func EncodePacketNumber(packetNumber uint32) []byte
- func EstablishUDPConnection(addr *net.UDPAddr) (*net.UDPConn, error)
- func GetPacketSample(header Header, packetBytes []byte) ([]byte, int)
- func GitCommit() string
- func Max(a, b int) int
- func NewbyteIntervalList() *byteIntervalList
- func PacketNumberLen(packetNumber uint32) int
- func StartPcapCapture(conn *Connection, netInterface string) (*exec.Cmd, error)
- func StopPcapCapture(conn *Connection, cmd *exec.Cmd) ([]byte, error)
- func Uint16ToBEBytes(uint16 uint16) []byte
- func Uint32ToBEBytes(uint32 uint32) []byte
- type AckBlock
- type AckECNFrame
- type AckFrame
- type Acknowledger
- type ApplicationCloseFrame
- type BlockedFrame
- type ClientHelloTransportParameters
- type Connection
- func (c *Connection) Close()
- func (c *Connection) CloseConnection(quicLayer bool, errCode uint16, reasonPhrase string)
- func (c *Connection) ConnectedIp() net.Addr
- func (c *Connection) GetAckFrame(space PNSpace) *AckFrame
- func (c *Connection) GetInitialPacket() *InitialPacket
- func (c *Connection) ProcessVersionNegotation(vn *VersionNegotationPacket) error
- func (c *Connection) SendHTTPGETRequest(path string, streamID uint64)
- func (c *Connection) SendPacket(packet Packet, level EncryptionLevel)
- func (c *Connection) TransitionTo(version uint32, ALPN string, resumptionTicket []byte)
- type ConnectionCloseFrame
- type ConnectionID
- type CryptoFrame
- type CryptoState
- type CryptoStreams
- type Direction
- type DirectionalEncryptionLevel
- type EncryptedExtensionsTransportParameters
- type EncryptionLevel
- type Frame
- type FramePacket
- func (p *FramePacket) AddFrame(frame Frame)
- func (p *FramePacket) Contains(frameType FrameType) bool
- func (p FramePacket) Encode(payload []byte) []byte
- func (p FramePacket) EncodeHeader() []byte
- func (p *FramePacket) EncodePayload() []byte
- func (p *FramePacket) GetAll(frameType FrameType) []Frame
- func (p *FramePacket) GetFirst(frameType FrameType) Frame
- func (p *FramePacket) GetFrames() []Frame
- func (p *FramePacket) GetRetransmittableFrames() []Frame
- func (p FramePacket) Header() Header
- func (p *FramePacket) Pointer() unsafe.Pointer
- func (p FramePacket) ShortString() string
- func (p *FramePacket) ShouldBeAcknowledged() bool
- type FrameType
- type Framer
- type HandshakePacket
- type Header
- type InitialPacket
- func (p InitialPacket) Encode(payload []byte) []byte
- func (p InitialPacket) EncodeHeader() []byte
- func (p *InitialPacket) EncryptionLevel() EncryptionLevel
- func (p *InitialPacket) GetRetransmittableFrames() []Frame
- func (p InitialPacket) Header() Header
- func (p *InitialPacket) PNSpace() PNSpace
- func (p InitialPacket) ShortString() string
- type KeyPhaseBit
- type LongHeader
- type MaxDataFrame
- type MaxStreamDataFrame
- type MaxStreamIdFrame
- type NewConnectionIdFrame
- type NewTokenFrame
- type PNSpace
- type Packet
- type PacketEncoder
- type PacketNumberQueue
- type PacketType
- type PaddingFrame
- type PathChallenge
- type PathResponse
- type PingFrame
- type ProtectedPacket
- type QueuedFrame
- type QuicTransportParameters
- type ResetStream
- type RetryPacket
- func (p RetryPacket) Encode(payload []byte) []byte
- func (p RetryPacket) EncodeHeader() []byte
- func (p *RetryPacket) EncodePayload() []byte
- func (p *RetryPacket) EncryptionLevel() EncryptionLevel
- func (p *RetryPacket) GetRetransmittableFrames() []Frame
- func (p RetryPacket) Header() Header
- func (p *RetryPacket) PNSpace() PNSpace
- func (p *RetryPacket) Pointer() unsafe.Pointer
- func (p RetryPacket) ShortString() string
- func (p *RetryPacket) ShouldBeAcknowledged() bool
- type ShortHeader
- type StopSendingFrame
- type Stream
- type StreamBlockedFrame
- type StreamFrame
- type StreamIdBlockedFrame
- type Streams
- type SupportedVersion
- type TLSTransportParameterHandler
- type Trace
- type TracePacket
- type TransportParameter
- type TransportParameterList
- type TransportParametersType
- type UnprocessedPayload
- type VersionNegotationPacket
- func (p VersionNegotationPacket) Encode(payload []byte) []byte
- func (p VersionNegotationPacket) EncodeHeader() []byte
- func (p *VersionNegotationPacket) EncodePayload() []byte
- func (p *VersionNegotationPacket) EncryptionLevel() EncryptionLevel
- func (p VersionNegotationPacket) Header() Header
- func (p *VersionNegotationPacket) PNSpace() PNSpace
- func (p *VersionNegotationPacket) Pointer() unsafe.Pointer
- func (p VersionNegotationPacket) ShortString() string
- func (p *VersionNegotationPacket) ShouldBeAcknowledged() bool
- type ZeroRTTProtectedPacket
- func (p ZeroRTTProtectedPacket) Encode(payload []byte) []byte
- func (p ZeroRTTProtectedPacket) EncodeHeader() []byte
- func (p *ZeroRTTProtectedPacket) EncryptionLevel() EncryptionLevel
- func (p ZeroRTTProtectedPacket) Header() Header
- func (p *ZeroRTTProtectedPacket) PNSpace() PNSpace
- func (p ZeroRTTProtectedPacket) ShortString() string
Constants ¶
View Source
const ( MinimumInitialLength = 1252 MinimumInitialLengthv6 = 1232 MaxUDPPayloadSize = 65507 MaximumVersion = 0xff00000d MinimumVersion = 0xff00000d )
View Source
const ( ERR_STREAM_ID_ERROR = 0x4 ERR_PROTOCOL_VIOLATION = 0xA )
View Source
const ( PaddingFrameType FrameType = 0x00 ResetStreamType = 0x01 ConnectionCloseType = 0x02 ApplicationCloseType = 0x03 MaxDataType = 0x04 MaxStreamDataType = 0x05 MaxStreamIdType = 0x06 PingType = 0x07 BlockedType = 0x08 StreamBlockedType = 0x09 StreamIdBlockedType = 0x0a NewConnectionIdType = 0x0b StopSendingType = 0x0c AckType = 0x0d PathChallengeType = 0x0e PathResponseType = 0x0f StreamType = 0x10 CryptoType = 0x18 NewTokenType = 0x19 AckECNType = 0x20 )
View Source
const ( InitialMaxStreamData TransportParametersType = 0x0000 InitialMaxData = 0x0001 InitialMaxBidiStreams = 0x0002 IdleTimeout = 0x0003 PreferredAddress = 0x0004 // TODO: Handle this parameter MaxPacketSize = 0x0005 StatelessResetToken = 0x0006 AckDelayExponent = 0x0007 InitialMaxUniStreams = 0x0008 DisableMigration = 0x0009 // TODO: Handle this parameter )
Variables ¶
View Source
var PNSpaceToEpoch = map[PNSpace]pigotls.Epoch{ PNSpaceInitial: pigotls.EpochInitial, PNSpaceHandshake: pigotls.EpochHandshake, PNSpaceAppData: pigotls.Epoch1RTT, }
View Source
var PNSpaceToString = map[PNSpace]string{ PNSpaceInitial: "Initial", PNSpaceHandshake: "Handshake", PNSpaceAppData: "Application data", }
View Source
var QuicALPNToken = "hq-13" // See https://www.ietf.org/mail-archive/web/quic/current/msg01882.html
View Source
var QuicVersion uint32 = 0xff00000d // See https://tools.ietf.org/html/draft-ietf-quic-transport-08#section-4
Functions ¶
func DecodePacketNumber ¶
func EncodePacketNumber ¶
func NewbyteIntervalList ¶
func NewbyteIntervalList() *byteIntervalList
NewbyteIntervalList returns an initialized list.
func PacketNumberLen ¶
func StartPcapCapture ¶
func StartPcapCapture(conn *Connection, netInterface string) (*exec.Cmd, error)
func StopPcapCapture ¶
func StopPcapCapture(conn *Connection, cmd *exec.Cmd) ([]byte, error)
func Uint16ToBEBytes ¶
func Uint32ToBEBytes ¶
Types ¶
type AckECNFrame ¶
func ReadAckECNFrame ¶
func ReadAckECNFrame(buffer *bytes.Reader, conn *Connection) *AckECNFrame
func (AckECNFrame) FrameLength ¶
func (frame AckECNFrame) FrameLength() uint16
func (AckECNFrame) FrameType ¶
func (frame AckECNFrame) FrameType() FrameType
type AckFrame ¶
type AckFrame struct { LargestAcknowledged uint64 AckDelay uint64 AckBlockCount uint64 AckBlocks []AckBlock }
func NewAckFrame ¶
func ReadAckFrame ¶
func (AckFrame) FrameLength ¶
func (AckFrame) GetAckedPackets ¶
type Acknowledger ¶
type Acknowledger interface {
ShouldBeAcknowledged() bool // Indicates whether or not the packet type should be acknowledged by the mean of sending an ack
}
type ApplicationCloseFrame ¶
type ApplicationCloseFrame struct {
// contains filtered or unexported fields
}
func NewApplicationCloseFrame ¶
func NewApplicationCloseFrame(buffer *bytes.Reader) *ApplicationCloseFrame
func (ApplicationCloseFrame) FrameLength ¶
func (frame ApplicationCloseFrame) FrameLength() uint16
func (ApplicationCloseFrame) FrameType ¶
func (frame ApplicationCloseFrame) FrameType() FrameType
type BlockedFrame ¶
type BlockedFrame struct {
// contains filtered or unexported fields
}
func NewBlockedFrame ¶
func NewBlockedFrame(buffer *bytes.Reader) *BlockedFrame
func (BlockedFrame) FrameLength ¶
func (frame BlockedFrame) FrameLength() uint16
func (BlockedFrame) FrameType ¶
func (frame BlockedFrame) FrameType() FrameType
type ClientHelloTransportParameters ¶
type ClientHelloTransportParameters struct { InitialVersion uint32 Parameters TransportParameterList `tls:"head=2"` }
type Connection ¶
type Connection struct { ServerName string UdpConnection *net.UDPConn UseIPv6 bool Host *net.UDPAddr Tls *pigotls.Connection TLSTPHandler *TLSTransportParameterHandler CryptoStates map[EncryptionLevel]*CryptoState ClientRandom []byte 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 broadcast.Broadcaster //type: Packet OutgoingPackets broadcast.Broadcaster //type: Packet IncomingPayloads broadcast.Broadcaster //type: []byte UnprocessedPayloads broadcast.Broadcaster //type: UnprocessedPayload EncryptionLevelsAvailable broadcast.Broadcaster //type: DirectionalEncryptionLevel FrameQueue broadcast.Broadcaster //type: QueuedFrame OriginalDestinationCID ConnectionID SourceCID ConnectionID DestinationCID ConnectionID Version uint32 PacketNumber map[PNSpace]uint64 AckQueue map[PNSpace][]uint64 // Stores the packet numbers to be acked TODO: This should be a channel actually Logger *log.Logger }
func NewConnection ¶
func NewDefaultConnection ¶
func (*Connection) Close ¶
func (c *Connection) Close()
func (*Connection) CloseConnection ¶
func (c *Connection) CloseConnection(quicLayer bool, errCode uint16, reasonPhrase string)
func (*Connection) ConnectedIp ¶
func (c *Connection) ConnectedIp() net.Addr
func (*Connection) GetAckFrame ¶
func (c *Connection) GetAckFrame(space PNSpace) *AckFrame
func (*Connection) GetInitialPacket ¶
func (c *Connection) GetInitialPacket() *InitialPacket
func (*Connection) ProcessVersionNegotation ¶
func (c *Connection) ProcessVersionNegotation(vn *VersionNegotationPacket) error
func (*Connection) SendHTTPGETRequest ¶
func (c *Connection) SendHTTPGETRequest(path string, streamID uint64)
func (*Connection) SendPacket ¶
func (c *Connection) SendPacket(packet Packet, level EncryptionLevel)
func (*Connection) TransitionTo ¶
func (c *Connection) TransitionTo(version uint32, ALPN string, resumptionTicket []byte)
type ConnectionCloseFrame ¶
type ConnectionCloseFrame struct { ErrorCode uint16 ErrorFrameType uint64 ReasonPhraseLength uint64 ReasonPhrase string }
func NewConnectionCloseFrame ¶
func NewConnectionCloseFrame(buffer *bytes.Reader) *ConnectionCloseFrame
func (ConnectionCloseFrame) FrameLength ¶
func (frame ConnectionCloseFrame) FrameLength() uint16
func (ConnectionCloseFrame) FrameType ¶
func (frame ConnectionCloseFrame) FrameType() FrameType
type ConnectionID ¶
type ConnectionID []byte
func (ConnectionID) CIDL ¶
func (c ConnectionID) CIDL() uint8
type CryptoFrame ¶
func NewCryptoFrame ¶
func NewCryptoFrame(cryptoStream *Stream, data []byte) *CryptoFrame
func ReadCryptoFrame ¶
func ReadCryptoFrame(buffer *bytes.Reader, conn *Connection) *CryptoFrame
func (CryptoFrame) FrameLength ¶
func (frame CryptoFrame) FrameLength() uint16
func (CryptoFrame) FrameType ¶
func (frame CryptoFrame) FrameType() FrameType
type CryptoState ¶
type CryptoState struct { Read cipher.AEAD Write cipher.AEAD PacketRead *pigotls.Cipher PacketWrite *pigotls.Cipher }
func NewInitialPacketProtection ¶
func NewInitialPacketProtection(conn *Connection) *CryptoState
func NewProtectedCryptoState ¶
func NewProtectedCryptoState(tls *pigotls.Connection, readSecret []byte, writeSecret []byte) *CryptoState
func (*CryptoState) InitRead ¶
func (s *CryptoState) InitRead(tls *pigotls.Connection, readSecret []byte)
func (*CryptoState) InitWrite ¶
func (s *CryptoState) InitWrite(tls *pigotls.Connection, writeSecret []byte)
type CryptoStreams ¶
func (CryptoStreams) Get ¶
func (s CryptoStreams) Get(space PNSpace) *Stream
type Direction ¶
type Direction string
const ToClient Direction = "to_client"
const ToServer Direction = "to_server"
type DirectionalEncryptionLevel ¶
type DirectionalEncryptionLevel struct { EncryptionLevel Read bool }
type EncryptedExtensionsTransportParameters ¶
type EncryptedExtensionsTransportParameters struct { NegotiatedVersion uint32 SupportedVersions []SupportedVersion `tls:"head=1"` Parameters TransportParameterList `tls:"head=2"` }
type EncryptionLevel ¶
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 )
func (EncryptionLevel) String ¶
func (eL EncryptionLevel) String() string
type Frame ¶
type FramePacket ¶
type FramePacket struct { Frames []Frame // contains filtered or unexported fields }
func (*FramePacket) AddFrame ¶
func (p *FramePacket) AddFrame(frame Frame)
func (*FramePacket) Contains ¶
func (p *FramePacket) Contains(frameType FrameType) bool
func (FramePacket) EncodeHeader ¶
func (p FramePacket) EncodeHeader() []byte
func (*FramePacket) EncodePayload ¶
func (p *FramePacket) EncodePayload() []byte
func (*FramePacket) GetAll ¶
func (p *FramePacket) GetAll(frameType FrameType) []Frame
func (*FramePacket) GetFirst ¶
func (p *FramePacket) GetFirst(frameType FrameType) Frame
func (*FramePacket) GetFrames ¶
func (p *FramePacket) GetFrames() []Frame
func (*FramePacket) GetRetransmittableFrames ¶
func (p *FramePacket) GetRetransmittableFrames() []Frame
func (*FramePacket) Pointer ¶
func (p *FramePacket) Pointer() unsafe.Pointer
func (FramePacket) ShortString ¶
func (p FramePacket) ShortString() string
func (*FramePacket) ShouldBeAcknowledged ¶
func (p *FramePacket) ShouldBeAcknowledged() bool
type HandshakePacket ¶
type HandshakePacket struct {
FramePacket
}
func NewHandshakePacket ¶
func NewHandshakePacket(conn *Connection) *HandshakePacket
func ReadHandshakePacket ¶
func ReadHandshakePacket(buffer *bytes.Reader, conn *Connection) *HandshakePacket
func (HandshakePacket) EncodeHeader ¶
func (p HandshakePacket) EncodeHeader() []byte
func (*HandshakePacket) EncryptionLevel ¶
func (p *HandshakePacket) EncryptionLevel() EncryptionLevel
func (*HandshakePacket) PNSpace ¶
func (p *HandshakePacket) PNSpace() PNSpace
func (HandshakePacket) ShortString ¶
func (p HandshakePacket) ShortString() string
type Header ¶
type Header interface { PacketType() PacketType DestinationConnectionID() ConnectionID PacketNumber() uint32 EncryptionLevel() EncryptionLevel Encode() []byte Length() int }
func ReadHeader ¶
func ReadHeader(buffer *bytes.Reader, conn *Connection) Header
type InitialPacket ¶
type InitialPacket struct {
FramePacket
}
func NewInitialPacket ¶
func NewInitialPacket(conn *Connection) *InitialPacket
func ReadInitialPacket ¶
func ReadInitialPacket(buffer *bytes.Reader, conn *Connection) *InitialPacket
func (InitialPacket) EncodeHeader ¶
func (p InitialPacket) EncodeHeader() []byte
func (*InitialPacket) EncryptionLevel ¶
func (p *InitialPacket) EncryptionLevel() EncryptionLevel
func (*InitialPacket) GetRetransmittableFrames ¶
func (p *InitialPacket) GetRetransmittableFrames() []Frame
func (*InitialPacket) PNSpace ¶
func (p *InitialPacket) PNSpace() PNSpace
func (InitialPacket) ShortString ¶
func (p InitialPacket) ShortString() string
type KeyPhaseBit ¶
type KeyPhaseBit bool
const KeyPhaseOne KeyPhaseBit = true
const KeyPhaseZero KeyPhaseBit = false
type LongHeader ¶
type LongHeader struct { Version uint32 DestinationCID ConnectionID SourceCID ConnectionID PayloadLength uint64 Token []byte LengthBeforePN int // contains filtered or unexported fields }
func NewLongHeader ¶
func NewLongHeader(packetType PacketType, conn *Connection, space PNSpace) *LongHeader
func ReadLongHeader ¶
func ReadLongHeader(buffer *bytes.Reader) *LongHeader
func (*LongHeader) DestinationConnectionID ¶
func (h *LongHeader) DestinationConnectionID() ConnectionID
func (*LongHeader) Encode ¶
func (h *LongHeader) Encode() []byte
func (*LongHeader) EncryptionLevel ¶
func (h *LongHeader) EncryptionLevel() EncryptionLevel
func (*LongHeader) Length ¶
func (h *LongHeader) Length() int
func (*LongHeader) PacketNumber ¶
func (h *LongHeader) PacketNumber() uint32
func (*LongHeader) PacketType ¶
func (h *LongHeader) PacketType() PacketType
type MaxDataFrame ¶
type MaxDataFrame struct {
MaximumData uint64
}
func NewMaxDataFrame ¶
func NewMaxDataFrame(buffer *bytes.Reader) *MaxDataFrame
func (MaxDataFrame) FrameLength ¶
func (frame MaxDataFrame) FrameLength() uint16
func (MaxDataFrame) FrameType ¶
func (frame MaxDataFrame) FrameType() FrameType
type MaxStreamDataFrame ¶
func NewMaxStreamDataFrame ¶
func NewMaxStreamDataFrame(buffer *bytes.Reader) *MaxStreamDataFrame
func (MaxStreamDataFrame) FrameLength ¶
func (frame MaxStreamDataFrame) FrameLength() uint16
func (MaxStreamDataFrame) FrameType ¶
func (frame MaxStreamDataFrame) FrameType() FrameType
type MaxStreamIdFrame ¶
type MaxStreamIdFrame struct {
// contains filtered or unexported fields
}
func NewMaxStreamIdFrame ¶
func NewMaxStreamIdFrame(buffer *bytes.Reader) *MaxStreamIdFrame
func (MaxStreamIdFrame) FrameLength ¶
func (frame MaxStreamIdFrame) FrameLength() uint16
func (MaxStreamIdFrame) FrameType ¶
func (frame MaxStreamIdFrame) FrameType() FrameType
type NewConnectionIdFrame ¶
type NewConnectionIdFrame struct { Sequence uint64 Length uint8 ConnectionId []byte StatelessResetToken [16]byte }
func NewNewConnectionIdFrame ¶
func NewNewConnectionIdFrame(buffer *bytes.Reader) *NewConnectionIdFrame
func (NewConnectionIdFrame) FrameLength ¶
func (frame NewConnectionIdFrame) FrameLength() uint16
func (NewConnectionIdFrame) FrameType ¶
func (frame NewConnectionIdFrame) FrameType() FrameType
type NewTokenFrame ¶
type NewTokenFrame struct {
Token []byte
}
func ReadNewTokenFrame ¶
func ReadNewTokenFrame(buffer *bytes.Reader, conn *Connection) *NewTokenFrame
func (NewTokenFrame) FrameLength ¶
func (frame NewTokenFrame) FrameLength() uint16
func (NewTokenFrame) FrameType ¶
func (frame NewTokenFrame) FrameType() FrameType
type Packet ¶
type Packet interface { Header() Header Acknowledger PacketEncoder Pointer() unsafe.Pointer PNSpace() PNSpace EncryptionLevel() EncryptionLevel ShortString() string }
type PacketEncoder ¶
type PacketNumberQueue ¶
type PacketNumberQueue []uint64
func (PacketNumberQueue) Len ¶
func (a PacketNumberQueue) Len() int
func (PacketNumberQueue) Less ¶
func (a PacketNumberQueue) Less(i, j int) bool
func (PacketNumberQueue) Swap ¶
func (a PacketNumberQueue) Swap(i, j int)
type PacketType ¶
type PacketType uint8
const ( Initial PacketType = 0x7f Retry PacketType = 0x7e Handshake PacketType = 0x7d ZeroRTTProtected PacketType = 0x7c ShortHeaderPacket PacketType = 0 // TODO: Find a way around this )
func (PacketType) String ¶
func (t PacketType) String() string
type PaddingFrame ¶
type PaddingFrame byte
func NewPaddingFrame ¶
func NewPaddingFrame(buffer *bytes.Reader) *PaddingFrame
func (PaddingFrame) FrameLength ¶
func (frame PaddingFrame) FrameLength() uint16
func (PaddingFrame) FrameType ¶
func (frame PaddingFrame) FrameType() FrameType
type PathChallenge ¶
type PathChallenge struct {
Data [8]byte
}
func ReadPathChallenge ¶
func ReadPathChallenge(buffer *bytes.Reader) *PathChallenge
func (PathChallenge) FrameLength ¶
func (frame PathChallenge) FrameLength() uint16
func (PathChallenge) FrameType ¶
func (frame PathChallenge) FrameType() FrameType
type PathResponse ¶
type PathResponse struct {
Data [8]byte
}
func NewPathResponse ¶
func NewPathResponse(data [8]byte) *PathResponse
func ReadPathResponse ¶
func ReadPathResponse(buffer *bytes.Reader) *PathResponse
func (PathResponse) FrameLength ¶
func (frame PathResponse) FrameLength() uint16
func (PathResponse) FrameType ¶
func (frame PathResponse) FrameType() FrameType
type ProtectedPacket ¶
type ProtectedPacket struct {
FramePacket
}
func NewProtectedPacket ¶
func NewProtectedPacket(conn *Connection) *ProtectedPacket
func ReadProtectedPacket ¶
func ReadProtectedPacket(buffer *bytes.Reader, conn *Connection) *ProtectedPacket
func (ProtectedPacket) EncodeHeader ¶
func (p ProtectedPacket) EncodeHeader() []byte
func (*ProtectedPacket) EncryptionLevel ¶
func (p *ProtectedPacket) EncryptionLevel() EncryptionLevel
func (*ProtectedPacket) PNSpace ¶
func (p *ProtectedPacket) PNSpace() PNSpace
func (ProtectedPacket) ShortString ¶
func (p ProtectedPacket) ShortString() string
type QueuedFrame ¶
type QueuedFrame struct { Frame EncryptionLevel }
type QuicTransportParameters ¶
type QuicTransportParameters struct { MaxStreamData uint32 MaxData uint32 MaxBidiStreams uint16 MaxUniStreams uint16 IdleTimeout uint16 PreferredAddress string MaxPacketSize uint16 StatelessResetToken []byte AckDelayExponent uint8 DisableMigration bool AdditionalParameters TransportParameterList ToJSON map[string]interface{} }
type ResetStream ¶
func NewResetStream ¶
func NewResetStream(buffer *bytes.Reader) *ResetStream
func (ResetStream) FrameLength ¶
func (frame ResetStream) FrameLength() uint16
func (ResetStream) FrameType ¶
func (frame ResetStream) FrameType() FrameType
type RetryPacket ¶
type RetryPacket struct { OriginalDestinationCID ConnectionID RetryToken []byte // contains filtered or unexported fields }
func ReadRetryPacket ¶
func ReadRetryPacket(buffer *bytes.Reader) *RetryPacket
func (RetryPacket) EncodeHeader ¶
func (p RetryPacket) EncodeHeader() []byte
func (*RetryPacket) EncodePayload ¶
func (p *RetryPacket) EncodePayload() []byte
func (*RetryPacket) EncryptionLevel ¶
func (p *RetryPacket) EncryptionLevel() EncryptionLevel
func (*RetryPacket) GetRetransmittableFrames ¶
func (p *RetryPacket) GetRetransmittableFrames() []Frame
func (*RetryPacket) PNSpace ¶
func (p *RetryPacket) PNSpace() PNSpace
func (*RetryPacket) Pointer ¶
func (p *RetryPacket) Pointer() unsafe.Pointer
func (RetryPacket) ShortString ¶
func (p RetryPacket) ShortString() string
func (*RetryPacket) ShouldBeAcknowledged ¶
func (p *RetryPacket) ShouldBeAcknowledged() bool
type ShortHeader ¶
type ShortHeader struct { KeyPhase KeyPhaseBit DestinationCID ConnectionID // contains filtered or unexported fields }
func NewShortHeader ¶
func NewShortHeader(keyPhase KeyPhaseBit, conn *Connection) *ShortHeader
func ReadShortHeader ¶
func ReadShortHeader(buffer *bytes.Reader, conn *Connection) *ShortHeader
func (*ShortHeader) DestinationConnectionID ¶
func (h *ShortHeader) DestinationConnectionID() ConnectionID
func (*ShortHeader) Encode ¶
func (h *ShortHeader) Encode() []byte
func (*ShortHeader) EncryptionLevel ¶
func (h *ShortHeader) EncryptionLevel() EncryptionLevel
func (*ShortHeader) Length ¶
func (h *ShortHeader) Length() int
func (*ShortHeader) PacketNumber ¶
func (h *ShortHeader) PacketNumber() uint32
func (*ShortHeader) PacketType ¶
func (h *ShortHeader) PacketType() PacketType
type StopSendingFrame ¶
func NewStopSendingFrame ¶
func NewStopSendingFrame(buffer *bytes.Reader) *StopSendingFrame
func (StopSendingFrame) FrameLength ¶
func (frame StopSendingFrame) FrameLength() uint16
func (StopSendingFrame) FrameType ¶
func (frame StopSendingFrame) FrameType() FrameType
type Stream ¶
type StreamBlockedFrame ¶
type StreamBlockedFrame struct {
// contains filtered or unexported fields
}
func NewStreamBlockedFrame ¶
func NewStreamBlockedFrame(buffer *bytes.Reader) *StreamBlockedFrame
func (StreamBlockedFrame) FrameLength ¶
func (frame StreamBlockedFrame) FrameLength() uint16
func (StreamBlockedFrame) FrameType ¶
func (frame StreamBlockedFrame) FrameType() FrameType
type StreamFrame ¶
type StreamFrame struct { FinBit bool LenBit bool OffBit bool StreamId uint64 Offset uint64 Length uint64 StreamData []byte }
func NewStreamFrame ¶
func NewStreamFrame(streamId uint64, stream *Stream, data []byte, finBit bool) *StreamFrame
func ReadStreamFrame ¶
func ReadStreamFrame(buffer *bytes.Reader, conn *Connection) *StreamFrame
func (StreamFrame) FrameLength ¶
func (frame StreamFrame) FrameLength() uint16
func (StreamFrame) FrameType ¶
func (frame StreamFrame) FrameType() FrameType
type StreamIdBlockedFrame ¶
type StreamIdBlockedFrame struct {
// contains filtered or unexported fields
}
func NewStreamIdNeededFrame ¶
func NewStreamIdNeededFrame(buffer *bytes.Reader) *StreamIdBlockedFrame
func (StreamIdBlockedFrame) FrameLength ¶
func (frame StreamIdBlockedFrame) FrameLength() uint16
func (StreamIdBlockedFrame) FrameType ¶
func (frame StreamIdBlockedFrame) FrameType() FrameType
type SupportedVersion ¶
type SupportedVersion uint32
type TLSTransportParameterHandler ¶
type TLSTransportParameterHandler struct { NegotiatedVersion uint32 InitialVersion uint32 QuicTransportParameters *EncryptedExtensionsTransportParameters ReceivedParameters *QuicTransportParameters }
func NewTLSTransportParameterHandler ¶
func NewTLSTransportParameterHandler(negotiatedVersion uint32, initialVersion uint32) *TLSTransportParameterHandler
func (*TLSTransportParameterHandler) GetExtensionData ¶
func (h *TLSTransportParameterHandler) GetExtensionData() ([]byte, error)
func (*TLSTransportParameterHandler) ReceiveExtensionData ¶
func (h *TLSTransportParameterHandler) ReceiveExtensionData(data []byte) error
type Trace ¶
type Trace struct { Commit string `json:"commit"` Scenario string `json:"scenario"` ScenarioVersion int `json:"scenario_version"` Host string `json:"host"` Ip string `json:"ip"` Results map[string]interface{} `json:"results"` StartedAt int64 `json:"started_at"` Duration uint64 `json:"duration"` ErrorCode uint8 `json:"error_code"` Stream []TracePacket `json:"stream"` Pcap []byte `json:"pcap"` DecryptedPcap []byte `json:"decrypted_pcap"` ClientRandom []byte `json:"client_random"` ExporterSecret []byte `json:"exporter_secret"` EarlyExporterSecret []byte `json:"early_exporter_secret"` }
func (*Trace) AttachTo ¶
func (t *Trace) AttachTo(conn *Connection)
func (*Trace) Complete ¶
func (t *Trace) Complete(conn *Connection)
type TracePacket ¶
type TransportParameter ¶
type TransportParameter struct { ParameterType TransportParametersType Value []byte `tls:"head=2"` }
type TransportParameterList ¶
type TransportParameterList []TransportParameter
func (*TransportParameterList) AddParameter ¶
func (list *TransportParameterList) AddParameter(p TransportParameter)
func (*TransportParameterList) GetParameter ¶
func (list *TransportParameterList) GetParameter(id TransportParametersType) []byte
type TransportParametersType ¶
type TransportParametersType uint16
type UnprocessedPayload ¶
type UnprocessedPayload struct { EncryptionLevel Payload []byte }
type VersionNegotationPacket ¶
type VersionNegotationPacket struct { UnusedField uint8 Version uint32 DestinationCID ConnectionID SourceCID ConnectionID SupportedVersions []SupportedVersion // contains filtered or unexported fields }
func NewVersionNegotationPacket ¶
func NewVersionNegotationPacket(unusedField uint8, version uint32, versions []SupportedVersion, conn *Connection) *VersionNegotationPacket
func ReadVersionNegotationPacket ¶
func ReadVersionNegotationPacket(buffer *bytes.Reader) *VersionNegotationPacket
func (VersionNegotationPacket) EncodeHeader ¶
func (p VersionNegotationPacket) EncodeHeader() []byte
func (*VersionNegotationPacket) EncodePayload ¶
func (p *VersionNegotationPacket) EncodePayload() []byte
func (*VersionNegotationPacket) EncryptionLevel ¶
func (p *VersionNegotationPacket) EncryptionLevel() EncryptionLevel
func (*VersionNegotationPacket) PNSpace ¶
func (p *VersionNegotationPacket) PNSpace() PNSpace
func (*VersionNegotationPacket) Pointer ¶
func (p *VersionNegotationPacket) Pointer() unsafe.Pointer
func (VersionNegotationPacket) ShortString ¶
func (p VersionNegotationPacket) ShortString() string
func (*VersionNegotationPacket) ShouldBeAcknowledged ¶
func (p *VersionNegotationPacket) ShouldBeAcknowledged() bool
type ZeroRTTProtectedPacket ¶
type ZeroRTTProtectedPacket struct {
FramePacket
}
func NewZeroRTTProtectedPacket ¶
func NewZeroRTTProtectedPacket(conn *Connection) *ZeroRTTProtectedPacket
func (ZeroRTTProtectedPacket) EncodeHeader ¶
func (p ZeroRTTProtectedPacket) EncodeHeader() []byte
func (*ZeroRTTProtectedPacket) EncryptionLevel ¶
func (p *ZeroRTTProtectedPacket) EncryptionLevel() EncryptionLevel
func (*ZeroRTTProtectedPacket) PNSpace ¶
func (p *ZeroRTTProtectedPacket) PNSpace() PNSpace
func (ZeroRTTProtectedPacket) ShortString ¶
func (p ZeroRTTProtectedPacket) ShortString() string
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
bin
|
|
http
Maxime Piraux's master's thesis Copyright (C) 2017-2018 Maxime Piraux This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
Maxime Piraux's master's thesis Copyright (C) 2017-2018 Maxime Piraux This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation. |
test_suite
Maxime Piraux's master's thesis Copyright (C) 2017-2018 Maxime Piraux This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
Maxime Piraux's master's thesis Copyright (C) 2017-2018 Maxime Piraux This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation. |
Maxime Piraux's master's thesis Copyright (C) 2017-2018 Maxime Piraux This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
Maxime Piraux's master's thesis Copyright (C) 2017-2018 Maxime Piraux This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation. |
Click to show internal directories.
Click to hide internal directories.