traceroute

package
v0.0.0-...-1f10c8a Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package traceroute adds traceroute functionality to the agent

Index

Constants

View Source
const (
	DefaultSourcePort   = 12345
	DefaultDestPort     = 33434
	DefaultNumPaths     = 1
	DefaultMinTTL       = 1
	DefaultMaxTTL       = 30
	DefaultDelay        = 50 //msec
	DefaultReadTimeout  = 10 * time.Second
	DefaultOutputFormat = "json"
)

TODO: are these good defaults?

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// TODO: add common configuration
	// Destination Hostname
	DestHostname string
	// Destination Port number
	DestPort uint16
	// Max number of hops to try
	MaxTTL uint8
	// TODO: do we want to expose this?
	TimeoutMs uint
}

Config specifies the configuration of an instance of Traceroute

type LinuxTraceroute

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

LinuxTraceroute defines a structure for running traceroute from an agent running on Linux

func New

func New(cfg Config) (*LinuxTraceroute, error)

New creates a new instance of LinuxTraceroute based on an input configuration

func (*LinuxTraceroute) Run

Run executes a traceroute

type Runner

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

Runner executes traceroutes

func NewRunner

func NewRunner() (*Runner, error)

NewRunner initializes a new traceroute runner

func (*Runner) RunTraceroute

func (r *Runner) RunTraceroute(ctx context.Context, cfg Config) (payload.NetworkPath, error)

RunTraceroute wraps the implementation of traceroute so it can be called from the different OS implementations

This code is experimental and will be replaced with a more complete implementation.

type Traceroute

type Traceroute interface {
	Run(context.Context) (payload.NetworkPath, error)
}

Traceroute defines an interface for running traceroutes for the Network Path integration

Jump to

Keyboard shortcuts

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