sniffing

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QuicFlag_PacketNumberLength = iota
	QuicFlag_PacketNumberLength1
	QuicFlag_Reserved
	QuicFlag_Reserved1
	QuicFlag_LongPacketType
	QuicFlag_LongPacketType1
	QuicFlag_FixedBit
	QuicFlag_HeaderForm
)
View Source
const (
	QuicFlag_HeaderForm_LongHeader  = 1
	QuicFlag_LongPacketType_Initial = 0
)
View Source
const (
	ContentType_HandShake                byte   = 22
	HandShakeType_Hello                  byte   = 1
	TlsExtension_ServerName              uint16 = 0
	TlsExtension_ServerNameType_HostName byte   = 0
)

Variables

View Source
var (
	Error              = fmt.Errorf("sniffing error")
	NotApplicableError = fmt.Errorf("%w: not applicable", Error)
	NotFoundError      = fmt.Errorf("%w: not found", Error)
)
View Source
var (
	Version_Tls1_0 = []byte{0x03, 0x01}
	Version_Tls1_2 = []byte{0x03, 0x03}
)

Functions

func IsSniffingError

func IsSniffingError(err error) bool

Types

type ConnSniffer

type ConnSniffer struct {
	net.Conn
	*Sniffer
}

func NewConnSniffer

func NewConnSniffer(conn net.Conn, snifferBufSize int, dataWaitingTimeout time.Duration) *ConnSniffer

func (*ConnSniffer) Close

func (s *ConnSniffer) Close() (err error)

func (*ConnSniffer) Read

func (s *ConnSniffer) Read(p []byte) (n int, err error)

type QuicReassemblePolicy

type QuicReassemblePolicy int
const (
	QuicReassemblePolicy_ReassembleCryptoToBytesFromPool QuicReassemblePolicy = iota
	QuicReassemblePolicy_LinearLocator
	QuicReassemblePolicy_Slow
)

type Sniffer

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

func NewPacketSniffer

func NewPacketSniffer(data []byte) *Sniffer

func NewStreamSniffer

func NewStreamSniffer(r io.Reader, bufSize int, dataWaitingTimeout time.Duration) *Sniffer

func (*Sniffer) Close

func (s *Sniffer) Close() (err error)

func (*Sniffer) Read

func (s *Sniffer) Read(p []byte) (n int, err error)

func (*Sniffer) SniffHttp

func (s *Sniffer) SniffHttp() (d string, err error)

func (*Sniffer) SniffQuic

func (s *Sniffer) SniffQuic() (d string, err error)

func (*Sniffer) SniffTcp

func (s *Sniffer) SniffTcp() (d string, err error)

func (*Sniffer) SniffTls

func (s *Sniffer) SniffTls() (d string, err error)

SniffTls only supports tls1.2, tls1.3

func (*Sniffer) SniffUdp added in v0.1.7

func (s *Sniffer) SniffUdp() (d string, err error)

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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