Documentation ¶
Index ¶
- func ComposeGQUICVersionNegotiation(connID protocol.ConnectionID, versions []protocol.VersionNumber) []byte
- func ComposeVersionNegotiation(connID protocol.ConnectionID, pn protocol.PacketNumber, ...) []byte
- func LogFrame(frame Frame, sent bool)
- func WritePublicReset(connectionID protocol.ConnectionID, rejectedPacketNumber protocol.PacketNumber, ...) []byte
- type AckFrame
- type AckRange
- type BlockedFrame
- type ConnectionCloseFrame
- type Frame
- type GoawayFrame
- type Header
- type MaxDataFrame
- type MaxStreamDataFrame
- type MaxStreamIDFrame
- type PingFrame
- type PublicReset
- type RstStreamFrame
- type StopSendingFrame
- type StopWaitingFrame
- type StreamBlockedFrame
- type StreamFrame
- 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( connID protocol.ConnectionID, pn protocol.PacketNumber, versions []protocol.VersionNumber, ) []byte
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 { LargestAcked protocol.PacketNumber LowestAcked protocol.PacketNumber AckRanges []AckRange // has to be ordered. The highest ACK range goes first, the lowest ACK range 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
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 { First protocol.PacketNumber Last protocol.PacketNumber }
AckRange is an ACK range
type BlockedFrame ¶
A BlockedFrame is a BLOCKED frame
func ParseBlockedFrame ¶
func ParseBlockedFrame(r *bytes.Reader, _ protocol.VersionNumber) (*BlockedFrame, error)
ParseBlockedFrame parses a BLOCKED frame
func (*BlockedFrame) MinLength ¶
func (f *BlockedFrame) MinLength(version protocol.VersionNumber) protocol.ByteCount
MinLength 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 ParseConnectionCloseFrame ¶
func ParseConnectionCloseFrame(r *bytes.Reader, version protocol.VersionNumber) (*ConnectionCloseFrame, error)
ParseConnectionCloseFrame reads a CONNECTION_CLOSE frame
func (*ConnectionCloseFrame) MinLength ¶
func (f *ConnectionCloseFrame) MinLength(version protocol.VersionNumber) protocol.ByteCount
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 }
A Frame in QUIC
func ParseBlockedFrameLegacy ¶
ParseBlockedFrameLegacy parses a BLOCKED frame (in gQUIC format) The frame returned is * a STREAM_BLOCKED frame, if the BLOCKED applies to a stream * a BLOCKED frame, if the BLOCKED applies to the connection
func ParseWindowUpdateFrame ¶
ParseWindowUpdateFrame parses a WINDOW_UPDATE frame The frame returned is * a MAX_STREAM_DATA frame, if the WINDOW_UPDATE applies to a stream * a MAX_DATA frame, if the WINDOW_UPDATE applies to the connection
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, _ protocol.VersionNumber) (*GoawayFrame, error)
ParseGoawayFrame parses a GOAWAY frame
func (*GoawayFrame) MinLength ¶
func (f *GoawayFrame) MinLength(version protocol.VersionNumber) protocol.ByteCount
MinLength of a written frame
func (*GoawayFrame) Write ¶
func (f *GoawayFrame) Write(b *bytes.Buffer, _ protocol.VersionNumber) error
type Header ¶
type Header struct { Raw []byte ConnectionID protocol.ConnectionID OmitConnectionID bool PacketNumberLen protocol.PacketNumberLen PacketNumber protocol.PacketNumber Version protocol.VersionNumber // VersionNumber sent by the client 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 // contains filtered or unexported fields }
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 ParseHeaderSentByClient ¶
ParseHeaderSentByClient parses the header for a packet that was sent by the client.
func ParseHeaderSentByServer ¶
ParseHeaderSentByServer parses the header for a packet that was sent by the server.
func (*Header) GetLength ¶
func (h *Header) GetLength(pers protocol.Perspective, version protocol.VersionNumber) (protocol.ByteCount, error)
GetLength determines the length of the Header.
func (*Header) Write ¶
func (h *Header) Write(b *bytes.Buffer, pers protocol.Perspective, version protocol.VersionNumber) error
Write writes the Header.
type MaxDataFrame ¶
A MaxDataFrame carries flow control information for the connection
func ParseMaxDataFrame ¶
func ParseMaxDataFrame(r *bytes.Reader, version protocol.VersionNumber) (*MaxDataFrame, error)
ParseMaxDataFrame parses a MAX_DATA frame
func (*MaxDataFrame) MinLength ¶
func (f *MaxDataFrame) MinLength(version protocol.VersionNumber) protocol.ByteCount
MinLength 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 ParseMaxStreamDataFrame ¶
func ParseMaxStreamDataFrame(r *bytes.Reader, version protocol.VersionNumber) (*MaxStreamDataFrame, error)
ParseMaxStreamDataFrame parses a MAX_STREAM_DATA frame
func (*MaxStreamDataFrame) MinLength ¶
func (f *MaxStreamDataFrame) MinLength(version protocol.VersionNumber) protocol.ByteCount
MinLength 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 ¶ added in v0.7.0
A MaxStreamIDFrame is a MAX_STREAM_ID frame
func ParseMaxStreamIDFrame ¶ added in v0.7.0
func ParseMaxStreamIDFrame(r *bytes.Reader, _ protocol.VersionNumber) (*MaxStreamIDFrame, error)
ParseMaxStreamIDFrame parses a MAX_STREAM_ID frame
func (*MaxStreamIDFrame) MinLength ¶ added in v0.7.0
func (f *MaxStreamIDFrame) MinLength(protocol.VersionNumber) protocol.ByteCount
MinLength of a written frame
func (*MaxStreamIDFrame) Write ¶ added in v0.7.0
func (f *MaxStreamIDFrame) Write(b *bytes.Buffer, _ protocol.VersionNumber) error
type PingFrame ¶
type PingFrame struct{}
A PingFrame is a ping frame
func ParsePingFrame ¶
ParsePingFrame parses 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 ParseRstStreamFrame ¶
func ParseRstStreamFrame(r *bytes.Reader, version protocol.VersionNumber) (*RstStreamFrame, error)
ParseRstStreamFrame parses a RST_STREAM frame
func (*RstStreamFrame) MinLength ¶
func (f *RstStreamFrame) MinLength(version protocol.VersionNumber) protocol.ByteCount
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 StopSendingFrame ¶ added in v0.7.0
type StopSendingFrame struct { StreamID protocol.StreamID ErrorCode protocol.ApplicationErrorCode }
A StopSendingFrame is a STOP_SENDING frame
func ParseStopSendingFrame ¶ added in v0.7.0
func ParseStopSendingFrame(r *bytes.Reader, _ protocol.VersionNumber) (*StopSendingFrame, error)
ParseStopSendingFrame parses a STOP_SENDING frame
func (*StopSendingFrame) MinLength ¶ added in v0.7.0
func (f *StopSendingFrame) MinLength(_ protocol.VersionNumber) protocol.ByteCount
MinLength of a written frame
func (*StopSendingFrame) Write ¶ added in v0.7.0
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 ParseStopWaitingFrame ¶
func ParseStopWaitingFrame(r *bytes.Reader, packetNumber protocol.PacketNumber, packetNumberLen protocol.PacketNumberLen, _ protocol.VersionNumber) (*StopWaitingFrame, error)
ParseStopWaitingFrame parses a StopWaiting frame
func (*StopWaitingFrame) MinLength ¶
func (f *StopWaitingFrame) MinLength(_ protocol.VersionNumber) protocol.ByteCount
MinLength 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 ParseStreamBlockedFrame ¶
func ParseStreamBlockedFrame(r *bytes.Reader, _ protocol.VersionNumber) (*StreamBlockedFrame, error)
ParseStreamBlockedFrame parses a STREAM_BLOCKED frame
func (*StreamBlockedFrame) MinLength ¶
func (f *StreamBlockedFrame) MinLength(version protocol.VersionNumber) protocol.ByteCount
MinLength 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 ParseStreamFrame ¶
func ParseStreamFrame(r *bytes.Reader, version protocol.VersionNumber) (*StreamFrame, error)
ParseStreamFrame reads a STREAM frame
func (*StreamFrame) DataLen ¶
func (f *StreamFrame) DataLen() protocol.ByteCount
DataLen gives the length of data in bytes
func (*StreamFrame) MinLength ¶
func (f *StreamFrame) MinLength(version protocol.VersionNumber) protocol.ByteCount
MinLength returns the length of the header of a StreamFrame the total length of the frame is frame.MinLength() + frame.DataLen()
func (*StreamFrame) Write ¶
func (f *StreamFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error
Write writes a STREAM frame
type StreamIDBlockedFrame ¶ added in v0.7.0
A StreamIDBlockedFrame is a STREAM_ID_BLOCKED frame
func ParseStreamIDBlockedFrame ¶ added in v0.7.0
func ParseStreamIDBlockedFrame(r *bytes.Reader, _ protocol.VersionNumber) (*StreamIDBlockedFrame, error)
ParseStreamIDBlockedFrame parses a STREAM_ID_BLOCKED frame
func (*StreamIDBlockedFrame) MinLength ¶ added in v0.7.0
func (f *StreamIDBlockedFrame) MinLength(_ protocol.VersionNumber) protocol.ByteCount
MinLength of a written frame
func (*StreamIDBlockedFrame) Write ¶ added in v0.7.0
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
- goaway_frame.go
- header.go
- ietf_header.go
- log.go
- max_data_frame.go
- max_stream_data_frame.go
- max_stream_id_frame.go
- ping_frame.go
- public_header.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