proto

package
v0.0.0-...-632c06c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandByte_Send = iota + 1
	CommandByte_SendV6
	CommandByte_Associate
	CommandByte_AssociateV6
	CommandByte_AssociateDone
	CommandByte_AssociateDoneV6
	CommandByte_ChannelDestroy
	CommandByte_Ping
	CommandByte_Pong
)
View Source
const (
	CommandByte_Stream_ConnectV4IP = iota + 1
	CommandByte_Stream_ConnectV6IP
	CommandByte_Stream_ConnectDomain
)
View Source
const HttpHeaderFlag_AlternativeChannelConnection = 1 << 2
View Source
const HttpHeaderFlag_BoostConnection = 1 << 0
View Source
const HttpHeaderFlag_WebsocketConnection = 1 << 1

Variables

This section is empty.

Functions

func IPv4AddrToByte

func IPv4AddrToByte(in net.IP) [4]byte

func IPv4ByteToAddr

func IPv4ByteToAddr(in [4]byte) net.IP

func IPv6AddrToByte

func IPv6AddrToByte(in net.IP) [16]byte

func IPv6ByteToAddr

func IPv6ByteToAddr(in [16]byte) net.IP

Types

type AssociateChannelDestroy

type AssociateChannelDestroy struct {
	//CommandByte uint8   `struc:"uint8"`
	Channel uint16 `struc:"uint16"`
}

type AssociateDoneHeader

type AssociateDoneHeader AssociateHeader

type AssociateDoneV6Header

type AssociateDoneV6Header AssociateV6Header

type AssociateHeader

type AssociateHeader struct {
	//CommandByte uint8   `struc:"uint8"`
	SourceIP   [4]byte `struc:"[4]byte"`
	DestIP     [4]byte `struc:"[4]byte"`
	SourcePort uint16  `struc:"uint16"`
	DestPort   uint16  `struc:"uint16"`
	Channel    uint16  `struc:"uint16"`
}

type AssociateV6Header

type AssociateV6Header struct {
	//CommandByte uint8    `struc:"uint8"`
	SourceIP   [16]byte `struc:"[16]byte"`
	DestIP     [16]byte `struc:"[16]byte"`
	SourcePort uint16   `struc:"uint16"`
	DestPort   uint16   `struc:"uint16"`
	Channel    uint16   `struc:"uint16"`
}

type CommandHeader

type CommandHeader struct {
	CommandByte uint8 `struc:"uint8"`
}

type DataHeader

type DataHeader struct {
	Channel uint16 `struc:"uint16"`
}

type HTTPLenHeader

type HTTPLenHeader struct {
	Length int64 `struc:"int64"`
}

WARNING: we assume this header is 8 byte! Since it is used to fill network buffer!

type HttpHeaderHolder

type HttpHeaderHolder struct {
	Masker   int64    `struc:"int64"`
	ConnID   [24]byte `struc:"[24]byte"`
	Rand     [24]byte `struc:"[24]byte"`
	Time     int64    `struc:"int64"`
	Flags    int64    `struc:"int64"`
	ConnIter int32    `struc:"int32"`
}

type PingHeader

type PingHeader struct {
	Seq        uint64 `struc:"uint64"`
	Seq2       uint64 `struc:"uint64"`
	SentPacket uint64 `struc:"uint64"`
	RecvPacket uint64 `struc:"uint64"`
}

type PongHeader

type PongHeader struct {
	SeqCopy    uint64 `struc:"uint64"`
	Seq2Copy   uint64 `struc:"uint64"`
	SentPacket uint64 `struc:"uint64"`
	RecvPacket uint64 `struc:"uint64"`
}

type SendHeader

type SendHeader struct {
	//CommandByte uint8   `struc:"uint8"`
	SourceIP   [4]byte `struc:"[4]byte"`
	DestIP     [4]byte `struc:"[4]byte"`
	SourcePort uint16  `struc:"uint16"`
	DestPort   uint16  `struc:"uint16"`
	PayloadLen uint16  `struc:"uint16,sizeof=Payload"`
	Payload    []byte  `struc:"[]byte"`
}

type SendV6Header

type SendV6Header struct {
	//CommandByte uint8    `struc:"uint8"`
	SourceIP   [16]byte `struc:"[16]byte"`
	DestIP     [16]byte `struc:"[16]byte"`
	SourcePort uint16   `struc:"uint16"`
	DestPort   uint16   `struc:"uint16"`
	PayloadLen uint16   `struc:"uint16,sizeof=Payload"`
	Payload    []byte   `struc:"[]byte"`
}

type StreamConnectDomainHeader

type StreamConnectDomainHeader struct {
	//CommandByte uint8    `struc:"uint8"`
	DestDomain_len uint16 `struc:"uint16,sizeof=DestDomain"`
	DestDomain     string `struc:"[]byte"`
	DestPort       uint16 `struc:"uint16"`
}

type StreamConnectDomainHeaderLen

type StreamConnectDomainHeaderLen struct {
	Length uint16 `struc:"uint16"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL