routing

package
v0.18.101 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Route

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

Route present a specific route

func (*Route) Equal

func (r *Route) Equal(other Route) bool

type Router

type Router interface {
	// GetAllRoutes returns all existing routes
	GetAllRoutes() ([]Route, error)

	// GetRoutesFromInterfaceToSubnet returns all routes from the given Interface to the given subnet
	GetRoutesFromInterfaceToSubnet(interfaceIndex int, destinationSubnet *net.IPNet) ([]Route, error)

	// CreateRoute creates a new route
	CreateRoute(interfaceIndex int, destinationSubnet *net.IPNet, gatewayAddress net.IP) error

	// DeleteRoute removes an existing route
	DeleteRoute(interfaceIndex int, destinationSubnet *net.IPNet, gatewayAddress net.IP) error
}

Router manages network routes

type RouterWindows

type RouterWindows struct{}

Router manages network routes on Windows OS using MSFT_NetRoute See also https://docs.microsoft.com/en-us/previous-versions/windows/desktop/legacy/hh872448(v%3Dvs.85)

func (RouterWindows) CreateRoute

func (r RouterWindows) CreateRoute(interfaceIndex int, destinationSubnet *net.IPNet, gatewayAddress net.IP) error

func (RouterWindows) DeleteRoute

func (r RouterWindows) DeleteRoute(interfaceIndex int, destinationSubnet *net.IPNet, gatewayAddress net.IP) error

func (RouterWindows) GetAllRoutes

func (r RouterWindows) GetAllRoutes() ([]Route, error)

func (RouterWindows) GetRoutesFromInterfaceToSubnet

func (r RouterWindows) GetRoutesFromInterfaceToSubnet(interfaceIndex int, destinationSubnet *net.IPNet) ([]Route, error)

Jump to

Keyboard shortcuts

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