capture

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

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

func (Callback) Apply

func (cb Callback) Apply(c *g.Capture)

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

func (Channel) Apply

func (d Channel) Apply(c *g.Capture)

type Comment

type Comment string

Comment can be used to add a custom comment to the PCAPng file

func (Comment) Apply

func (d Comment) Apply(c *g.Capture)

type File

type File struct {
	*os.File
}

File writes all captured packets to a file handle

func ToFile

func ToFile(f *os.File) File

func (File) Apply

func (f File) Apply(c *g.Capture)

type Filename

type Filename string

Filename writes all captured packets to a PCAPng file

func ToFilename

func ToFilename(fn string) Filename

func (Filename) Apply

func (fn Filename) Apply(c *g.Capture)

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)

Jump to

Keyboard shortcuts

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