handshake

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientLogin

type ClientLogin struct {
	Capabilities         int // int<2>
	ExtendedCapabilities int // int<2>
	MaxPacketSize        int // int<4>
	Charset              byte
	// 23 bytes zero
	UserName   string // string<nul>
	PasswdLen  byte
	Passwd     []byte // string<len> len=$PasswdLen
	Database   string
	AuthPlugin string
	Attr       map[string]string
}

ClientLogin client发送给mysql server的auth请求体

func DecodeClientLoginPacket

func DecodeClientLoginPacket(src *parse.Source) (*ClientLogin, error)

DecodeClientLoginPacket 解码client发送给mysql server的auth验证请求 doc: https://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::HandshakeResponse41

func (*ClientLogin) Map

func (c *ClientLogin) Map() model.Map

Map ...

func (*ClientLogin) String

func (c *ClientLogin) String() string

type ServerGreeting

type ServerGreeting struct {
	ProtocolVersion byte   // 1
	MySQLVersion    string // string<nul>
	ThreadID        int    // int<4>
	Salt_1          []byte // 8 bytes
	// filter 0x00
	Capabilities               int // int<2>
	ServerLanguage             byte
	StatusFlag                 int // 2 bytes
	ExtendedServerCapabilities int // 2 bytes
	AuthPluginLen              int // 1 byte
	// 10 bytes reserved
	Salt_2     []byte
	AuthPlugin string
}

ServerGreeting 服务器发给client的greeting包 field顺序就是protocol顺序

func DecodeServerGreeting

func DecodeServerGreeting(src *parse.Source) (*ServerGreeting, error)

DecodeServerGreeting 解码mysql发给client的greet包 doc: https://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::Handshake

func (*ServerGreeting) Map

func (sg *ServerGreeting) Map() model.Map

Map ...

func (*ServerGreeting) String

func (sg *ServerGreeting) String() string

Jump to

Keyboard shortcuts

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