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 (*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()
Click to show internal directories.
Click to hide internal directories.