ipforward

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRouteMetric int = 256
)

Variables

This section is empty.

Functions

func NewNetRoute

func NewNetRoute(linkIndex int, destinationSubnet *net.IPNet, gatewayAddress net.IP) (err error)

NewNetRoute creates a new routes

func RemoveNetRoute

func RemoveNetRoute(linkIndex int, destinationSubnet *net.IPNet, gatewayAddress net.IP) (err error)

RemoveNetRoute removes an existing routes

Types

type Route

type Route struct {
	LinkIndex         int
	DestinationSubnet *net.IPNet
	GatewayAddress    net.IP
	RouteMetric       int
}

func GetNetRoutes

func GetNetRoutes(linkIndex int, destinationSubnet *net.IPNet) (routes []Route, err error)

GetNetRoutes returns nets routes by link and destination subnet

func GetNetRoutesAll

func GetNetRoutesAll() (routes []Route, err error)

GetNetRoutesAll returns all nets routes on the host

func (*Route) Equal

func (r *Route) Equal(route Route) 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