protocol

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProtocolMethod = map[string]func(Protocol) protocol{
	"auth_aes128_sha1": NewAuthAES128SHA1,
	"auth_aes128_md5":  NewAuthAES128MD5,
	"auth_chain_a":     NewAuthChainA,
	"auth_chain_b":     NewAuthChainB,
	"origin":           NewOrigin,
	"auth_sha1_v4":     NewAuthSHA1v4,
	"verify_sha1":      NewVerifySHA1,
	"ota":              NewVerifySHA1,
}

Functions

func CalcAdler32

func CalcAdler32(input []byte) uint32

func CheckAdler32

func CheckAdler32(input []byte, l int) bool

func NewAuthAES128MD5

func NewAuthAES128MD5(info Protocol) protocol

func NewAuthAES128SHA1

func NewAuthAES128SHA1(info Protocol) protocol

func NewAuthChainA

func NewAuthChainA(info Protocol) protocol

func NewAuthChainB

func NewAuthChainB(info Protocol) protocol

func NewAuthSHA1v4

func NewAuthSHA1v4(info Protocol) protocol

func NewErrorProtocol

func NewErrorProtocol(err error) protocol

func NewOrigin

func NewOrigin(Protocol) protocol

func NewVerifySHA1

func NewVerifySHA1(info Protocol) protocol

Types

type AuthData

type AuthData struct {
	// contains filtered or unexported fields
}

func NewAuth

func NewAuth() *AuthData

type Protocol

type Protocol struct {
	*cipher.Cipher

	HeadSize     int
	TcpMss       int
	ObfsOverhead int
	Name         string
	Param        string
	IV           []byte

	Auth *AuthData
}

func (Protocol) Packet

func (s Protocol) Packet(c net.PacketConn) (net.PacketConn, error)

func (*Protocol) SetHeadLen

func (s *Protocol) SetHeadLen(data []byte, defaultValue int)

func (Protocol) Stream

func (s Protocol) Stream(c net.Conn, iv []byte) (net.Conn, error)

Jump to

Keyboard shortcuts

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