Documentation ¶
Index ¶
- func ComposeGQUICVersionNegotiation(connID protocol.ConnectionID, versions []protocol.VersionNumber) []byte
- func ComposeVersionNegotiation(destConnID, srcConnID protocol.ConnectionID, versions []protocol.VersionNumber) ([]byte, error)
- func LogFrame(logger utils.Logger, frame Frame, sent bool)
- func WritePublicReset(connectionID protocol.ConnectionID, rejectedPacketNumber protocol.PacketNumber, ...) []byte
- type AckFrame
- func (f *AckFrame) AcksPacket(p protocol.PacketNumber) bool
- func (f *AckFrame) HasMissingRanges() bool
- func (f *AckFrame) LargestAcked() protocol.PacketNumber
- func (f *AckFrame) Length(version protocol.VersionNumber) protocol.ByteCount
- func (f *AckFrame) LowestAcked() protocol.PacketNumber
- func (f *AckFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error
- type AckRange
- type BlockedFrame
- type ConnectionCloseFrame
- type Frame
- type GoawayFrame
- type Header
- type InvariantHeader
- type MaxDataFrame
- type MaxStreamDataFrame
- type MaxStreamIDFrame
- type PathChallengeFrame
- type PathResponseFrame
- type PingFrame
- type PublicReset
- type RstStreamFrame
- type StopSendingFrame
- type StopWaitingFrame
- type StreamBlockedFrame
- type StreamFrame
- func (f *StreamFrame) DataLen() protocol.ByteCount
- func (f *StreamFrame) Length(version protocol.VersionNumber) protocol.ByteCount
- func (f *StreamFrame) MaxDataLen(maxSize protocol.ByteCount, version protocol.VersionNumber) protocol.ByteCount
- func (f *StreamFrame) MaybeSplitOffFrame(maxSize protocol.ByteCount, version protocol.VersionNumber) (*StreamFrame, error)
- func (f *StreamFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error
- type StreamIDBlockedFrame
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComposeGQUICVersionNegotiation ¶
func ComposeGQUICVersionNegotiation(connID protocol.ConnectionID, versions []protocol.VersionNumber) []byte
ComposeGQUICVersionNegotiation composes a Version Negotiation Packet for gQUIC
func ComposeVersionNegotiation ¶
func ComposeVersionNegotiation(destConnID, srcConnID protocol.ConnectionID, versions []protocol.VersionNumber) ([]byte, error)
ComposeVersionNegotiation composes a Version Negotiation according to the IETF draft
func WritePublicReset ¶
func WritePublicReset(connectionID protocol.ConnectionID, rejectedPacketNumber protocol.PacketNumber, nonceProof uint64) []byte
WritePublicReset writes a PUBLIC_RESET
Types ¶
type AckFrame ¶
type AckFrame struct { AckRanges []AckRange // has to be ordered. The highest ACK range goes first, the lowest ACK range goes last DelayTime time.Duration }
An AckFrame is an ACK frame
func (*AckFrame) AcksPacket ¶
func (f *AckFrame) AcksPacket(p protocol.PacketNumber) bool
AcksPacket determines if this ACK frame acks a certain packet number
func (*AckFrame) HasMissingRanges ¶
HasMissingRanges returns if this frame reports any missing packets
func (*AckFrame) LargestAcked ¶
func (f *AckFrame) LargestAcked() protocol.PacketNumber
LargestAcked is the largest acked packet number
func (*AckFrame) Length ¶
func (f *AckFrame) Length(version protocol.VersionNumber) protocol.ByteCount
Length of a written frame
func (*AckFrame) LowestAcked ¶
func (f *AckFrame) LowestAcked() protocol.PacketNumber
LowestAcked is the lowest acked packet number
type AckRange ¶
type AckRange struct { Smallest protocol.PacketNumber Largest protocol.PacketNumber }
AckRange is an ACK range
func (AckRange) Len ¶
func (r AckRange) Len() protocol.PacketNumber
Len returns the number of packets contained in this ACK range
type BlockedFrame ¶
A BlockedFrame is a BLOCKED frame
func (*BlockedFrame) Length ¶
func (f *BlockedFrame) Length(version protocol.VersionNumber) protocol.ByteCount
Length of a written frame
func (*BlockedFrame) Write ¶
func (f *BlockedFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error
type ConnectionCloseFrame ¶
A ConnectionCloseFrame in QUIC
func (*ConnectionCloseFrame) Length ¶
func (f *ConnectionCloseFrame) Length(version protocol.VersionNumber) protocol.ByteCount
Length of a written frame
func (*ConnectionCloseFrame) Write ¶
func (f *ConnectionCloseFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error
Write writes an CONNECTION_CLOSE frame.
type Frame ¶
type Frame interface { Write(b *bytes.Buffer, version protocol.VersionNumber) error Length(version protocol.VersionNumber) protocol.ByteCount }
A Frame in QUIC
func ParseNextFrame ¶
ParseNextFrame parses the next frame It skips PADDING frames.
type GoawayFrame ¶
type GoawayFrame struct { ErrorCode qerr.ErrorCode LastGoodStream protocol.StreamID ReasonPhrase string }
A GoawayFrame is a GOAWAY frame
func (*GoawayFrame) Length ¶
func (f *GoawayFrame) Length(version protocol.VersionNumber) protocol.ByteCount
Length of a written frame
func (*GoawayFrame) Write ¶
func (f *GoawayFrame) Write(b *bytes.Buffer, _ protocol.VersionNumber) error
type Header ¶
type Header struct { IsPublicHeader bool Raw []byte Version protocol.VersionNumber DestConnectionID protocol.ConnectionID SrcConnectionID protocol.ConnectionID OrigDestConnectionID protocol.ConnectionID // only needed in the Retry packet PacketNumberLen protocol.PacketNumberLen PacketNumber protocol.PacketNumber IsVersionNegotiation bool SupportedVersions []protocol.VersionNumber // Version Number sent in a Version Negotiation Packet by the server // only needed for the gQUIC Public Header VersionFlag bool ResetFlag bool DiversificationNonce []byte // only needed for the IETF Header Type protocol.PacketType IsLongHeader bool KeyPhase int PayloadLen protocol.ByteCount Token []byte }
Header is the header of a QUIC packet. It contains fields that are only needed for the gQUIC Public Header and the IETF draft Header.
func (*Header) Write ¶
func (h *Header) Write(b *bytes.Buffer, pers protocol.Perspective, ver protocol.VersionNumber) error
Write writes the Header.
type InvariantHeader ¶
type InvariantHeader struct { IsLongHeader bool Version protocol.VersionNumber SrcConnectionID protocol.ConnectionID DestConnectionID protocol.ConnectionID // contains filtered or unexported fields }
The InvariantHeader is the version independent part of the header
func ParseInvariantHeader ¶
func ParseInvariantHeader(b *bytes.Reader, shortHeaderConnIDLen int) (*InvariantHeader, error)
ParseInvariantHeader parses the version independent part of the header
func (*InvariantHeader) Parse ¶
func (iv *InvariantHeader) Parse(b *bytes.Reader, sentBy protocol.Perspective, ver protocol.VersionNumber) (*Header, error)
Parse parses the version dependent part of the header
type MaxDataFrame ¶
A MaxDataFrame carries flow control information for the connection
func (*MaxDataFrame) Length ¶
func (f *MaxDataFrame) Length(version protocol.VersionNumber) protocol.ByteCount
Length of a written frame
func (*MaxDataFrame) Write ¶
func (f *MaxDataFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error
Write writes a MAX_STREAM_DATA frame
type MaxStreamDataFrame ¶
A MaxStreamDataFrame carries flow control information for a stream
func (*MaxStreamDataFrame) Length ¶
func (f *MaxStreamDataFrame) Length(version protocol.VersionNumber) protocol.ByteCount
Length of a written frame
func (*MaxStreamDataFrame) Write ¶
func (f *MaxStreamDataFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error
Write writes a MAX_STREAM_DATA frame
type MaxStreamIDFrame ¶
A MaxStreamIDFrame is a MAX_STREAM_ID frame
func (*MaxStreamIDFrame) Length ¶
func (f *MaxStreamIDFrame) Length(protocol.VersionNumber) protocol.ByteCount
Length of a written frame
func (*MaxStreamIDFrame) Write ¶
func (f *MaxStreamIDFrame) Write(b *bytes.Buffer, _ protocol.VersionNumber) error
type PathChallengeFrame ¶
type PathChallengeFrame struct {
Data [8]byte
}
A PathChallengeFrame is a PATH_CHALLENGE frame
func (*PathChallengeFrame) Length ¶
func (f *PathChallengeFrame) Length(_ protocol.VersionNumber) protocol.ByteCount
Length of a written frame
func (*PathChallengeFrame) Write ¶
func (f *PathChallengeFrame) Write(b *bytes.Buffer, _ protocol.VersionNumber) error
type PathResponseFrame ¶
type PathResponseFrame struct {
Data [8]byte
}
A PathResponseFrame is a PATH_RESPONSE frame
func (*PathResponseFrame) Length ¶
func (f *PathResponseFrame) Length(_ protocol.VersionNumber) protocol.ByteCount
Length of a written frame
func (*PathResponseFrame) Write ¶
func (f *PathResponseFrame) Write(b *bytes.Buffer, _ protocol.VersionNumber) error
type PingFrame ¶
type PingFrame struct{}
A PingFrame is a ping frame
type PublicReset ¶
type PublicReset struct { RejectedPacketNumber protocol.PacketNumber Nonce uint64 }
A PublicReset is a PUBLIC_RESET
func ParsePublicReset ¶
func ParsePublicReset(r *bytes.Reader) (*PublicReset, error)
ParsePublicReset parses a PUBLIC_RESET
type RstStreamFrame ¶
type RstStreamFrame struct { StreamID protocol.StreamID // The error code is a uint32 in gQUIC, but a uint16 in IETF QUIC. // protocol.ApplicaitonErrorCode is a uint16, so larger values in gQUIC frames will be truncated. ErrorCode protocol.ApplicationErrorCode ByteOffset protocol.ByteCount }
A RstStreamFrame is a RST_STREAM frame in QUIC
func (*RstStreamFrame) Length ¶
func (f *RstStreamFrame) Length(version protocol.VersionNumber) protocol.ByteCount
Length of a written frame
func (*RstStreamFrame) Write ¶
func (f *RstStreamFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error
Write writes a RST_STREAM frame
type StopSendingFrame ¶
type StopSendingFrame struct { StreamID protocol.StreamID ErrorCode protocol.ApplicationErrorCode }
A StopSendingFrame is a STOP_SENDING frame
func (*StopSendingFrame) Length ¶
func (f *StopSendingFrame) Length(_ protocol.VersionNumber) protocol.ByteCount
Length of a written frame
func (*StopSendingFrame) Write ¶
func (f *StopSendingFrame) Write(b *bytes.Buffer, _ protocol.VersionNumber) error
type StopWaitingFrame ¶
type StopWaitingFrame struct { LeastUnacked protocol.PacketNumber PacketNumberLen protocol.PacketNumberLen // PacketNumber is the packet number of the packet that this StopWaitingFrame will be sent with PacketNumber protocol.PacketNumber }
A StopWaitingFrame in QUIC
func (*StopWaitingFrame) Length ¶
func (f *StopWaitingFrame) Length(_ protocol.VersionNumber) protocol.ByteCount
Length of a written frame
func (*StopWaitingFrame) Write ¶
func (f *StopWaitingFrame) Write(b *bytes.Buffer, v protocol.VersionNumber) error
type StreamBlockedFrame ¶
A StreamBlockedFrame in QUIC
func (*StreamBlockedFrame) Length ¶
func (f *StreamBlockedFrame) Length(version protocol.VersionNumber) protocol.ByteCount
Length of a written frame
func (*StreamBlockedFrame) Write ¶
func (f *StreamBlockedFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error
Write writes a STREAM_BLOCKED frame
type StreamFrame ¶
type StreamFrame struct { StreamID protocol.StreamID FinBit bool DataLenPresent bool Offset protocol.ByteCount Data []byte }
A StreamFrame of QUIC
func (*StreamFrame) DataLen ¶
func (f *StreamFrame) DataLen() protocol.ByteCount
DataLen gives the length of data in bytes
func (*StreamFrame) Length ¶
func (f *StreamFrame) Length(version protocol.VersionNumber) protocol.ByteCount
Length returns the total length of the STREAM frame
func (*StreamFrame) MaxDataLen ¶
func (f *StreamFrame) MaxDataLen(maxSize protocol.ByteCount, version protocol.VersionNumber) protocol.ByteCount
MaxDataLen returns the maximum data length If 0 is returned, writing will fail (a STREAM frame must contain at least 1 byte of data).
func (*StreamFrame) MaybeSplitOffFrame ¶
func (f *StreamFrame) MaybeSplitOffFrame(maxSize protocol.ByteCount, version protocol.VersionNumber) (*StreamFrame, error)
MaybeSplitOffFrame splits a frame such that it is not bigger than n bytes. If n >= len(frame), nil is returned and nothing is modified.
func (*StreamFrame) Write ¶
func (f *StreamFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error
Write writes a STREAM frame
type StreamIDBlockedFrame ¶
A StreamIDBlockedFrame is a STREAM_ID_BLOCKED frame
func (*StreamIDBlockedFrame) Length ¶
func (f *StreamIDBlockedFrame) Length(_ protocol.VersionNumber) protocol.ByteCount
Length of a written frame
func (*StreamIDBlockedFrame) Write ¶
func (f *StreamIDBlockedFrame) Write(b *bytes.Buffer, _ protocol.VersionNumber) error
Source Files ¶
- ack_frame.go
- ack_frame_legacy.go
- ack_range.go
- blocked_frame.go
- blocked_frame_legacy.go
- connection_close_frame.go
- frame.go
- frame_parser.go
- goaway_frame.go
- header.go
- header_parser.go
- log.go
- max_data_frame.go
- max_stream_data_frame.go
- max_stream_id_frame.go
- path_challenge_frame.go
- path_response_frame.go
- ping_frame.go
- public_reset.go
- rst_stream_frame.go
- stop_sending_frame.go
- stop_waiting_frame.go
- stream_blocked_frame.go
- stream_frame.go
- stream_frame_legacy.go
- stream_id_blocked_frame.go
- version_negotiation.go
- window_update_frame.go