wintun

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

This section is empty.

Variables

View Source
var WintunStaticRequestedGUID *windows.GUID
View Source
var WintunTunnelType = "Nebula"

Functions

This section is empty.

Types

type Device

type Device interface {
	File() *os.File                 // returns the file descriptor of the device
	Read([]byte, int) (int, error)  // read a packet from the device (without any additional headers)
	Write([]byte, int) (int, error) // writes a packet to the device (without any additional headers)
	Flush() error                   // flush all previous writes to the device
	Name() (string, error)          // fetches and returns the current name
	Close() error                   // stops the device and closes the event channel
}

func CreateTUN

func CreateTUN(ifname string, mtu int) (Device, error)

CreateTUN creates a Wintun interface with the given name. Should a Wintun interface with the same name exist, it is reused.

func CreateTUNWithRequestedGUID

func CreateTUNWithRequestedGUID(ifname string, requestedGUID *windows.GUID, mtu int) (Device, error)

CreateTUNWithRequestedGUID creates a Wintun interface with the given name and a requested GUID. Should a Wintun interface with the same name exist, it is reused.

type NativeTun

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

func (*NativeTun) Close

func (tun *NativeTun) Close() error

func (*NativeTun) File

func (tun *NativeTun) File() *os.File

func (*NativeTun) Flush

func (tun *NativeTun) Flush() error

func (*NativeTun) LUID

func (tun *NativeTun) LUID() uint64

LUID returns Windows interface instance ID.

func (*NativeTun) Name

func (tun *NativeTun) Name() (string, error)

func (*NativeTun) Read

func (tun *NativeTun) Read(buff []byte, offset int) (int, error)

func (*NativeTun) RunningVersion

func (tun *NativeTun) RunningVersion() (version uint32, err error)

RunningVersion returns the running version of the Wintun driver.

func (*NativeTun) Write

func (tun *NativeTun) Write(buff []byte, offset int) (int, error)

Jump to

Keyboard shortcuts

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