decoding

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const INT24Width = 3

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandCode

type CommandCode byte

func (CommandCode) String

func (c CommandCode) String() string

type ConnectionBuilder

type ConnectionBuilder interface {
	AddToConnection(
		request bool, seen []time.Time, typeName string, item interface{},
	)
	Compressed() bool
	JustSeenGreeting() bool
	PreviousRequestType() string
	ParamsForQuery(query uint32) uint16
}

type Emitter

type Emitter interface {
	Transmission(typeName string, t interface{})
	ConnectionBuilder() ConnectionBuilder
}

type MySQLConnectionBuilder

type MySQLConnectionBuilder struct {
	Address   tcp.ConnectionAddress
	Readers   *MySQLConnectionReaders
	Requests  []structure.Transmission
	Responses []structure.Transmission
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(
	address tcp.ConnectionAddress,
	readers *MySQLConnectionReaders,
	noSort bool,
	completed chan interface{},
) *MySQLConnectionBuilder

func (*MySQLConnectionBuilder) AddToConnection

func (b *MySQLConnectionBuilder) AddToConnection(
	request bool, seen []time.Time, typeName string, item interface{},
)

func (*MySQLConnectionBuilder) Compressed

func (b *MySQLConnectionBuilder) Compressed() bool

func (*MySQLConnectionBuilder) DecodeConnection

func (b *MySQLConnectionBuilder) DecodeConnection()

func (*MySQLConnectionBuilder) JustSeenGreeting

func (b *MySQLConnectionBuilder) JustSeenGreeting() bool

func (*MySQLConnectionBuilder) ParamsForQuery

func (b *MySQLConnectionBuilder) ParamsForQuery(query uint32) uint16

func (*MySQLConnectionBuilder) PreviousRequestType

func (b *MySQLConnectionBuilder) PreviousRequestType() string

func (*MySQLConnectionBuilder) ReadDone

func (b *MySQLConnectionBuilder) ReadDone()

func (*MySQLConnectionBuilder) RequestPacketBuffer

func (b *MySQLConnectionBuilder) RequestPacketBuffer(t packet.TimesSeen) *packet.Buffer

func (*MySQLConnectionBuilder) ResponsePacketBuffer

func (b *MySQLConnectionBuilder) ResponsePacketBuffer(t packet.TimesSeen) *packet.Buffer

type MySQLConnectionReaders

type MySQLConnectionReaders struct {
	IntermediateData *bool
	RawData          *bool
	// contains filtered or unexported fields
}

func New

func New(
	intermediateData *bool,
	rawData *bool,
	verbose *bool,
	noSort *bool,
) *MySQLConnectionReaders

func (*MySQLConnectionReaders) ConnectionBuilder

func (h *MySQLConnectionReaders) ConnectionBuilder(
	address tcp.ConnectionAddress,
	completed chan interface{},
) *MySQLConnectionBuilder

func (*MySQLConnectionReaders) ReadStream

func (h *MySQLConnectionReaders) ReadStream(
	r tcp.Stream, a, b gopacket.Flow,
	completed chan interface{},
)

ReadStream tries to read tcp connections and extract MySQL connections.

type RawDataEmitter

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

func SetupRawDataEmitter

func SetupRawDataEmitter(e Emitter, wrt io.Writer) (io.Writer, *RawDataEmitter)

func (*RawDataEmitter) ConnectionBuilder

func (e *RawDataEmitter) ConnectionBuilder() ConnectionBuilder

func (*RawDataEmitter) Transmission

func (e *RawDataEmitter) Transmission(typeName string, t interface{})

type RequestDecoder

type RequestDecoder struct {
	Emit Emitter
}

func (*RequestDecoder) String

func (m *RequestDecoder) String() string

func (*RequestDecoder) Write

func (m *RequestDecoder) Write(p []byte) (int, error)

type ResponseDecoder

type ResponseDecoder struct {
	Emit Emitter

	Fields  []structure.ColumnInfo
	State   readState
	Results [][]interface{}
	// contains filtered or unexported fields
}

ResponseDecoder - dealing with the response.

func (*ResponseDecoder) DecodeBinaryResult

func (m *ResponseDecoder) DecodeBinaryResult(b *bytes.Buffer) error

func (*ResponseDecoder) FlushResponse

func (m *ResponseDecoder) FlushResponse()

func (*ResponseDecoder) ResetState

func (m *ResponseDecoder) ResetState()

func (*ResponseDecoder) String

func (m *ResponseDecoder) String() string

func (*ResponseDecoder) Write

func (m *ResponseDecoder) Write(p []byte) (int, error)

type TransmissionEmitter

type TransmissionEmitter struct {
	Request bool
	Times   packet.TimesSeen
	Builder *MySQLConnectionBuilder
}

func (*TransmissionEmitter) ConnectionBuilder

func (e *TransmissionEmitter) ConnectionBuilder() ConnectionBuilder

func (*TransmissionEmitter) Transmission

func (e *TransmissionEmitter) Transmission(typeName string, t interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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