routing

package
v0.19.14 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

Jump to

Keyboard shortcuts

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