sniffer

package
v1.66.2 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListDeviceNames

func ListDeviceNames(withDescription bool, withIP bool) ([]string, error)

ListDeviceNames returns the list of adapters available for sniffing on this computer. If the withDescription parameter is set to true, a human readable version of the adapter name is added. If the withIP parameter is set to true, IP address of the adapter is added.

Types

type MainWorker

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

func (*MainWorker) OnHEPPacket

func (mw *MainWorker) OnHEPPacket(data []byte)

func (*MainWorker) OnPacket

func (mw *MainWorker) OnPacket(data []byte, ci *gopacket.CaptureInfo)

func (*MainWorker) SendPingHEPPacket added in v1.65.3

func (mw *MainWorker) SendPingHEPPacket()

type SnifferSetup

type SnifferSetup struct {
	DataSource gopacket.PacketDataSource
	// contains filtered or unexported fields
}

func New

func New(cfgMain *config.Config) (*SnifferSetup, error)

func (*SnifferSetup) Close

func (sniffer *SnifferSetup) Close() error
func (sniffer *SnifferSetup) Datalink() layers.LinkType

func (*SnifferSetup) IsAlive

func (sniffer *SnifferSetup) IsAlive() bool

func (*SnifferSetup) Reopen

func (sniffer *SnifferSetup) Reopen() error

func (*SnifferSetup) Run

func (sniffer *SnifferSetup) Run() error

func (*SnifferSetup) SendPing added in v1.65.3

func (sniffer *SnifferSetup) SendPing() error

func (*SnifferSetup) Stop

func (sniffer *SnifferSetup) Stop() error

type Worker

type Worker interface {
	OnPacket(data []byte, ci *gopacket.CaptureInfo)
	OnHEPPacket(data []byte)
	SendPingHEPPacket()
}

func NewWorker

func NewWorker(lt layers.LinkType) (Worker, error)

type WorkerFactory

type WorkerFactory func(layers.LinkType) (Worker, error)

Jump to

Keyboard shortcuts

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