Documentation ¶
Index ¶
- Constants
- Variables
- func ReadStreamLevelFrame(conn *Conn, f StreamLevelFrame) (bool, error)
- type AckFrame
- type AckTypeFlag
- type BlockedFrame
- type Client
- func (self *Client) Connect(addPair string) error
- func (self *Client) Loop()
- func (self *Client) Ping() error
- func (self *Client) PublicResetPacket()
- func (self *Client) ReadLoop()
- func (self *Client) ReadPacketFromClient(p Packet) (bool, error)
- func (self *Client) ReadPacketFromServer(p Packet) (bool, error)
- func (self *Client) Request() error
- func (self *Client) Send(p Packet) error
- func (self *Client) SendFramePacket(frames []Frame) error
- type Conn
- func (conn *Conn) ApplyAckFrame(f *AckFrame) (bool, error)
- func (conn *Conn) ApplyConnectionCloseFrame(f *ConnectionCloseFrame) (bool, error)
- func (conn *Conn) ApplyGoAwayFrame(f *GoAwayFrame) (bool, error)
- func (conn *Conn) ApplyPingFrame(f *PingFrame) (bool, error)
- func (conn *Conn) ApplyStopWaitingFrame(f *StopWaitingFrame) (bool, error)
- func (conn *Conn) Close() error
- func (conn *Conn) Dial() error
- func (conn *Conn) GenStream(streamID uint32) *Stream
- func (conn *Conn) IncrementPacketIdx()
- func (self *Conn) NewConnectionID() (uint64, error)
- func (conn *Conn) ReadConnectionLevelFrame(f Frame) (bool, error)
- func (conn *Conn) WritePacket(p Packet, fromServer bool) error
- type ConnectionCloseFrame
- type Frame
- func ParseAckFrame(fp *FramePacket, data []byte) (Frame, int)
- func ParseBlockedFrame(fp *FramePacket, data []byte) (Frame, int)
- func ParseCongestionFeedbackFrame(fp *FramePacket, data []uint8) (Frame, int)
- func ParseConnectionCloseFrame(fp *FramePacket, data []byte) (Frame, int)
- func ParseGoAwayFrame(fp *FramePacket, data []byte) (Frame, int)
- func ParsePaddingFrame(fp *FramePacket, data []byte) (Frame, int)
- func ParsePingFrame(fp *FramePacket, data []byte) (Frame, int)
- func ParseRstStreamFrame(fp *FramePacket, data []byte) (Frame, int)
- func ParseStopWaitingFrame(fp *FramePacket, data []byte) (Frame, int)
- func ParseStreamFrame(fp *FramePacket, data []byte) (Frame, int)
- func ParseWindowUpdateFrame(fp *FramePacket, data []byte) (Frame, int)
- type FramePacket
- type FrameParser
- type FrameType
- type GoAwayFrame
- type MY_ERROR
- type Message
- func (message *Message) AppendTagValue(tag QuicTag, value []byte) bool
- func (message *Message) GetWire() (wire []byte, err error)
- func (message *Message) Parse(data []byte) (index int, err error)
- func (message *Message) SortTags()
- func (message *Message) String() string
- func (message *Message) TagContain(tag QuicTag) bool
- type Packet
- type PacketHeader
- type PacketParser
- type PacketType
- type PaddingFrame
- type PingFrame
- type PublicFlagType
- type PublicResetPacket
- func (packet *PublicResetPacket) AppendTagValue(tag QuicTag, value []byte) bool
- func (packet *PublicResetPacket) GetConnectionID() uint64
- func (packet *PublicResetPacket) GetHeader() *PacketHeader
- func (packet *PublicResetPacket) GetWire() ([]byte, error)
- func (packet *PublicResetPacket) String() string
- type QUIC_OFFICIAL_ERROR
- type QuicTag
- type RstStreamFrame
- type Server
- type State
- type StopWaitingFrame
- type Stream
- func (self *Stream) ApplyBlockedFrame(f *BlockedFrame) (bool, error)
- func (self *Stream) ApplyRstStreamFrame(f *RstStreamFrame) (bool, error)
- func (self *Stream) ApplyStreamFrame(f *StreamFrame) (bool, error)
- func (self *Stream) ApplyWindowUpdateFrame(f *WindowUpdateFrame) (bool, error)
- func (self *Stream) SendFrame(f Frame)
- func (self *Stream) String() string
- type StreamFrame
- type StreamLevelFrame
- type Timestamp
- type Transport
- func (self *Transport) Close() error
- func (self *Transport) Dial(rAddr *net.UDPAddr) error
- func (self *Transport) Listen(lAddr *net.UDPAddr) error
- func (self *Transport) Recv() (Packet, int, *net.UDPAddr, error)
- func (self *Transport) Send(p Packet) (err error)
- func (self *Transport) SendTo(p Packet, rAddr *net.UDPAddr) (err error)
- type VersionNegotiationPacket
- type Window
- type WindowUpdateFrame
Constants ¶
const ( // "01nullmm" // 'n' HasAckBlockLengths AckTypeFlag = 0x20 // 'u' Unused = 0x10 // 'll' LargestAckedLenMask = 0x0c LargestAckedLen1 = 0x00 LargestAckedLen2 = 0x04 LargestAckedLen4 = 0x08 LargestAckedLen6 = 0x0c // 'mm' AckBlockLengthLenMask = 0x03 AckBlockLengthLen1 = 0x00 AckBlockLengthLen2 = 0x01 AckBlockLengthLen4 = 0x02 AckBlockLengthLen6 = 0x03 )
const ( CONTAIN_QUIC_VERSION PublicFlagType = 0x01 PUBLIC_RESET = 0x02 PRESENT_NONSE = 0x04 CONNECTION_ID_LENGTH_8 = 0x08 OMIT_CONNECTION_ID = 0x00 PACKET_NUMBER_LENGTH_MASK = 0x30 PACKET_NUMBER_LENGTH_6 = 0x30 PACKET_NUMBER_LENGTH_4 = 0x20 PACKET_NUMBER_LENGTH_2 = 0x10 PACKET_NUMBER_LENGTH_1 = 0x00 RESERVED_MULTIPATH = 0x40 MUST_BE_ZERO = 0x80 )
const ( MTU = 1500 // temporally using MTU_IPv4 = 1370 // TODO: when to negotiate? MTU_IPv6 = 1350 )
Variables ¶
var FrameParserMap = map[FrameType]FrameParser{ PaddingFrameType: ParsePaddingFrame, RstStreamFrameType: ParseRstStreamFrame, ConnectionCloseFrameType: ParseConnectionCloseFrame, GoAwayFrameType: ParseGoAwayFrame, WindowUpdateFrameType: ParseWindowUpdateFrame, BlockedFrameType: ParseBlockedFrame, StopWaitingFrameType: ParseStopWaitingFrame, PingFrameType: ParsePingFrame, StreamFrameType: ParseStreamFrame, AckFrameType: ParseAckFrame, CongestionFeedbackFrameType: ParseCongestionFeedbackFrame, }
var PacketParserMap = map[PacketType]PacketParser{ VersionNegotiationPacketType: ParseVersionNegotiationPacket, FramePacketType: ParseFramePacket, PublicResetPacketType: ParsePublicResetPacket, }
var QUIC_VERSION_LIST []uint32 = []uint32{ uint32('Q'<<24 | '0'<<16 | '3'<<8 | '4'), }
Functions ¶
func ReadStreamLevelFrame ¶
func ReadStreamLevelFrame(conn *Conn, f StreamLevelFrame) (bool, error)
Types ¶
type AckFrame ¶
type AckFrame struct { *FramePacket Type FrameType Settings byte LargestAcked uint64 LargestAckedDeltaTime uint16 NumberBlocks_1 byte FirstAckBlockLength uint64 GapToNextBlock []byte AckBlockLength []uint64 // repeats NumberBlocks_1 times ??? NumTimestamp byte Timestamps []Timestamp }
func NewAckFrame ¶
type AckTypeFlag ¶
type AckTypeFlag byte
type BlockedFrame ¶
type BlockedFrame struct { *FramePacket Type FrameType StreamID uint32 }
0 1 2 3 4
+--------+--------+--------+--------+--------+ |Type(8) | Stream ID (32 bits) | +--------+--------+--------+--------+--------+
func NewBlockedFrame ¶
func NewBlockedFrame(streamID uint32) *BlockedFrame
func (*BlockedFrame) GetStreamID ¶
func (frame *BlockedFrame) GetStreamID() uint32
func (*BlockedFrame) GetType ¶
func (frame *BlockedFrame) GetType() FrameType
func (*BlockedFrame) GetWire ¶
func (frame *BlockedFrame) GetWire() (wire []byte, err error)
func (*BlockedFrame) String ¶
func (frame *BlockedFrame) String() (str string)
type Client ¶
type Client struct { Conn *Conn RecvChan chan Packet LastSentVersion uint32 DecidedVersion uint32 // if not zero, version negotiation was finished BufUntilVersionDecided []Packet IsServerObj bool CurrentMaxStreamID uint32 }
func (*Client) PublicResetPacket ¶
func (self *Client) PublicResetPacket()
func (*Client) ReadPacketFromClient ¶
func (*Client) ReadPacketFromServer ¶
func (*Client) SendFramePacket ¶
type Conn ¶
type Conn struct { *Transport Window *Window Streams map[uint32]*Stream LastGoodStreamID uint32 ConnectionID uint64 RemoteAddr *net.UDPAddr SentGoAway bool RecvGoAway bool TimeSpawn time.Time PacketIdx uint64 UnackedPackets map[uint64]Packet }
func (*Conn) ApplyConnectionCloseFrame ¶
func (conn *Conn) ApplyConnectionCloseFrame(f *ConnectionCloseFrame) (bool, error)
func (*Conn) ApplyGoAwayFrame ¶
func (conn *Conn) ApplyGoAwayFrame(f *GoAwayFrame) (bool, error)
func (*Conn) ApplyStopWaitingFrame ¶
func (conn *Conn) ApplyStopWaitingFrame(f *StopWaitingFrame) (bool, error)
func (*Conn) IncrementPacketIdx ¶
func (conn *Conn) IncrementPacketIdx()
func (*Conn) NewConnectionID ¶
func (*Conn) ReadConnectionLevelFrame ¶
type ConnectionCloseFrame ¶
type ConnectionCloseFrame struct { *FramePacket Type FrameType ErrorCode QUIC_OFFICIAL_ERROR ReasonPhraseLength uint16 ReasonPhrase string }
func NewConnectionCloseFrame ¶
func NewConnectionCloseFrame(errorCode QUIC_OFFICIAL_ERROR, reasonPhrase string) *ConnectionCloseFrame
func (*ConnectionCloseFrame) GetType ¶
func (frame *ConnectionCloseFrame) GetType() FrameType
func (*ConnectionCloseFrame) GetWire ¶
func (frame *ConnectionCloseFrame) GetWire() (wire []byte, err error)
func (*ConnectionCloseFrame) String ¶
func (frame *ConnectionCloseFrame) String() (str string)
type Frame ¶
func ParseAckFrame ¶
func ParseAckFrame(fp *FramePacket, data []byte) (Frame, int)
func ParseBlockedFrame ¶
func ParseBlockedFrame(fp *FramePacket, data []byte) (Frame, int)
func ParseCongestionFeedbackFrame ¶
func ParseCongestionFeedbackFrame(fp *FramePacket, data []uint8) (Frame, int)
CongestionFeedback
func ParseConnectionCloseFrame ¶
func ParseConnectionCloseFrame(fp *FramePacket, data []byte) (Frame, int)
func ParseGoAwayFrame ¶
func ParseGoAwayFrame(fp *FramePacket, data []byte) (Frame, int)
func ParsePaddingFrame ¶
func ParsePaddingFrame(fp *FramePacket, data []byte) (Frame, int)
func ParsePingFrame ¶
func ParsePingFrame(fp *FramePacket, data []byte) (Frame, int)
func ParseRstStreamFrame ¶
func ParseRstStreamFrame(fp *FramePacket, data []byte) (Frame, int)
func ParseStopWaitingFrame ¶
func ParseStopWaitingFrame(fp *FramePacket, data []byte) (Frame, int)
func ParseStreamFrame ¶
func ParseStreamFrame(fp *FramePacket, data []byte) (Frame, int)
func ParseWindowUpdateFrame ¶
func ParseWindowUpdateFrame(fp *FramePacket, data []byte) (Frame, int)
type FramePacket ¶
type FramePacket struct { *PacketHeader Frames []Frame Wire []byte DataSize uint16 RestSize uint16 }
+--------+---...---+--------+---...---+ | Type | Payload | Type | Payload | +--------+---...---+--------+---...---+
func NewFramePacket ¶
func NewFramePacket(connectionID, packetNumber uint64, frame []Frame) *FramePacket
func (*FramePacket) GetConnectionID ¶
func (packet *FramePacket) GetConnectionID() uint64
func (*FramePacket) GetHeader ¶
func (packet *FramePacket) GetHeader() *PacketHeader
func (*FramePacket) GetWire ¶
func (packet *FramePacket) GetWire() ([]byte, error)
func (*FramePacket) PushBack ¶
func (packet *FramePacket) PushBack(frame Frame) bool
func (*FramePacket) String ¶
func (packet *FramePacket) String() (str string)
type FrameParser ¶
type FrameParser func(fp *FramePacket, data []byte) (Frame, int)
type GoAwayFrame ¶
type GoAwayFrame struct { *FramePacket Type FrameType ErrorCode QUIC_OFFICIAL_ERROR LastGoodStreamID uint32 ReasonPhraseLength uint16 ReasonPhrase string }
func NewGoAwayFrame ¶
func NewGoAwayFrame(errorCode QUIC_OFFICIAL_ERROR, lastGoodStreamID uint32, reasonPhrase string) *GoAwayFrame
func (*GoAwayFrame) GetType ¶
func (frame *GoAwayFrame) GetType() FrameType
func (*GoAwayFrame) GetWire ¶
func (frame *GoAwayFrame) GetWire() (wire []byte, err error)
func (*GoAwayFrame) String ¶
func (frame *GoAwayFrame) String() (str string)
type Packet ¶
type Packet interface { GetWire() ([]byte, error) GetConnectionID() uint64 GetHeader() *PacketHeader String() string }
func ParseFramePacket ¶
func ParseFramePacket(ph *PacketHeader, data []byte) (Packet, int)
func ParsePublicResetPacket ¶
func ParsePublicResetPacket(ph *PacketHeader, data []byte) (Packet, int)
func ParseVersionNegotiationPacket ¶
func ParseVersionNegotiationPacket(ph *PacketHeader, data []byte) (Packet, int)
type PacketHeader ¶
type PacketHeader struct { Type PacketType PublicFlags PublicFlagType ConnectionID uint64 Nonse []uint8 // 0(nil) or 32 Versions []uint32 PacketNumber uint64 RegularPacket bool }
func NewPacketHeader ¶
func NewPacketHeader(packetType PacketType, connectionID uint64, versions []uint32, packetNumber uint64, nonse []uint8) *PacketHeader
func ParsePacketHeader ¶
func ParsePacketHeader(data []byte, fromServer bool) (ph *PacketHeader, length int, err error)
func (*PacketHeader) GetWire ¶
func (ph *PacketHeader) GetWire() (wire []byte, err error)
func (*PacketHeader) String ¶
func (ph *PacketHeader) String() string
type PacketParser ¶
type PacketParser func(ph *PacketHeader, data []byte) (Packet, int)
type PacketType ¶
type PacketType byte
const ( VersionNegotiationPacketType PacketType = iota FramePacketType PublicResetPacketType )
func (PacketType) String ¶
func (pType PacketType) String() string
type PaddingFrame ¶
type PaddingFrame struct { *FramePacket Type FrameType }
func NewPaddingFrame ¶
func NewPaddingFrame() *PaddingFrame
func (*PaddingFrame) GetType ¶
func (frame *PaddingFrame) GetType() FrameType
func (*PaddingFrame) GetWire ¶
func (frame *PaddingFrame) GetWire() (wire []byte, err error)
func (*PaddingFrame) String ¶
func (frame *PaddingFrame) String() (str string)
type PingFrame ¶
type PingFrame struct { *FramePacket Type FrameType }
func NewPingFrame ¶
func NewPingFrame() *PingFrame
type PublicFlagType ¶
type PublicFlagType byte
func (PublicFlagType) String ¶
func (f PublicFlagType) String() string
type PublicResetPacket ¶
type PublicResetPacket struct { *PacketHeader Msg *Message }
0 1 2 3 4 8
+--------+--------+--------+--------+--------+-- --+ | Public | Connection ID (64) ... | -> |Flags(8)| | +--------+--------+--------+--------+--------+-- --+
9 10 11 12 13 14
+--------+--------+--------+--------+--------+--------+--- | Quic Tag (32) | Tag value map ... -> | (PRST) | (variable length) +--------+--------+--------+--------+--------+--------+---
func NewPublicResetPacket ¶
func NewPublicResetPacket(connectionID uint64) *PublicResetPacket
func (*PublicResetPacket) AppendTagValue ¶
func (packet *PublicResetPacket) AppendTagValue(tag QuicTag, value []byte) bool
func (*PublicResetPacket) GetConnectionID ¶
func (packet *PublicResetPacket) GetConnectionID() uint64
func (*PublicResetPacket) GetHeader ¶
func (packet *PublicResetPacket) GetHeader() *PacketHeader
func (*PublicResetPacket) GetWire ¶
func (packet *PublicResetPacket) GetWire() ([]byte, error)
func (*PublicResetPacket) String ¶
func (packet *PublicResetPacket) String() string
type QUIC_OFFICIAL_ERROR ¶
type QUIC_OFFICIAL_ERROR uint16
TODO: The official errors shuold be in other file and package?
const ( QUIC_NO_ERROR QUIC_OFFICIAL_ERROR = iota QUIC_STREAM_DATA_AFTER_TERMINATION QUIC_SERVER_ERROR_PROCESSING_STREAM QUIC_MULTIPLE_TERMINATION_OFFSETS QUIC_BAD_APPLICATION_PAYLOAD QUIC_INVALID_PACKET_HEADER QUIC_INVALID_FRAME_DATA QUIC_INVALID_RST_STREAM_DATA QUIC_INVALID_CONNECTION_CLOSE_DATA QUIC_INVALID_ACK_DATA QUIC_DECRYPTION_FAILURE QUIC_ENCRYPTION_FAILURE QUIC_PACKET_TOO_LARGE QUIC_PACKET_FOR_NONEXISTENT_STREAM QUIC_CLIENT_GOING_AWAY QUIC_SERVER_GOING_AWAY QUIC_INVALID_STREAM_ID QUIC_TOO_MANY_OPEN_STREAMS QUIC_CONNECTION_TIMED_OUT QUIC_CRYPTO_TAGS_OUT_OF_ORDER QUIC_CRYPTO_TOO_MANY_ENTRIES QUIC_CRYPTO_INVALID_VALUE_LENGTH QUIC_CRYPTO_MESSAGE_AFTER_HANDSHAKE_COMPLETE QUIC_INVALID_CRYPTO_MESSAGE_TYPE QUIC_SEQUENCE_NUMBER_LIMIT_REACHED )
func (QUIC_OFFICIAL_ERROR) Error ¶
func (e QUIC_OFFICIAL_ERROR) Error() string
type QuicTag ¶
type QuicTag uint32
const ( CHLO QuicTag = 'C' + ('H' << 8) + ('L' << 16) + ('O' << 24) SHLO QuicTag = 'S' + ('H' << 8) + ('L' << 16) + ('O' << 24) REJ QuicTag = 'R' + ('E' << 8) + ('J' << 16) + (0 << 24) // Required Parameters // in CHLO/SHLO // Stream Flow Control Window SFCW QuicTag = 'S' + ('F' << 8) + ('C' << 16) + ('W' << 24) // Connection/Session Flow Control Window CFCW QuicTag = 'C' + ('F' << 8) + ('C' << 16) + ('W' << 24) // in CHLO // Version VER QuicTag = 'V' + ('E' << 8) + ('R' << 16) + (0 << 24) // Server Name Indication (optional) SNI QuicTag = 'S' + ('N' << 8) + ('I' << 16) + (0 << 24) // Source-address token (optional) STK QuicTag = 'S' + ('T' << 8) + ('K' << 16) + (0 << 24) // Proof demand (optional) PDMD QuicTag = 'P' + ('D' << 8) + ('M' << 16) + ('D' << 24) // Common certificate sets (optional) CCS QuicTag = 'C' + ('C' << 8) + ('S' << 16) + (0 << 24) // Cached certificate (optional) CCRT QuicTag = 'C' + ('C' << 8) + ('R' << 16) + ('T' << 24) // Optional Parameters // Socket receive buffer size in bytes SRBF QuicTag = 'S' + ('R' << 8) + ('B' << 16) + ('F' << 24) // Connection ID truncation TCID QuicTag = 'T' + ('C' << 8) + ('I' << 16) + ('D' << 24) // Connection Options are a repeated tag field COPT QuicTag = 'C' + ('O' << 8) + ('P' << 16) + ('T' << 24) // in REJ // Server config (optional) SCFG QuicTag = 'S' + ('C' << 8) + ('F' << 16) + ('G' << 24) // Server nonce (optional) SNO QuicTag = 'S' + ('N' << 8) + ('O' << 16) + (0 << 24) // Proof of authenticity (optional) PROF QuicTag = 'P' + ('R' << 8) + ('O' << 16) + ('F' << 24) // in SCFG // Server config ID SCID QuicTag = 'S' + ('C' << 8) + ('I' << 16) + ('D' << 24) // Key exchange algorithms KEXS QuicTag = 'K' + ('E' << 8) + ('X' << 16) + ('S' << 24) // Authenticated encryption algorithms AEAD QuicTag = 'A' + ('E' << 8) + ('A' << 16) + ('D' << 24) // A list of public values PUBS QuicTag = 'P' + ('U' << 8) + ('B' << 16) + ('S' << 24) // Orbit ORBT QuicTag = 'O' + ('R' << 8) + ('B' << 16) + ('T' << 24) // Expiry EXPY QuicTag = 'E' + ('X' << 8) + ('P' << 16) + ('Y' << 24) // in AEAD // AES-GCM with a 12-byte tag and IV AESG QuicTag = 'A' + ('E' << 8) + ('S' << 16) + ('G' << 24) // Salsa20 with Poly1305 S20P QuicTag = 'S' + ('2' << 8) + ('0' << 16) + ('P' << 24) // in KEXS // Curve25519 C255 QuicTag = 'C' + ('2' << 8) + ('5' << 16) + ('5' << 24) // P-256 P256 QuicTag = 'P' + ('2' << 8) + ('5' << 16) + ('6' << 24) // in full CHLO // SCID, AEAD, KEXS, SNO, PUBS // Client nonce NONC QuicTag = 'N' + ('O' << 8) + ('N' << 16) + ('C' << 24) // Client encrypted tag-values (optional) CETV QuicTag = 'C' + ('E' << 8) + ('T' << 16) + ('V' << 24) // in CETV // ChannelID key (optional) CIDK QuicTag = 'C' + ('I' << 8) + ('D' << 16) + ('K' << 24) // ChnnelID signature (optional) CIDS QuicTag = 'C' + ('I' << 8) + ('D' << 16) + ('S' << 24) // in Public Reset Packet PRST QuicTag = 'P' + ('R' << 8) + ('S' << 16) + ('T' << 24) // public reset nonce proof RNON QuicTag = 'R' + ('N' << 8) + ('O' << 16) + ('N' << 24) // rejected sequence number RSEQ QuicTag = 'R' + ('S' << 8) + ('E' << 16) + ('Q' << 24) // client address CADR QuicTag = 'C' + ('A' << 8) + ('D' << 16) + ('R' << 24) )
type RstStreamFrame ¶
type RstStreamFrame struct { *FramePacket Type FrameType StreamID uint32 Offset uint64 ErrorCode QUIC_OFFICIAL_ERROR }
func NewRstStreamFrame ¶
func NewRstStreamFrame(streamID uint32, offset uint64, errorCode QUIC_OFFICIAL_ERROR) *RstStreamFrame
func (*RstStreamFrame) GetStreamID ¶
func (frame *RstStreamFrame) GetStreamID() uint32
func (*RstStreamFrame) GetType ¶
func (frame *RstStreamFrame) GetType() FrameType
func (*RstStreamFrame) GetWire ¶
func (frame *RstStreamFrame) GetWire() (wire []byte, err error)
func (*RstStreamFrame) String ¶
func (frame *RstStreamFrame) String() (str string)
type Server ¶
func (*Server) FramePacket ¶
func (*Server) ListenAndServe ¶
func (*Server) PublicResetPacket ¶
func (self *Server) PublicResetPacket()
func (*Server) VersionNegotiationPacket ¶
func (self *Server) VersionNegotiationPacket()
type StopWaitingFrame ¶
type StopWaitingFrame struct { *FramePacket Type FrameType LeastUnackedDelta uint64 }
func NewStopWaitingFrame ¶
func NewStopWaitingFrame(leastUnackedDelta uint64) *StopWaitingFrame
func (*StopWaitingFrame) GetType ¶
func (frame *StopWaitingFrame) GetType() FrameType
func (*StopWaitingFrame) GetWire ¶
func (frame *StopWaitingFrame) GetWire() (wire []byte, err error)
func (*StopWaitingFrame) String ¶
func (frame *StopWaitingFrame) String() (str string)
type Stream ¶
type Stream struct { *Conn ID uint32 State State PeerState State Window *Window FlowControllBlocked bool }
func (*Stream) ApplyBlockedFrame ¶
func (self *Stream) ApplyBlockedFrame(f *BlockedFrame) (bool, error)
func (*Stream) ApplyRstStreamFrame ¶
func (self *Stream) ApplyRstStreamFrame(f *RstStreamFrame) (bool, error)
func (*Stream) ApplyStreamFrame ¶
func (self *Stream) ApplyStreamFrame(f *StreamFrame) (bool, error)
func (*Stream) ApplyWindowUpdateFrame ¶
func (self *Stream) ApplyWindowUpdateFrame(f *WindowUpdateFrame) (bool, error)
type StreamFrame ¶
type StreamFrame struct { *FramePacket Type FrameType Settings byte Fin bool StreamID uint32 Offset uint64 Data []byte }
func NewStreamFrame ¶
func NewStreamFrame(fin bool, streamID uint32, offset uint64, data []byte) *StreamFrame
func (*StreamFrame) GetStreamID ¶
func (frame *StreamFrame) GetStreamID() uint32
func (*StreamFrame) GetType ¶
func (frame *StreamFrame) GetType() FrameType
func (*StreamFrame) GetWire ¶
func (frame *StreamFrame) GetWire() (wire []byte, err error)
func (*StreamFrame) String ¶
func (frame *StreamFrame) String() (str string)
type StreamLevelFrame ¶
type VersionNegotiationPacket ¶
type VersionNegotiationPacket struct {
*PacketHeader
}
func NewVersionNegotiationPacket ¶
func NewVersionNegotiationPacket(connectionID uint64, versions []uint32) *VersionNegotiationPacket
func (*VersionNegotiationPacket) GetConnectionID ¶
func (packet *VersionNegotiationPacket) GetConnectionID() uint64
func (*VersionNegotiationPacket) GetHeader ¶
func (packet *VersionNegotiationPacket) GetHeader() *PacketHeader
func (*VersionNegotiationPacket) GetWire ¶
func (packet *VersionNegotiationPacket) GetWire() (wire []byte, err error)
func (*VersionNegotiationPacket) String ¶
func (packet *VersionNegotiationPacket) String() string
type WindowUpdateFrame ¶
type WindowUpdateFrame struct { *FramePacket Type FrameType StreamID uint32 Offset uint64 }
func NewWindowUpdateFrame ¶
func NewWindowUpdateFrame(streamID uint32, offset uint64) *WindowUpdateFrame
func (*WindowUpdateFrame) GetStreamID ¶
func (frame *WindowUpdateFrame) GetStreamID() uint32
func (*WindowUpdateFrame) GetType ¶
func (frame *WindowUpdateFrame) GetType() FrameType
func (*WindowUpdateFrame) GetWire ¶
func (frame *WindowUpdateFrame) GetWire() (wire []byte, err error)
func (*WindowUpdateFrame) String ¶
func (frame *WindowUpdateFrame) String() (str string)