pathprobe

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package pathprobe contains methods to probe scion paths. This is heplful to detect path status.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterEmptyPaths

func FilterEmptyPaths(paths []snet.Path) []snet.Path

FilterEmptyPaths removes all empty paths from paths and returns a copy.

func PathKey

func PathKey(path snet.Path) string

PathKey is the mapping of a path reply entry to a key that is returned in GetStatuses.

Types

type Option

type Option func(o *options)

func WithEPIC

func WithEPIC(epic bool) Option

type Prober

type Prober struct {
	// DstIA is the destination ISD-AS.
	DstIA addr.IA
	// LocalIA is the source ISD-AS.
	LocalIA addr.IA
	// LocalIP is the local IP endpoint to be used when probing. If not set, the proper will resolve
	// an appropriate local IP endpoint depending on the path that should be probed. Note, LocalIP
	// should not be set, unless you know what you are doing.
	LocalIP net.IP
	// ID is the SCMP traceroute ID used by the Prober.
	ID uint16
	// Dispatcher is the path to the dispatcher socket. Leaving this empty uses
	// the default dispatcher socket value.
	Dispatcher string
	// Metrics injected into snet.DefaultPacketDispatcherService.
	SCIONPacketConnMetrics snet.SCIONPacketConnMetrics
}

Prober can be used to get the status of a path.

func (Prober) GetStatuses

func (p Prober) GetStatuses(ctx context.Context, paths []snet.Path,
	opts ...Option) (map[string]Status, error)

GetStatuses probes the paths and returns the statuses of the paths. The returned map is keyed with path.Path.FwdPath. The input should only be non-empty paths.

type Status

type Status struct {
	Status         StatusName
	LocalIP        netip.Addr
	AdditionalInfo string
}

Status indicates the state a path is in.

func (Status) String

func (s Status) String() string

type StatusName

type StatusName string

StatusName defines the different states a path can be in.

const (
	// StatusUnknown indicates that it is not clear what state the path is in.
	StatusUnknown StatusName = "Unknown"
	// StatusTimeout indicates that a reply did come back in time for the path.
	StatusTimeout StatusName = "Timeout"
	// StatusAlive indicates that the expected reply did come back in time.
	StatusAlive StatusName = "Alive"
	// StatusSCMP indicates that an unexpected SCMP packet came in the reply.
	StatusSCMP StatusName = "SCMP"
)

Jump to

Keyboard shortcuts

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