ipforward

package
v1.4.0-policy Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	DefaultRouteMetric int = 256
)

Variables

This section is empty.

Functions

func NewNetRouteForInterface

func NewNetRouteForInterface(ifaceIndex int, destinationSubnet net.IPNet, nextHop net.IP) (err error)

NewNetRouteForInterface creates a new route for given interface.

func RemoveNetRoutes

func RemoveNetRoutes(destinationSubnet *net.IPNet) error

RemoveNetRoutes returns given destination subnet routes.

func RemoveNetRoutesForInterface

func RemoveNetRoutesForInterface(ifaceIndex int, destinationSubnet *net.IPNet, nextHop *net.IP) error

RemoveNetRoutesForInterface removes existing routes for given interface.

Types

type Route

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

func GetNetRoutes

func GetNetRoutes() ([]Route, error)

GetNetRoutes returns all nets routes.

func GetNetRoutesForInterface

func GetNetRoutesForInterface(ifaceIndex int, destinationSubnet *net.IPNet) ([]Route, error)

GetNetRoutesForInterface returns nets routes for given interface index and destination subnet.

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