routing

package
v2.12.0-rc.6 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Subnets added in v2.8.0

func Subnets(routes []*Route) []*net.IPNet

Types

type Route

type Route struct {
	LocalIP   net.IP
	RoutedNet *net.IPNet
	Interface *net.Interface
	Gateway   net.IP
	Default   bool
}

func DefaultRoute added in v2.5.4

func DefaultRoute(ctx context.Context) (*Route, error)

func GetRoute

func GetRoute(ctx context.Context, routedNet *net.IPNet) (*Route, error)

func GetRoutingTable added in v2.4.8

func GetRoutingTable(ctx context.Context) ([]*Route, error)

func Routes added in v2.8.0

func Routes(c context.Context, ms []*net.IPNet) []*Route

func (*Route) AddStatic added in v2.7.2

func (r *Route) AddStatic(ctx context.Context) (err error)

AddStatic adds a specific route. This can be used to prevent certain IP addresses from being routed to the route's interface.

func (*Route) RemoveStatic added in v2.7.2

func (r *Route) RemoveStatic(ctx context.Context) (err error)

RemoveStatic removes a specific route added via AddStatic.

func (*Route) Routes

func (r *Route) Routes(ip net.IP) bool

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