addrutil

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultLocalIP added in v0.6.0

func DefaultLocalIP(ctx context.Context, sdConn daemon.Connector) (net.IP, error)

DefaultLocalIP returns _an_ IP of this host in the local AS.

This returns a sensible but arbitrary local IP. In the general case the local IP would depend on the next hop of selected path. This approach will not work in more complicated setups where e.g. different network interfaces are used to talk to different AS interfaces.

This is a simple workaround for not being able to use wildcard addresses with snet. Once available, a wildcard address should be used instead and this should be removed.

func ResolveLocal added in v0.5.0

func ResolveLocal(dst net.IP) (net.IP, error)

ResolveLocal returns the local IP address used for traffic destined to dst.

Types

type Pather added in v0.6.0

type Pather struct {
	NextHopper interface {
		// UnderlayNextHop determines the next hop underlay address for the
		// specified interface id.
		UnderlayNextHop(uint16) *net.UDPAddr
	}
}

Pather computes the remote address with a path based on the provided segment.

func (Pather) GetPath added in v0.6.0

func (p Pather) GetPath(svc addr.HostSVC, ps *seg.PathSegment) (*snet.SVCAddr, error)

GetPath computes the remote address with a path based on the provided segment.

Jump to

Keyboard shortcuts

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