nettap

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTapNotFound             = errors.New("tap not found")
	ErrTapManagerUnimplemented = errors.New("tap manager is implemented on windows only")
)

Functions

func Available

func Available() bool

func NewUniqueTapName

func NewUniqueTapName() (string, error)

func ValidateTapName

func ValidateTapName(_ string) error

Types

type Alloc

type Alloc struct {
	TapName string
	PID     int
}

func (*Alloc) Validate

func (a *Alloc) Validate() error

type TapManager

type TapManager struct {
	// contains filtered or unexported fields
}

func NewTapManager

func NewTapManager(_ *slog.Logger) (*TapManager, error)

func (*TapManager) ConfigureNet

func (tm *TapManager) ConfigureNet(_ string, _ string) error

func (*TapManager) CreateNewTap

func (tm *TapManager) CreateNewTap(_ string) error

func (*TapManager) DeleteTap

func (tm *TapManager) DeleteTap(_ string) error

func (*TapManager) PruneTaps

func (tm *TapManager) PruneTaps(knownAllocs []Alloc) ([]string, error)

The taps removed slice always returns the taps removed, even after an error has occurred sometime while deleting non-first interfaces.

type TapNet

type TapNet struct {
	HostIP  net.IP
	GuestIP net.IP

	HostCIDR  string
	GuestCIDR string
}

func GenerateNet

func GenerateNet() (TapNet, error)

Jump to

Keyboard shortcuts

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