decoder

package
v0.0.0-...-0bd7171 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Netflow10Decoder

type Netflow10Decoder struct {
	Netflow10DecoderConfig
	// contains filtered or unexported fields
}

Netflow10Decoder decode a serial number and IP address from Netflow data

func NewNetflow10Decoder

func NewNetflow10Decoder(config Netflow10DecoderConfig) *Netflow10Decoder

NewNetflow10Decoder creates a new instance of a NetflowDecoder

func (*Netflow10Decoder) Decode

func (nd *Netflow10Decoder) Decode(ip uint32, data []byte) (*Sensor, error)

Decode tries to decode a netflow packet. The decoder maintains a session for ever IP address so devices using different IP address can reuse templates. Once a NF10/IPFIX packet is decoded, Decode tries to find a serial number. If no serial number has been found the returned value is zero.

type Netflow10DecoderConfig

type Netflow10DecoderConfig struct {
	ProductTypeElementID  uint16
	SerialNumberElementID uint16
	OptionTemplateID      uint16
}

Netflow10DecoderConfig contains the Netflow10Decoder configuration

type NetflowDecoder

type NetflowDecoder interface {
	Decode(ip uint32, data []byte) (*Sensor, error)
}

NetflowDecoder is an interface for a decoder that obtains a IP and Serial Number from Netflow data

type Sensor

type Sensor struct {
	SerialNumber  string
	ObservationID uint32
	Address       net.IP
	ProductType   uint32
}

Sensor struct contains information about a sensor that has been detected

Jump to

Keyboard shortcuts

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