sniff

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedConn

type CachedConn struct {
	net.Conn
	// contains filtered or unexported fields
}

Cache, ReadMultiBuffer should be called sequentially.

type CachedDdlPacketConn

type CachedDdlPacketConn struct {
	udp.DdlPacketReaderWriter
	// contains filtered or unexported fields
}

type CachedPacketConn

type CachedPacketConn struct {
	udp.PacketReaderWriter
	// contains filtered or unexported fields
}

func (*CachedPacketConn) ReadPacket

func (r *CachedPacketConn) ReadPacket() (*udp.Packet, error)

type CachedRW

type CachedRW struct {
	buf.DdlReaderWriter
	// contains filtered or unexported fields
}

type CachedReadRw

type CachedReadRw struct {
	buf.ReaderWriter
	// contains filtered or unexported fields
}

Cache, ReadMultiBuffer should be called sequentially.

func (*CachedReadRw) OkayToUnwrapReader

func (r *CachedReadRw) OkayToUnwrapReader() int

func (*CachedReadRw) OkayToUnwrapWriter

func (r *CachedReadRw) OkayToUnwrapWriter() int

func (*CachedReadRw) ReadMultiBuffer

func (r *CachedReadRw) ReadMultiBuffer() (buf.MultiBuffer, error)

func (*CachedReadRw) UnwrapReader

func (r *CachedReadRw) UnwrapReader() any

func (*CachedReadRw) UnwrapWriter

func (r *CachedReadRw) UnwrapWriter() any

type SniffResult

type SniffResult interface {
	Protocol() string
	Domain() string
}

type Sniffer

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

func NewSniffer

func NewSniffer() *Sniffer

NewSniffer returns the singleton sniffer (zero allocation, thread-safe)

func (*Sniffer) Sniff

func (sniffer *Sniffer) Sniff(ctx context.Context, info *session.Info, rw interface{}) (interface{}, error)

Sniff attempts to identify the protocol from the connection

func (*Sniffer) SniffConn

func (sniffer *Sniffer) SniffConn(ctx context.Context, conn net.Conn) (net.Conn, SniffResult, error)

SniffConn sniffs a TCP connection

Jump to

Keyboard shortcuts

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