tracker

package
v0.0.0-...-3923ab8 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FlowMetadata

type FlowMetadata struct {
	TotalBytes          uint64
	TotalPackets        uint64
	ReverseTotalBytes   uint64
	ReverseTotalPackets uint64
	FlowStartTime       uint64
	FlowLastSeen        uint64
	FlowProtocols       []protocols.Protocol
	ClientTCPState      protocols.TCPState
	ServerTCPState      protocols.TCPState
	SYN, ACK, FIN, RST  bool
}

FlowMetadata tracks metadata associated with a given flow

type FlowTable

type FlowTable struct {
	FlowStats        map[flow.FlowKey]*FlowTableEntry
	Lock             sync.Mutex
	ActiveFlowsGauge prometheus.Gauge
	OutputChannel    chan flow.Flow
	FlowTimeout      int
	Id               int
}

func NewFlowTable

func NewFlowTable(flowTimeout, id int, outputChannel chan flow.Flow, flowGauge prometheus.Gauge) *FlowTable

func (*FlowTable) ReleaseFlow

func (ft *FlowTable) ReleaseFlow(key flow.FlowKey, entry *FlowTableEntry)

ReleaseFlow assumes that the FlowTable lock is already aquired

func (*FlowTable) SweepTable

func (ft *FlowTable) SweepTable()

func (*FlowTable) TrackFlow

func (ft *FlowTable) TrackFlow(key flow.FlowKey, networkLayer gopacket.NetworkLayer, transportLayer gopacket.TransportLayer, ci gopacket.CaptureInfo)

func (*FlowTable) UpdateMetrics

func (ft *FlowTable) UpdateMetrics()

type FlowTableEntry

type FlowTableEntry struct {
	Metadata FlowMetadata
	Flow     flow.Flow
}

type FlowTracker

type FlowTracker struct {
	FlowTables    []*FlowTable
	FlowTableLock sync.Mutex
	OutputChannel chan flow.Flow
	NumTables     int
}

func NewFlowTracker

func NewFlowTracker(outputChannel chan flow.Flow, numTables, flowTimeout int) *FlowTracker

func (*FlowTracker) Start

func (ft *FlowTracker) Start()

func (*FlowTracker) SweepTables

func (ft *FlowTracker) SweepTables()

func (*FlowTracker) TrackFlow

func (ft *FlowTracker) TrackFlow(key flow.FlowKey, networkLayer gopacket.NetworkLayer, transportLayer gopacket.TransportLayer, ci gopacket.CaptureInfo)

func (*FlowTracker) UpdateMetrics

func (ft *FlowTracker) UpdateMetrics()

type FlowTrackerConfiguration

type FlowTrackerConfiguration struct {
	MaxFlowLength uint64
	FlowTimeout   uint64
}

Jump to

Keyboard shortcuts

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