sniffer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2015 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListDeviceNames

func ListDeviceNames(withDescription 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.

Types

type AfpacketHandle

type AfpacketHandle struct {
	TPacket *afpacket.TPacket
}

func NewAfpacketHandle

func NewAfpacketHandle(device string, snaplen int, block_size int, num_blocks int,
	timeout time.Duration) (*AfpacketHandle, error)

func (*AfpacketHandle) Close

func (h *AfpacketHandle) Close()

func (*AfpacketHandle) ReadPacketData

func (h *AfpacketHandle) ReadPacketData() (data []byte, ci gopacket.CaptureInfo, err error)

func (*AfpacketHandle) SetBPFFilter

func (h *AfpacketHandle) SetBPFFilter(expr string) (_ error)

type PfringHandle

type PfringHandle struct {
}

func NewPfringHandle

func NewPfringHandle(device string, snaplen int, promisc bool) (*PfringHandle, error)

func (*PfringHandle) Close

func (h *PfringHandle) Close()

func (*PfringHandle) Enable

func (h *PfringHandle) Enable() (_ error)

func (*PfringHandle) ReadPacketData

func (h *PfringHandle) ReadPacketData() (data []byte, ci gopacket.CaptureInfo, err error)

func (*PfringHandle) SetBPFFilter

func (h *PfringHandle) SetBPFFilter(expr string) (_ error)

type SnifferSetup

type SnifferSetup struct {
	Decoder    *decoder.DecoderStruct
	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(
	test_mode bool,
	tcp tcp.Processor,
	udp udp.Processor,
) 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

Jump to

Keyboard shortcuts

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