pcapinput

package
v0.0.0-...-005ee03 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2020 License: ISC Imports: 5 Imported by: 0

Documentation

Overview

Package pcapinput enables PCAP live capture or file reading.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoInputConfig = errors.New("either device or filename must be specified")
)

Error conditions.

Functions

func Open

func Open(ctx context.Context, cfg Config) (source gopacket.PacketDataSource, e error)

Open opens PCAP handle.

Types

type Config

type Config struct {
	Device   string `json:"device,omitempty"`
	SnapLen  int    `json:"snaplen,omitempty"`
	Filename string `json:"filename,omitempty"`
}

Config contains PCAP input options.

type Device

type Device struct {
	Name      string   `json:"name"`
	Addresses []net.IP `json:"addresses"`
}

Device contains information about a network interface.

func ListDevices

func ListDevices() (list []Device)

ListDevices returns information about available network interfaces.

Jump to

Keyboard shortcuts

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