probe

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Probe

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

newProbe holds configuration for a single probe instance

func (*Probe) Run

func (p *Probe) Run()

type ProbeConfig

type ProbeConfig struct {
	NoResolve bool
	// contains filtered or unexported fields
}

ProbeConfig holds configuration common to all probes

type ProbeEvent

type ProbeEvent struct {
	ProbeID   uint16
	EventType string // "sent", "received", "timeout", etc.
	Data      any
}

Event structure for probe statistics

type ProbeEventDataIterationComplete

type ProbeEventDataIterationComplete struct {
	ProbeNum  uint      // Which iteration just completed
	Timestamp time.Time // When it completed
}

type ProbeEventDataReceived

type ProbeEventDataReceived struct {
	ProbeNum  uint
	TTL       uint8
	Timestamp time.Time
	IP        string
	Flag      string
}

type ProbeEventDataSent

type ProbeEventDataSent struct {
	ProbeNum  uint
	TTL       uint8
	Timestamp time.Time
}

type ProbeEventDataTimeout

type ProbeEventDataTimeout struct {
	ProbeNum uint
	SentTime time.Time
	TTL      uint8
}

type ProbeManager

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

ProbeManager coordinates multiple parallel probes to the same destination

func NewProbeManager

func NewProbeManager(a config.Args) (*ProbeManager, error)

NewProbeManager creates and initializes a probe manager

func (*ProbeManager) Run

func (pm *ProbeManager) Run() error

Run initializes and executes all probes in parallel

func (*ProbeManager) Stop

func (pm *ProbeManager) Stop()

Stop terminates all probes and cleans up resources

type ProbeManagerStats

type ProbeManagerStats struct {
	Probes      map[uint16]*shared.ProbeStats
	CurrentRuns map[uint16]*ProbeRunBuilder // Current probe run being built for each probe ID
	Mutex       sync.RWMutex
	TTLCache    *ttlcache.Cache[TTLCacheKey, TTLCacheValue]
}

Top-level stats structure for all probes

type ProbeRunBuilder

type ProbeRunBuilder struct {
	ProbeID   uint16
	ProbeNum  uint
	Hops      map[uint8]*shared.HopRun // TTL -> hop result (internal map for building)
	Timestamp time.Time
}

ProbeRunBuilder is used internally to build a ProbeRun incrementally

type ProbeTracker

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

type ProtocolConfig

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

type ResponseEvent

type ResponseEvent struct {
	ProbeNum uint
	TTL      uint8
	Flag     string
}

type TTLCacheKey

type TTLCacheKey struct {
	ProbeID  uint16
	ProbeNum uint // Which iteration
	TTL      uint8
}

Key for the TTL cache

type TTLCacheValue

type TTLCacheValue struct {
	SentTime time.Time
}

Value stored in the TTL cache

type TransmitEvent

type TransmitEvent struct {
	Buffer   gopacket.SerializeBuffer
	ProbeID  uint16
	ProbeNum uint
	TTL      uint8
}

Jump to

Keyboard shortcuts

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