traceroute

package
v0.0.0-...-47294c1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package traceroute adds traceroute functionality to the agent

Index

Constants

View Source
const (
	// DefaultSourcePort defines the default source port
	DefaultSourcePort = 12345
	// DefaultDestPort defines the default destination port
	DefaultDestPort = 33434
	// DefaultNumPaths defines the default number of paths
	DefaultNumPaths = 1
	// DefaultMinTTL defines the default minimum TTL
	DefaultMinTTL = 1
	// DefaultDelay defines the default delay
	DefaultDelay = 50 //msec
	// DefaultOutputFormat defines the default output format
	DefaultOutputFormat = "json"
)

Variables

This section is empty.

Functions

func GetHostname

func GetHostname(ipAddr string) string

GetHostname returns the hostname for the given IP address as a string.

func GetReverseDNSForIP

func GetReverseDNSForIP(destIP net.IP) string

GetReverseDNSForIP returns the reverse DNS for the given IP address as a net.IP.

Types

type Config

type Config struct {
	// TODO: add common configuration
	// Destination Hostname
	DestHostname string
	// Destination Port number
	DestPort uint16
	// Destination service name
	DestinationService string
	// Source service name
	SourceService string
	// Source container ID
	SourceContainerID string
	// Max number of hops to try
	MaxTTL uint8
	// TODO: do we want to expose this?
	Timeout time.Duration
	// Protocol is the protocol to use
	// for traceroute, default is UDP
	Protocol payload.Protocol
}

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

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(telemetryComp telemetryComponent.Component) (*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

Directories

Path Synopsis
Package tcp adds a TCP traceroute implementation to the agent
Package tcp adds a TCP traceroute implementation to the agent

Jump to

Keyboard shortcuts

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