]> git.ipfire.org Git - thirdparty/hostap.git/blame - doc/ctrl_iface.doxygen
Add attribute for dwell time in QCA vendor scan
[thirdparty/hostap.git] / doc / ctrl_iface.doxygen
CommitLineData
30c28971 1/**
5eb513c3 2\page ctrl_iface_page wpa_supplicant control interface
30c28971 3
5eb513c3
JM
4wpa_supplicant implements a control interface that can be used by
5external programs to control the operations of the wpa_supplicant
30c28971 6daemon and to get status information and event notifications. There is
5eb513c3 7a small C library, in a form of a single C file, \ref wpa_ctrl.c, that
30c28971
JM
8provides helper functions to facilitate the use of the control
9interface. External programs can link this file into them and then use
5eb513c3
JM
10the library functions documented in \ref wpa_ctrl.h to interact with
11wpa_supplicant. This library can also be used with C++. \ref wpa_cli.c and
30c28971
JM
12wpa_gui are example programs using this library.
13
14There are multiple mechanisms for inter-process communication. For
5eb513c3 15example, Linux version of wpa_supplicant is using UNIX domain sockets
30c28971 16for the control interface and Windows version UDP sockets. The use of
5eb513c3 17the functions defined in \ref wpa_ctrl.h can be used to hide the details of
30c28971
JM
18the used IPC from external programs.
19
20
21\section using_ctrl_iface Using the control interface
22
23External programs, e.g., a GUI or a configuration utility, that need to
5eb513c3 24communicate with wpa_supplicant should link in \ref wpa_ctrl.c. This
30c28971 25allows them to use helper functions to open connection to the control
5eb513c3
JM
26interface with \ref wpa_ctrl_open() and to send commands with
27\ref wpa_ctrl_request().
30c28971 28
5eb513c3 29wpa_supplicant uses the control interface for two types of communication:
30c28971
JM
30commands and unsolicited event messages. Commands are a pair of
31messages, a request from the external program and a response from
5eb513c3
JM
32wpa_supplicant. These can be executed using \ref wpa_ctrl_request().
33Unsolicited event messages are sent by wpa_supplicant to the control
30c28971
JM
34interface connection without specific request from the external program
35for receiving each message. However, the external program needs to
5eb513c3 36attach to the control interface with \ref wpa_ctrl_attach() to receive these
30c28971
JM
37unsolicited messages.
38
39If the control interface connection is used both for commands and
40unsolicited event messages, there is potential for receiving an
41unsolicited message between the command request and response.
5eb513c3 42\ref wpa_ctrl_request() caller will need to supply a callback, msg_cb,
30c28971 43for processing these messages. Often it is easier to open two
5eb513c3 44control interface connections by calling \ref wpa_ctrl_open() twice and
30c28971
JM
45then use one of the connections for commands and the other one for
46unsolicited messages. This way command request/response pairs will
47not be broken by unsolicited messages. wpa_cli is an example of how
48to use only one connection for both purposes and wpa_gui demonstrates
49how to use two separate connections.
50
51Once the control interface connection is not needed anymore, it should
5eb513c3 52be closed by calling \ref wpa_ctrl_close(). If the connection was used for
30c28971 53unsolicited event messages, it should be first detached by calling
5eb513c3 54\ref wpa_ctrl_detach().
30c28971
JM
55
56
57\section ctrl_iface_cmds Control interface commands
58
5eb513c3 59Following commands can be used with \ref wpa_ctrl_request():
30c28971
JM
60
61\subsection ctrl_iface_PING PING
62
5eb513c3 63This command can be used to test whether wpa_supplicant is replying
30c28971 64to the control interface commands. The expected reply is \c PONG if the
5eb513c3 65connection is open and wpa_supplicant is processing commands.
30c28971
JM
66
67
68\subsection ctrl_iface_MIB MIB
69
70Request a list of MIB variables (dot1x, dot11). The output is a text
71block with each line in \c variable=value format. For example:
72
73\verbatim
74dot11RSNAOptionImplemented=TRUE
75dot11RSNAPreauthenticationImplemented=TRUE
76dot11RSNAEnabled=FALSE
77dot11RSNAPreauthenticationEnabled=FALSE
78dot11RSNAConfigVersion=1
79dot11RSNAConfigPairwiseKeysSupported=5
80dot11RSNAConfigGroupCipherSize=128
81dot11RSNAConfigPMKLifetime=43200
82dot11RSNAConfigPMKReauthThreshold=70
83dot11RSNAConfigNumberOfPTKSAReplayCounters=1
84dot11RSNAConfigSATimeout=60
85dot11RSNAAuthenticationSuiteSelected=00-50-f2-2
86dot11RSNAPairwiseCipherSelected=00-50-f2-4
87dot11RSNAGroupCipherSelected=00-50-f2-4
88dot11RSNAPMKIDUsed=
89dot11RSNAAuthenticationSuiteRequested=00-50-f2-2
90dot11RSNAPairwiseCipherRequested=00-50-f2-4
91dot11RSNAGroupCipherRequested=00-50-f2-4
92dot11RSNAConfigNumberOfGTKSAReplayCounters=0
93dot11RSNA4WayHandshakeFailures=0
94dot1xSuppPaeState=5
95dot1xSuppHeldPeriod=60
96dot1xSuppAuthPeriod=30
97dot1xSuppStartPeriod=30
98dot1xSuppMaxStart=3
99dot1xSuppSuppControlledPortStatus=Authorized
100dot1xSuppBackendPaeState=2
101dot1xSuppEapolFramesRx=0
102dot1xSuppEapolFramesTx=440
103dot1xSuppEapolStartFramesTx=2
104dot1xSuppEapolLogoffFramesTx=0
105dot1xSuppEapolRespFramesTx=0
106dot1xSuppEapolReqIdFramesRx=0
107dot1xSuppEapolReqFramesRx=0
108dot1xSuppInvalidEapolFramesRx=0
109dot1xSuppEapLengthErrorFramesRx=0
110dot1xSuppLastEapolFrameVersion=0
111dot1xSuppLastEapolFrameSource=00:00:00:00:00:00
112\endverbatim
113
114
115\subsection ctrl_iface_STATUS STATUS
116
117Request current WPA/EAPOL/EAP status information. The output is a text
118block with each line in \c variable=value format. For example:
119
120\verbatim
121bssid=02:00:01:02:03:04
122ssid=test network
123pairwise_cipher=CCMP
124group_cipher=CCMP
125key_mgmt=WPA-PSK
126wpa_state=COMPLETED
127ip_address=192.168.1.21
128Supplicant PAE state=AUTHENTICATED
129suppPortStatus=Authorized
130EAP state=SUCCESS
131\endverbatim
132
133
134\subsection ctrl_iface_STATUS-VERBOSE STATUS-VERBOSE
135
136Same as STATUS, but with more verbosity (i.e., more \c variable=value pairs).
137
138\verbatim
139bssid=02:00:01:02:03:04
140ssid=test network
141id=0
142pairwise_cipher=CCMP
143group_cipher=CCMP
144key_mgmt=WPA-PSK
145wpa_state=COMPLETED
146ip_address=192.168.1.21
147Supplicant PAE state=AUTHENTICATED
148suppPortStatus=Authorized
149heldPeriod=60
150authPeriod=30
151startPeriod=30
152maxStart=3
153portControl=Auto
154Supplicant Backend state=IDLE
155EAP state=SUCCESS
156reqMethod=0
157methodState=NONE
158decision=COND_SUCC
159ClientTimeout=60
160\endverbatim
161
162
163\subsection ctrl_iface_PMKSA PMKSA
164
165Show PMKSA cache
166
167\verbatim
168Index / AA / PMKID / expiration (in seconds) / opportunistic
1691 / 02:00:01:02:03:04 / 000102030405060708090a0b0c0d0e0f / 41362 / 0
1702 / 02:00:01:33:55:77 / 928389281928383b34afb34ba4212345 / 362 / 1
171\endverbatim
172
173
174\subsection ctrl_iface_SET SET <variable> <value>
175
176Set variables:
177- EAPOL::heldPeriod
178- EAPOL::authPeriod
179- EAPOL::startPeriod
180- EAPOL::maxStart
181- dot11RSNAConfigPMKLifetime
182- dot11RSNAConfigPMKReauthThreshold
183- dot11RSNAConfigSATimeout
184
185Example command:
186\verbatim
187SET EAPOL::heldPeriod 45
188\endverbatim
189
190
191\subsection ctrl_iface_LOGON LOGON
192
193IEEE 802.1X EAPOL state machine logon.
194
195
196\subsection ctrl_iface_LOGOFF LOGOFF
197
198IEEE 802.1X EAPOL state machine logoff.
199
200
201\subsection ctrl_iface_REASSOCIATE REASSOCIATE
202
203Force reassociation.
204
205
206\subsection ctrl_iface_RECONNECT RECONNECT
207
208Connect if disconnected (i.e., like \c REASSOCIATE, but only connect
209if in disconnected state).
210
211
212\subsection ctrl_iface_PREAUTH PREAUTH <BSSID>
213
214Start pre-authentication with the given BSSID.
215
216
217\subsection ctrl_iface_ATTACH ATTACH
218
219Attach the connection as a monitor for unsolicited events. This can
5eb513c3 220be done with \ref wpa_ctrl_attach().
30c28971
JM
221
222
223\subsection ctrl_iface_DETACH DETACH
224
225Detach the connection as a monitor for unsolicited events. This can
5eb513c3 226be done with \ref wpa_ctrl_detach().
30c28971
JM
227
228
229\subsection ctrl_iface_LEVEL LEVEL <debug level>
230
231Change debug level.
232
233
234\subsection ctrl_iface_RECONFIGURE RECONFIGURE
235
5eb513c3 236Force wpa_supplicant to re-read its configuration data.
30c28971
JM
237
238
239\subsection ctrl_iface_TERMINATE TERMINATE
240
5eb513c3 241Terminate wpa_supplicant process.
30c28971
JM
242
243
244\subsection ctrl_iface_BSSID BSSID <network id> <BSSID>
245
246Set preferred BSSID for a network. Network id can be received from the
247\c LIST_NETWORKS command output.
248
249
250\subsection ctrl_iface_LIST_NETWORKS LIST_NETWORKS
251
252List configured networks.
253
254\verbatim
255network id / ssid / bssid / flags
2560 example network any [CURRENT]
257\endverbatim
258
259(note: fields are separated with tabs)
260
261
262\subsection ctrl_iface_DISCONNECT DISCONNECT
263
264Disconnect and wait for \c REASSOCIATE or \c RECONNECT command before
265connecting.
266
267
268\subsection ctrl_iface_SCAN SCAN
269
270Request a new BSS scan.
271
272
273\subsection ctrl_iface_SCAN_RESULTS SCAN_RESULTS
274
275Get the latest scan results.
276
277\verbatim
278bssid / frequency / signal level / flags / ssid
27900:09:5b:95:e0:4e 2412 208 [WPA-PSK-CCMP] jkm private
28002:55:24:33:77:a3 2462 187 [WPA-PSK-TKIP] testing
28100:09:5b:95:e0:4f 2412 209 jkm guest
282\endverbatim
283
284(note: fields are separated with tabs)
285
286
287\subsection ctrl_iface_BSS BSS
288
289Get detailed per-BSS scan results. \c BSS command can be used to
290iterate through scan results one BSS at a time and to fetch all
291information from the found BSSes. This provides access to the same
292data that is available through \c SCAN_RESULTS but in a way that
293avoids problems with large number of scan results not fitting in the
294ctrl_iface messages.
295
296There are two options for selecting the BSS with the \c BSS command:
297"BSS <idx>" requests information for the BSS identified by the index
298(0 .. size-1) in the scan results table and "BSS <BSSID>" requests
299information for the given BSS (based on BSSID in 00:01:02:03:04:05
300format).
301
302BSS information is presented in following format. Please note that new
303fields may be added to this field=value data, so the ctrl_iface user
304should be prepared to ignore values it does not understand.
305
306\verbatim
307bssid=00:09:5b:95:e0:4e
308freq=2412
309beacon_int=0
310capabilities=0x0011
311qual=51
312noise=161
313level=212
314tsf=0000000000000000
315ie=000b6a6b6d2070726976617465010180dd180050f20101000050f20401000050f20401000050f2020000
316ssid=jkm private
317\endverbatim
318
319
320
321\subsection ctrl_iface_SELECT_NETWORK SELECT_NETWORK <network id>
322
323Select a network (disable others). Network id can be received from the
324\c LIST_NETWORKS command output.
325
326
327\subsection ctrl_iface_ENABLE_NETWORK ENABLE_NETWORK <network id>
328
329Enable a network. Network id can be received from the
330\c LIST_NETWORKS command output. Special network id \c all can be
331used to enable all network.
332
333
334\subsection ctrl_iface_DISABLE_NETWORK DISABLE_NETWORK <network id>
335
336Disable a network. Network id can be received from the
337\c LIST_NETWORKS command output. Special network id \c all can be
338used to disable all network.
339
340
341\subsection ctrl_iface_ADD_NETWORK ADD_NETWORK
342
343Add a new network. This command creates a new network with empty
344configuration. The new network is disabled and once it has been
345configured it can be enabled with \c ENABLE_NETWORK command. \c ADD_NETWORK
346returns the network id of the new network or FAIL on failure.
347
348
349\subsection ctrl_iface_REMOVE_NETWORK REMOVE_NETWORK <network id>
350
351Remove a network. Network id can be received from the
352\c LIST_NETWORKS command output. Special network id \c all can be
353used to remove all network.
354
355
356\subsection ctrl_iface_SET_NETWORK SET_NETWORK <network id> <variable> <value>
357
358Set network variables. Network id can be received from the
359\c LIST_NETWORKS command output.
360
361This command uses the same variables and data formats as the
362configuration file. See example wpa_supplicant.conf for more details.
363
364- ssid (network name, SSID)
365- psk (WPA passphrase or pre-shared key)
366- key_mgmt (key management protocol)
367- identity (EAP identity)
368- password (EAP password)
369- ...
370
371
372\subsection ctrl_iface_GET_NETWORK GET_NETWORK <network id> <variable>
373
374Get network variables. Network id can be received from the
375\c LIST_NETWORKS command output.
376
377
378\subsection ctrl_iface_SAVE_CONFIG SAVE_CONFIG
379
380Save the current configuration.
381
382
4f338bea
JM
383\subsection ctrl_iface_P2P_FIND P2P_FIND
384
385Start P2P device discovery. Optional parameter can be used to specify
386the duration for the discovery in seconds (e.g., "P2P_FIND 5"). If the
387duration is not specified, discovery will be started for indefinite
388time, i.e., until it is terminated by P2P_STOP_FIND or P2P_CONNECT (to
389start group formation with a discovered peer).
390
391The default search type is to first run a full scan of all channels
392and then continue scanning only social channels (1, 6, 11). This
393behavior can be changed by specifying a different search type: social
394(e.g., "P2P_FIND 5 type=social") will skip the initial full scan and
395only search social channels; progressive (e.g., "P2P_FIND
396type=progressive") starts with a full scan and then searches
397progressively through all channels one channel at the time with the
398social channel scans. Progressive device discovery can be used to find
399new groups (and groups that were not found during the initial scan,
400e.g., due to the GO being asleep) over time without adding
401considerable extra delay for every Search state round.
402
403
404\subsection ctrl_iface_P2P_STOP_FIND P2P_STOP_FIND
405
406Stop ongoing P2P device discovery or other operation (connect, listen
407mode).
408
409
410\subsection ctrl_iface_P2P_CONNECT P2P_CONNECT
411
412Start P2P group formation with a discovered P2P peer. This includes
413group owner negotiation, group interface setup, provisioning, and
414establishing data connection.
415
416P2P_CONNECT <peer device address> <pbc|pin|PIN#>
417[label|display|keypad] [persistent] [join|auth] [go_intent=<0..15>]
418
419Start P2P group formation with a discovered P2P peer. This includes
420optional group owner negotiation, group interface setup, provisioning,
421and establishing data connection.
422
423The <pbc|pin|PIN#> parameter specifies the WPS provisioning
424method. "pbc" string starts pushbutton method, "pin" string start PIN
425method using an automatically generated PIN (which will be returned as
426the command return code), PIN# means that a pre-selected PIN can be
427used (e.g., 12345670). [label|display|keypad] is used with PIN method
428to specify which PIN is used (label=PIN from local label,
429display=dynamically generated random PIN from local display,
430keypad=PIN entered from peer device label or display). "persistent"
431parameter can be used to request a persistent group to be formed.
432
433"join" indicates that this is a command to join an existing group as a
434client. It skips the GO Negotiation part.
435
436"auth" indicates that the WPS parameters are authorized for the peer
437device without actually starting GO Negotiation (i.e., the peer is
438expected to initiate GO Negotiation). This is mainly for testing
439purposes.
440
441The optional "go_intent" parameter can be used to override the default
442GO Intent value.
443
444
445\subsection ctrl_iface_P2P_LISTEN P2P_LISTEN
446
447Start Listen-only state. Optional parameter can be used to specify the
448duration for the Listen operation in seconds. This command may not
449be of that much use during normal operations and is mainly designed
450for testing. It can also be used to keep the device discoverable
451without having to maintain a group.
452
453
454\subsection ctrl_iface_P2P_GROUP_REMOVE P2P_GROUP_REMOVE
455
456Terminate a P2P group. If a new virtual network interface was used for
457the group, it will also be removed. The network interface name of the
458group interface is used as a parameter for this command.
459
460
461\subsection ctrl_iface_P2P_GROUP_ADD P2P_GROUP_ADD
462
463Set up a P2P group owner manually (i.e., without group owner
464negotiation with a specific peer). This is also known as autonomous
465GO. Optional persistent=<network id> can be used to specify restart of
466a persistent group.
467
468
469\subsection ctrl_iface_P2P_PROV_DISC P2P_PROV_DISC
470
471Send P2P provision discovery request to the specified peer. The
472parameters for this command are the P2P device address of the peer and
473the desired configuration method. For example, "P2P_PROV_DISC
47402:01:02:03:04:05 display" would request the peer to display a PIN for
475us and "P2P_PROV_DISC 02:01:02:03:04:05 keypad" would request the peer
476to enter a PIN that we display.
477
478
479\subsection ctrl_iface_P2P_GET_PASSPHRASE P2P_GET_PASSPHRASE
480
481Get the passphrase for a group (only available when acting as a GO).
482
483
484\subsection ctrl_iface_P2P_SERV_DISC_REQ P2P_SERV_DISC_REQ
485
486Schedule a P2P service discovery request. The parameters for this
487command are the device address of the peer device (or 00:00:00:00:00:00
488for wildcard query that is sent to every discovered P2P peer that
489supports service discovery) and P2P Service Query TLV(s) as hexdump.
490For example, "P2P_SERV_DISC_REQ 00:00:00:00:00:00 02000001" schedules
491a request for listing all supported service discovery protocols and
492requests this to be sent to all discovered peers. The pending requests
493are sent during device discovery (see \ref ctrl_iface_P2P_FIND).
494
495This command returns an identifier for the pending query (e.g.,
496"1f77628") that can be used to cancel the request. Directed requests
497will be automatically removed when the specified peer has replied to
498it.
499
500
501\subsection ctrl_iface_P2P_SERV_DISC_CANCEL_REQ P2P_SERV_DISC_CANCEL_REQ
502
503Cancel a pending P2P service discovery request. This command takes a
504single parameter: identifier for the pending query (the value returned
505by \ref ctrl_iface_P2P_SERV_DISC_REQ), e.g.,
506"P2P_SERV_DISC_CANCEL_REQ 1f77628".
507
508
509\subsection ctrl_iface_P2P_SERV_DISC_RESP P2P_SERV_DISC_RESP
510
511Reply to a service discovery query. This command takes following
512parameters: frequency in MHz, destination address, dialog token,
513response TLV(s). The first three parameters are copied from the
514request event. For example,
515"P2P_SERV_DISC_RESP 2437 02:40:61:c2:f3:b7 1 0300000101".
516
517
518\subsection ctrl_iface_P2P_SERVICE_UPDATE P2P_SERVICE_UPDATE
519
520Indicate that local services have changed. This is used to increment
521the P2P service indicator value so that peers know when previously
522cached information may have changed.
523
524
525\subsection ctrl_iface_P2P_SERV_DISC_EXTERNAL P2P_SERV_DISC_EXTERNAL
526
527Configure external processing of P2P service requests: 0 (default) =
528no external processing of requests (i.e., internal code will reject
529each request), 1 = external processing of requests (external program
530is responsible for replying to service discovery requests with
531\ref ctrl_iface_P2P_SERV_DISC_RESP).
532
533
534\subsection ctrl_iface_P2P_REJECT P2P_REJECT
535
536Reject connection attempt from a peer (specified with a device
537address). This is a mechanism to reject a pending GO Negotiation with
538a peer and request to automatically block any further connection or
539discovery of the peer.
540
541
542\subsection ctrl_iface_P2P_INVITE P2P_INVITE
543
544Invite a peer to join a group or to (re)start a persistent group.
545
546
547\subsection ctrl_iface_P2P_PEER P2P_PEER
548
549Fetch information about a discovered peer. This command takes in an
550argument specifying which peer to select: P2P Device Address of the
551peer, "FIRST" to indicate the first peer in the list, or "NEXT-<P2P
552Device Address>" to indicate the entry following the specified peer
553(to allow for iterating through the list).
554
555
556\subsection ctrl_iface_P2P_EXT_LISTEN P2P_EXT_LISTEN
557
558Enable/disable extended listen timing. Without parameters, this
559command disables extended listen timing. When enabling the feature,
8df47653 560two parameters are used: availability period and availability interval
4f338bea
JM
561(both in milliseconds and with range of 1-65535).
562
563
30c28971
JM
564\section ctrl_iface_interactive Interactive requests
565
5eb513c3 566If wpa_supplicant needs additional information during authentication
30c28971
JM
567(e.g., password), it will use a specific prefix, \c CTRL-REQ-
568(\a WPA_CTRL_REQ macro) in an unsolicited event message. An external
569program, e.g., a GUI, can provide such information by using
570\c CTRL-RSP- (\a WPA_CTRL_RSP macro) prefix in a command with matching
571field name.
572
573The following fields can be requested in this way from the user:
574- IDENTITY (EAP identity/user name)
575- PASSWORD (EAP password)
576- NEW_PASSWORD (New password if the server is requesting password change)
577- PIN (PIN code for accessing a SIM or smartcard)
578- OTP (one-time password; like password, but the value is used only once)
579- PASSPHRASE (passphrase for a private key file)
580
581\verbatim
582CTRL-REQ-<field name>-<network id>-<human readable text>
583CTRL-RSP-<field name>-<network id>-<value>
584\endverbatim
585
5eb513c3 586For example, request from wpa_supplicant:
30c28971
JM
587\verbatim
588CTRL-REQ-PASSWORD-1-Password needed for SSID test-network
589\endverbatim
590
591And a matching reply from the GUI:
592\verbatim
593CTRL-RSP-PASSWORD-1-secret
594\endverbatim
595
596
597\subsection ctrl_iface_GET_CAPABILITY GET_CAPABILITY <option> [strict]
598
599Get list of supported functionality (eap, pairwise, group,
600proto). Supported functionality is shown as space separate lists of
5eb513c3 601values used in the same format as in wpa_supplicant configuration.
30c28971
JM
602If optional argument, 'strict', is added, only the values that the
603driver claims to explicitly support are included. Without this, all
604available capabilities are included if the driver does not provide
605a mechanism for querying capabilities.
606
607Example request/reply pairs:
608
609\verbatim
610GET_CAPABILITY eap
611AKA FAST GTC LEAP MD5 MSCHAPV2 OTP PAX PEAP PSK SIM TLS TTLS
612\endverbatim
613
614\verbatim
615GET_CAPABILITY pairwise
616CCMP TKIP NONE
617\endverbatim
618
619\verbatim
620GET_CAPABILITY pairwise strict
621\endverbatim
622
623\verbatim
624GET_CAPABILITY group
625CCMP TKIP WEP104 WEP40
626\endverbatim
627
628\verbatim
629GET_CAPABILITY key_mgmt
630WPA-PSK WPA-EAP IEEE8021X NONE
631\endverbatim
632
633\verbatim
634GET_CAPABILITY proto
635RSN WPA
636\endverbatim
637
638\verbatim
639GET_CAPABILITY auth_alg
640OPEN SHARED LEAP
641\endverbatim
642
643
644\subsection ctrl_iface_AP_SCAN AP_SCAN <ap_scan value>
645
646Change ap_scan value:
6470 = no scanning,
5eb513c3
JM
6481 = wpa_supplicant requests scans and uses scan results to select the AP,
6492 = wpa_supplicant does not use scanning and just requests driver to
30c28971
JM
650associate and take care of AP selection
651
652
653\subsection ctrl_iface_INTERFACES INTERFACES
654
655List configured interfaces.
656
657\verbatim
658wlan0
659eth0
660\endverbatim
661
b590812e
JM
662
663\section ctrl_iface_events Control interface events
664
5eb513c3 665wpa_supplicant generates number messages based on events like
b590812e
JM
666connection or a completion of a task. These are available to external
667programs that attach to receive unsolicited messages over the control
5eb513c3 668interface with \ref wpa_ctrl_attach().
b590812e
JM
669
670The event messages will be delivered over the attach control interface
671as text strings that start with the priority level of the message and
5eb513c3 672a fixed prefix text as defined in \ref wpa_ctrl.h. After this, optional
b590812e
JM
673additional information may be included depending on the event
674message. For example, following event message is delivered when new
675scan results are available:
676
677\verbatim
678<2>CTRL-EVENT-SCAN-RESULTS
679\endverbatim
680
681Following priority levels are used:
682- 0 = MSGDUMP
683- 1 = DEBUG
684- 2 = INFO
685- 3 = WARNING
686- 4 = ERROR
687
688By default, any priority level greater than equal to 2 (INFO) are
689delivered over the attached control interface. LEVEL command can be
690used to set the level of messages which will be delivered. It should
691be noted that there are many debug messages that do not include any
692particulat prefix and are subject to change. They may be used for
693debug information, but can usually be ignored by external programs.
694
695In most cases, the external program can skip over the priority field
696in the beginning of the event message and then compare the following
5eb513c3 697text to the event strings from \ref wpa_ctrl.h that the program is
b590812e
JM
698interested in processing.
699
700Following subsections describe the most common event notifications
5eb513c3 701generated by wpa_supplicant.
b590812e
JM
702
703\subsection ctrl_iface_event_CTRL_REQ CTRL-REQ-
704
705WPA_CTRL_REQ: Request information from a user. See
706\ref ctrl_iface_interactive "Interactive requests" sections for more
707details.
708
709\subsection ctrl_iface_event_CONNECTED CTRL-EVENT-CONNECTED
710
711WPA_EVENT_CONNECTED: Indicate successfully completed authentication
712and that the data connection is now enabled.
713
714\subsection ctrl_iface_event_DISCONNECTED CTRL-EVENT-DISCONNECTED
715
716WPA_EVENT_DISCONNECTED: Disconnected, data connection is not available
717
718\subsection ctrl_iface_event_TERMINATING CTRL-EVENT-TERMINATING
719
5eb513c3 720WPA_EVENT_TERMINATING: wpa_supplicant is exiting
b590812e
JM
721
722\subsection ctrl_iface_event_PASSWORD_CHANGED CTRL-EVENT-PASSWORD-CHANGED
723
724WPA_EVENT_PASSWORD_CHANGED: Password change was completed successfully
725
726\subsection ctrl_iface_event_EAP_NOTIFICATION CTRL-EVENT-EAP-NOTIFICATION
727
728WPA_EVENT_EAP_NOTIFICATION: EAP-Request/Notification received
729
730\subsection ctrl_iface_event_EAP_STARTED CTRL-EVENT-EAP-STARTED
731
732WPA_EVENT_EAP_STARTED: EAP authentication started (EAP-Request/Identity
733received)
734
735\subsection ctrl_iface_event_EAP_METHOD CTRL-EVENT-EAP-METHOD
736
737WPA_EVENT_EAP_METHOD: EAP method selected
738
739\subsection ctrl_iface_event_EAP_SUCCESS CTRL-EVENT-EAP-SUCCESS
740
741WPA_EVENT_EAP_SUCCESS: EAP authentication completed successfully
742
743\subsection ctrl_iface_event_EAP_FAILURE CTRL-EVENT-EAP-FAILURE
744
745WPA_EVENT_EAP_FAILURE: EAP authentication failed (EAP-Failure received)
746
747\subsection ctrl_iface_event_SCAN_RESULTS CTRL-EVENT-SCAN-RESULTS
748
749WPA_EVENT_SCAN_RESULTS: New scan results available
750
751\subsection ctrl_iface_event_BSS_ADDED CTRL-EVENT-BSS-ADDED
752
753WPA_EVENT_BSS_ADDED: A new BSS entry was added. The event prefix is
754followed by the BSS entry id and BSSID.
755
756\verbatim
757CTRL-EVENT-BSS-ADDED 34 00:11:22:33:44:55
758\endverbatim
759
760\subsection ctrl_iface_event_BSS_REMOVED CTRL-EVENT-BSS-REMOVED
761
762WPA_EVENT_BSS_REMOVED: A BSS entry was removed. The event prefix is
763followed by BSS entry id and BSSID.
764
765\verbatim
766CTRL-EVENT-BSS-REMOVED 34 00:11:22:33:44:55
767\endverbatim
768
769\subsection ctrl_iface_event_WPS_OVERLAP_DETECTED WPS-OVERLAP-DETECTED
770
771WPS_EVENT_OVERLAP: WPS overlap detected in PBC mode
772
773\subsection ctrl_iface_event_WPS_AP_AVAILABLE_PBC WPS-AP-AVAILABLE-PBC
774
775WPS_EVENT_AP_AVAILABLE_PBC: Available WPS AP with active PBC found in
776scan results.
777
778\subsection ctrl_iface_event_WPS_AP_AVAILABLE_PIN WPS-AP-AVAILABLE-PIN
779
780WPS_EVENT_AP_AVAILABLE_PIN: Available WPS AP with recently selected PIN
781registrar found in scan results.
782
783\subsection ctrl_iface_event_WPS_AP_AVAILABLE WPS-AP-AVAILABLE
784
785WPS_EVENT_AP_AVAILABLE: Available WPS AP found in scan results
786
787\subsection ctrl_iface_event_WPS_CRED_RECEIVED WPS-CRED-RECEIVED
788
789WPS_EVENT_CRED_RECEIVED: A new credential received
790
791\subsection ctrl_iface_event_WPS_M2D WPS-M2D
792
793WPS_EVENT_M2D: M2D received
794
795\subsection ctrl_iface_event_WPS_FAIL
796
797WPS_EVENT_FAIL: WPS registration failed after M2/M2D
798
799\subsection ctrl_iface_event_WPS_SUCCESS WPS-SUCCESS
800
801WPS_EVENT_SUCCESS: WPS registration completed successfully
802
803\subsection ctrl_iface_event_WPS_TIMEOUT WPS-TIMEOUT
804
805WPS_EVENT_TIMEOUT: WPS enrollment attempt timed out and was terminated
806
807\subsection ctrl_iface_event_WPS_ENROLLEE_SEEN WPS-ENROLLEE-SEEN
808
809WPS_EVENT_ENROLLEE_SEEN: WPS Enrollee was detected (used in AP mode).
810The event prefix is followed by MAC addr, UUID-E, pri dev type,
811config methods, dev passwd id, request type, [dev name].
812
813\verbatim
814WPS-ENROLLEE-SEEN 02:00:00:00:01:00
815572cf82f-c957-5653-9b16-b5cfb298abf1 1-0050F204-1 0x80 4 1
816[Wireless Client]
817\endverbatim
818
819\subsection ctrl_iface_event_WPS_ER_AP_ADD WPS-ER-AP-ADD
820
821WPS_EVENT_ER_AP_ADD: WPS ER discovered an AP
822
823\verbatim
824WPS-ER-AP-ADD 87654321-9abc-def0-1234-56789abc0002 02:11:22:33:44:55
825pri_dev_type=6-0050F204-1 wps_state=1 |Very friendly name|Company|
826Long description of the model|WAP|http://w1.fi/|http://w1.fi/hostapd/
827\endverbatim
828
829\subsection ctrl_iface_event_WPS_ER_AP_REMOVE WPS-ER-AP-REMOVE
830
831WPS_EVENT_ER_AP_REMOVE: WPS ER removed an AP entry
832
833\verbatim
834WPS-ER-AP-REMOVE 87654321-9abc-def0-1234-56789abc0002
835\endverbatim
836
837\subsection ctrl_iface_event_WPS_ER_ENROLLEE_ADD WPS-ER-ENROLLEE-ADD
838
839WPS_EVENT_ER_ENROLLEE_ADD: WPS ER discovered a new Enrollee
840
841\verbatim
842WPS-ER-ENROLLEE-ADD 2b7093f1-d6fb-5108-adbb-bea66bb87333
84302:66:a0:ee:17:27 M1=1 config_methods=0x14d dev_passwd_id=0
844pri_dev_type=1-0050F204-1
845|Wireless Client|Company|cmodel|123|12345|
846\endverbatim
847
848\subsection ctrl_iface_event_WPS_ER_ENROLLEE_REMOVE WPS-ER-ENROLLEE-REMOVE
849
850WPS_EVENT_ER_ENROLLEE_REMOVE: WPS ER removed an Enrollee entry
851
852\verbatim
853WPS-ER-ENROLLEE-REMOVE 2b7093f1-d6fb-5108-adbb-bea66bb87333
85402:66:a0:ee:17:27
855\endverbatim
856
857\subsection ctrl_iface_event_WPS_PIN_NEEDED WPS-PIN-NEEDED
858
859WPS_EVENT_PIN_NEEDED: PIN is needed to complete provisioning with an
860Enrollee. This is followed by information about the Enrollee (UUID,
861MAC address, device name, manufacturer, model name, model number,
862serial number, primary device type).
863\verbatim
864WPS-PIN-NEEDED 5a02a5fa-9199-5e7c-bc46-e183d3cb32f7 02:2a:c4:18:5b:f3
865[Wireless Client|Company|cmodel|123|12345|1-0050F204-1]
866\endverbatim
867
868\subsection ctrl_iface_event_WPS_NEW_AP_SETTINGS WPS-NEW-AP-SETTINGS
869
870WPS_EVENT_NEW_AP_SETTINGS: New AP settings were received
871
872\subsection ctrl_iface_event_WPS_REG_SUCCESS WPS-REG-SUCCESS
873
874WPS_EVENT_REG_SUCCESS: WPS provisioning was completed successfully
875(AP/Registrar)
876
877\subsection ctrl_iface_event_WPS_AP_SETUP_LOCKED WPS-AP-SETUP-LOCKED
878
879WPS_EVENT_AP_SETUP_LOCKED: AP changed into setup locked state due to
880multiple failed configuration attempts using the AP PIN.
881
882\subsection ctrl_iface_event_AP_STA_CONNECTED AP-STA-CONNECTED
883
884AP_STA_CONNECTED: A station associated with us (AP mode event). The
885event prefix is followed by the MAC address of the station.
886
887\verbatim
888AP-STA-CONNECTED 02:2a:c4:18:5b:f3
889\endverbatim
890
891\subsection ctrl_iface_event_AP_STA_DISCONNECTED AP-STA-DISCONNECTED
892
893AP_STA_DISCONNECTED: A station disassociated (AP mode event)
894
895\verbatim
896AP-STA-DISCONNECTED 02:2a:c4:18:5b:f3
897\endverbatim
898
4f338bea
JM
899\subsection ctrl_iface_event_P2P_EVENT_DEVICE_FOUND P2P-DEVICE-FOUND
900
901P2P_EVENT_DEVICE_FOUND: Indication of a discovered P2P device with
902information about that device.
903
904\verbatim
905P2P-DEVICE-FOUND 02:b5:64:63:30:63 p2p_dev_addr=02:b5:64:63:30:63
906pri_dev_type=1-0050f204-1 name='Wireless Client' config_methods=0x84
907dev_capab=0x21 group_capab=0x0
908\endverbatim
909
910\subsection ctrl_iface_event_P2P_EVENT_GO_NEG_REQUEST P2P-GO-NEG-REQUEST
911
912P2P_EVENT_GO_NEG_REQUEST: A P2P device requested GO negotiation, but we
913were not ready to start the negotiation.
914
915\verbatim
3dfda83d 916P2P-GO-NEG-REQUEST 02:40:61:c2:f3:b7 dev_passwd_id=4
4f338bea
JM
917\endverbatim
918
919\subsection ctrl_iface_event_P2P_EVENT_GO_NEG_SUCCESS P2P-GO-NEG-SUCCESS
920
921P2P_EVENT_GO_NEG_SUCCESS: Indication of successfully complete group
922owner negotiation.
923
924\subsection ctrl_iface_event_P2P_EVENT_GO_NEG_FAILURE P2P-GO-NEG-FAILURE
925
926P2P_EVENT_GO_NEG_FAILURE: Indication of failed group owner negotiation.
927
928\subsection ctrl_iface_event_P2P_EVENT_GROUP_FORMATION_SUCCESS P2P-GROUP-FORMATION-SUCCESS
929
930P2P_EVENT_GROUP_FORMATION_SUCCESS: Indication that P2P group formation
931has been completed successfully.
932
933\subsection ctrl_iface_event_P2P_EVENT_GROUP_FORMATION_FAILURE P2P-GROUP-FORMATION-FAILURE
934
935P2P_EVENT_GROUP_FORMATION_FAILURE: Indication that P2P group formation
936failed (e.g., due to provisioning failure or timeout).
937
938\subsection ctrl_iface_event_P2P_EVENT_GROUP_STARTED P2P-GROUP-STARTED
939
940P2P_EVENT_GROUP_STARTED: Indication of a new P2P group having been
941started. Additional parameters: network interface name for the group,
942role (GO/client), SSID. The passphrase used in the group is also
943indicated here if known (on GO) or PSK (on client). If the group is a
944persistent one, a flag indicating that is included.
945
946\verbatim
947P2P-GROUP-STARTED wlan0-p2p-0 GO ssid="DIRECT-3F Testing"
948passphrase="12345678" go_dev_addr=02:40:61:c2:f3:b7 [PERSISTENT]
949\endverbatim
950
951\subsection ctrl_iface_event_P2P_EVENT_GROUP_REMOVED P2P-GROUP-REMOVED
952
953P2P_EVENT_GROUP_REMOVED: Indication of a P2P group having been removed.
954Additional parameters: network interface name for the group, role
955(GO/client).
956
957\verbatim
958P2P-GROUP-REMOVED wlan0-p2p-0 GO
959\endverbatim
960
961\subsection ctrl_iface_event_P2P_EVENT_PROV_DISC_SHOW_PIN P2P-PROV-DISC-SHOW-PIN
962
963P2P_EVENT_PROV_DISC_SHOW_PIN: Request from the peer for us to display
964a PIN that will be entered on the peer. The following parameters are
965included after the event prefix: peer_address PIN. The PIN is a
966random PIN generated for this connection. P2P_CONNECT command can be
967used to accept the request with the same PIN configured for the
968connection.
969
970\verbatim
971P2P-PROV-DISC-SHOW-PIN 02:40:61:c2:f3:b7 12345670
972p2p_dev_addr=02:40:61:c2:f3:b7 pri_dev_type=1-0050F204-1 name='Test'
973config_methods=0x188 dev_capab=0x21 group_capab=0x0
974\endverbatim
975
976\subsection ctrl_iface_event_P2P_EVENT_PROV_DISC_ENTER_PIN P2P-PROV-DISC-ENTER-PIN
977
978P2P_EVENT_PROV_DISC_ENTER_PIN: Request from the peer for us to enter a
979PIN displayed on the peer. The following parameter is included after
980the event prefix: peer address.
981
982\verbatim
983P2P-PROV-DISC-ENTER-PIN 02:40:61:c2:f3:b7 p2p_dev_addr=02:40:61:c2:f3:b7
984pri_dev_type=1-0050F204-1 name='Test' config_methods=0x188
985dev_capab=0x21 group_capab=0x0
986\endverbatim
987
988\subsection ctrl_iface_event_P2P_EVENT_PROV_DISC_PBC_REQ P2P-PROV-DISC-PBC-REQ
989
990P2P_EVENT_PROV_DISC_PBC_REQ: Request from the peer for us to connect
991using PBC. The following parameters are included after the event prefix:
992peer_address. P2P_CONNECT command can be used to accept the request.
993
994\verbatim
995P2P-PROV-DISC-PBC-REQ 02:40:61:c2:f3:b7 p2p_dev_addr=02:40:61:c2:f3:b7
996pri_dev_type=1-0050F204-1 name='Test' config_methods=0x188
997dev_capab=0x21 group_capab=0x0
998\endverbatim
999
1000\subsection ctrl_iface_event_P2P_EVENT_PROV_DISC_PBC_RESP P2P-PROV-DISC-PBC-RESP
1001
1002P2P_EVENT_PROV_DISC_PBC_RESP: The peer accepted our provision discovery
1003request to connect using PBC. The following parameters are included
1004after the event prefix: peer_address. P2P_CONNECT command can be used to
1005start GO Negotiation after this.
1006
1007\verbatim
1008P2P-PROV-DISC-PBC-RESP 02:40:61:c2:f3:b7
1009\endverbatim
1010
1011\subsection ctrl_iface_event_P2P_EVENT_SERV_DISC_REQ P2P-SERV-DISC-REQ
1012
1013P2P-SERV-DISC-REQ: Indicate reception of a P2P service discovery
1014request. The following parameters are included after the event prefix:
9f85a37e
JM
1015frequency in MHz, source address, dialog token, Service Update
1016Indicator, Service Query TLV(s) as hexdump.
4f338bea
JM
1017
1018\verbatim
1019P2P-SERV-DISC-REQ 2412 02:40:61:c2:f3:b7 0 0 02000001
1020\endverbatim
1021
1022\subsection ctrl_iface_event_P2P_EVENT_SERV_DISC_RESP P2P-SERV-DISC-RESP
1023
1024P2P-SERV-DISC-RESP: Indicate reception of a P2P service discovery
1025response. The following parameters are included after the event prefix:
9f85a37e
JM
1026source address, Service Update Indicator, Service Response TLV(s) as
1027hexdump.
4f338bea
JM
1028
1029\verbatim
1030P2P-SERV-DISC-RESP 02:40:61:c2:f3:b7 0 0300000101
1031\endverbatim
1032
1033\subsection ctrl_iface_event_P2P_EVENT_INVITATION_RECEIVED P2P-INVITATION-RECEIVED
1034
1035P2P-INVITATION-RECEIVED: Indicate reception of a P2P Invitation
1036Request. For persistent groups, the parameter after the event prefix
1037indicates which network block includes the persistent group data.
1038
1039\verbatim
1040P2P-INVITATION-RECEIVED sa=02:40:61:c2:f3:b7 persistent=0
1041\endverbatim
1042
1043\subsection ctrl_iface_event_P2P_EVENT_INVITATION_RESULT P2P-INVITATION-RESULT
1044
1045P2P-INVITATION-RESULT: Indicate result of a P2P invitation that was
1046requested with \ref ctrl_iface_P2P_INVITE. The parameter
1047status=<value> shows the status code returned by the peer (or -1 on
1048local failure or timeout).
1049
1050\verbatim
1051P2P-INVITATION-RESULT status=1
1052\endverbatim
1053
30c28971 1054*/