ifctl

package
v0.0.0-...-9adf2cc Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package ifctl declares cross-platform helpers for creating and managing network interfaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	// Name returns the name of the interface.
	Name() string

	// Set sets the state of the interface to be up or down.
	Set(state bool) error

	// SetAddr sets the address of the interface to the one provided.
	SetAddr(addr *net.IPNet) error

	// Add adds a route for an IPNet to the interface.
	AddRoute(route *net.IPNet) error

	// DeleteRoute removes a route for an IPNet to the interface.
	DeleteRoute(route *net.IPNet) error

	// Delete deletes the interface.
	Delete() error
}

func From

func From(name string) (Interface, error)

From returns an Interface by its name.

func New

func New(name string) (Interface, error)

New creates a new WireGuard interface and returns an Interface object.

By default, the created interface will be down and must be manually set up.

Jump to

Keyboard shortcuts

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