Documentation ¶
Overview ¶
Package capture contains the options to configure to packet capturing
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Callback ¶
type Callback g.CaptureCallbackFunc
Callback provides a custom callback function which is called for each captured packet
type CaptureLength ¶
type CaptureLength int
func (CaptureLength) Apply ¶
func (sl CaptureLength) Apply(c *g.Capture)
type Channel ¶
type Channel chan g.CapturePacket
Channel sends all captured packets to the provided channel.
func ToChannel ¶
func ToChannel(ch chan g.CapturePacket) Channel
type Filename ¶
type Filename string
Filename writes all captured packets to a PCAPng file
func ToFilename ¶
type FilterExpression ¶
type FilterExpression string
FilterExpression is a libpcap filter expression See: https://www.tcpdump.org/manpages/pcap-filter.7.html
func (FilterExpression) Apply ¶
func (bpf FilterExpression) Apply(c *g.Capture)
type FilterInstructions ¶
type FilterInstructions []bpf.Instruction
FilterInstructions allows filtering the captured packets by providing a compiled BPF filter program.
func (FilterInstructions) Apply ¶
func (fi FilterInstructions) Apply(c *g.Capture)
type FilterInterfaces ¶
type FilterInterfaces g.CaptureFilterInterfaceFunc
FilterInterface is a filter callback to limit the interfaces which will be recorded
func (FilterInterfaces) Apply ¶
func (f FilterInterfaces) Apply(c *g.Capture)
type FilterPackets ¶
type FilterPackets g.CaptureFilterPacketFunc
FilterPackets is a callback to filter packets within the Go application rather via BPF in the kernel
func (FilterPackets) Apply ¶
func (f FilterPackets) Apply(c *g.Capture)
type Promiscuous ¶
type Promiscuous bool
func (Promiscuous) Apply ¶
func (p Promiscuous) Apply(c *g.Capture)