sniffer

package
v0.0.0-...-b3f7bda Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListDeviceNames

func ListDeviceNames(withDescription, 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 adapter is added.

Types

type Option

type Option func(sniffer *Sniffer)

func WithBpfFilter

func WithBpfFilter(filter string) Option

func WithBufferSize

func WithBufferSize(size int) Option

func WithDevice

func WithDevice(name string) Option

func WithDumpFiile

func WithDumpFiile(path string) Option

func WithFile

func WithFile(name string) Option

func WithPromisc

func WithPromisc(promisc bool) Option

func WithSnaplen

func WithSnaplen(len int) Option

func WithTimeout

func WithTimeout(seconds int) Option

设置超时

type Sniffer

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

func New

func New(opts ...Option) (*Sniffer, error)

func (*Sniffer) Run

func (s *Sniffer) Run() error

Jump to

Keyboard shortcuts

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