device

package
v0.5.48 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package device implements OS abstractions for managing WireGuard links

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenUAPI

func ListenUAPI(name string) (net.Listener, error)

Types

type Device

type Device interface {
	link.Link

	Bind() *wg.Bind
	BindUpdate() error
}

func FindUserDevice

func FindUserDevice(name string) (Device, error)

func NewDevice

func NewDevice(name string, user bool) (kernelDev Device, err error)

type KernelDevice

type KernelDevice struct {
	link.Link

	ListenPort int
	// contains filtered or unexported fields
}

func FindKernelDevice

func FindKernelDevice(name string) (*KernelDevice, error)

func NewKernelDevice

func NewKernelDevice(name string) (*KernelDevice, error)

func (*KernelDevice) Bind

func (d *KernelDevice) Bind() *wg.Bind

func (*KernelDevice) BindUpdate

func (d *KernelDevice) BindUpdate() error

type UserDevice

type UserDevice struct {
	link.Link
	*device.Device
	// contains filtered or unexported fields
}

func NewUserDevice

func NewUserDevice(name string) (*UserDevice, error)

func (*UserDevice) Bind

func (d *UserDevice) Bind() *wg.Bind

func (*UserDevice) Close

func (d *UserDevice) Close() error

Jump to

Keyboard shortcuts

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