types

package
v0.83.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: BSD-3-Clause Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ProtocolUnknown = Protocol(0)
	ICMP            = Protocol(1)
	TCP             = Protocol(6)
	UDP             = Protocol(17)
	ICMPv6          = Protocol(58)
	SCTP            = Protocol(132)
)
View Source
const (
	TypeUnknown = Type(iota)
	TypeStart
	TypeEnd
	TypeDrop
)
View Source
const (
	DirectionUnknown = Direction(iota)
	Ingress
	Egress
)
View Source
const ZoneID = 0x1BD0

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregatingStore added in v0.75.0

type AggregatingStore interface {
	FlowEventAggregator
	Store
}

type ConnTracker

type ConnTracker interface {
	// Start begins tracking connections by listening for conntrack events.
	Start(bool) error
	// Stop stops the connection tracking.
	Stop()
	// Close stops listening for events and cleans up resources
	Close() error
}

ConnTracker defines the interface for connection tracking functionality

type Direction

type Direction int

func (Direction) String

func (d Direction) String() string

type Event

type Event struct {
	ID          uuid.UUID
	Timestamp   time.Time
	WindowStart time.Time
	WindowEnd   time.Time
	EventFields
}

func (*Event) Clone added in v0.75.0

func (e *Event) Clone() *Event

type EventFields

type EventFields struct {
	FlowID           uuid.UUID
	Type             Type
	RuleID           []byte
	Direction        Direction
	Protocol         Protocol
	SourceIP         netip.Addr
	DestIP           netip.Addr
	SourceResourceID []byte
	DestResourceID   []byte
	SourcePort       uint16
	DestPort         uint16
	ICMPType         uint8
	ICMPCode         uint8
	RxPackets        uint64
	TxPackets        uint64
	RxBytes          uint64
	TxBytes          uint64
	NumOfStarts      uint64
	NumOfEnds        uint64
	NumOfDrops       uint64
}

type FlowConfig

type FlowConfig struct {
	URL                string
	Interval           time.Duration
	Enabled            bool
	Counters           bool
	TokenPayload       string
	TokenSignature     string
	DNSCollection      bool
	ExitNodeCollection bool
}

type FlowEventAggregator added in v0.75.0

type FlowEventAggregator interface {
	ResetAggregationWindow() FlowEventAggregator
	GetAggregatedEvents() []*Event
}

type FlowLogger

type FlowLogger interface {
	ResetAggregationWindow() FlowEventAggregator
	// StoreEvent stores a flow event
	StoreEvent(flowEvent EventFields)
	// Close closes the logger
	Close()
	// Enable enables the flow logger receiver
	Enable()
	// UpdateConfig updates the flow manager configuration
	UpdateConfig(dnsCollection, exitNodeCollection bool)
}

type FlowManager

type FlowManager interface {
	// FlowConfig handles network map updates
	Update(update *FlowConfig) error
	// Close closes the manager
	Close()
	// GetLogger returns a flow logger
	GetLogger() FlowLogger
}

type IFaceMapper

type IFaceMapper interface {
	IsUserspaceBind() bool
	Name() string
	Address() wgaddr.Address
}

IFaceMapper provides interface to check if we're using userspace WireGuard

type Protocol

type Protocol uint8

func (Protocol) String

func (p Protocol) String() string

type Store

type Store interface {
	// StoreEvent stores a flow event
	StoreEvent(event *Event)
	// GetEvents returns all stored events
	GetEvents() []*Event
	// DeleteEvents deletes events from the store
	DeleteEvents([]uuid.UUID)
	// Close closes the store
	Close()
}

type Type

type Type int

Jump to

Keyboard shortcuts

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