winwlanapi

package
v0.8.0-beta.16 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	ClientVersion2 = 2

	// InterfaceOpcode for WlanQueryInterface
	IntfOpcodeCurrentConnection = 7

	// NotificationSource for WlanRegisterNotification
	NotificationSourceNone = 0
	NotificationSourceACM  = 0x00000008

	// NotificationACM codes
	NotificationACMConnectionComplete = 10
	NotificationACMDisconnected       = 21

	// InterfaceState
	InterfaceStateNotReady           = 0
	InterfaceStateConnected          = 1
	InterfaceStateAdHocNetworkFormed = 2
	InterfaceStateDisconnecting      = 3
	InterfaceStateDisconnected       = 4
	InterfaceStateAssociating        = 5
	InterfaceStateDiscovering        = 6
	InterfaceStateAuthenticating     = 7

	// DOT11_SSID
	Dot11SSIDMaxLength = 32
)

Variables

This section is empty.

Functions

func CloseHandle

func CloseHandle(handle windows.Handle) error

func OpenHandle

func OpenHandle() (windows.Handle, error)

func RegisterNotification

func RegisterNotification(handle windows.Handle, notificationSource uint32, callback uintptr, context uintptr) error

func UnregisterNotification

func UnregisterNotification(handle windows.Handle) error

Types

type AssociationAttributes

type AssociationAttributes struct {
	SSID    Dot11SSID
	BSSType uint32
	BSSID   Dot11MacAddress

	PhyType       uint32
	PhyIndex      uint32
	SignalQuality uint32
	RxRate        uint32
	TxRate        uint32
	// contains filtered or unexported fields
}

type ConnectionAttributes

type ConnectionAttributes struct {
	InterfaceState        uint32
	ConnectionMode        uint32
	ProfileName           [256]uint16
	AssociationAttributes AssociationAttributes
	SecurityAttributes    SecurityAttributes
}

func QueryCurrentConnection

func QueryCurrentConnection(handle windows.Handle, interfaceGUID *windows.GUID) (*ConnectionAttributes, error)

type Dot11MacAddress

type Dot11MacAddress [6]byte

type Dot11SSID

type Dot11SSID struct {
	Length uint32
	SSID   [Dot11SSIDMaxLength]byte
}

type InterfaceInfo

type InterfaceInfo struct {
	InterfaceGUID        windows.GUID
	InterfaceDescription [256]uint16
	InterfaceState       uint32
}

func EnumInterfaces

func EnumInterfaces(handle windows.Handle) ([]InterfaceInfo, error)

type InterfaceInfoList

type InterfaceInfoList struct {
	NumberOfItems uint32
	Index         uint32
	InterfaceInfo [1]InterfaceInfo
}

type NotificationCallback

type NotificationCallback func(data *NotificationData, context uintptr) uintptr

NotificationCallback is the type for notification callback functions. Use syscall.NewCallback to create a callback from a Go function.

type NotificationData

type NotificationData struct {
	NotificationSource uint32
	NotificationCode   uint32
	InterfaceGUID      windows.GUID
	DataSize           uint32
	Data               uintptr
}

type SecurityAttributes

type SecurityAttributes struct {
	SecurityEnabled int32 // Windows BOOL is 4 bytes
	OneXEnabled     int32
	AuthAlgorithm   uint32
	CipherAlgorithm uint32
}

Jump to

Keyboard shortcuts

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