pcap

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package pcap provides functions to interface with the gopacket/pcap library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartCapture

func StartCapture(opts Options) error

Types

type Flag added in v0.1.2

type Flag uint8
const (
	// capture all packets from all interfaces.
	CaptureAllFlag Flag = 1 << iota
	// put capturing interface in promiscuous mode
	PromiscuousFlag
	// put capturing interface in monitor mode
	MonitorFlag
	// automatically use the first non loopback interface found on the system to capture packets
	AutoIfaceFlag
	// display packets in hex form
	HexDumpFlag
	// display packets in summary form
	SummaryFlag
)

type FlagSet added in v0.1.2

type FlagSet uint16

func (FlagSet) IsSet added in v0.1.2

func (f FlagSet) IsSet(flag Flag) bool

func (FlagSet) Set added in v0.1.2

func (f FlagSet) Set(flag Flag) FlagSet

type Interface added in v0.1.2

type Interface struct {
	PcapName string
	net.Interface
}

type Options added in v0.1.2

type Options struct {
	Flags      FlagSet
	Filter     string
	IfaceName  string
	InputFile  string
	OutputFile string
}

Jump to

Keyboard shortcuts

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