logic

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractNames added in v0.2.0

func ExtractNames(ctx context.Context, pkt gopacket.Packet, repo interfaces.Repository)

ExtractNames parses protocol-specific information from a packet and saves name resolution data (IP→name, MAC→name) to the repository.

func GetEthernetMACs added in v0.2.0

func GetEthernetMACs(pkt gopacket.Packet) (srcMAC, dstMAC net.HardwareAddr)

GetEthernetMACs extracts source and destination MAC addresses from the Ethernet layer.

Types

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

func NewEngine

func NewEngine(opts ...Option) *Engine

func (*Engine) FlowCount

func (x *Engine) FlowCount() int

func (*Engine) Flush

func (x *Engine) Flush(ctx context.Context) *model.Record

func (*Engine) InputPacket

func (x *Engine) InputPacket(ctx context.Context, pkt gopacket.Packet) (*model.Record, error)

func (*Engine) Tick

func (x *Engine) Tick(ctx context.Context, now time.Time) (*model.Record, error)

type FlowMap

type FlowMap struct {
	// contains filtered or unexported fields
}

func NewFlowMap

func NewFlowMap() *FlowMap

func (*FlowMap) Expire

func (x *FlowMap) Expire(at time.Time) []*model.Flow

func (*FlowMap) Flush

func (x *FlowMap) Flush() []*model.Flow

func (*FlowMap) Get

func (x *FlowMap) Get(key model.FlowKey) *model.Flow

func (*FlowMap) Len

func (x *FlowMap) Len() int

func (*FlowMap) Put

func (x *FlowMap) Put(flow *model.Flow) bool

func (*FlowMap) SetNames added in v0.2.0

func (x *FlowMap) SetNames(key model.FlowKey, addr net.IP, names []string)

type Option

type Option func(*Engine)

func WithRepository added in v0.2.0

func WithRepository(repo interfaces.Repository) Option

func WithTimeout

func WithTimeout(d time.Duration) Option

Jump to

Keyboard shortcuts

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