Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidAckRanges occurs when a client sends inconsistent ACK ranges ErrInvalidAckRanges = errors.New("AckFrame: ACK frame contains invalid ACK ranges") // ErrInvalidFirstAckRange occurs when the first ACK range contains no packets ErrInvalidFirstAckRange = errors.New("AckFrame: ACK frame has invalid first ACK range") )
Functions ¶
Types ¶
type AckFrame ¶
type AckFrame struct { LargestAcked protocol.PacketNumber LowestAcked protocol.PacketNumber AckRanges []AckRange // has to be ordered. The ACK range with the highest FirstPacketNumber goes first, the ACK range with the lowest FirstPacketNumber goes last // time when the LargestAcked was receiveid // this field Will not be set for received ACKs frames PacketReceivedTime time.Time DelayTime time.Duration }
An AckFrame is an ACK frame in QUIC
func ParseAckFrame ¶
ParseAckFrame reads 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
type AckRange ¶
type AckRange struct { FirstPacketNumber protocol.PacketNumber LastPacketNumber protocol.PacketNumber }
AckRange is an ACK range
type BlockedFrame ¶
A BlockedFrame in QUIC
func ParseBlockedFrame ¶
func ParseBlockedFrame(r *bytes.Reader) (*BlockedFrame, error)
ParseBlockedFrame parses a BLOCKED frame
func (*BlockedFrame) MinLength ¶
func (f *BlockedFrame) MinLength(version protocol.VersionNumber) (protocol.ByteCount, error)
MinLength of a written frame
func (*BlockedFrame) Write ¶
func (f *BlockedFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error
Write writes a BlockedFrame frame
type ConnectionCloseFrame ¶
A ConnectionCloseFrame in QUIC
func ParseConnectionCloseFrame ¶
func ParseConnectionCloseFrame(r *bytes.Reader) (*ConnectionCloseFrame, error)
ParseConnectionCloseFrame reads a CONNECTION_CLOSE frame
func (*ConnectionCloseFrame) MinLength ¶
func (f *ConnectionCloseFrame) MinLength(version protocol.VersionNumber) (protocol.ByteCount, error)
MinLength 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 MinLength(version protocol.VersionNumber) (protocol.ByteCount, error) }
A Frame in QUIC
type GoawayFrame ¶
type GoawayFrame struct { ErrorCode qerr.ErrorCode LastGoodStream protocol.StreamID ReasonPhrase string }
A GoawayFrame is a GOAWAY frame
func ParseGoawayFrame ¶
func ParseGoawayFrame(r *bytes.Reader) (*GoawayFrame, error)
ParseGoawayFrame parses a GOAWAY frame
func (*GoawayFrame) MinLength ¶
func (f *GoawayFrame) MinLength(version protocol.VersionNumber) (protocol.ByteCount, error)
MinLength of a written frame
func (*GoawayFrame) Write ¶
func (f *GoawayFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error
type PLUSFeedbackFrame ¶
type PLUSFeedbackFrame struct {
Data []byte
}
A PLUSFeedbackFrame in QUIC
func ParsePLUSFeedbackFrame ¶
func ParsePLUSFeedbackFrame(r *bytes.Reader) (*PLUSFeedbackFrame, error)
ParsePLUSFeedbackFrame reads a pcf frame
func (*PLUSFeedbackFrame) MinLength ¶
func (f *PLUSFeedbackFrame) MinLength(version protocol.VersionNumber) (protocol.ByteCount, error)
MinLength of a written frame Returns the FULL length. Not if packet_packer/stream_framer can handle variably sized *control* frames.
func (*PLUSFeedbackFrame) Write ¶
func (f *PLUSFeedbackFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error
Write writes a PLUSFeedbackFrame frame
type PingFrame ¶
type PingFrame struct{}
A PingFrame is a ping frame
func ParsePingFrame ¶
ParsePingFrame parses a Ping frame
type RstStreamFrame ¶
type RstStreamFrame struct { StreamID protocol.StreamID ErrorCode uint32 ByteOffset protocol.ByteCount }
A RstStreamFrame in QUIC
func ParseRstStreamFrame ¶
func ParseRstStreamFrame(r *bytes.Reader) (*RstStreamFrame, error)
ParseRstStreamFrame parses a RST_STREAM frame
func (*RstStreamFrame) MinLength ¶
func (f *RstStreamFrame) MinLength(version protocol.VersionNumber) (protocol.ByteCount, error)
MinLength 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 StopWaitingFrame ¶
type StopWaitingFrame struct { LeastUnacked protocol.PacketNumber PacketNumberLen protocol.PacketNumberLen PacketNumber protocol.PacketNumber }
A StopWaitingFrame in QUIC
func ParseStopWaitingFrame ¶
func ParseStopWaitingFrame(r *bytes.Reader, packetNumber protocol.PacketNumber, packetNumberLen protocol.PacketNumberLen, version protocol.VersionNumber) (*StopWaitingFrame, error)
ParseStopWaitingFrame parses a StopWaiting frame
func (*StopWaitingFrame) MinLength ¶
func (f *StopWaitingFrame) MinLength(version protocol.VersionNumber) (protocol.ByteCount, error)
MinLength of a written frame
func (*StopWaitingFrame) Write ¶
func (f *StopWaitingFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error
type StreamFrame ¶
type StreamFrame struct { StreamID protocol.StreamID FinBit bool DataLenPresent bool Offset protocol.ByteCount Data []byte }
A StreamFrame of QUIC
func ParseStreamFrame ¶
func ParseStreamFrame(r *bytes.Reader) (*StreamFrame, error)
ParseStreamFrame reads a stream frame. The type byte must not have been read yet.
func (*StreamFrame) DataLen ¶
func (f *StreamFrame) DataLen() protocol.ByteCount
DataLen gives the length of data in bytes
func (*StreamFrame) MinLength ¶
func (f *StreamFrame) MinLength(protocol.VersionNumber) (protocol.ByteCount, error)
MinLength returns the length of the header of a StreamFrame the total length of the StreamFrame is frame.MinLength() + frame.DataLen()
func (*StreamFrame) Write ¶
func (f *StreamFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error
WriteStreamFrame writes a stream frame.
type WindowUpdateFrame ¶
A WindowUpdateFrame in QUIC
func ParseWindowUpdateFrame ¶
func ParseWindowUpdateFrame(r *bytes.Reader) (*WindowUpdateFrame, error)
ParseWindowUpdateFrame parses a RST_STREAM frame
func (*WindowUpdateFrame) MinLength ¶
func (f *WindowUpdateFrame) MinLength(version protocol.VersionNumber) (protocol.ByteCount, error)
MinLength of a written frame
func (*WindowUpdateFrame) Write ¶
func (f *WindowUpdateFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error
Write writes a RST_STREAM frame