sniffer

package
v5.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2016 License: Apache-2.0 Imports: 13 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)

ListDevicesNames 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 adatper is added.

Types

type SnifferSetup

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

func (*SnifferSetup) Close

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

func (*SnifferSetup) Init

func (sniffer *SnifferSetup) Init(testMode bool, filter string, factory WorkerFactory, interfaces *config.InterfacesConfig) error

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) Stop

func (sniffer *SnifferSetup) Stop() error

type Worker

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

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