types

package
v0.59.2 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2025 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolUnknown = Protocol(0)
	ICMP            = Protocol(1)
	TCP             = Protocol(6)
	UDP             = Protocol(17)
	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 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
	EventFields
}

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
}

type FlowConfig

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

type FlowLogger

type FlowLogger interface {
	// StoreEvent stores a flow event
	StoreEvent(flowEvent EventFields)
	// GetEvents returns all stored events
	GetEvents() []*Event
	// DeleteEvents deletes events from the store
	DeleteEvents([]uuid.UUID)
	// 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