showpaths

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

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
	// SCIOND configures a specific SCION Deamon address.
	SCIOND string
	// MaxPaths configures the maximum number of displayed paths. If this option is
	// not provided, the DefaultMaxPaths is used.
	MaxPaths int
	// Refresh configures whether sciond 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
}

Config configures the showpath run.

type Hop

type Hop struct {
	IfID common.IFIDType `json:"ifid"`
	IA   addr.IA         `json:"isd_as"`
}

Hop represents an hop on the path.

type Path

type Path struct {
	FullPath    snet.Path `json:"-"`
	Fingerprint string    `json:"fingerprint"`
	Hops        []Hop     `json:"hops"`
	NextHop     string    `json:"next_hop"`
	Expiry      time.Time `json:"expiry"`
	MTU         uint16    `json:"mtu"`
	Status      string    `json:"status,omitempty"`
	StatusInfo  string    `json:"status_info,omitempty"`
	Local       net.IP    `json:"local_ip,omitempty"`
}

Path holds information about the discovered path.

type Result

type Result struct {
	Destination addr.IA `json:"destination"`
	Paths       []Path  `json:"paths"`
}

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, showExpiration, colored bool)

Human writes human readable output to the writer.

func (Result) JSON

func (r Result) JSON(w io.Writer) error

JSON writes the showpaths result as a json object to the writer.

Jump to

Keyboard shortcuts

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