ipforward

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

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