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") 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 ¶
AnalyzerFactory interface is used for create Analyzer services.
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.
Click to show internal directories.
Click to hide internal directories.