corewlan

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Rendered for darwin/amd64

Overview

Package corewlan provides a fluent Go API over the macOS CoreWLAN framework.

Construction

New… functions create objects; each With… method sets one property and returns its receiver, so configuration calls chain. A <Type>FromID constructor adopts an Objective-C object obtained elsewhere.

Lifecycle

A wrapper releases its Objective-C object automatically once the garbage collector finds it unreachable. Call Release to relinquish the reference deterministically (for objects holding scarce resources); Release is idempotent, and afterwards the wrapper's methods are no-ops returning zero values.

Delegates

A …Delegate interface is implemented by a plain Go value and installed with the matching With… setter; the package builds the Objective-C delegate object behind the scenes. Optional protocol methods are separate one-method …Handler interfaces — implement the ones you need on the same value and the framework calls them too.

Types

Each base type below lists the concrete types you construct and pass where the base is accepted:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CWBSSIDDidChangeNotification

func CWBSSIDDidChangeNotification() obj.Object

CWBSSIDDidChangeNotification returns the string constant CWBSSIDDidChangeNotification, for use as a dictionary key or argument.

func CWCountryCodeDidChangeNotification

func CWCountryCodeDidChangeNotification() obj.Object

CWCountryCodeDidChangeNotification returns the string constant CWCountryCodeDidChangeNotification, for use as a dictionary key or argument.

func CWErrorDomain

func CWErrorDomain() obj.Object

CWErrorDomain returns the string constant CWErrorDomain, for use as a dictionary key or argument.

func CWKeychainCopyEAPIdentity

func CWKeychainCopyEAPIdentity(ssidData obj.Object, identity unsafe.Pointer) error

CWKeychainCopyEAPIdentity reports an error if the CoreWLAN framework function CWKeychainCopyEAPIdentity fails.

func CWKeychainCopyEAPIdentityList

func CWKeychainCopyEAPIdentityList() (obj.Object, error)

CWKeychainCopyEAPIdentityList reports an error if the CoreWLAN framework function CWKeychainCopyEAPIdentityList fails.

func CWKeychainCopyEAPUsernameAndPassword

func CWKeychainCopyEAPUsernameAndPassword(ssidData obj.Object) (obj.Object, obj.Object, error)

CWKeychainCopyEAPUsernameAndPassword reports an error if the CoreWLAN framework function CWKeychainCopyEAPUsernameAndPassword fails.

func CWKeychainCopyPassword

func CWKeychainCopyPassword(ssidData obj.Object) (obj.Object, error)

CWKeychainCopyPassword reports an error if the CoreWLAN framework function CWKeychainCopyPassword fails.

func CWKeychainCopyWiFiEAPIdentity

func CWKeychainCopyWiFiEAPIdentity(domain KeychainDomain, ssid []byte, identity unsafe.Pointer) error

CWKeychainCopyWiFiEAPIdentity reports an error if the CoreWLAN framework function CWKeychainCopyWiFiEAPIdentity fails.

func CWKeychainDeleteEAPUsernameAndPassword

func CWKeychainDeleteEAPUsernameAndPassword(ssidData obj.Object) error

CWKeychainDeleteEAPUsernameAndPassword reports an error if the CoreWLAN framework function CWKeychainDeleteEAPUsernameAndPassword fails.

func CWKeychainDeletePassword

func CWKeychainDeletePassword(ssidData obj.Object) error

CWKeychainDeletePassword reports an error if the CoreWLAN framework function CWKeychainDeletePassword fails.

func CWKeychainDeleteWiFiEAPUsernameAndPassword

func CWKeychainDeleteWiFiEAPUsernameAndPassword(domain KeychainDomain, ssid []byte) error

CWKeychainDeleteWiFiEAPUsernameAndPassword reports an error if the CoreWLAN framework function CWKeychainDeleteWiFiEAPUsernameAndPassword fails.

func CWKeychainDeleteWiFiPassword

func CWKeychainDeleteWiFiPassword(domain KeychainDomain, ssid []byte) error

CWKeychainDeleteWiFiPassword reports an error if the CoreWLAN framework function CWKeychainDeleteWiFiPassword fails.

func CWKeychainFindWiFiEAPUsernameAndPassword

func CWKeychainFindWiFiEAPUsernameAndPassword(domain KeychainDomain, ssid []byte, username string, password string) error

CWKeychainFindWiFiEAPUsernameAndPassword reports an error if the CoreWLAN framework function CWKeychainFindWiFiEAPUsernameAndPassword fails.

func CWKeychainFindWiFiPassword

func CWKeychainFindWiFiPassword(domain KeychainDomain, ssid []byte, password string) error

CWKeychainFindWiFiPassword reports an error if the CoreWLAN framework function CWKeychainFindWiFiPassword fails.

func CWKeychainSetEAPIdentity

func CWKeychainSetEAPIdentity(ssidData obj.Object, identity obj.Object) error

CWKeychainSetEAPIdentity reports an error if the CoreWLAN framework function CWKeychainSetEAPIdentity fails.

func CWKeychainSetEAPUsernameAndPassword

func CWKeychainSetEAPUsernameAndPassword(ssidData obj.Object, username obj.Object, password obj.Object) error

CWKeychainSetEAPUsernameAndPassword reports an error if the CoreWLAN framework function CWKeychainSetEAPUsernameAndPassword fails.

func CWKeychainSetPassword

func CWKeychainSetPassword(ssidData obj.Object, password obj.Object) error

CWKeychainSetPassword reports an error if the CoreWLAN framework function CWKeychainSetPassword fails.

func CWKeychainSetWiFiEAPIdentity

func CWKeychainSetWiFiEAPIdentity(domain KeychainDomain, ssid []byte, identity obj.Object) error

CWKeychainSetWiFiEAPIdentity reports an error if the CoreWLAN framework function CWKeychainSetWiFiEAPIdentity fails.

func CWKeychainSetWiFiEAPUsernameAndPassword

func CWKeychainSetWiFiEAPUsernameAndPassword(domain KeychainDomain, ssid []byte, username string, password string) error

CWKeychainSetWiFiEAPUsernameAndPassword reports an error if the CoreWLAN framework function CWKeychainSetWiFiEAPUsernameAndPassword fails.

func CWKeychainSetWiFiPassword

func CWKeychainSetWiFiPassword(domain KeychainDomain, ssid []byte, password string) error

CWKeychainSetWiFiPassword reports an error if the CoreWLAN framework function CWKeychainSetWiFiPassword fails.

func CWLinkDidChangeNotification

func CWLinkDidChangeNotification() obj.Object

CWLinkDidChangeNotification returns the string constant CWLinkDidChangeNotification, for use as a dictionary key or argument.

func CWLinkQualityDidChangeNotification

func CWLinkQualityDidChangeNotification() obj.Object

CWLinkQualityDidChangeNotification returns the string constant CWLinkQualityDidChangeNotification, for use as a dictionary key or argument.

func CWLinkQualityNotificationRSSIKey

func CWLinkQualityNotificationRSSIKey() obj.Object

CWLinkQualityNotificationRSSIKey returns the string constant CWLinkQualityNotificationRSSIKey, for use as a dictionary key or argument.

func CWLinkQualityNotificationTransmitRateKey

func CWLinkQualityNotificationTransmitRateKey() obj.Object

CWLinkQualityNotificationTransmitRateKey returns the string constant CWLinkQualityNotificationTransmitRateKey, for use as a dictionary key or argument.

func CWModeDidChangeNotification

func CWModeDidChangeNotification() obj.Object

CWModeDidChangeNotification returns the string constant CWModeDidChangeNotification, for use as a dictionary key or argument.

func CWPowerDidChangeNotification

func CWPowerDidChangeNotification() obj.Object

CWPowerDidChangeNotification returns the string constant CWPowerDidChangeNotification, for use as a dictionary key or argument.

func CWSSIDDidChangeNotification

func CWSSIDDidChangeNotification() obj.Object

CWSSIDDidChangeNotification returns the string constant CWSSIDDidChangeNotification, for use as a dictionary key or argument.

func CWScanCacheDidUpdateNotification

func CWScanCacheDidUpdateNotification() obj.Object

CWScanCacheDidUpdateNotification returns the string constant CWScanCacheDidUpdateNotification, for use as a dictionary key or argument.

func CWWiFiClientInterfaceNames

func CWWiFiClientInterfaceNames() []string

CWWiFiClientInterfaceNames returns the list of the names of available Wi-Fi interfaces.

CWWiFiClientInterfaceNames returns the collection as a Go slice.

func InterfaceNames added in v0.17.0

func InterfaceNames() []string

InterfaceNames returns the list of BSD names for WLAN interfaces available on the current system.

Types

type Channel added in v0.17.0

type Channel struct {
	objref.Handle
}

Channel is an idiomatic wrapper over the Objective-C class CWChannel.

Encapsulates an IEEE 802.11 channel.

func ChannelFromID added in v0.17.0

func ChannelFromID(id objc.ID) *Channel

ChannelFromID adopts an existing Objective-C object as a Channel (nil for 0), retaining it and registering a release finalizer.

func NewChannel added in v0.17.0

func NewChannel() *Channel

NewChannel creates a new Channel.

func (*Channel) ChannelBand added in v0.17.0

func (c *Channel) ChannelBand() ChannelBand

ChannelBand returns the channel band as indicated by the CWChannelBand type.

func (*Channel) ChannelNumber added in v0.17.0

func (c *Channel) ChannelNumber() int

ChannelNumber returns the channel number represented as an integer value.

func (*Channel) ChannelWidth added in v0.17.0

func (c *Channel) ChannelWidth() ChannelWidth

ChannelWidth returns the channel width as indicated by the CWChannelWidth type.

func (*Channel) Description added in v0.17.0

func (c *Channel) Description() string

Description returns the object's -description text.

func (*Channel) IsEqual added in v0.17.0

func (c *Channel) IsEqual(other obj.Object) bool

IsEqual reports Objective-C equality (isEqual:) with another object.

func (*Channel) IsEqualToChannel added in v0.17.0

func (c *Channel) IsEqualToChannel(channel *Channel) bool

IsEqualToChannel determine CWChannel object equality.

func (*Channel) IsKind added in v0.17.0

func (c *Channel) IsKind(className string) bool

IsKind reports whether the object is an instance of the named class or a subclass.

func (*Channel) String added in v0.17.0

func (c *Channel) String() string

String returns the object's -description text, so a wrapper prints usefully under fmt.

type ChannelBand added in v0.17.0

type ChannelBand int64

CoreWLAN channel bands.

const (
	// Unknown channel band.
	KCWChannelBandUnknown ChannelBand = 0
	// 2.4GHz channel band.
	KCWChannelBand2GHz ChannelBand = 1
	// 5GHz channel band.
	KCWChannelBand5GHz ChannelBand = 2
	KCWChannelBand6GHz ChannelBand = 3
)

func (ChannelBand) String added in v0.17.0

func (e ChannelBand) String() string

String returns the ChannelBand constant's name, or its numeric form when the value is not a known constant.

type ChannelWidth added in v0.17.0

type ChannelWidth int64

CoreWLAN channel widths.

const (
	// Unknown channel width.
	KCWChannelWidthUnknown ChannelWidth = 0
	// 20MHz channel width.
	KCWChannelWidth20MHz ChannelWidth = 1
	// 40MHz channel width.
	KCWChannelWidth40MHz ChannelWidth = 2
	// 80MHz channel width.
	KCWChannelWidth80MHz ChannelWidth = 3
	// 160MHz channel width.
	KCWChannelWidth160MHz ChannelWidth = 4
)

func (ChannelWidth) String added in v0.17.0

func (e ChannelWidth) String() string

String returns the ChannelWidth constant's name, or its numeric form when the value is not a known constant.

type CipherKeyFlags added in v0.17.0

type CipherKeyFlags uint64

Cipher key flags. Bitmask — values may be combined with |.

const (
	// Open System authentication.
	KCWCipherKeyFlagsNone CipherKeyFlags = 0
	// A flag that indicates to use the cipher key for unicast packets.
	KCWCipherKeyFlagsUnicast CipherKeyFlags = 2
	// A flag that indicates to use the cipher key for multicast packets.
	KCWCipherKeyFlagsMulticast CipherKeyFlags = 4
	// A flag that indicates to use the cipher key for packets sent from the interface.
	KCWCipherKeyFlagsTx CipherKeyFlags = 8
	// A flag that indicates to use the cipher key for packets received by the interface.
	KCWCipherKeyFlagsRx CipherKeyFlags = 16
)

func (CipherKeyFlags) String added in v0.17.0

func (e CipherKeyFlags) String() string

String returns the CipherKeyFlags constant's name, or its numeric form when the value is not a known constant.

type Clockid added in v0.17.0

type Clockid int32
const (
	ClockidRealtime           Clockid = 0
	ClockidMonotonic          Clockid = 6
	ClockidMonotonicRaw       Clockid = 4
	ClockidMonotonicRawApprox Clockid = 5
	ClockidUptimeRaw          Clockid = 8
	ClockidUptimeRawApprox    Clockid = 9
	ClockidProcessCputimeID   Clockid = 12
	ClockidThreadCputimeID    Clockid = 16
)

func (Clockid) String added in v0.17.0

func (e Clockid) String() string

String returns the Clockid constant's name, or its numeric form when the value is not a known constant.

type Configuration added in v0.17.0

type Configuration struct {
	objref.Handle
}

Configuration is an idiomatic wrapper over the Objective-C class CWConfiguration.

Configuration is an abstract base — you do not construct it directly. Construct one of MutableConfiguration and pass it where a Configuration is accepted.

Encapsulates an immutable configuration for an AirPort WLAN interface.

func CWConfigurationConfiguration

func CWConfigurationConfiguration() *Configuration

CWConfigurationConfiguration returns convenience method for getting an empty CWConfiguration object.

func ConfigurationFromID added in v0.17.0

func ConfigurationFromID(id objc.ID) *Configuration

ConfigurationFromID adopts an existing Objective-C object as a Configuration (nil for 0), retaining it and registering a release finalizer.

func ConfigurationWithConfiguration added in v0.17.0

func ConfigurationWithConfiguration(configuration *Configuration) *Configuration

ConfigurationWithConfiguration convenience method for getting a CWConfiguration object initialized with the given CWConfiguration object.

func NewConfigurationWithConfiguration added in v0.17.0

func NewConfigurationWithConfiguration(configuration *Configuration) *Configuration

NewConfigurationWithConfiguration creates and returns a CWConfiguration object initialized with the given CWConfiguration object.

func (*Configuration) Description added in v0.17.0

func (c *Configuration) Description() string

Description returns the object's -description text.

func (*Configuration) IsEqual added in v0.17.0

func (c *Configuration) IsEqual(other obj.Object) bool

IsEqual reports Objective-C equality (isEqual:) with another object.

func (*Configuration) IsEqualToConfiguration added in v0.17.0

func (c *Configuration) IsEqualToConfiguration(configuration *Configuration) bool

IsEqualToConfiguration determine CWConfiguration object equality.

func (*Configuration) IsKind added in v0.17.0

func (c *Configuration) IsKind(className string) bool

IsKind reports whether the object is an instance of the named class or a subclass.

func (*Configuration) NetworkProfiles added in v0.17.0

func (c *Configuration) NetworkProfiles() obj.Object

NetworkProfiles returns the preferred networks list. The order of the ordered set corresponds to the order the preferred networks list.

func (*Configuration) RememberJoinedNetworks added in v0.17.0

func (c *Configuration) RememberJoinedNetworks() bool

RememberJoinedNetworks reports whether returns the preference to remember all Wi-Fi networks joined unless otherwise specified by the user when joining a particular Wi-Fi network.

func (*Configuration) RequireAdministratorForAssociation added in v0.17.0

func (c *Configuration) RequireAdministratorForAssociation() bool

RequireAdministratorForAssociation reports whether returns the preference to require an administrator password to change networks. If true, the user may be prompted to enter an administrator password upon attempting to join a Wi-Fi network. This preference is enforced at the API layer.

func (*Configuration) RequireAdministratorForIBSSMode added in v0.17.0

func (c *Configuration) RequireAdministratorForIBSSMode() bool

RequireAdministratorForIBSSMode reports whether returns the preference to require an administrator password to create a computer-to-computer network. If true, the user may be prompted to enter an administrator password upon attempting to create an IBSS network. This preference is enforced at the API layer.

func (*Configuration) RequireAdministratorForPower added in v0.17.0

func (c *Configuration) RequireAdministratorForPower() bool

RequireAdministratorForPower reports whether returns the preference to require an administrator password to change the interface power state. If true, the user may be prompted to enter an administrator password upon attempting to turn Wi-Fi on or off. This preference is enforced at the API layer.

func (*Configuration) String added in v0.17.0

func (c *Configuration) String() string

String returns the object's -description text, so a wrapper prints usefully under fmt.

type ConfigurationProvider added in v0.17.0

type ConfigurationProvider interface {
	objref.Object
	// contains filtered or unexported methods
}

ConfigurationProvider is accepted wherever a CWConfiguration (or one of its subclasses) is expected.

type DispatchAutoreleaseFrequency added in v0.17.0

type DispatchAutoreleaseFrequency uint64
const (
	DispatchAutoreleaseFrequencyInherit  DispatchAutoreleaseFrequency = 0
	DispatchAutoreleaseFrequencyWorkItem DispatchAutoreleaseFrequency = 1
	DispatchAutoreleaseFrequencyNever    DispatchAutoreleaseFrequency = 2
)

func (DispatchAutoreleaseFrequency) String added in v0.17.0

String returns the DispatchAutoreleaseFrequency constant's name, or its numeric form when the value is not a known constant.

type DispatchBlockFlags added in v0.17.0

type DispatchBlockFlags uint64

Bitmask — values may be combined with |.

const (
	DispatchBlockFlagsBarrier         DispatchBlockFlags = 1
	DispatchBlockFlagsDetached        DispatchBlockFlags = 2
	DispatchBlockFlagsAssignCurrent   DispatchBlockFlags = 4
	DispatchBlockFlagsNoQosClass      DispatchBlockFlags = 8
	DispatchBlockFlagsInheritQosClass DispatchBlockFlags = 16
	DispatchBlockFlagsEnforceQosClass DispatchBlockFlags = 32
)

func (DispatchBlockFlags) String added in v0.17.0

func (e DispatchBlockFlags) String() string

String returns the DispatchBlockFlags constant's name, or its numeric form when the value is not a known constant.

type EntryID added in v0.17.0

type EntryID int32
const (
	EntryIDFirstEntry EntryID = 0
	EntryIDNextEntry  EntryID = -1
	EntryIDLastEntry  EntryID = -2
)

func (EntryID) String added in v0.17.0

func (e EntryID) String() string

String returns the EntryID constant's name, or its numeric form when the value is not a known constant.

type Err added in v0.17.0

type Err int64
const (
	KCWNoErr                                  Err = 0
	KCWEAPOLErr                               Err = 1
	KCWInvalidParameterErr                    Err = -3900
	KCWNoMemoryErr                            Err = -3901
	KCWUnknownErr                             Err = -3902
	KCWNotSupportedErr                        Err = -3903
	KCWInvalidFormatErr                       Err = -3904
	KCWTimeoutErr                             Err = -3905
	KCWUnspecifiedFailureErr                  Err = -3906
	KCWUnsupportedCapabilitiesErr             Err = -3907
	KCWReassociationDeniedErr                 Err = -3908
	KCWAssociationDeniedErr                   Err = -3909
	KCWAuthenticationAlgorithmUnsupportedErr  Err = -3910
	KCWInvalidAuthenticationSequenceNumberErr Err = -3911
	KCWChallengeFailureErr                    Err = -3912
	KCWAPFullErr                              Err = -3913
	KCWUnsupportedRateSetErr                  Err = -3914
	KCWShortSlotUnsupportedErr                Err = -3915
	KCWDSSSOFDMUnsupportedErr                 Err = -3916
	KCWInvalidInformationElementErr           Err = -3917
	KCWInvalidGroupCipherErr                  Err = -3918
	KCWInvalidPairwiseCipherErr               Err = -3919
	KCWInvalidAKMPErr                         Err = -3920
	KCWUnsupportedRSNVersionErr               Err = -3921
	KCWInvalidRSNCapabilitiesErr              Err = -3922
	KCWCipherSuiteRejectedErr                 Err = -3923
	KCWInvalidPMKErr                          Err = -3924
	KCWSupplicantTimeoutErr                   Err = -3925
	KCWHTFeaturesNotSupportedErr              Err = -3926
	KCWPCOTransitionTimeNotSupportedErr       Err = -3927
	KCWReferenceNotBoundErr                   Err = -3928
	KCWIPCFailureErr                          Err = -3929
	KCWOperationNotPermittedErr               Err = -3930
	KCWErr                                    Err = -3931
)

func (Err) String added in v0.17.0

func (e Err) String() string

String returns the Err constant's name, or its numeric form when the value is not a known constant.

type EventDelegate added in v0.17.0

type EventDelegate interface {
}

EventDelegate receives the callbacks of the Objective-C protocol CWEventDelegate. Pass an implementation to the matching With… setter; the wrapper builds the Objective-C delegate object for you. Every method listed here is required. The protocol's optional methods are separate one-method interfaces (EventDelegate…Handler): implement the ones you need on the same value and the framework will call them too.

type EventDelegateBssidDidChangeForWiFiInterfaceWithNameHandler added in v0.17.0

type EventDelegateBssidDidChangeForWiFiInterfaceWithNameHandler interface {
	BssidDidChangeForWiFiInterfaceWithName(interfaceName string)
}

EventDelegateBssidDidChangeForWiFiInterfaceWithNameHandler is the optional CWEventDelegate method bssidDidChangeForWiFiInterfaceWithName:. Implement it on a EventDelegate value to receive that callback; a value without it is simply never sent one.

type EventDelegateClientConnectionInterruptedHandler added in v0.17.0

type EventDelegateClientConnectionInterruptedHandler interface {
	ClientConnectionInterrupted()
}

EventDelegateClientConnectionInterruptedHandler is the optional CWEventDelegate method clientConnectionInterrupted. Implement it on a EventDelegate value to receive that callback; a value without it is simply never sent one.

type EventDelegateClientConnectionInvalidatedHandler added in v0.17.0

type EventDelegateClientConnectionInvalidatedHandler interface {
	ClientConnectionInvalidated()
}

EventDelegateClientConnectionInvalidatedHandler is the optional CWEventDelegate method clientConnectionInvalidated. Implement it on a EventDelegate value to receive that callback; a value without it is simply never sent one.

type EventDelegateCountryCodeDidChangeForWiFiInterfaceWithNameHandler added in v0.17.0

type EventDelegateCountryCodeDidChangeForWiFiInterfaceWithNameHandler interface {
	CountryCodeDidChangeForWiFiInterfaceWithName(interfaceName string)
}

EventDelegateCountryCodeDidChangeForWiFiInterfaceWithNameHandler is the optional CWEventDelegate method countryCodeDidChangeForWiFiInterfaceWithName:. Implement it on a EventDelegate value to receive that callback; a value without it is simply never sent one.

type EventDelegateLinkDidChangeForWiFiInterfaceWithNameHandler added in v0.17.0

type EventDelegateLinkDidChangeForWiFiInterfaceWithNameHandler interface {
	LinkDidChangeForWiFiInterfaceWithName(interfaceName string)
}

EventDelegateLinkDidChangeForWiFiInterfaceWithNameHandler is the optional CWEventDelegate method linkDidChangeForWiFiInterfaceWithName:. Implement it on a EventDelegate value to receive that callback; a value without it is simply never sent one.

type EventDelegateLinkQualityDidChangeForWiFiInterfaceWithNameRssiTransmitRateHandler added in v0.17.0

type EventDelegateLinkQualityDidChangeForWiFiInterfaceWithNameRssiTransmitRateHandler interface {
	LinkQualityDidChangeForWiFiInterfaceWithNameRssiTransmitRate(interfaceName string, rssi int, transmitRate float64)
}

EventDelegateLinkQualityDidChangeForWiFiInterfaceWithNameRssiTransmitRateHandler is the optional CWEventDelegate method linkQualityDidChangeForWiFiInterfaceWithName:rssi:transmitRate:. Implement it on a EventDelegate value to receive that callback; a value without it is simply never sent one.

type EventDelegateModeDidChangeForWiFiInterfaceWithNameHandler added in v0.17.0

type EventDelegateModeDidChangeForWiFiInterfaceWithNameHandler interface {
	ModeDidChangeForWiFiInterfaceWithName(interfaceName string)
}

EventDelegateModeDidChangeForWiFiInterfaceWithNameHandler is the optional CWEventDelegate method modeDidChangeForWiFiInterfaceWithName:. Implement it on a EventDelegate value to receive that callback; a value without it is simply never sent one.

type EventDelegatePowerStateDidChangeForWiFiInterfaceWithNameHandler added in v0.17.0

type EventDelegatePowerStateDidChangeForWiFiInterfaceWithNameHandler interface {
	PowerStateDidChangeForWiFiInterfaceWithName(interfaceName string)
}

EventDelegatePowerStateDidChangeForWiFiInterfaceWithNameHandler is the optional CWEventDelegate method powerStateDidChangeForWiFiInterfaceWithName:. Implement it on a EventDelegate value to receive that callback; a value without it is simply never sent one.

type EventDelegateScanCacheUpdatedForWiFiInterfaceWithNameHandler added in v0.17.0

type EventDelegateScanCacheUpdatedForWiFiInterfaceWithNameHandler interface {
	ScanCacheUpdatedForWiFiInterfaceWithName(interfaceName string)
}

EventDelegateScanCacheUpdatedForWiFiInterfaceWithNameHandler is the optional CWEventDelegate method scanCacheUpdatedForWiFiInterfaceWithName:. Implement it on a EventDelegate value to receive that callback; a value without it is simply never sent one.

type EventDelegateSsidDidChangeForWiFiInterfaceWithNameHandler added in v0.17.0

type EventDelegateSsidDidChangeForWiFiInterfaceWithNameHandler interface {
	SsidDidChangeForWiFiInterfaceWithName(interfaceName string)
}

EventDelegateSsidDidChangeForWiFiInterfaceWithNameHandler is the optional CWEventDelegate method ssidDidChangeForWiFiInterfaceWithName:. Implement it on a EventDelegate value to receive that callback; a value without it is simply never sent one.

type EventType added in v0.17.0

type EventType uint64

Wi-Fi event types.

const (
	// No specified event type.
	EventTypeNone EventType = 0
	// Posts when the power state of any Wi-Fi interface changes.
	EventTypePowerDidChange EventType = 1
	// Posts when the current SSID of any Wi-Fi interface changes.
	EventTypeSSIDDidChange EventType = 2
	// Posts when the current BSSID of any Wi-Fi interface changes.
	EventTypeBSSIDDidChange EventType = 3
	// Posts when the adopted country code of any Wi-Fi interface changes.
	EventTypeCountryCodeDidChange EventType = 4
	// Posts when the link state for any Wi-Fi interface changes.
	EventTypeLinkDidChange EventType = 5
	// Posts when the RSSI or transmit rate for any Wi-Fi interface changes.
	EventTypeLinkQualityDidChange EventType = 6
	// Posts when the operating mode of any Wi-Fi interface changes.
	EventTypeModeDidChange EventType = 7
	// Posts when the scan cache of any Wi-Fi interface is updated with new scan results.
	EventTypeScanCacheUpdated EventType = 8
	EventTypeBtCoexStats      EventType = 9
	// Unknown event type.
	EventTypeUnknown EventType = 9223372036854775807
)

func (EventType) String added in v0.17.0

func (e EventType) String() string

String returns the EventType constant's name, or its numeric form when the value is not a known constant.

type FilesecProperty added in v0.17.0

type FilesecProperty int32
const (
	FilesecPropertyOwner        FilesecProperty = 1
	FilesecPropertyGroup        FilesecProperty = 2
	FilesecPropertyUUID         FilesecProperty = 3
	FilesecPropertyMode         FilesecProperty = 4
	FilesecPropertyACL          FilesecProperty = 5
	FilesecPropertyGrpuuid      FilesecProperty = 6
	FilesecPropertyACLRaw       FilesecProperty = 100
	FilesecPropertyACLAllocsize FilesecProperty = 101
)

func (FilesecProperty) String added in v0.17.0

func (e FilesecProperty) String() string

String returns the FilesecProperty constant's name, or its numeric form when the value is not a known constant.

type Flag added in v0.17.0

type Flag int32
const (
	FlagFlagDeferInherit      Flag = 1
	FlagFlagNoInherit         Flag = 131072
	FlagEntryInherited        Flag = 16
	FlagEntryFileInherit      Flag = 32
	FlagEntryDirectoryInherit Flag = 64
	FlagEntryLimitInherit     Flag = 128
	FlagEntryOnlyInherit      Flag = 256
)

func (Flag) String added in v0.17.0

func (e Flag) String() string

String returns the Flag constant's name, or its numeric form when the value is not a known constant.

type IBSSModeSecurity added in v0.17.0

type IBSSModeSecurity int64

IBSS mode security types.

const (
	// Open System authentication.
	KCWIBSSModeSecurityNone IBSSModeSecurity = 0
	// WEP security.
	KCWIBSSModeSecurityWEP40 IBSSModeSecurity = 1
	// WPA Personal authentication.
	KCWIBSSModeSecurityWEP104 IBSSModeSecurity = 2
)

func (IBSSModeSecurity) String added in v0.17.0

func (e IBSSModeSecurity) String() string

String returns the IBSSModeSecurity constant's name, or its numeric form when the value is not a known constant.

type Idtype added in v0.17.0

type Idtype int32
const (
	IdtypeAll  Idtype = 0
	IdtypePid  Idtype = 1
	IdtypePgid Idtype = 2
)

func (Idtype) String added in v0.17.0

func (e Idtype) String() string

String returns the Idtype constant's name, or its numeric form when the value is not a known constant.

type Interface added in v0.17.0

type Interface struct {
	objref.Handle
}

Interface is an idiomatic wrapper over the Objective-C class CWInterface.

Encapsulates an IEEE 802.11 interface.

func CWInterfaceInterface

func CWInterfaceInterface() *Interface

CWInterfaceInterface returns convenience method for getting an CWInterface object for the default WLAN interface.

func InterfaceFromID added in v0.17.0

func InterfaceFromID(id objc.ID) *Interface

InterfaceFromID adopts an existing Objective-C object as a Interface (nil for 0), retaining it and registering a release finalizer.

func InterfaceWithName added in v0.17.0

func InterfaceWithName(name string) *Interface

InterfaceWithName an instance method for obtaining an CWInterface object.

func NewInterfaceWithInterfaceName added in v0.17.0

func NewInterfaceWithInterfaceName(name string) *Interface

NewInterfaceWithInterfaceName convenience method for getting an CWInterface object with the specified name.

func (*Interface) ActivePHYMode added in v0.17.0

func (i *Interface) ActivePHYMode() PHYMode

ActivePHYMode returns the current active PHY modes for the interface.

func (*Interface) AssociateToEnterpriseNetworkIdentityUsernamePassword added in v0.17.0

func (i *Interface) AssociateToEnterpriseNetworkIdentityUsernamePassword(network *Network, identity obj.Object, username string, password string) error

AssociateToEnterpriseNetworkIdentityUsernamePassword connects to the given enterprise network.

func (*Interface) AssociateToNetworkPassword added in v0.17.0

func (i *Interface) AssociateToNetworkPassword(network *Network, password string) error

AssociateToNetworkPassword associates to a given network using the given network passphrase.

func (*Interface) Bssid added in v0.17.0

func (i *Interface) Bssid() string

Bssid returns the current basic service set identifier (BSSID) for the interface, returned as a UTF-8 string.

func (*Interface) CachedScanResults added in v0.17.0

func (i *Interface) CachedScanResults() []*Network

CachedScanResults returns the networks currently in the scan cache for the WLAN interface. The order of the returned elements is unspecified.

func (*Interface) CommitConfigurationAuthorization added in v0.17.0

func (i *Interface) CommitConfigurationAuthorization(configuration *Configuration, authorization obj.Object) error

CommitConfigurationAuthorization commit a configuration for the given WLAN interface.

func (*Interface) Configuration added in v0.17.0

func (i *Interface) Configuration() *Configuration

Configuration returns the current configuration for the given WLAN interface.

func (*Interface) CountryCode added in v0.17.0

func (i *Interface) CountryCode() string

CountryCode returns the current country code (ISO/IEC 3166-1:1997) for the interface.

func (*Interface) Description added in v0.17.0

func (i *Interface) Description() string

Description returns the object's -description text.

func (*Interface) Disassociate added in v0.17.0

func (i *Interface) Disassociate()

Disassociate disassociates from the current network.

func (*Interface) HardwareAddress added in v0.17.0

func (i *Interface) HardwareAddress() string

HardwareAddress returns the hardware media access control (MAC) address for the interface, returned as a UTF-8 string.

func (*Interface) InterfaceMode added in v0.17.0

func (i *Interface) InterfaceMode() InterfaceMode

InterfaceMode returns the current mode for the interface.

func (*Interface) InterfaceName added in v0.17.0

func (i *Interface) InterfaceName() string

InterfaceName returns the BSD name of the Wi-Fi interface (e.g. "en0").

func (*Interface) IsEqual added in v0.17.0

func (i *Interface) IsEqual(other obj.Object) bool

IsEqual reports Objective-C equality (isEqual:) with another object.

func (*Interface) IsKind added in v0.17.0

func (i *Interface) IsKind(className string) bool

IsKind reports whether the object is an instance of the named class or a subclass.

func (*Interface) NoiseMeasurement added in v0.17.0

func (i *Interface) NoiseMeasurement() int

NoiseMeasurement returns the current aggregate noise measurement (dBm) for the interface.

func (*Interface) PowerOn added in v0.17.0

func (i *Interface) PowerOn() bool

PowerOn reports whether the interface power state is set to “ON”.

func (*Interface) RssiValue added in v0.17.0

func (i *Interface) RssiValue() int

RssiValue returns the current aggregate received signal strength indication (RSSI) measurement (dBm) for the interface.

func (*Interface) ScanForNetworksWithName added in v0.17.0

func (i *Interface) ScanForNetworksWithName(networkName string) (result []*Network, err error)

ScanForNetworksWithName scans for networks. The order of the returned elements is unspecified.

func (*Interface) ScanForNetworksWithNameIncludeHidden added in v0.17.0

func (i *Interface) ScanForNetworksWithNameIncludeHidden(networkName string, includeHidden bool) (result []*Network, err error)

ScanForNetworksWithNameIncludeHidden scans for networks with the name you specify, optionally including hidden networks. The order of the returned elements is unspecified.

func (*Interface) ScanForNetworksWithSSID added in v0.17.0

func (i *Interface) ScanForNetworksWithSSID(ssid []byte) (result []*Network, err error)

ScanForNetworksWithSSID scans for networks. The order of the returned elements is unspecified.

func (*Interface) ScanForNetworksWithSSIDIncludeHidden added in v0.17.0

func (i *Interface) ScanForNetworksWithSSIDIncludeHidden(ssid []byte, includeHidden bool) (result []*Network, err error)

ScanForNetworksWithSSIDIncludeHidden scans for networks with the SSID you specify, optionally including hidden networks. The order of the returned elements is unspecified.

func (*Interface) Security added in v0.17.0

func (i *Interface) Security() Security

Security returns the current security mode for the interface.

func (*Interface) ServiceActive added in v0.17.0

func (i *Interface) ServiceActive() bool

ServiceActive reports whether the interface has its corresponding network service enabled.

func (*Interface) SetPairwiseMasterKey added in v0.17.0

func (i *Interface) SetPairwiseMasterKey(key []byte) error

SetPairwiseMasterKey sets the interface pairwise primary key (PMK).

func (*Interface) SetPower added in v0.17.0

func (i *Interface) SetPower(power bool) error

SetPower sets the interface power state.

func (*Interface) SetWEPKeyFlagsIndex added in v0.17.0

func (i *Interface) SetWEPKeyFlagsIndex(key []byte, flags CipherKeyFlags, index int) error

SetWEPKeyFlagsIndex sets the interface WEP key.

func (*Interface) SetWLANChannel added in v0.17.0

func (i *Interface) SetWLANChannel(channel *Channel) error

SetWLANChannel sets the interface channel.

func (*Interface) Ssid added in v0.17.0

func (i *Interface) Ssid() string

Ssid returns the current service set identifier (SSID) for the interface, encoded as a string.

func (*Interface) SsidData added in v0.17.0

func (i *Interface) SsidData() []byte

SsidData returns the current service set identifier (SSID) for the interface, returned as data.

func (*Interface) StartIBSSModeWithSSIDSecurityChannelPassword added in v0.17.0

func (i *Interface) StartIBSSModeWithSSIDSecurityChannelPassword(ssidData []byte, security IBSSModeSecurity, channel int, password string) error

StartIBSSModeWithSSIDSecurityChannelPassword creates a computer-to-computer (ad-hoc) network with the given network name, security type, and password on the specified channel.

func (*Interface) String added in v0.17.0

func (i *Interface) String() string

String returns the object's -description text, so a wrapper prints usefully under fmt.

func (*Interface) SupportedWLANChannels added in v0.17.0

func (i *Interface) SupportedWLANChannels() []*Channel

SupportedWLANChannels returns an array of channels supported by the interface for the active country code. The order of the returned elements is unspecified.

func (*Interface) TransmitPower added in v0.17.0

func (i *Interface) TransmitPower() int

TransmitPower returns the current transmit power (mW) for the interface.

func (*Interface) TransmitRate added in v0.17.0

func (i *Interface) TransmitRate() float64

TransmitRate returns the current transmit rate (Mbps) for the interface.

func (*Interface) WlanChannel added in v0.17.0

func (i *Interface) WlanChannel() *Channel

WlanChannel returns the current channel for the interface.

type InterfaceMode added in v0.17.0

type InterfaceMode int64

Wi-Fi interface operating modes.

const (
	// Interface is not in any mode.
	KCWInterfaceModeNone InterfaceMode = 0
	// Interface is participating in an infrastructure network as a non-AP station.
	KCWInterfaceModeStation InterfaceMode = 1
	// Interface is participating in an IBSS network.
	KCWInterfaceModeIBSS InterfaceMode = 2
	// Interface is participating in an infrastructure network as an access point.
	KCWInterfaceModeHostAP InterfaceMode = 3
)

func (InterfaceMode) String added in v0.17.0

func (e InterfaceMode) String() string

String returns the InterfaceMode constant's name, or its numeric form when the value is not a known constant.

type IpcInfoObjectType added in v0.17.0

type IpcInfoObjectType uint32
const (
	IpcInfoObjectTypeNone               IpcInfoObjectType = 0
	IpcInfoObjectTypeThreadControl      IpcInfoObjectType = 1
	IpcInfoObjectTypeTaskControl        IpcInfoObjectType = 2
	IpcInfoObjectTypeHost               IpcInfoObjectType = 3
	IpcInfoObjectTypeHostPriv           IpcInfoObjectType = 4
	IpcInfoObjectTypeProcessor          IpcInfoObjectType = 5
	IpcInfoObjectTypeProcessorSet       IpcInfoObjectType = 6
	IpcInfoObjectTypeProcessorSetName   IpcInfoObjectType = 7
	IpcInfoObjectTypeTimer              IpcInfoObjectType = 8
	IpcInfoObjectTypePortSubstOnce      IpcInfoObjectType = 9
	IpcInfoObjectTypeMig                IpcInfoObjectType = 10
	IpcInfoObjectTypeMemoryObject       IpcInfoObjectType = 11
	IpcInfoObjectTypeXmmPager           IpcInfoObjectType = 12
	IpcInfoObjectTypeXmmKernel          IpcInfoObjectType = 13
	IpcInfoObjectTypeXmmReply           IpcInfoObjectType = 14
	IpcInfoObjectTypeUndReply           IpcInfoObjectType = 15
	IpcInfoObjectTypeHostNotify         IpcInfoObjectType = 16
	IpcInfoObjectTypeHostSecurity       IpcInfoObjectType = 17
	IpcInfoObjectTypeLedger             IpcInfoObjectType = 18
	IpcInfoObjectTypeMainDevice         IpcInfoObjectType = 19
	IpcInfoObjectTypeTaskName           IpcInfoObjectType = 20
	IpcInfoObjectTypeSubsystem          IpcInfoObjectType = 21
	IpcInfoObjectTypeIODoneQueue        IpcInfoObjectType = 22
	IpcInfoObjectTypeSemaphore          IpcInfoObjectType = 23
	IpcInfoObjectTypeLockSet            IpcInfoObjectType = 24
	IpcInfoObjectTypeClock              IpcInfoObjectType = 25
	IpcInfoObjectTypeClockCtrl          IpcInfoObjectType = 26
	IpcInfoObjectTypeIokitIdent         IpcInfoObjectType = 27
	IpcInfoObjectTypeNamedEntry         IpcInfoObjectType = 28
	IpcInfoObjectTypeIokitConnect       IpcInfoObjectType = 29
	IpcInfoObjectTypeIokitObject        IpcInfoObjectType = 30
	IpcInfoObjectTypeUpl                IpcInfoObjectType = 31
	IpcInfoObjectTypeMemObjControl      IpcInfoObjectType = 32
	IpcInfoObjectTypeAuSessionport      IpcInfoObjectType = 33
	IpcInfoObjectTypeFileport           IpcInfoObjectType = 34
	IpcInfoObjectTypeLabelh             IpcInfoObjectType = 35
	IpcInfoObjectTypeTaskResume         IpcInfoObjectType = 36
	IpcInfoObjectTypeVoucher            IpcInfoObjectType = 37
	IpcInfoObjectTypeVoucherAttrControl IpcInfoObjectType = 38
	IpcInfoObjectTypeWorkInterval       IpcInfoObjectType = 39
	IpcInfoObjectTypeUxHandler          IpcInfoObjectType = 40
	IpcInfoObjectTypeUextObject         IpcInfoObjectType = 41
	IpcInfoObjectTypeArcadeReg          IpcInfoObjectType = 42
	IpcInfoObjectTypeEventlink          IpcInfoObjectType = 43
	IpcInfoObjectTypeTaskInspect        IpcInfoObjectType = 44
	IpcInfoObjectTypeTaskRead           IpcInfoObjectType = 45
	IpcInfoObjectTypeThreadInspect      IpcInfoObjectType = 46
	IpcInfoObjectTypeThreadRead         IpcInfoObjectType = 47
	IpcInfoObjectTypeSuidCred           IpcInfoObjectType = 48
	IpcInfoObjectTypeHypervisor         IpcInfoObjectType = 49
	IpcInfoObjectTypeTaskIDToken        IpcInfoObjectType = 50
	IpcInfoObjectTypeTaskFatal          IpcInfoObjectType = 51
	IpcInfoObjectTypeKcdata             IpcInfoObjectType = 52
	IpcInfoObjectTypeExclavesResource   IpcInfoObjectType = 53
	IpcInfoObjectTypeThreadResume       IpcInfoObjectType = 54
	IpcInfoObjectTypeUnknown            IpcInfoObjectType = 4294967295
)

func (IpcInfoObjectType) String added in v0.17.0

func (e IpcInfoObjectType) String() string

String returns the IpcInfoObjectType constant's name, or its numeric form when the value is not a known constant.

type KeychainDomain added in v0.17.0

type KeychainDomain int64

Keychain domain types that CoreWLAN keychain methods use.

const (
	// No keychain domain specified.
	KCWKeychainDomainNone KeychainDomain = 0
	// The user keychain domain.
	KCWKeychainDomainUser KeychainDomain = 1
	// The system keychain domain.
	KCWKeychainDomainSystem KeychainDomain = 2
)

func (KeychainDomain) String added in v0.17.0

func (e KeychainDomain) String() string

String returns the KeychainDomain constant's name, or its numeric form when the value is not a known constant.

type LaunchDataType added in v0.17.0

type LaunchDataType int32
const (
	LaunchDataTypeDictionary LaunchDataType = 1
	LaunchDataTypeArray      LaunchDataType = 2
	LaunchDataTypeFd         LaunchDataType = 3
	LaunchDataTypeInteger    LaunchDataType = 4
	LaunchDataTypeReal       LaunchDataType = 5
	LaunchDataTypeBool       LaunchDataType = 6
	LaunchDataTypeString     LaunchDataType = 7
	LaunchDataTypeOpaque     LaunchDataType = 8
	LaunchDataTypeErrno      LaunchDataType = 9
	LaunchDataTypeMachport   LaunchDataType = 10
)

func (LaunchDataType) String added in v0.17.0

func (e LaunchDataType) String() string

String returns the LaunchDataType constant's name, or its numeric form when the value is not a known constant.

type MDLabelDomain

type MDLabelDomain int32

These constants are used to specify a domain to MDLabelCreate().

const (
	KMDLabelUserDomain  MDLabelDomain = 0
	KMDLabelLocalDomain MDLabelDomain = 1
)

func (MDLabelDomain) String

func (e MDLabelDomain) String() string

String returns the MDLabelDomain constant's name, or its numeric form when the value is not a known constant.

type MDQueryOptionFlags

type MDQueryOptionFlags int32
const (
	KMDQuerySynchronous        MDQueryOptionFlags = 1
	KMDQueryWantsUpdates       MDQueryOptionFlags = 4
	KMDQueryAllowFSTranslation MDQueryOptionFlags = 8
)

func (MDQueryOptionFlags) String

func (e MDQueryOptionFlags) String() string

String returns the MDQueryOptionFlags constant's name, or its numeric form when the value is not a known constant.

type MDQuerySortOptionFlags

type MDQuerySortOptionFlags int32
const (
	KMDQueryReverseSortOrderFlag MDQuerySortOptionFlags = 1
)

func (MDQuerySortOptionFlags) String

func (e MDQuerySortOptionFlags) String() string

String returns the MDQuerySortOptionFlags constant's name, or its numeric form when the value is not a known constant.

type MachVMRangeFlags added in v0.17.0

type MachVMRangeFlags uint64

Bitmask — values may be combined with |.

const (
	MachVMRangeFlagsNone MachVMRangeFlags = 0
)

func (MachVMRangeFlags) String added in v0.17.0

func (e MachVMRangeFlags) String() string

String returns the MachVMRangeFlags constant's name, or its numeric form when the value is not a known constant.

type MachVMRangeFlavor added in v0.17.0

type MachVMRangeFlavor uint32
const (
	MachVMRangeFlavorInvalid MachVMRangeFlavor = 0
	MachVMRangeFlavorV1      MachVMRangeFlavor = 1
)

func (MachVMRangeFlavor) String added in v0.17.0

func (e MachVMRangeFlavor) String() string

String returns the MachVMRangeFlavor constant's name, or its numeric form when the value is not a known constant.

type MachVMRangeTag added in v0.17.0

type MachVMRangeTag uint16
const (
	MachVMRangeTagDefault MachVMRangeTag = 0
	MachVMRangeTagData    MachVMRangeTag = 1
	MachVMRangeTagFixed   MachVMRangeTag = 2
)

func (MachVMRangeTag) String added in v0.17.0

func (e MachVMRangeTag) String() string

String returns the MachVMRangeTag constant's name, or its numeric form when the value is not a known constant.

type MpoFlags added in v0.17.0

type MpoFlags uint32

Bitmask — values may be combined with |.

const (
	MpoFlagsPort                        MpoFlags = 0
	MpoFlagsServicePort                 MpoFlags = 1024
	MpoFlagsConnectionPort              MpoFlags = 2048
	MpoFlagsReplyPort                   MpoFlags = 4096
	MpoFlagsWeakReplyPort               MpoFlags = 16384
	MpoFlagsNotificationPort            MpoFlags = 17408
	MpoFlagsExceptionPort               MpoFlags = 32768
	MpoFlagsConnectionPortWithPortArray MpoFlags = 65536
)

func (MpoFlags) String added in v0.17.0

func (e MpoFlags) String() string

String returns the MpoFlags constant's name, or its numeric form when the value is not a known constant.

type MutableConfiguration added in v0.17.0

type MutableConfiguration struct {
	Configuration
}

MutableConfiguration is an idiomatic wrapper over the Objective-C class CWMutableConfiguration.

It embeds Configuration, promoting that type's methods.

Encapsulates a mutable configuration for an AirPort WLAN interface.

func MutableConfigurationFromID added in v0.17.0

func MutableConfigurationFromID(id objc.ID) *MutableConfiguration

MutableConfigurationFromID adopts an existing Objective-C object as a MutableConfiguration (nil for 0), retaining it and registering a release finalizer.

func NewMutableConfiguration added in v0.17.0

func NewMutableConfiguration() *MutableConfiguration

NewMutableConfiguration creates a new MutableConfiguration.

func (*MutableConfiguration) WithNetworkProfiles added in v0.17.0

func (mc *MutableConfiguration) WithNetworkProfiles(networkProfiles obj.Object) *MutableConfiguration

WithNetworkProfiles sets the preferred networks list.

func (*MutableConfiguration) WithRememberJoinedNetworks added in v0.17.0

func (mc *MutableConfiguration) WithRememberJoinedNetworks(rememberJoinedNetworks bool) *MutableConfiguration

WithRememberJoinedNetworks sets a Boolean value that determines whether to remember all joined Wi-Fi networks unless the user specifies otherwise when joining a particular Wi-Fi network.

func (*MutableConfiguration) WithRequireAdministratorForAssociation added in v0.17.0

func (mc *MutableConfiguration) WithRequireAdministratorForAssociation(requireAdministratorForAssociation bool) *MutableConfiguration

WithRequireAdministratorForAssociation sets a Boolean value that determines whether to require an administrator password to change networks.

func (*MutableConfiguration) WithRequireAdministratorForIBSSMode added in v0.17.0

func (mc *MutableConfiguration) WithRequireAdministratorForIBSSMode(requireAdministratorForIBSSMode bool) *MutableConfiguration

WithRequireAdministratorForIBSSMode sets a Boolean value that determines whether to require an administrator password to create a computer-to-computer network.

func (*MutableConfiguration) WithRequireAdministratorForPower added in v0.17.0

func (mc *MutableConfiguration) WithRequireAdministratorForPower(requireAdministratorForPower bool) *MutableConfiguration

WithRequireAdministratorForPower sets a Boolean value that determines whether to require an administrator password to change the interface power state.

type MutableNetworkProfile added in v0.17.0

type MutableNetworkProfile struct {
	NetworkProfile
}

MutableNetworkProfile is an idiomatic wrapper over the Objective-C class CWMutableNetworkProfile.

It embeds NetworkProfile, promoting that type's methods.

Encapsulates a mutable network profile entry.

func MutableNetworkProfileFromID added in v0.17.0

func MutableNetworkProfileFromID(id objc.ID) *MutableNetworkProfile

MutableNetworkProfileFromID adopts an existing Objective-C object as a MutableNetworkProfile (nil for 0), retaining it and registering a release finalizer.

func NewMutableNetworkProfile added in v0.17.0

func NewMutableNetworkProfile() *MutableNetworkProfile

NewMutableNetworkProfile creates a new MutableNetworkProfile.

func (*MutableNetworkProfile) WithSecurity added in v0.17.0

func (mnp *MutableNetworkProfile) WithSecurity(security Security) *MutableNetworkProfile

WithSecurity sets the security type.

func (*MutableNetworkProfile) WithSsidData added in v0.17.0

func (mnp *MutableNetworkProfile) WithSsidData(ssidData []byte) *MutableNetworkProfile

WithSsidData sets the service set identifier (SSID).

type Network added in v0.17.0

type Network struct {
	objref.Handle
}

Network is an idiomatic wrapper over the Objective-C class CWNetwork.

Encapsulates an IEEE 802.11 network, providing read-only accessors to various properties of the network.

func CWMergeNetworks

func CWMergeNetworks(networks []*Network) []*Network

CWMergeNetworks calls the CoreWLAN framework function CWMergeNetworks.

func NetworkFromID added in v0.17.0

func NetworkFromID(id objc.ID) *Network

NetworkFromID adopts an existing Objective-C object as a Network (nil for 0), retaining it and registering a release finalizer.

func NewNetwork added in v0.17.0

func NewNetwork() *Network

NewNetwork creates a new Network.

func (*Network) BeaconInterval added in v0.17.0

func (n *Network) BeaconInterval() int

BeaconInterval returns the beacon interval (ms) for the Wi-Fi device.

func (*Network) Bssid added in v0.17.0

func (n *Network) Bssid() string

Bssid returns the basic service set identifier (BSSID) for the Wi-Fi network device, returned as UTF-8 string. Returns a UTF-8 string using hexadecimal characters formatted as XX:XX:XX:XX:XX:XX.

func (*Network) CountryCode added in v0.17.0

func (n *Network) CountryCode() string

CountryCode returns the advertised country code (ISO/IEC 3166-1:1997) for the Wi-Fi device.

func (*Network) Description added in v0.17.0

func (n *Network) Description() string

Description returns the object's -description text.

func (*Network) Ibss added in v0.17.0

func (n *Network) Ibss() bool

Ibss reports whether the Wi-Fi device is participating in an independent basic service set (IBSS), or ad-hoc Wi-Fi network.

func (*Network) InformationElementData added in v0.17.0

func (n *Network) InformationElementData() []byte

InformationElementData returns information element data included in beacon or probe response frames.

func (*Network) IsEqual added in v0.17.0

func (n *Network) IsEqual(other obj.Object) bool

IsEqual reports Objective-C equality (isEqual:) with another object.

func (*Network) IsEqualToNetwork added in v0.17.0

func (n *Network) IsEqualToNetwork(network *Network) bool

IsEqualToNetwork method for determining CWNetwork object equality.

func (*Network) IsKind added in v0.17.0

func (n *Network) IsKind(className string) bool

IsKind reports whether the object is an instance of the named class or a subclass.

func (*Network) NoiseMeasurement added in v0.17.0

func (n *Network) NoiseMeasurement() int

NoiseMeasurement returns the noise measurement (dBm) for the Wi-Fi device.

func (*Network) RssiValue added in v0.17.0

func (n *Network) RssiValue() int

RssiValue returns the received signal strength indication (RSSI) measurement (dBm) for the Wi-Fi device.

func (*Network) Ssid added in v0.17.0

func (n *Network) Ssid() string

Ssid returns the service set identifier (SSID) for the Wi-Fi network device, encoded as a string. Returns nil if the SSID can not be encoded as a valid UTF-8 or WinLatin1 string.

func (*Network) SsidData added in v0.17.0

func (n *Network) SsidData() []byte

SsidData returns the service set identifier (SSID) for the Wi-Fi network device, encapsulated in an NSData object. The SSID is defined as 1-32 octets.

func (*Network) String added in v0.17.0

func (n *Network) String() string

String returns the object's -description text, so a wrapper prints usefully under fmt.

func (*Network) SupportsPHYMode added in v0.17.0

func (n *Network) SupportsPHYMode(phyMode PHYMode) bool

SupportsPHYMode method for determining which PHY modes a network supports.

func (*Network) SupportsSecurity added in v0.17.0

func (n *Network) SupportsSecurity(security Security) bool

SupportsSecurity method for determining which security types a network supports.

func (*Network) WlanChannel added in v0.17.0

func (n *Network) WlanChannel() *Channel

WlanChannel returns the operating channel of the Wi-Fi device.

type NetworkProfile added in v0.17.0

type NetworkProfile struct {
	objref.Handle
}

NetworkProfile is an idiomatic wrapper over the Objective-C class CWNetworkProfile.

NetworkProfile is an abstract base — you do not construct it directly. Construct one of MutableNetworkProfile and pass it where a NetworkProfile is accepted.

Encapsulates an immutable network profile entry.

func CWNetworkProfileNetworkProfile

func CWNetworkProfileNetworkProfile() *NetworkProfile

CWNetworkProfileNetworkProfile returns convenience method for getting a CWNetworkProfile object.

func NetworkProfileFromID added in v0.17.0

func NetworkProfileFromID(id objc.ID) *NetworkProfile

NetworkProfileFromID adopts an existing Objective-C object as a NetworkProfile (nil for 0), retaining it and registering a release finalizer.

func NetworkProfileWithNetworkProfile added in v0.17.0

func NetworkProfileWithNetworkProfile(networkProfile *NetworkProfile) *NetworkProfile

NetworkProfileWithNetworkProfile convenience method for getting a CWNetworkProfile object initialized with the given CWNetworkProfile object.

func NewNetworkProfileWithNetworkProfile added in v0.17.0

func NewNetworkProfileWithNetworkProfile(networkProfile *NetworkProfile) *NetworkProfile

NewNetworkProfileWithNetworkProfile creates and returns a CWNetworkProfile object initialized with the given CWNetworkProfile object.

func (*NetworkProfile) Description added in v0.17.0

func (np *NetworkProfile) Description() string

Description returns the object's -description text.

func (*NetworkProfile) IsEqual added in v0.17.0

func (np *NetworkProfile) IsEqual(other obj.Object) bool

IsEqual reports Objective-C equality (isEqual:) with another object.

func (*NetworkProfile) IsEqualToNetworkProfile added in v0.17.0

func (np *NetworkProfile) IsEqualToNetworkProfile(networkProfile *NetworkProfile) bool

IsEqualToNetworkProfile determine CWNetworkProfile object equality.

func (*NetworkProfile) IsKind added in v0.17.0

func (np *NetworkProfile) IsKind(className string) bool

IsKind reports whether the object is an instance of the named class or a subclass.

func (*NetworkProfile) Security added in v0.17.0

func (np *NetworkProfile) Security() Security

Security returns the security type of the Wi-Fi network profile.

func (*NetworkProfile) Ssid added in v0.17.0

func (np *NetworkProfile) Ssid() string

Ssid returns the service set identifier (SSID) for the Wi-Fi network profile, encoded as a string. Returns nil if the SSID can not be encoded as a valid UTF-8 or WinLatin1 string.

func (*NetworkProfile) SsidData added in v0.17.0

func (np *NetworkProfile) SsidData() []byte

SsidData returns the service set identifier (SSID) for the Wi-Fi network profile, encapsulated in an NSData object. The SSID is 1-32 octets.

func (*NetworkProfile) String added in v0.17.0

func (np *NetworkProfile) String() string

String returns the object's -description text, so a wrapper prints usefully under fmt.

type NetworkProfileProvider added in v0.17.0

type NetworkProfileProvider interface {
	objref.Object
	// contains filtered or unexported methods
}

NetworkProfileProvider is accepted wherever a CWNetworkProfile (or one of its subclasses) is expected.

type OSClockid added in v0.17.0

type OSClockid uint32
const (
	OSClockidTime OSClockid = 32
)

func (OSClockid) String added in v0.17.0

func (e OSClockid) String() string

String returns the OSClockid constant's name, or its numeric form when the value is not a known constant.

type PHYMode added in v0.17.0

type PHYMode int64

CoreWLAN physical layer modes.

const (
	// No specified mode.
	KCWPHYModeNone PHYMode = 0
	// IEEE 802.11a PHY.
	KCWPHYMode11a PHYMode = 1
	// IEEE 802.11b PHY.
	KCWPHYMode11b PHYMode = 2
	// IEEE 802.11g PHY.
	KCWPHYMode11g PHYMode = 3
	// IEEE 802.11n PHY.
	KCWPHYMode11n PHYMode = 4
	// IEEE 802.11ac PHY.
	KCWPHYMode11ac PHYMode = 5
	KCWPHYMode11ax PHYMode = 6
	KCWPHYMode11be PHYMode = 7
)

func (PHYMode) String added in v0.17.0

func (e PHYMode) String() string

String returns the PHYMode constant's name, or its numeric form when the value is not a known constant.

type Perm added in v0.17.0

type Perm int32
const (
	PermReadData           Perm = 2
	PermListDirectory      Perm = 2
	PermWriteData          Perm = 4
	PermAddFile            Perm = 4
	PermExecute            Perm = 8
	PermSearch             Perm = 8
	PermDelete             Perm = 16
	PermAppendData         Perm = 32
	PermAddSubdirectory    Perm = 32
	PermDeleteChild        Perm = 64
	PermReadAttributes     Perm = 128
	PermWriteAttributes    Perm = 256
	PermReadExtattributes  Perm = 512
	PermWriteExtattributes Perm = 1024
	PermReadSecurity       Perm = 2048
	PermWriteSecurity      Perm = 4096
	PermChangeOwner        Perm = 8192
	PermSynchronize        Perm = 1048576
)

func (Perm) String added in v0.17.0

func (e Perm) String() string

String returns the Perm constant's name, or its numeric form when the value is not a known constant.

type PtrauthKey added in v0.17.0

type PtrauthKey int32
const (
	Ptrauth_key_none                     PtrauthKey = -1
	Ptrauth_key_asia                     PtrauthKey = 0
	Ptrauth_key_asib                     PtrauthKey = 1
	Ptrauth_key_asda                     PtrauthKey = 2
	Ptrauth_key_asdb                     PtrauthKey = 3
	Ptrauth_key_process_independent_code PtrauthKey = 0
	Ptrauth_key_process_dependent_code   PtrauthKey = 1
	Ptrauth_key_process_independent_data PtrauthKey = 2
	Ptrauth_key_process_dependent_data   PtrauthKey = 3
	Ptrauth_key_return_address           PtrauthKey = 1
	Ptrauth_key_frame_pointer            PtrauthKey = 3
	Ptrauth_key_function_pointer         PtrauthKey = 0
	Ptrauth_key_block_function           PtrauthKey = 0
	Ptrauth_key_cxx_vtable_pointer       PtrauthKey = 2
	Ptrauth_key_method_list_pointer      PtrauthKey = 2
	Ptrauth_key_objc_isa_pointer         PtrauthKey = 2
	Ptrauth_key_objc_super_pointer       PtrauthKey = 2
	Ptrauth_key_objc_sel_pointer         PtrauthKey = 3
	Ptrauth_key_objc_class_ro_pointer    PtrauthKey = 2
	Ptrauth_key_block_descriptor_pointer PtrauthKey = 2
	Ptrauth_key_init_fini_pointer        PtrauthKey = 0
)

func (PtrauthKey) String added in v0.17.0

func (e PtrauthKey) String() string

String returns the PtrauthKey constant's name, or its numeric form when the value is not a known constant.

type QosClass added in v0.17.0

type QosClass uint32
const (
	QosClassUserInteractive QosClass = 33
	QosClassUserInitiated   QosClass = 25
	QosClassDefault         QosClass = 21
	QosClassUtility         QosClass = 17
	QosClassBackground      QosClass = 9
	QosClassUnspecified     QosClass = 0
)

func (QosClass) String added in v0.17.0

func (e QosClass) String() string

String returns the QosClass constant's name, or its numeric form when the value is not a known constant.

type Security added in v0.17.0

type Security uint64

CoreWLAN security types.

const (
	// Open System authentication.
	KCWSecurityNone Security = 0
	// WEP security.
	KCWSecurityWEP Security = 1
	// WPA Personal authentication.
	KCWSecurityWPAPersonal Security = 2
	// WPA/WPA2 Personal authentication.
	KCWSecurityWPAPersonalMixed Security = 3
	// WPA2 Personal authentication.
	KCWSecurityWPA2Personal Security = 4
	// Personal authentication.
	KCWSecurityPersonal Security = 5
	// Dynamic WEP security.
	KCWSecurityDynamicWEP Security = 6
	// WPA Enterprise authentication.
	KCWSecurityWPAEnterprise Security = 7
	// WPA/WPA2 Enterprise authentication.
	KCWSecurityWPAEnterpriseMixed Security = 8
	// WPA2 Enterprise authentication.
	KCWSecurityWPA2Enterprise Security = 9
	// Enterprise authentication.
	KCWSecurityEnterprise Security = 10
	// WPA3 Personal authentication.
	KCWSecurityWPA3Personal Security = 11
	// WPA3 Enterprise authentication.
	KCWSecurityWPA3Enterprise Security = 12
	// WPA3 Transition (WPA3/WPA2 Personal) authentication.
	KCWSecurityWPA3Transition Security = 13
	KCWSecurityOWE            Security = 14
	KCWSecurityOWETransition  Security = 15
	// Unknown security type.
	KCWSecurityUnknown Security = 9223372036854775807
)

func (Security) String added in v0.17.0

func (e Security) String() string

String returns the Security constant's name, or its numeric form when the value is not a known constant.

type Tag added in v0.17.0

type Tag int32
const (
	TagUndefinedTag  Tag = 0
	TagExtendedAllow Tag = 1
	TagExtendedDeny  Tag = 2
)

func (Tag) String added in v0.17.0

func (e Tag) String() string

String returns the Tag constant's name, or its numeric form when the value is not a known constant.

type Type added in v0.17.0

type Type int32
const (
	TypeExtended Type = 256
	TypeAccess   Type = 0
	TypeDefault  Type = 1
	TypeAfs      Type = 2
	TypeCoda     Type = 3
	TypeNtfs     Type = 4
	TypeNwfs     Type = 5
)

func (Type) String added in v0.17.0

func (e Type) String() string

String returns the Type constant's name, or its numeric form when the value is not a known constant.

type VirtualMemoryGuardExceptionCode added in v0.17.0

type VirtualMemoryGuardExceptionCode uint32
const (
	KGUARD_EXC_DEALLOC_GAP                   VirtualMemoryGuardExceptionCode = 1
	KGUARD_EXC_RECLAIM_COPYIO_FAILURE        VirtualMemoryGuardExceptionCode = 2
	KGUARD_EXC_RECLAIM_INDEX_FAILURE         VirtualMemoryGuardExceptionCode = 4
	KGUARD_EXC_RECLAIM_DEALLOCATE_FAILURE    VirtualMemoryGuardExceptionCode = 8
	KGUARD_EXC_RECLAIM_ACCOUNTING_FAILURE    VirtualMemoryGuardExceptionCode = 9
	KGUARD_EXC_SEC_IOPL_ON_EXEC_PAGE         VirtualMemoryGuardExceptionCode = 10
	KGUARD_EXC_SEC_EXEC_ON_IOPL_PAGE         VirtualMemoryGuardExceptionCode = 11
	KGUARD_EXC_SEC_UPL_WRITE_ON_EXEC_REGION  VirtualMemoryGuardExceptionCode = 12
	KGUARD_EXC_LARGE_ALLOCATION_TELEMETRY    VirtualMemoryGuardExceptionCode = 13
	KGUARD_EXC_SEC_ACCESS_FAULT              VirtualMemoryGuardExceptionCode = 98
	KGUARD_EXC_SEC_ASYNC_ACCESS_FAULT        VirtualMemoryGuardExceptionCode = 99
	KGUARD_EXC_SEC_COPY_DENIED               VirtualMemoryGuardExceptionCode = 100
	KGUARD_EXC_SEC_SHARING_DENIED            VirtualMemoryGuardExceptionCode = 101
	KGUARD_EXC_MTE_SYNC_FAULT                VirtualMemoryGuardExceptionCode = 200
	KGUARD_EXC_MTE_ASYNC_USER_FAULT          VirtualMemoryGuardExceptionCode = 201
	KGUARD_EXC_MTE_ASYNC_KERN_FAULT          VirtualMemoryGuardExceptionCode = 202
	KGUARD_EXC_GUARD_OBJECT_ASYNC_USER_FAULT VirtualMemoryGuardExceptionCode = 203
	KGUARD_EXC_GUARD_OBJECT_ASYNC_KERN_FAULT VirtualMemoryGuardExceptionCode = 204
)

func (VirtualMemoryGuardExceptionCode) String added in v0.17.0

String returns the VirtualMemoryGuardExceptionCode constant's name, or its numeric form when the value is not a known constant.

type WiFiClient added in v0.17.0

type WiFiClient struct {
	objref.Handle
}

WiFiClient is an idiomatic wrapper over the Objective-C class CWWiFiClient.

A wrapper around the entire Wi-Fi subsystem that you use to access interfaces and set up event notifications.

func NewWiFiClient added in v0.17.0

func NewWiFiClient() *WiFiClient

NewWiFiClient creates a new WiFiClient.

func SharedWiFiClient added in v0.17.0

func SharedWiFiClient() *WiFiClient

SharedWiFiClient returns the shared Wi-Fi client object.

func WiFiClientFromID added in v0.17.0

func WiFiClientFromID(id objc.ID) *WiFiClient

WiFiClientFromID adopts an existing Objective-C object as a WiFiClient (nil for 0), retaining it and registering a release finalizer.

func (*WiFiClient) Delegate added in v0.17.0

func (wfc *WiFiClient) Delegate() obj.Object

Delegate sets the delegate to the specified object, which may implement CWWiFiEventDelegate protocol for Wi-Fi event handling. Clients may register for specific Wi-Fi events using -[CWWiFiClient startMonitoringEventWithType:error:].

func (*WiFiClient) Description added in v0.17.0

func (wfc *WiFiClient) Description() string

Description returns the object's -description text.

func (*WiFiClient) Interface added in v0.17.0

func (wfc *WiFiClient) Interface() *Interface

Interface returns the default Wi-Fi interface.

func (*WiFiClient) InterfaceNames added in v0.17.0

func (wfc *WiFiClient) InterfaceNames() []string

InterfaceNames returns the list of available Wi-Fi interface names (e.g. "en0"). If no Wi-Fi interfaces are available, this method will return an empty array. Returns nil if an error occurs.

InterfaceNames returns the collection as a Go slice.

func (*WiFiClient) InterfaceWithName added in v0.17.0

func (wfc *WiFiClient) InterfaceWithName(interfaceName string) *Interface

InterfaceWithName returns the Wi-Fi interface with the given name.

func (*WiFiClient) Interfaces added in v0.17.0

func (wfc *WiFiClient) Interfaces() []*Interface

Interfaces returns all available Wi-Fi interfaces.

Interfaces returns the collection as a Go slice.

func (*WiFiClient) IsEqual added in v0.17.0

func (wfc *WiFiClient) IsEqual(other obj.Object) bool

IsEqual reports Objective-C equality (isEqual:) with another object.

func (*WiFiClient) IsKind added in v0.17.0

func (wfc *WiFiClient) IsKind(className string) bool

IsKind reports whether the object is an instance of the named class or a subclass.

func (*WiFiClient) StartMonitoringEventWithType added in v0.17.0

func (wfc *WiFiClient) StartMonitoringEventWithType(type_ EventType) error

StartMonitoringEventWithType register for specific Wi-Fi event notifications.

func (*WiFiClient) StopMonitoringAllEventsAndReturnError added in v0.17.0

func (wfc *WiFiClient) StopMonitoringAllEventsAndReturnError() error

StopMonitoringAllEventsAndReturnError unregister for all Wi-Fi event notifications.

StopMonitoringAllEventsAndReturnError returns an error if the operation did not succeed.

func (*WiFiClient) StopMonitoringEventWithType added in v0.17.0

func (wfc *WiFiClient) StopMonitoringEventWithType(type_ EventType) error

StopMonitoringEventWithType unregister for specific Wi-Fi event notifications.

func (*WiFiClient) String added in v0.17.0

func (wfc *WiFiClient) String() string

String returns the object's -description text, so a wrapper prints usefully under fmt.

func (*WiFiClient) WithDelegate added in v0.17.0

func (wfc *WiFiClient) WithDelegate(delegate obj.Object) *WiFiClient

WithDelegate sets an object that provides Wi-Fi event handling.

type XpcListenerCreateFlags added in v0.17.0

type XpcListenerCreateFlags uint64

Bitmask — values may be combined with |.

const (
	XpcListenerCreateFlagsNone            XpcListenerCreateFlags = 0
	XpcListenerCreateFlagsInactive        XpcListenerCreateFlags = 1
	XpcListenerCreateFlagsForceMach       XpcListenerCreateFlags = 2
	XpcListenerCreateFlagsForceXpcservice XpcListenerCreateFlags = 4
)

func (XpcListenerCreateFlags) String added in v0.17.0

func (e XpcListenerCreateFlags) String() string

String returns the XpcListenerCreateFlags constant's name, or its numeric form when the value is not a known constant.

type XpcSessionCreateFlags added in v0.17.0

type XpcSessionCreateFlags uint64

Bitmask — values may be combined with |.

const (
	XpcSessionCreateFlagsNone           XpcSessionCreateFlags = 0
	XpcSessionCreateFlagsInactive       XpcSessionCreateFlags = 1
	XpcSessionCreateFlagsMachPrivileged XpcSessionCreateFlags = 2
)

func (XpcSessionCreateFlags) String added in v0.17.0

func (e XpcSessionCreateFlags) String() string

String returns the XpcSessionCreateFlags constant's name, or its numeric form when the value is not a known constant.

Jump to

Keyboard shortcuts

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