route

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package route defines the types of the values returned by netconfig.GetIPRoutes. It's kept in a separate package to avoid dependency cycles.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDefaultIPRoute

func IsDefaultIPRoute(r *IPRoute) bool

IsDefaultRoute returns true if r is a default route, i.e., that it matches any destination address.

func IsDefaultIPv4Route

func IsDefaultIPv4Route(r *IPRoute) bool

IsDefaultIPv4Route returns true if r is a default IPv4 route.

func IsDefaultIPv6Route

func IsDefaultIPv6Route(r *IPRoute) bool

IsDefaultIPv6Route returns true if r is a default IPv6 route.

Types

type IPRoute

type IPRoute struct {
	Net             net.IPNet
	Gateway         net.IP
	PreferredSource net.IP
	IfcIndex        int
}

IPRoute represents a route in the kernel's routing table. Any route with a nil Gateway is a directly connected network.

Jump to

Keyboard shortcuts

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