tcpdump

package
v0.0.0-...-3e59a5d Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSnapshotLen     = 1024
	DefaultPromiscuousMode = false
	DefaultBPFFilter       = "tcp or udp"
	DefaultTimeout         = 10 * time.Second
	AnyDevice              = "any"
)

Default settings for tcpdump

Variables

This section is empty.

Functions

func CaptureLogInfo

func CaptureLogInfo(s string, i ...interface{})

CaptureLogInfo default print function

Types

type PacketCaptureManager

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

PacketCaptureManager struct

func NewPacketCaptureManager

func NewPacketCaptureManager(snapshotLen int32, promiscuousMode bool, timeout time.Duration) *PacketCaptureManager

NewPacketCaptureManager creates a new packet manager

func (*PacketCaptureManager) SetDevice

func (pCM *PacketCaptureManager) SetDevice(deviceName string) error

SetDevice sets the device to be captured, e.g. eth0

func (*PacketCaptureManager) SetFilter

func (pCM *PacketCaptureManager) SetFilter(bpfFilter string) error

SetFilter sets the packet filter. Default is DefaultBPFFilter ("tcp or udp")

func (*PacketCaptureManager) StartCapturing

func (pCM *PacketCaptureManager) StartCapturing() error

StartCapturing starts the capturing process

Jump to

Keyboard shortcuts

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