netutil

package
v0.0.0-...-dd22d64 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package netutil defines an API to analyze network packets.

This package is a work in progress and makes no API stability promises.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadRequest   = errors.New("netutil: bad request")
	ErrNotSupported = errors.New("netutil: not supported")
	ErrUnavailable  = errors.New("netutil: not available")
	ErrInternal     = errors.New("netutil: internal error")
	// specific interface Analyze
	ErrAnalyzerExists   = errors.New("netutil: analyzer with name exists")
	ErrTimeOutOfSync    = errors.New("netutil: time out of sync")
	ErrPacketOutOfOrder = errors.New("netutil: packet time out of order")
)

Some standard errors returned by interfaces.

Functions

This section is empty.

Types

type Analyzer

type Analyzer interface {
	SendPacket(layer Layer, md PacketMetadata, data []byte) error
	Close() error
}

Analyzer interface defines analyzer methods.

type AnalyzerFactory

type AnalyzerFactory interface {
	NewAnalyzer(name string) (Analyzer, error)
}

AnalyzerFactory interface is used for create Analyzer services.

type Layer

type Layer int

Layer of packets.

const (
	Ethernet Layer = iota
	IPv4
	IPv6
)

Layer types.

func (Layer) String

func (l Layer) String() string

type PacketMetadata

type PacketMetadata struct {
	// Timestamp is the time the packet was captured, if that is known.
	Timestamp time.Time
	// CaptureLength is the total number of bytes read off of the wire.
	CaptureLength int
	// Length is the size of the original packet.  Should always be >= CaptureLength.
	Length int
	// InterfaceIndex
	InterfaceIndex int
}

PacketMetadata is a copy of gopacket.PacketMetadata.

Directories

Path Synopsis
grpc
analyze
Package analyze implements a netutil.Analyzer client and a ready to use service component.
Package analyze implements a netutil.Analyzer client and a ready to use service component.
pb

Jump to

Keyboard shortcuts

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