Versions in this module Expand all Collapse all v1 v1.0.2 Apr 13, 2023 Changes in this version + const CONN_MAX_LISTEN_BUFF + var ErrAssocRejected = errors.New("assocation rejected") + var ErrAuthFailed = errors.New("auth failed") + var ErrDisconnected = errors.New("disconnected") + var ErrInvalidEvent = errors.New("invalid event message") + var ErrNoIdentifier = errors.New("no id_str field found") + var ErrSSIDNotFound = errors.New("SSID not found") + func DecodeSsid(ssid string) (string, error) + func DefaultInterface() (string, bool) + func EncodeSsid(ssid string) string + func InterfacesFromSysfs() []string + func InterfacesFromWPARunDir(basePath ...string) []string type AP + Signal int + type APs []AP + func (nets APs) FindBySSID(ssid string) (AP, bool) + type AdvancedNetwork struct + AnonymousIdentity *string + AuthAlg *rawString + BSSID *rawString + BSSIDBlacklist *rawString + BSSIDWhitelist *rawString + CaCert *string + CaCert2 *string + ClientCert *string + ClientCert2 *string + Disabled *int + EAP *rawString + EapolFlags *int + Flags []string + Frequency *int + Group *rawString + ID int + IDStr *string + Identity *string + KeyMgmt *rawString + MACSecPolicy *int + Mode *int + PCSC *string + PSK *string + PacFile *string + Pairwise *rawString + Password *string + Phase1 *string + Phase2 *string + Pin *string + Priority *int + PrivateKey *string + PrivateKey2 *string + PrivateKeyPasswd *string + PrivateKeyPasswd2 *string + Proto *rawString + SSID *string + ScanSSID *int + WEPKey0 *string + WEPKey1 *string + WEPKey2 *string + WEPTxKeyidx *int + WpaPtkRekey *int type Client + func (cl *Client) Conn() *Conn + func (cl *Client) GetNetworkAttr(id int, attr string) (string, error) + func (cl *Client) Subscribe(topics ...string) *Subscription type Conn + func (c *Conn) WithLogOutput(w io.Writer) type Network + Known bool + func NewOpenNetwork(ssid string) Network + func (net Network) Attributes(sep, indent string) []string + func (net Network) IsCurrent() bool + type Networks []Network + func (nets Networks) FindByIDStr(idStr string) (Network, bool) + func (nets Networks) FindBySSID(ssid string) (Network, bool) + func (nets Networks) FindCurrent() (Network, bool) type Subscription + func (s *Subscription) Unsubscribe() + type WPAConn interface + SendCommand func(...string) (string, error) + SendCommandBool func(...string) error + SendCommandInt func(...string) (int, error) + Subscribe func(...string) *Subscription v1.0.0 Feb 28, 2020 Changes in this version + const AcsEventCompleted + const AcsEventFailed + const AcsEventStarted + const ApCsaFinished + const ApEventDisabled + const ApEventEnabled + const ApRejectedBlockedSta + const ApRejectedMaxSta + const ApStaConnected + const ApStaDisconnected + const ApStaPollOk + const ApStaPossiblePskMismatch + const BssMaskAll + const BssTmResp + const CmdAbortScan + const CmdAddCred + const CmdAddNetwork + const CmdAllSta + const CmdApScan + const CmdBlacklist + const CmdBss + const CmdBssExpireAge + const CmdBssExpireCount + const CmdBssFlush + const CmdBssid + const CmdChanSwitch + const CmdDeauthenticate + const CmdDisableNetwork + const CmdDisassociate + const CmdDisconnect + const CmdDriverFlags + const CmdDump + const CmdDupNetwork + const CmdEnableNetwork + const CmdErpFlush + const CmdFlush + const CmdFtDs + const CmdGet + const CmdGetCapability + const CmdGetCred + const CmdGetNetwork + const CmdGetPrefFreqList + const CmdHelp + const CmdIbssRsn + const CmdIdentity + const CmdIfname + const CmdInterface + const CmdInterfaceAdd + const CmdInterfaceList + const CmdInterfaceRemove + const CmdLevel + const CmdLicense + const CmdListCreds + const CmdListNetworks + const CmdLogLevel + const CmdLogoff + const CmdLogon + const CmdMacRandScan + const CmdMib + const CmdNeighborRepRequest + const CmdNewPassword + const CmdNote + const CmdOtp + const CmdP2pAspProvision + const CmdP2pAspProvisionResp + const CmdP2pCancel + const CmdP2pConnect + const CmdP2pExtListen + const CmdP2pFind + const CmdP2pFlush + const CmdP2pGetPassphrase + const CmdP2pGroupAdd + const CmdP2pGroupMember + const CmdP2pGroupRemove + const CmdP2pInvite + const CmdP2pListen + const CmdP2pLoStart + const CmdP2pLoStop + const CmdP2pPeer + const CmdP2pPeers + const CmdP2pPresenceReq + const CmdP2pProvDisc + const CmdP2pReject + const CmdP2pRemoveClient + const CmdP2pServDiscCancelReq + const CmdP2pServDiscExternal + const CmdP2pServDiscReq + const CmdP2pServDiscResp + const CmdP2pServiceAdd + const CmdP2pServiceDel + const CmdP2pServiceFlush + const CmdP2pServiceRep + const CmdP2pServiceUpdate + const CmdP2pSet + const CmdP2pStopFind + const CmdP2pUnauthorize + const CmdPassphrase + const CmdPassword + const CmdPin + const CmdPing + const CmdPktcntPoll + const CmdPmksa + const CmdPmksaFlush + const CmdPreauthenticate + const CmdQuit + const CmdRadioWork + const CmdRaw + const CmdReassociate + const CmdReattach + const CmdReauthenticate + const CmdReconfigure + const CmdReconnect + const CmdRelog + const CmdRemoveCred + const CmdRemoveNetwork + const CmdResume + const CmdRoam + const CmdSaveConfig + const CmdScan + const CmdScanInterval + const CmdScanResults + const CmdSelectNetwork + const CmdSet + const CmdSetCred + const CmdSetNetwork + const CmdSignalMonitor + const CmdSignalPoll + const CmdSim + const CmdSta + const CmdStaAutoconnect + const CmdStatus + const CmdStkstart + const CmdSuspend + const CmdTdlsCancelChanSwitch + const CmdTdlsChanSwitch + const CmdTdlsDiscover + const CmdTdlsLinkStatus + const CmdTdlsSetup + const CmdTdlsTeardown + const CmdTerminate + const CmdVendor + const CmdVendorElemAdd + const CmdVendorElemGet + const CmdVendorElemRemove + const CmdWmmAcAddts + const CmdWmmAcDelts + const CmdWmmAcStatus + const CmdWpsApPin + const CmdWpsCheckPin + const CmdWpsErConfig + const CmdWpsErLearn + const CmdWpsErPbc + const CmdWpsErPin + const CmdWpsErSetConfig + const CmdWpsErStart + const CmdWpsErStop + const CmdWpsPbc + const CmdWpsPin + const CmdWpsReg + const CredAdded + const CredModified + const CredRemoved + const CtrlIfacePort + const CtrlIfacePortLimit + const CtrlReq + const CtrlRsp + const DfsEventCacCompleted + const DfsEventCacStart + const DfsEventNewChannel + const DfsEventNopFinished + const DfsEventPreCacExpired + const DfsEventRadarDetected + const DppEventAuthSuccess + const DppEventCSignKey + const DppEventConfFailed + const DppEventConfReceived + const DppEventConfSent + const DppEventConfobjPass + const DppEventConfobjPsk + const DppEventConfobjSsid + const DppEventConnector + const DppEventFail + const DppEventMissingConnector + const DppEventNetAccessKey + const DppEventNetworkID + const DppEventNotCompatible + const DppEventResponsePending + const DppEventRx + const DppEventScanPeerQrCode + const DppEventTx + const DppEventTxStatus + const EssDisassocImminent + const EventAssocReject + const EventAuthReject + const EventAvoidFreq + const EventBeaconLoss + const EventBssAdded + const EventBssRemoved + const EventChannelSwitch + const EventConnected + const EventDisconnected + const EventEapFailure + const EventEapFailure2 + const EventEapMethod + const EventEapNotification + const EventEapPeerAlt + const EventEapPeerCert + const EventEapProposedMethod + const EventEapRetransmit + const EventEapRetransmit2 + const EventEapStarted + const EventEapStatus + const EventEapSuccess + const EventEapSuccess2 + const EventEapTLSCertError + const EventEapTimeoutFailure + const EventEapTimeoutFailure2 + const EventFreqConflict + const EventNetworkNotFound + const EventPasswordChanged + const EventReenabled + const EventRegdomChange + const EventScanFailed + const EventScanResults + const EventScanStarted + const EventSignalChange + const EventStateChange + const EventSubnetStatusUpdate + const EventTempDisabled + const EventTerminating + const FilsHlpRx + const GasQueryDone + const GasQueryStart + const GasResponseInfo + const GlobalCtrlIfacePort + const GlobalCtrlIfacePortLimit + const Hs20DeauthImminentNotice + const Hs20SubscriptionRemediation + const IbssRsnCompleted + const InterfaceDisabled + const InterfaceEnabled + const InterworkingAlreadyConnected + const InterworkingAp + const InterworkingBlacklisted + const InterworkingNoMatch + const InterworkingSelected + const MboCellPreference + const MboTransitionReason + const MeshGroupRemoved + const MeshGroupStarted + const MeshPeerConnected + const MeshPeerDisconnected + const MeshSaeAuthBlocked + const MeshSaeAuthFailure + const P2pEventCrossConnectDisable + const P2pEventCrossConnectEnable + const P2pEventDeviceFound + const P2pEventDeviceLost + const P2pEventFallbackToGoNeg + const P2pEventFallbackToGoNegEnabled + const P2pEventFindStopped + const P2pEventGoNegFailure + const P2pEventGoNegRequest + const P2pEventGoNegSuccess + const P2pEventGroupFormationFailure + const P2pEventGroupFormationSuccess + const P2pEventGroupRemoved + const P2pEventGroupStarted + const P2pEventInvitationAccepted + const P2pEventInvitationReceived + const P2pEventInvitationResult + const P2pEventListenOffloadStop + const P2pEventNfcBothGo + const P2pEventNfcPeerClient + const P2pEventNfcWhileClient + const P2pEventP2psProvisionDone + const P2pEventP2psProvisionStart + const P2pEventPersistentPskFail + const P2pEventPresenceResponse + const P2pEventProvDiscEnterPin + const P2pEventProvDiscFailure + const P2pEventProvDiscPbcReq + const P2pEventProvDiscPbcResp + const P2pEventProvDiscShowPin + const P2pEventRemoveAndReformGroup + const P2pEventServAspResp + const P2pEventServDiscReq + const P2pEventServDiscResp + const P2pListenOffloadStopReason + const PmksaCacheAdded + const PmksaCacheRemoved + const RrmEventNeighborRepFailed + const RrmEventNeighborRepRxed + const RxAnqp + const RxHs20Anqp + const RxHs20AnqpIcon + const RxHs20Icon + const RxMboAnqp + const WpsEventActive + const WpsEventApAvailable + const WpsEventApAvailableAuth + const WpsEventApAvailablePbc + const WpsEventApAvailablePin + const WpsEventApPinDisabled + const WpsEventApPinEnabled + const WpsEventApSetupLocked + const WpsEventApSetupUnlocked + const WpsEventCredReceived + const WpsEventDisable + const WpsEventEnrolleeSeen + const WpsEventErApAdd + const WpsEventErApRemove + const WpsEventErApSettings + const WpsEventErEnrolleeAdd + const WpsEventErEnrolleeRemove + const WpsEventErSetSelReg + const WpsEventFail + const WpsEventM2d + const WpsEventNewApSettings + const WpsEventOpenNetwork + const WpsEventOverlap + const WpsEventPinNeeded + const WpsEventRegSuccess + const WpsEventSuccess + const WpsEventTimeout + var ErrCmdTimeout = errors.New("timeout while waiting for command response") + var ErrScanFailed = errors.New("scan failed") + var Interfaces = SysFSInterfaces + func IsUseOfClosedNetworkConnectionError(err error) bool + func SysFSInterfaces() []string + type AP struct + BSSID net.HardwareAddr + ESSID string + Flags []string + Freq int + Frequency int + ID int + RSSI int + SSID string + SignalStrength int + type Client struct + func NewClient(iface string) (c *Client, err error) + func NewClientFromConn(conn *Conn) (c *Client) + func (cl *Client) AddNetwork(net Network) (Network, error) + func (cl *Client) AddOrUpdateNetwork(net Network) (Network, error) + func (cl *Client) Close() + func (cl *Client) Connect(net Network) (Network, error) + func (cl *Client) DisableNetwork(id int) error + func (cl *Client) EnableNetwork(id int) error + func (cl *Client) LoadConfig() error + func (cl *Client) Networks() (nets []Network, err error) + func (cl *Client) RemoveNetwork(id int) error + func (cl *Client) SaveConfig() error + func (cl *Client) Scan() (nets []AP, err error) + func (cl *Client) Status() (State, error) + func (cl *Client) UpdateNetwork(net Network) (Network, error) + type Conn struct + Interface string + func Dial(iface string) (*Conn, error) + func (c *Conn) Close() + func (c *Conn) SendCommand(command ...string) (string, error) + func (c *Conn) SendCommandBool(command ...string) error + func (c *Conn) SendCommandInt(command ...string) (int, error) + func (c *Conn) SendCommandWithContext(ctx context.Context, command ...string) (string, error) + func (c *Conn) Subscribe(eventNames ...string) Subscription + type Connectable interface + SetCmds func() []string + type Connector interface + Connect func(Network) error + type Event struct + Arguments map[string]string + Name string + func NewEventFromMsg(msg string) (Event, error) + type Network struct + BSSID string + Flags []string + ID int + IDStr string + KeyMgmt string + PSK string + SSID string + ScanSSID bool + func NewDisabledNetwork(ssid, psk string) Network + func NewNamedNetwork(name, ssid, psk string) Network + func NewNetwork(ssid, psk string) Network + func (net Network) Connect(cl Connector) error + func (net Network) Disable(on bool) + func (net Network) IsDisabled() bool + func (net Network) SetCmds() [][]string + type State struct + Address string + BSSID string + GroupCipher string + ID string + IPAddress string + KeyManagement string + Mode string + PairwiseCipher string + SSID string + UUID string + WpaState string + func NewState(data string) State + type Subscription struct + func (s *Subscription) Next() chan Event v0 v0.0.0 Sep 25, 2014