showpaths

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const DefaultMaxPaths = 10

DefaultMaxPaths is the maximum number of paths that are displayed by default.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Local configures the local IP address to use. If this option is not provided,
	// a local IP that can reach SCION hosts is selected with the help of the kernel.
	Local net.IP
	// Daemon configures a specific SCION Daemon address.
	Daemon string
	// MaxPaths configures the maximum number of displayed paths. If this option is
	// not provided, the DefaultMaxPaths is used.
	MaxPaths int
	// Refresh configures whether the daemon is queried with the refresh flag.
	Refresh bool
	// NoProbe configures whether the path status is probed or not.
	NoProbe bool
	// Sequence is a string of space separated Hop Predicates that is used for
	// filtering.
	Sequence string
	// Epic filters paths for which EPIC is not available, and when probing, the
	// EPIC path type header is used.
	Epic bool
}

Config configures the showpath run.

type Hop

type Hop struct {
	IfID iface.ID `json:"interface"`
	IA   addr.IA  `json:"isd_as"`
}

Hop represents an hop on the path.

type Path

type Path struct {
	FullPath    snet.Path       `json:"-" yaml:"-"`
	Fingerprint string          `json:"fingerprint" yaml:"fingerprint"`
	Hops        []Hop           `json:"hops" yaml:"hops"`
	Sequence    string          `json:"sequence" yaml:"sequence"`
	NextHop     string          `json:"next_hop" yaml:"next_hop"`
	Expiry      time.Time       `json:"expiry" yaml:"expiry"`
	MTU         uint16          `json:"mtu" yaml:"mtu"`
	Latency     []time.Duration `json:"latency" yaml:"latency"`
	Status      string          `json:"status,omitempty" yaml:"status,omitempty"`
	StatusInfo  string          `json:"status_info,omitempty" yaml:"status_info,omitempty"`
	Local       netip.Addr      `json:"local_ip,omitempty" yaml:"local_ip,omitempty"`
}

Path holds information about the discovered path.

type Result

type Result struct {
	LocalIA     addr.IA `json:"local_isd_as" yaml:"local_isd_as"`
	Destination addr.IA `json:"destination" yaml:"destination"`
	Paths       []Path  `json:"paths,omitempty" yaml:"paths,omitempty"`
}

Result contains all the discovered paths.

func Run

func Run(ctx context.Context, dst addr.IA, cfg Config) (*Result, error)

Run lists the paths to the specified ISD-AS to stdout.

func (Result) Alive

func (r Result) Alive() int

Alive returns the number of alive paths.

func (Result) Human

func (r Result) Human(w io.Writer, showExtendedMetadata, colored bool)

Human writes human readable output to the writer.

func (Result) IsLocal

func (r Result) IsLocal() bool

IsLocal returns true iff Source and Destination AS are identical

Jump to

Keyboard shortcuts

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