Documentation ¶
Index ¶
- Constants
- func FloatToUFloat16(a float64) []byte
- type Frame
- type FrameAck
- type FrameBlocked
- type FrameCongestionFeedback
- type FrameConnectionClose
- type FrameGoAway
- type FramePadding
- type FramePing
- type FrameResetStream
- type FrameStopWaiting
- type FrameStream
- type FrameWindowUpdate
- type Listener
- type Packet
Constants ¶
const ( PaddingFrame = 0x0 ResetStreamFrame = 0x1 ConnectionCloseFrame = 0x2 GoAwayFrame = 0x3 WindowUpdateFrame = 0x4 BlockedFrame = 0x5 StopWaitingFrame = 0x6 PingFrame = 0x7 StreamFrame = 0x80 AckFrameMask = 0xC0 AckFrame = 0x40 CongestionFeedbackFrameMask = 0xE0 CongestionFeedbackFrame = 0x20 )
Frame Types
const ( StreamIDMask = 0x03 OffsetMask = 0x1C DataLenMask = 0x20 FinMask = 0x40 )
Constants for FrameStream
const ( SequenceNumberDeltaLenMask = 0x03 LargestObservedSequenceNumberLenMask = 0xC )
Constants for FrameAck
const ( // QuicVersion - LSB 0x1 has value 1 iff the packet contains a Quic Version. This bit must be set by a client in all packets until confirmation from a server arrives agreeing to the proposed version is received by the client. A server indicates agreement on a version by sending packets without setting this bit. QuicVersion = 0x1 // PublicReset - Bit at location, 0x2, is set to indicate that the packet is a Public Reset packet. PublicReset = 0x2 // DataPacket is the bitmask for a data packet. If version and public reset aren't set. DataPacket = 0x3 // ConnIDBitMask - Pair of bits, included in 0xC, together indicate the size of the connection ID that is present in the packet, but should be set to set to 0xC in all packets until agreeably negotiated to a different value, for a given direction (e.g., client may request fewer bytes of the connection id be presented). Within this 2 bit mask: ConnIDBitMask = 0xC ConnID8Bytes = 0xC ConnID4Bytes = 0x8 ConnID1Byte = 0x4 ConnIDOmmited = 0x0 // SequenceNumberBitMask - Pair of bits included in 0x30 indicate the number of low-order-bytes of the packet sequence number that are present in each packet. Within this 2 bit mask: SequenceNumberBitMask = 0x30 SequenceNumber6Bytes = 0x30 SequenceNumber4Bytes = 0x20 SequenceNumber2Bytes = 0x10 SequenceNumber1Byte = 0x00 )
Public Flags
const ( // FlagEntropy - for data packets, signifies that this packet contains the 1 bit of entropy, for fec packets, contains the xor of the entropy of protected packets. FlagEntropy = 0x01 // FlagFECGroup - indicates whether the fec byte is present. FlagFECGroup = 0x02 // FlagFEC - signifies that this packet represents an FEC packet. FlagFEC = 0x04 )
Private Flags
Variables ¶
This section is empty.
Functions ¶
func FloatToUFloat16 ¶
FloatToUFloat16 converts a float64 into a 16 bit unsigned float with 11 explicit bits of mantissa and 5 bits of explicit exponent byte array.
Types ¶
type FrameBlocked ¶
type FrameBlocked struct {
StreamID uint64
}
FrameBlocked represents a BlockedFrame
func (FrameBlocked) ToBuf ¶
func (f FrameBlocked) ToBuf() ([]byte, error)
ToBuf serializes a FrameBlocked into a byte array
type FrameCongestionFeedback ¶
type FrameCongestionFeedback struct { }
FrameCongestionFeedback represents a CongestionFeedbackFrame
func (FrameCongestionFeedback) ToBuf ¶
func (f FrameCongestionFeedback) ToBuf() ([]byte, error)
ToBuf serializes a FrameCongestionFeedback into a byte array
type FrameConnectionClose ¶
FrameConnectionClose represents a ConnectionCloseFrame
func (FrameConnectionClose) ToBuf ¶
func (f FrameConnectionClose) ToBuf() ([]byte, error)
ToBuf serializes a FrameConnectionClose into a byte array
type FrameGoAway ¶
FrameGoAway represents a GoAwayFrame
func (FrameGoAway) ToBuf ¶
func (f FrameGoAway) ToBuf() ([]byte, error)
ToBuf serializes a FrameGoAway into a byte array
type FramePadding ¶
type FramePadding struct { }
FramePadding represents a PaddingFrame
func (FramePadding) ToBuf ¶
func (f FramePadding) ToBuf() ([]byte, error)
ToBuf serializes a FramePadding into a byte array
type FrameResetStream ¶
type FrameResetStream struct {
StreamID, ErrorCode uint64
}
FrameResetStream represents a ResetStreamFrame
func (FrameResetStream) ToBuf ¶
func (f FrameResetStream) ToBuf() ([]byte, error)
ToBuf serializes a frame into a byte array
type FrameStopWaiting ¶
FrameStopWaiting represents a StopWaitingFrame
func (FrameStopWaiting) ToBuf ¶
func (f FrameStopWaiting) ToBuf() ([]byte, error)
ToBuf serializes a frame into a byte array TODO Variable length delta
type FrameStream ¶
FrameStream represents a StreamFrame
func (FrameStream) ToBuf ¶
func (f FrameStream) ToBuf() ([]byte, error)
ToBuf serializes a frame into a byte array TODO: Implement variable length StreamID and optional data length
type FrameWindowUpdate ¶
type FrameWindowUpdate struct {
StreamID, ByteOffset uint64
}
FrameWindowUpdate represents a WindowUpdateFrame
func (FrameWindowUpdate) ToBuf ¶
func (f FrameWindowUpdate) ToBuf() ([]byte, error)
ToBuf serializes a frame into a byte array
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener represents a QUIC connection