18d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/*
28d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * wpa_supplicant/hostapd control interface library
38d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * Copyright (c) 2004-2006, Jouni Malinen <j@w1.fi>
48d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt *
5c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidt * This software may be distributed under the terms of the BSD license.
6c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidt * See README for more details.
78d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt */
88d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
98d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#ifndef WPA_CTRL_H
108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPA_CTRL_H
118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#ifdef  __cplusplus
138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtextern "C" {
148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#endif
158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
168d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* wpa_supplicant control interface - fixed message prefixes */
178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** Interactive request for identity/password/pin */
198d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPA_CTRL_REQ "CTRL-REQ-"
208d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
218d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** Response to identity/password/pin request */
228d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPA_CTRL_RSP "CTRL-RSP-"
238d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
248d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* Event messages with fixed prefix */
258d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** Authentication completed successfully and data connection enabled */
268d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPA_EVENT_CONNECTED "CTRL-EVENT-CONNECTED "
278d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** Disconnected, data connection is not available */
288d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPA_EVENT_DISCONNECTED "CTRL-EVENT-DISCONNECTED "
298d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** Association rejected during connection attempt */
308d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPA_EVENT_ASSOC_REJECT "CTRL-EVENT-ASSOC-REJECT "
318d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** wpa_supplicant is exiting */
328d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPA_EVENT_TERMINATING "CTRL-EVENT-TERMINATING "
338d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** Password change was completed successfully */
348d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPA_EVENT_PASSWORD_CHANGED "CTRL-EVENT-PASSWORD-CHANGED "
358d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** EAP-Request/Notification received */
368d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPA_EVENT_EAP_NOTIFICATION "CTRL-EVENT-EAP-NOTIFICATION "
378d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** EAP authentication started (EAP-Request/Identity received) */
388d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPA_EVENT_EAP_STARTED "CTRL-EVENT-EAP-STARTED "
398d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** EAP method proposed by the server */
408d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPA_EVENT_EAP_PROPOSED_METHOD "CTRL-EVENT-EAP-PROPOSED-METHOD "
418d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** EAP method selected */
428d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPA_EVENT_EAP_METHOD "CTRL-EVENT-EAP-METHOD "
438d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** EAP peer certificate from TLS */
448d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPA_EVENT_EAP_PEER_CERT "CTRL-EVENT-EAP-PEER-CERT "
458d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** EAP TLS certificate chain validation error */
468d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPA_EVENT_EAP_TLS_CERT_ERROR "CTRL-EVENT-EAP-TLS-CERT-ERROR "
478da800a193fb6f8832218715f82a7b4e2d2ad338Dmitry Shmidt/** EAP status */
488da800a193fb6f8832218715f82a7b4e2d2ad338Dmitry Shmidt#define WPA_EVENT_EAP_STATUS "CTRL-EVENT-EAP-STATUS "
498d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** EAP authentication completed successfully */
508d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPA_EVENT_EAP_SUCCESS "CTRL-EVENT-EAP-SUCCESS "
518d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** EAP authentication failed (EAP-Failure received) */
528d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPA_EVENT_EAP_FAILURE "CTRL-EVENT-EAP-FAILURE "
5361d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt/** Network block temporarily disabled (e.g., due to authentication failure) */
5461d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt#define WPA_EVENT_TEMP_DISABLED "CTRL-EVENT-SSID-TEMP-DISABLED "
5561d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt/** Temporarily disabled network block re-enabled */
5661d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt#define WPA_EVENT_REENABLED "CTRL-EVENT-SSID-REENABLED "
57fb79edc9df1f20461e90e478363d207348213d35Dmitry Shmidt/** New scan started */
58fb79edc9df1f20461e90e478363d207348213d35Dmitry Shmidt#define WPA_EVENT_SCAN_STARTED "CTRL-EVENT-SCAN-STARTED "
598d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** New scan results available */
608d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPA_EVENT_SCAN_RESULTS "CTRL-EVENT-SCAN-RESULTS "
618d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** wpa_supplicant state change */
628d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPA_EVENT_STATE_CHANGE "CTRL-EVENT-STATE-CHANGE "
638d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** A new BSS entry was added (followed by BSS entry id and BSSID) */
648d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPA_EVENT_BSS_ADDED "CTRL-EVENT-BSS-ADDED "
658d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** A BSS entry was removed (followed by BSS entry id and BSSID) */
668d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPA_EVENT_BSS_REMOVED "CTRL-EVENT-BSS-REMOVED "
677dba0e5708da7276a43a44cf479aa743564e15b9Dmitry Shmidt/** Change in the signal level was reported by the driver */
687dba0e5708da7276a43a44cf479aa743564e15b9Dmitry Shmidt#define WPA_EVENT_SIGNAL_CHANGE "CTRL-EVENT-SIGNAL-CHANGE "
697dba0e5708da7276a43a44cf479aa743564e15b9Dmitry Shmidt/** Regulatory domain channel */
707dba0e5708da7276a43a44cf479aa743564e15b9Dmitry Shmidt#define WPA_EVENT_REGDOM_CHANGE "CTRL-EVENT-REGDOM-CHANGE "
718d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
72b7b4d0ec07161a6d76c40ba7ef1306e82fbb7e15Dmitry Shmidt/** RSN IBSS 4-way handshakes completed with specified peer */
73b7b4d0ec07161a6d76c40ba7ef1306e82fbb7e15Dmitry Shmidt#define IBSS_RSN_COMPLETED "IBSS-RSN-COMPLETED "
74b7b4d0ec07161a6d76c40ba7ef1306e82fbb7e15Dmitry Shmidt
7504f534e89ed127da4077485376f24debc50d80d5Dmitry Shmidt/** Notification of frequency conflict due to a concurrent operation.
7604f534e89ed127da4077485376f24debc50d80d5Dmitry Shmidt *
7704f534e89ed127da4077485376f24debc50d80d5Dmitry Shmidt * The indicated network is disabled and needs to be re-enabled before it can
7804f534e89ed127da4077485376f24debc50d80d5Dmitry Shmidt * be used again.
7904f534e89ed127da4077485376f24debc50d80d5Dmitry Shmidt */
8004f534e89ed127da4077485376f24debc50d80d5Dmitry Shmidt#define WPA_EVENT_FREQ_CONFLICT "CTRL-EVENT-FREQ-CONFLICT "
81cf32e60fa7e0d33fe1551a6dba8dcbbec47ea50eDmitry Shmidt/** Frequency ranges that the driver recommends to avoid */
82cf32e60fa7e0d33fe1551a6dba8dcbbec47ea50eDmitry Shmidt#define WPA_EVENT_AVOID_FREQ "CTRL-EVENT-AVOID-FREQ "
838d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** WPS overlap detected in PBC mode */
848d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_OVERLAP "WPS-OVERLAP-DETECTED "
858d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** Available WPS AP with active PBC found in scan results */
868d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_AP_AVAILABLE_PBC "WPS-AP-AVAILABLE-PBC "
878d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** Available WPS AP with our address as authorized in scan results */
888d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_AP_AVAILABLE_AUTH "WPS-AP-AVAILABLE-AUTH "
898d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** Available WPS AP with recently selected PIN registrar found in scan results
908d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt */
918d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_AP_AVAILABLE_PIN "WPS-AP-AVAILABLE-PIN "
928d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** Available WPS AP found in scan results */
938d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_AP_AVAILABLE "WPS-AP-AVAILABLE "
948d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** A new credential received */
958d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_CRED_RECEIVED "WPS-CRED-RECEIVED "
968d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** M2D received */
978d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_M2D "WPS-M2D "
988d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** WPS registration failed after M2/M2D */
998d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_FAIL "WPS-FAIL "
1008d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** WPS registration completed successfully */
1018d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_SUCCESS "WPS-SUCCESS "
1028d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** WPS enrollment attempt timed out and was terminated */
1038d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_TIMEOUT "WPS-TIMEOUT "
104b7b4d0ec07161a6d76c40ba7ef1306e82fbb7e15Dmitry Shmidt/* PBC mode was activated */
105b7b4d0ec07161a6d76c40ba7ef1306e82fbb7e15Dmitry Shmidt#define WPS_EVENT_ACTIVE "WPS-PBC-ACTIVE "
106b7b4d0ec07161a6d76c40ba7ef1306e82fbb7e15Dmitry Shmidt/* PBC mode was disabled */
107b7b4d0ec07161a6d76c40ba7ef1306e82fbb7e15Dmitry Shmidt#define WPS_EVENT_DISABLE "WPS-PBC-DISABLE "
1088d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1098d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_ENROLLEE_SEEN "WPS-ENROLLEE-SEEN "
1108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_OPEN_NETWORK "WPS-OPEN-NETWORK "
1128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* WPS ER events */
1148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_ER_AP_ADD "WPS-ER-AP-ADD "
1158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_ER_AP_REMOVE "WPS-ER-AP-REMOVE "
1168d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_ER_ENROLLEE_ADD "WPS-ER-ENROLLEE-ADD "
1178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_ER_ENROLLEE_REMOVE "WPS-ER-ENROLLEE-REMOVE "
1188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_ER_AP_SETTINGS "WPS-ER-AP-SETTINGS "
1198d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_ER_SET_SEL_REG "WPS-ER-AP-SET-SEL-REG "
1208d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1218d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** P2P device found */
1228d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_EVENT_DEVICE_FOUND "P2P-DEVICE-FOUND "
123497c1d5e50162d6b3c1cce5dbd9c5fd9da69aaefDmitry Shmidt
124497c1d5e50162d6b3c1cce5dbd9c5fd9da69aaefDmitry Shmidt/** P2P device lost */
125497c1d5e50162d6b3c1cce5dbd9c5fd9da69aaefDmitry Shmidt#define P2P_EVENT_DEVICE_LOST "P2P-DEVICE-LOST "
126497c1d5e50162d6b3c1cce5dbd9c5fd9da69aaefDmitry Shmidt
1278d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/** A P2P device requested GO negotiation, but we were not ready to start the
1288d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * negotiation */
1298d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_EVENT_GO_NEG_REQUEST "P2P-GO-NEG-REQUEST "
1308d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_EVENT_GO_NEG_SUCCESS "P2P-GO-NEG-SUCCESS "
1318d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_EVENT_GO_NEG_FAILURE "P2P-GO-NEG-FAILURE "
1328d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_EVENT_GROUP_FORMATION_SUCCESS "P2P-GROUP-FORMATION-SUCCESS "
1338d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_EVENT_GROUP_FORMATION_FAILURE "P2P-GROUP-FORMATION-FAILURE "
1348d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_EVENT_GROUP_STARTED "P2P-GROUP-STARTED "
1358d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_EVENT_GROUP_REMOVED "P2P-GROUP-REMOVED "
1368d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_EVENT_CROSS_CONNECT_ENABLE "P2P-CROSS-CONNECT-ENABLE "
1378d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_EVENT_CROSS_CONNECT_DISABLE "P2P-CROSS-CONNECT-DISABLE "
1388d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* parameters: <peer address> <PIN> */
1398d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_EVENT_PROV_DISC_SHOW_PIN "P2P-PROV-DISC-SHOW-PIN "
1408d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* parameters: <peer address> */
1418d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_EVENT_PROV_DISC_ENTER_PIN "P2P-PROV-DISC-ENTER-PIN "
1428d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* parameters: <peer address> */
1438d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_EVENT_PROV_DISC_PBC_REQ "P2P-PROV-DISC-PBC-REQ "
1448d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* parameters: <peer address> */
1458d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_EVENT_PROV_DISC_PBC_RESP "P2P-PROV-DISC-PBC-RESP "
14604949598a23f501be6eec21697465fd46a28840aDmitry Shmidt/* parameters: <peer address> <status> */
14704949598a23f501be6eec21697465fd46a28840aDmitry Shmidt#define P2P_EVENT_PROV_DISC_FAILURE "P2P-PROV-DISC-FAILURE"
1488d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* parameters: <freq> <src addr> <dialog token> <update indicator> <TLVs> */
1498d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_EVENT_SERV_DISC_REQ "P2P-SERV-DISC-REQ "
1508d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* parameters: <src addr> <update indicator> <TLVs> */
1518d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_EVENT_SERV_DISC_RESP "P2P-SERV-DISC-RESP "
1528d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_EVENT_INVITATION_RECEIVED "P2P-INVITATION-RECEIVED "
1538d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_EVENT_INVITATION_RESULT "P2P-INVITATION-RESULT "
1541f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt#define P2P_EVENT_FIND_STOPPED "P2P-FIND-STOPPED "
155391c59f0632df8db1c325da1d31d479b2eedce45Dmitry Shmidt#define P2P_EVENT_PERSISTENT_PSK_FAIL "P2P-PERSISTENT-PSK-FAIL id="
156fb79edc9df1f20461e90e478363d207348213d35Dmitry Shmidt#define P2P_EVENT_PRESENCE_RESPONSE "P2P-PRESENCE-RESPONSE "
157cf32e60fa7e0d33fe1551a6dba8dcbbec47ea50eDmitry Shmidt#define P2P_EVENT_NFC_BOTH_GO "P2P-NFC-BOTH-GO "
158cf32e60fa7e0d33fe1551a6dba8dcbbec47ea50eDmitry Shmidt#define P2P_EVENT_NFC_PEER_CLIENT "P2P-NFC-PEER-CLIENT "
159cf32e60fa7e0d33fe1551a6dba8dcbbec47ea50eDmitry Shmidt#define P2P_EVENT_NFC_WHILE_CLIENT "P2P-NFC-WHILE-CLIENT "
1601f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt
161f7e0a9905988e62e4f70fed8b795722abeab719bDmitry Shmidt/* parameters: <PMF enabled> <timeout in ms> <Session Information URL> */
162f7e0a9905988e62e4f70fed8b795722abeab719bDmitry Shmidt#define ESS_DISASSOC_IMMINENT "ESS-DISASSOC-IMMINENT "
163cf32e60fa7e0d33fe1551a6dba8dcbbec47ea50eDmitry Shmidt#define P2P_EVENT_REMOVE_AND_REFORM_GROUP "P2P-REMOVE-AND-REFORM-GROUP "
164f7e0a9905988e62e4f70fed8b795722abeab719bDmitry Shmidt
1651f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt#define INTERWORKING_AP "INTERWORKING-AP "
166f21452aea786ac056eb01f1cbba4f553bd502747Dmitry Shmidt#define INTERWORKING_BLACKLISTED "INTERWORKING-BLACKLISTED "
1671f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt#define INTERWORKING_NO_MATCH "INTERWORKING-NO-MATCH "
1685460547a121207cf7a99eac45e05fcdd83be3161Dmitry Shmidt#define INTERWORKING_ALREADY_CONNECTED "INTERWORKING-ALREADY-CONNECTED "
169f21452aea786ac056eb01f1cbba4f553bd502747Dmitry Shmidt#define INTERWORKING_SELECTED "INTERWORKING-SELECTED "
1708d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1710cfd5f779f6cdd2f774a27bb1dec95d3940cd16aDmitry Shmidt/* Credential block added; parameters: <id> */
1720cfd5f779f6cdd2f774a27bb1dec95d3940cd16aDmitry Shmidt#define CRED_ADDED "CRED-ADDED "
1730cfd5f779f6cdd2f774a27bb1dec95d3940cd16aDmitry Shmidt/* Credential block modified; parameters: <id> <field> */
1740cfd5f779f6cdd2f774a27bb1dec95d3940cd16aDmitry Shmidt#define CRED_MODIFIED "CRED-MODIFIED "
1750cfd5f779f6cdd2f774a27bb1dec95d3940cd16aDmitry Shmidt/* Credential block removed; parameters: <id> */
1760cfd5f779f6cdd2f774a27bb1dec95d3940cd16aDmitry Shmidt#define CRED_REMOVED "CRED-REMOVED "
1770cfd5f779f6cdd2f774a27bb1dec95d3940cd16aDmitry Shmidt
17861d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt#define GAS_RESPONSE_INFO "GAS-RESPONSE-INFO "
179fb79edc9df1f20461e90e478363d207348213d35Dmitry Shmidt/* parameters: <addr> <dialog_token> <freq> */
180fb79edc9df1f20461e90e478363d207348213d35Dmitry Shmidt#define GAS_QUERY_START "GAS-QUERY-START "
181fb79edc9df1f20461e90e478363d207348213d35Dmitry Shmidt/* parameters: <addr> <dialog_token> <freq> <status_code> <result> */
182fb79edc9df1f20461e90e478363d207348213d35Dmitry Shmidt#define GAS_QUERY_DONE "GAS-QUERY-DONE "
183fb79edc9df1f20461e90e478363d207348213d35Dmitry Shmidt
184f21452aea786ac056eb01f1cbba4f553bd502747Dmitry Shmidt#define HS20_SUBSCRIPTION_REMEDIATION "HS20-SUBSCRIPTION-REMEDIATION "
185f21452aea786ac056eb01f1cbba4f553bd502747Dmitry Shmidt#define HS20_DEAUTH_IMMINENT_NOTICE "HS20-DEAUTH-IMMINENT-NOTICE "
186f21452aea786ac056eb01f1cbba4f553bd502747Dmitry Shmidt
187fb79edc9df1f20461e90e478363d207348213d35Dmitry Shmidt#define EXT_RADIO_WORK_START "EXT-RADIO-WORK-START "
188fb79edc9df1f20461e90e478363d207348213d35Dmitry Shmidt#define EXT_RADIO_WORK_TIMEOUT "EXT-RADIO-WORK-TIMEOUT "
18961d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt
1908d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* hostapd control interface - fixed message prefixes */
1918d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_PIN_NEEDED "WPS-PIN-NEEDED "
1928d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_NEW_AP_SETTINGS "WPS-NEW-AP-SETTINGS "
1938d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_REG_SUCCESS "WPS-REG-SUCCESS "
1948d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_AP_SETUP_LOCKED "WPS-AP-SETUP-LOCKED "
1958d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_AP_SETUP_UNLOCKED "WPS-AP-SETUP-UNLOCKED "
1968d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_AP_PIN_ENABLED "WPS-AP-PIN-ENABLED "
1978d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_EVENT_AP_PIN_DISABLED "WPS-AP-PIN-DISABLED "
1988d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define AP_STA_CONNECTED "AP-STA-CONNECTED "
1998d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define AP_STA_DISCONNECTED "AP-STA-DISCONNECTED "
2008d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
201f86232838cf712377867cb42417c1613ab5dc425Dmitry Shmidt#define AP_REJECTED_MAX_STA "AP-REJECTED-MAX-STA "
202f86232838cf712377867cb42417c1613ab5dc425Dmitry Shmidt#define AP_REJECTED_BLOCKED_STA "AP-REJECTED-BLOCKED-STA "
2038d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
204cce06667447b5aec83452adb0c15100ada531095Dmitry Shmidt#define AP_EVENT_ENABLED "AP-ENABLED "
205cce06667447b5aec83452adb0c15100ada531095Dmitry Shmidt#define AP_EVENT_DISABLED "AP-DISABLED "
206cce06667447b5aec83452adb0c15100ada531095Dmitry Shmidt
207cce06667447b5aec83452adb0c15100ada531095Dmitry Shmidt#define ACS_EVENT_STARTED "ACS-STARTED "
208cce06667447b5aec83452adb0c15100ada531095Dmitry Shmidt#define ACS_EVENT_COMPLETED "ACS-COMPLETED "
209cce06667447b5aec83452adb0c15100ada531095Dmitry Shmidt#define ACS_EVENT_FAILED "ACS-FAILED "
210cce06667447b5aec83452adb0c15100ada531095Dmitry Shmidt
211cce06667447b5aec83452adb0c15100ada531095Dmitry Shmidt#define DFS_EVENT_RADAR_DETECTED "DFS-RADAR-DETECTED "
212cce06667447b5aec83452adb0c15100ada531095Dmitry Shmidt#define DFS_EVENT_NEW_CHANNEL "DFS-NEW-CHANNEL "
213cce06667447b5aec83452adb0c15100ada531095Dmitry Shmidt#define DFS_EVENT_CAC_START "DFS-CAC-START "
214cce06667447b5aec83452adb0c15100ada531095Dmitry Shmidt#define DFS_EVENT_CAC_COMPLETED "DFS-CAC-COMPLETED "
215cce06667447b5aec83452adb0c15100ada531095Dmitry Shmidt#define DFS_EVENT_NOP_FINISHED "DFS-NOP-FINISHED "
216cce06667447b5aec83452adb0c15100ada531095Dmitry Shmidt
217e0e48dc666fb14a7bb60264ca87463ba7bc1fe0bDmitry Shmidt#define AP_CSA_FINISHED "AP-CSA-FINISHED "
218e0e48dc666fb14a7bb60264ca87463ba7bc1fe0bDmitry Shmidt
21904949598a23f501be6eec21697465fd46a28840aDmitry Shmidt/* BSS command information masks */
22004949598a23f501be6eec21697465fd46a28840aDmitry Shmidt
2212f3b8dec59373945c5feef8a78ced8967a80cc66Dmitry Shmidt#define WPA_BSS_MASK_ALL		0xFFFDFFFF
22204949598a23f501be6eec21697465fd46a28840aDmitry Shmidt#define WPA_BSS_MASK_ID			BIT(0)
22304949598a23f501be6eec21697465fd46a28840aDmitry Shmidt#define WPA_BSS_MASK_BSSID		BIT(1)
22404949598a23f501be6eec21697465fd46a28840aDmitry Shmidt#define WPA_BSS_MASK_FREQ		BIT(2)
22504949598a23f501be6eec21697465fd46a28840aDmitry Shmidt#define WPA_BSS_MASK_BEACON_INT		BIT(3)
22604949598a23f501be6eec21697465fd46a28840aDmitry Shmidt#define WPA_BSS_MASK_CAPABILITIES	BIT(4)
22704949598a23f501be6eec21697465fd46a28840aDmitry Shmidt#define WPA_BSS_MASK_QUAL		BIT(5)
22804949598a23f501be6eec21697465fd46a28840aDmitry Shmidt#define WPA_BSS_MASK_NOISE		BIT(6)
22904949598a23f501be6eec21697465fd46a28840aDmitry Shmidt#define WPA_BSS_MASK_LEVEL		BIT(7)
23004949598a23f501be6eec21697465fd46a28840aDmitry Shmidt#define WPA_BSS_MASK_TSF		BIT(8)
23104949598a23f501be6eec21697465fd46a28840aDmitry Shmidt#define WPA_BSS_MASK_AGE		BIT(9)
23204949598a23f501be6eec21697465fd46a28840aDmitry Shmidt#define WPA_BSS_MASK_IE			BIT(10)
23304949598a23f501be6eec21697465fd46a28840aDmitry Shmidt#define WPA_BSS_MASK_FLAGS		BIT(11)
23404949598a23f501be6eec21697465fd46a28840aDmitry Shmidt#define WPA_BSS_MASK_SSID		BIT(12)
23504949598a23f501be6eec21697465fd46a28840aDmitry Shmidt#define WPA_BSS_MASK_WPS_SCAN		BIT(13)
23604949598a23f501be6eec21697465fd46a28840aDmitry Shmidt#define WPA_BSS_MASK_P2P_SCAN		BIT(14)
23704949598a23f501be6eec21697465fd46a28840aDmitry Shmidt#define WPA_BSS_MASK_INTERNETW		BIT(15)
23861d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt#define WPA_BSS_MASK_WIFI_DISPLAY	BIT(16)
2392f3b8dec59373945c5feef8a78ced8967a80cc66Dmitry Shmidt#define WPA_BSS_MASK_DELIM		BIT(17)
24004949598a23f501be6eec21697465fd46a28840aDmitry Shmidt
24104949598a23f501be6eec21697465fd46a28840aDmitry Shmidt
2422e67f06149ff649fb6f8782bad041d3d9124685eDmitry Shmidt/* VENDOR_ELEM_* frame id values */
2432e67f06149ff649fb6f8782bad041d3d9124685eDmitry Shmidtenum wpa_vendor_elem_frame {
2442e67f06149ff649fb6f8782bad041d3d9124685eDmitry Shmidt	VENDOR_ELEM_PROBE_REQ_P2P = 0,
2452e67f06149ff649fb6f8782bad041d3d9124685eDmitry Shmidt	VENDOR_ELEM_PROBE_RESP_P2P = 1,
2462e67f06149ff649fb6f8782bad041d3d9124685eDmitry Shmidt	VENDOR_ELEM_PROBE_RESP_P2P_GO = 2,
2472e67f06149ff649fb6f8782bad041d3d9124685eDmitry Shmidt	VENDOR_ELEM_BEACON_P2P_GO = 3,
2482e67f06149ff649fb6f8782bad041d3d9124685eDmitry Shmidt	VENDOR_ELEM_P2P_PD_REQ = 4,
2492e67f06149ff649fb6f8782bad041d3d9124685eDmitry Shmidt	VENDOR_ELEM_P2P_PD_RESP = 5,
2502e67f06149ff649fb6f8782bad041d3d9124685eDmitry Shmidt	VENDOR_ELEM_P2P_GO_NEG_REQ = 6,
2512e67f06149ff649fb6f8782bad041d3d9124685eDmitry Shmidt	VENDOR_ELEM_P2P_GO_NEG_RESP = 7,
2522e67f06149ff649fb6f8782bad041d3d9124685eDmitry Shmidt	VENDOR_ELEM_P2P_GO_NEG_CONF = 8,
2532e67f06149ff649fb6f8782bad041d3d9124685eDmitry Shmidt	VENDOR_ELEM_P2P_INV_REQ = 9,
2542e67f06149ff649fb6f8782bad041d3d9124685eDmitry Shmidt	VENDOR_ELEM_P2P_INV_RESP = 10,
2552e67f06149ff649fb6f8782bad041d3d9124685eDmitry Shmidt	VENDOR_ELEM_P2P_ASSOC_REQ = 11,
2562e67f06149ff649fb6f8782bad041d3d9124685eDmitry Shmidt	VENDOR_ELEM_P2P_ASSOC_RESP = 12,
2572e67f06149ff649fb6f8782bad041d3d9124685eDmitry Shmidt	NUM_VENDOR_ELEM_FRAMES
2582e67f06149ff649fb6f8782bad041d3d9124685eDmitry Shmidt};
2592e67f06149ff649fb6f8782bad041d3d9124685eDmitry Shmidt
2602e67f06149ff649fb6f8782bad041d3d9124685eDmitry Shmidt
2618d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* wpa_supplicant/hostapd control interface access */
2628d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2638d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/**
2648d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * wpa_ctrl_open - Open a control interface to wpa_supplicant/hostapd
2658d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * @ctrl_path: Path for UNIX domain sockets; ignored if UDP sockets are used.
2668d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * Returns: Pointer to abstract control interface data or %NULL on failure
2678d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt *
2688d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * This function is used to open a control interface to wpa_supplicant/hostapd.
2698d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * ctrl_path is usually /var/run/wpa_supplicant or /var/run/hostapd. This path
2708d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * is configured in wpa_supplicant/hostapd and other programs using the control
2718d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * interface need to use matching path configuration.
2728d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt */
2738d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstruct wpa_ctrl * wpa_ctrl_open(const char *ctrl_path);
2748d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2758d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2768d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/**
2778d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * wpa_ctrl_close - Close a control interface to wpa_supplicant/hostapd
2788d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * @ctrl: Control interface data from wpa_ctrl_open()
2798d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt *
2808d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * This function is used to close a control interface.
2818d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt */
2828d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpa_ctrl_close(struct wpa_ctrl *ctrl);
2838d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2848d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2858d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/**
2868d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * wpa_ctrl_request - Send a command to wpa_supplicant/hostapd
2878d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * @ctrl: Control interface data from wpa_ctrl_open()
2888d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * @cmd: Command; usually, ASCII text, e.g., "PING"
2898d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * @cmd_len: Length of the cmd in bytes
2908d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * @reply: Buffer for the response
2918d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * @reply_len: Reply buffer length
2928d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * @msg_cb: Callback function for unsolicited messages or %NULL if not used
2938d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * Returns: 0 on success, -1 on error (send or receive failed), -2 on timeout
2948d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt *
2958d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * This function is used to send commands to wpa_supplicant/hostapd. Received
2968d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * response will be written to reply and reply_len is set to the actual length
2978d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * of the reply. This function will block for up to two seconds while waiting
2988d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * for the reply. If unsolicited messages are received, the blocking time may
2998d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * be longer.
3008d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt *
3018d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * msg_cb can be used to register a callback function that will be called for
3028d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * unsolicited messages received while waiting for the command response. These
3038d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * messages may be received if wpa_ctrl_request() is called at the same time as
3048d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * wpa_supplicant/hostapd is sending such a message. This can happen only if
3058d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * the program has used wpa_ctrl_attach() to register itself as a monitor for
3068d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * event messages. Alternatively to msg_cb, programs can register two control
3078d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * interface connections and use one of them for commands and the other one for
3088d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * receiving event messages, in other words, call wpa_ctrl_attach() only for
3098d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * the control interface connection that will be used for event messages.
3108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt */
3118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpa_ctrl_request(struct wpa_ctrl *ctrl, const char *cmd, size_t cmd_len,
3128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		     char *reply, size_t *reply_len,
3138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		     void (*msg_cb)(char *msg, size_t len));
3148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3168d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/**
3178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * wpa_ctrl_attach - Register as an event monitor for the control interface
3188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * @ctrl: Control interface data from wpa_ctrl_open()
3198d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * Returns: 0 on success, -1 on failure, -2 on timeout
3208d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt *
3218d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * This function registers the control interface connection as a monitor for
3228d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * wpa_supplicant/hostapd events. After a success wpa_ctrl_attach() call, the
3238d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * control interface connection starts receiving event messages that can be
3248d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * read with wpa_ctrl_recv().
3258d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt */
3268d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpa_ctrl_attach(struct wpa_ctrl *ctrl);
3278d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3288d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3298d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/**
3308d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * wpa_ctrl_detach - Unregister event monitor from the control interface
3318d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * @ctrl: Control interface data from wpa_ctrl_open()
3328d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * Returns: 0 on success, -1 on failure, -2 on timeout
3338d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt *
3348d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * This function unregisters the control interface connection as a monitor for
3358d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * wpa_supplicant/hostapd events, i.e., cancels the registration done with
3368d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * wpa_ctrl_attach().
3378d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt */
3388d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpa_ctrl_detach(struct wpa_ctrl *ctrl);
3398d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3408d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3418d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/**
3428d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * wpa_ctrl_recv - Receive a pending control interface message
3438d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * @ctrl: Control interface data from wpa_ctrl_open()
3448d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * @reply: Buffer for the message data
3458d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * @reply_len: Length of the reply buffer
3468d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * Returns: 0 on success, -1 on failure
3478d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt *
3489ead16e203b81d44a2d84eadc2901ceeb7daf805Dmitry Shmidt * This function will receive a pending control interface message. The received
3499ead16e203b81d44a2d84eadc2901ceeb7daf805Dmitry Shmidt * response will be written to reply and reply_len is set to the actual length
3509ead16e203b81d44a2d84eadc2901ceeb7daf805Dmitry Shmidt * of the reply.
3519ead16e203b81d44a2d84eadc2901ceeb7daf805Dmitry Shmidt
3528d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * wpa_ctrl_recv() is only used for event messages, i.e., wpa_ctrl_attach()
3538d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * must have been used to register the control interface as an event monitor.
3548d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt */
3558d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpa_ctrl_recv(struct wpa_ctrl *ctrl, char *reply, size_t *reply_len);
3568d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3578d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3588d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/**
3598d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * wpa_ctrl_pending - Check whether there are pending event messages
3608d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * @ctrl: Control interface data from wpa_ctrl_open()
3618d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * Returns: 1 if there are pending messages, 0 if no, or -1 on error
3628d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt *
3638d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * This function will check whether there are any pending control interface
3648d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * message available to be received with wpa_ctrl_recv(). wpa_ctrl_pending() is
3658d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * only used for event messages, i.e., wpa_ctrl_attach() must have been used to
3668d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * register the control interface as an event monitor.
3678d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt */
3688d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpa_ctrl_pending(struct wpa_ctrl *ctrl);
3698d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3708d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3718d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/**
3728d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * wpa_ctrl_get_fd - Get file descriptor used by the control interface
3738d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * @ctrl: Control interface data from wpa_ctrl_open()
3748d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * Returns: File descriptor used for the connection
3758d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt *
3768d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * This function can be used to get the file descriptor that is used for the
3778d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * control interface connection. The returned value can be used, e.g., with
3788d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * select() while waiting for multiple events.
3798d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt *
3808d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * The returned file descriptor must not be used directly for sending or
3818d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * receiving packets; instead, the library functions wpa_ctrl_request() and
3828d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * wpa_ctrl_recv() must be used for this.
3838d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt */
3848d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpa_ctrl_get_fd(struct wpa_ctrl *ctrl);
3858d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
38661d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidtchar * wpa_ctrl_get_remote_ifname(struct wpa_ctrl *ctrl);
38761d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt
3881f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt#ifdef ANDROID
3891f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt/**
3901f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt * wpa_ctrl_cleanup() - Delete any local UNIX domain socket files that
3911f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt * may be left over from clients that were previously connected to
3921f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt * wpa_supplicant. This keeps these files from being orphaned in the
3931f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt * event of crashes that prevented them from being removed as part
3941f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt * of the normal orderly shutdown.
3951f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt */
3961f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtvoid wpa_ctrl_cleanup(void);
3971f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt#endif /* ANDROID */
3981f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt
3998d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#ifdef CONFIG_CTRL_IFACE_UDP
40061d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt/* Port range for multiple wpa_supplicant instances and multiple VIFs */
4018d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPA_CTRL_IFACE_PORT 9877
40261d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt#define WPA_CTRL_IFACE_PORT_LIMIT 50 /* decremented from start */
4038d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPA_GLOBAL_CTRL_IFACE_PORT 9878
40461d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt#define WPA_GLOBAL_CTRL_IFACE_PORT_LIMIT 20 /* incremented from start */
4058d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#endif /* CONFIG_CTRL_IFACE_UDP */
4068d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4078d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4088d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#ifdef  __cplusplus
4098d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
4108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#endif
4118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#endif /* WPA_CTRL_H */
413