ctrl_iface.doxygen 33 KB

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