routes

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRouteExists = errors.New("route already exists")

Functions

func Add

func Add(ctx context.Context, ifaceName string, addr netip.Prefix) error

Add adds a route to the interface with the given name.

func EnableIPForwarding

func EnableIPForwarding() error

EnableIPForwarding enables IP forwarding.

func GetDefaultGateway

func GetDefaultGateway(_ context.Context) (netip.Addr, error)

GetDefaultGateway returns the default gateway of the current system.

func Remove

func Remove(ctx context.Context, ifaceName string, addr netip.Prefix) error

Remove removes a route from the interface with the given name.

func SetDefaultIPv4Gateway

func SetDefaultIPv4Gateway(ctx context.Context, gateway netip.Addr) error

SetDefaultIPv4Gateway sets the default IPv4 gateway for the current system.

func SetDefaultIPv6Gateway

func SetDefaultIPv6Gateway(ctx context.Context, gateway netip.Addr) error

SetDefaultIPv6Gateway sets the default IPv6 gateway for the current system.

Types

This section is empty.

Jump to

Keyboard shortcuts

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