routing

package
v0.0.0-...-c97f47a Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2020 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Overview

Provides network routing information about the system. It can either return all available routes or select a specific route depending on a destination address.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Route

type Route struct {
	Default bool
	SrcNet  *net.IPNet
	DstNet  *net.IPNet
	Gateway net.IP
	Iface   *net.Interface
}

func RouteTo

func RouteTo(dst net.IP) (*Route, error)

Return the route that matches the given destination address.

func Routes

func Routes() ([]*Route, error)

List all available routes on the system.

func (*Route) GetIfaceIPv4Addr

func (r *Route) GetIfaceIPv4Addr() (net.IP, error)

Return the default IPv4 address of a network interface.

func (*Route) GetIfaceIPv6Addr

func (r *Route) GetIfaceIPv6Addr() (net.IP, error)

Return the default IPv6 address of a network interface.

func (*Route) String

func (r *Route) String() string

Jump to

Keyboard shortcuts

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