wintun

package
v0.0.0-...-413bfd4 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: GPL-2.0 Imports: 9 Imported by: 0

README

wintun

DLL version: 0.14.1

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	PacketSizeMax   = 0xffff    // Maximum packet size
	RingCapacityMin = 0x20000   // Minimum ring capacity (128 kiB)
	RingCapacityMax = 0x4000000 // Maximum ring capacity (64 MiB)
)

Variables

This section is empty.

Functions

func RunningVersion

func RunningVersion() (version uint32, err error)

RunningVersion returns the version of the running Wintun driver.

func Uninstall

func Uninstall() (err error)

Uninstall removes the driver from the system if no drivers are currently in use.

Types

type Adapter

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

func CreateAdapter

func CreateAdapter(name string, tunnelType string, requestedGUID *windows.GUID) (wintun *Adapter, err error)

CreateAdapter creates a Wintun adapter. name is the cosmetic name of the adapter. tunnelType represents the type of adapter and should be "Wintun". requestedGUID is the GUID of the created network adapter, which then influences NLA generation deterministically. If it is set to nil, the GUID is chosen by the system at random, and hence a new NLA entry is created for each new adapter.

func OpenAdapter

func OpenAdapter(name string) (wintun *Adapter, err error)

OpenAdapter opens an existing Wintun adapter by name.

func (*Adapter) Close

func (wintun *Adapter) Close() (err error)

Close closes a Wintun adapter.

func (*Adapter) LUID

func (wintun *Adapter) LUID() (luid uint64)

LUID returns the LUID of the adapter.

func (*Adapter) StartSession

func (wintun *Adapter) StartSession(capacity uint32) (session Session, err error)

type Packet

type Packet struct {
	Next *Packet              // Pointer to next packet in queue
	Size uint32               // Size of packet (max WINTUN_MAX_IP_PACKET_SIZE)
	Data *[PacketSizeMax]byte // Pointer to layer 3 IPv4 or IPv6 packet
}

Packet with data

type Session

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

func (Session) AllocateSendPacket

func (session Session) AllocateSendPacket(packetSize int) (packet []byte, err error)

func (Session) End

func (session Session) End()

func (Session) ReadWaitEvent

func (session Session) ReadWaitEvent() (handle windows.Handle)

func (Session) ReceivePacket

func (session Session) ReceivePacket() (packet []byte, err error)

func (Session) ReleaseReceivePacket

func (session Session) ReleaseReceivePacket(packet []byte)

func (Session) SendPacket

func (session Session) SendPacket(packet []byte)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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