xref: /dflybsd-src/contrib/wpa_supplicant/src/common/wpa_ctrl.h (revision 3a84a4273475ed07d0ab1c2dfeffdfedef35d9cd)
16d49e1aeSJan Lentfer /*
26d49e1aeSJan Lentfer  * wpa_supplicant/hostapd control interface library
3*a1157835SDaniel Fojt  * Copyright (c) 2004-2017, Jouni Malinen <j@w1.fi>
46d49e1aeSJan Lentfer  *
53ff40c12SJohn Marino  * This software may be distributed under the terms of the BSD license.
63ff40c12SJohn Marino  * See README for more details.
76d49e1aeSJan Lentfer  */
86d49e1aeSJan Lentfer 
96d49e1aeSJan Lentfer #ifndef WPA_CTRL_H
106d49e1aeSJan Lentfer #define WPA_CTRL_H
116d49e1aeSJan Lentfer 
126d49e1aeSJan Lentfer #ifdef  __cplusplus
136d49e1aeSJan Lentfer extern "C" {
146d49e1aeSJan Lentfer #endif
156d49e1aeSJan Lentfer 
166d49e1aeSJan Lentfer /* wpa_supplicant control interface - fixed message prefixes */
176d49e1aeSJan Lentfer 
186d49e1aeSJan Lentfer /** Interactive request for identity/password/pin */
196d49e1aeSJan Lentfer #define WPA_CTRL_REQ "CTRL-REQ-"
206d49e1aeSJan Lentfer 
216d49e1aeSJan Lentfer /** Response to identity/password/pin request */
226d49e1aeSJan Lentfer #define WPA_CTRL_RSP "CTRL-RSP-"
236d49e1aeSJan Lentfer 
246d49e1aeSJan Lentfer /* Event messages with fixed prefix */
256d49e1aeSJan Lentfer /** Authentication completed successfully and data connection enabled */
266d49e1aeSJan Lentfer #define WPA_EVENT_CONNECTED "CTRL-EVENT-CONNECTED "
276d49e1aeSJan Lentfer /** Disconnected, data connection is not available */
286d49e1aeSJan Lentfer #define WPA_EVENT_DISCONNECTED "CTRL-EVENT-DISCONNECTED "
293ff40c12SJohn Marino /** Association rejected during connection attempt */
303ff40c12SJohn Marino #define WPA_EVENT_ASSOC_REJECT "CTRL-EVENT-ASSOC-REJECT "
31*a1157835SDaniel Fojt /** Authentication rejected during connection attempt */
32*a1157835SDaniel Fojt #define WPA_EVENT_AUTH_REJECT "CTRL-EVENT-AUTH-REJECT "
336d49e1aeSJan Lentfer /** wpa_supplicant is exiting */
346d49e1aeSJan Lentfer #define WPA_EVENT_TERMINATING "CTRL-EVENT-TERMINATING "
356d49e1aeSJan Lentfer /** Password change was completed successfully */
366d49e1aeSJan Lentfer #define WPA_EVENT_PASSWORD_CHANGED "CTRL-EVENT-PASSWORD-CHANGED "
376d49e1aeSJan Lentfer /** EAP-Request/Notification received */
386d49e1aeSJan Lentfer #define WPA_EVENT_EAP_NOTIFICATION "CTRL-EVENT-EAP-NOTIFICATION "
396d49e1aeSJan Lentfer /** EAP authentication started (EAP-Request/Identity received) */
406d49e1aeSJan Lentfer #define WPA_EVENT_EAP_STARTED "CTRL-EVENT-EAP-STARTED "
413ff40c12SJohn Marino /** EAP method proposed by the server */
423ff40c12SJohn Marino #define WPA_EVENT_EAP_PROPOSED_METHOD "CTRL-EVENT-EAP-PROPOSED-METHOD "
436d49e1aeSJan Lentfer /** EAP method selected */
446d49e1aeSJan Lentfer #define WPA_EVENT_EAP_METHOD "CTRL-EVENT-EAP-METHOD "
453ff40c12SJohn Marino /** EAP peer certificate from TLS */
463ff40c12SJohn Marino #define WPA_EVENT_EAP_PEER_CERT "CTRL-EVENT-EAP-PEER-CERT "
47*a1157835SDaniel Fojt /** EAP peer certificate alternative subject name component from TLS */
48*a1157835SDaniel Fojt #define WPA_EVENT_EAP_PEER_ALT "CTRL-EVENT-EAP-PEER-ALT "
493ff40c12SJohn Marino /** EAP TLS certificate chain validation error */
503ff40c12SJohn Marino #define WPA_EVENT_EAP_TLS_CERT_ERROR "CTRL-EVENT-EAP-TLS-CERT-ERROR "
513ff40c12SJohn Marino /** EAP status */
523ff40c12SJohn Marino #define WPA_EVENT_EAP_STATUS "CTRL-EVENT-EAP-STATUS "
53*a1157835SDaniel Fojt /** Retransmit the previous request packet */
54*a1157835SDaniel Fojt #define WPA_EVENT_EAP_RETRANSMIT "CTRL-EVENT-EAP-RETRANSMIT "
55*a1157835SDaniel Fojt #define WPA_EVENT_EAP_RETRANSMIT2 "CTRL-EVENT-EAP-RETRANSMIT2 "
566d49e1aeSJan Lentfer /** EAP authentication completed successfully */
576d49e1aeSJan Lentfer #define WPA_EVENT_EAP_SUCCESS "CTRL-EVENT-EAP-SUCCESS "
58*a1157835SDaniel Fojt #define WPA_EVENT_EAP_SUCCESS2 "CTRL-EVENT-EAP-SUCCESS2 "
596d49e1aeSJan Lentfer /** EAP authentication failed (EAP-Failure received) */
606d49e1aeSJan Lentfer #define WPA_EVENT_EAP_FAILURE "CTRL-EVENT-EAP-FAILURE "
61*a1157835SDaniel Fojt #define WPA_EVENT_EAP_FAILURE2 "CTRL-EVENT-EAP-FAILURE2 "
62*a1157835SDaniel Fojt /** EAP authentication failed due to no response received */
63*a1157835SDaniel Fojt #define WPA_EVENT_EAP_TIMEOUT_FAILURE "CTRL-EVENT-EAP-TIMEOUT-FAILURE "
64*a1157835SDaniel Fojt #define WPA_EVENT_EAP_TIMEOUT_FAILURE2 "CTRL-EVENT-EAP-TIMEOUT-FAILURE2 "
65*a1157835SDaniel Fojt #define WPA_EVENT_EAP_ERROR_CODE "EAP-ERROR-CODE "
663ff40c12SJohn Marino /** Network block temporarily disabled (e.g., due to authentication failure) */
673ff40c12SJohn Marino #define WPA_EVENT_TEMP_DISABLED "CTRL-EVENT-SSID-TEMP-DISABLED "
683ff40c12SJohn Marino /** Temporarily disabled network block re-enabled */
693ff40c12SJohn Marino #define WPA_EVENT_REENABLED "CTRL-EVENT-SSID-REENABLED "
703ff40c12SJohn Marino /** New scan started */
713ff40c12SJohn Marino #define WPA_EVENT_SCAN_STARTED "CTRL-EVENT-SCAN-STARTED "
726d49e1aeSJan Lentfer /** New scan results available */
736d49e1aeSJan Lentfer #define WPA_EVENT_SCAN_RESULTS "CTRL-EVENT-SCAN-RESULTS "
74*a1157835SDaniel Fojt /** Scan command failed */
75*a1157835SDaniel Fojt #define WPA_EVENT_SCAN_FAILED "CTRL-EVENT-SCAN-FAILED "
763ff40c12SJohn Marino /** wpa_supplicant state change */
773ff40c12SJohn Marino #define WPA_EVENT_STATE_CHANGE "CTRL-EVENT-STATE-CHANGE "
783ff40c12SJohn Marino /** A new BSS entry was added (followed by BSS entry id and BSSID) */
793ff40c12SJohn Marino #define WPA_EVENT_BSS_ADDED "CTRL-EVENT-BSS-ADDED "
803ff40c12SJohn Marino /** A BSS entry was removed (followed by BSS entry id and BSSID) */
813ff40c12SJohn Marino #define WPA_EVENT_BSS_REMOVED "CTRL-EVENT-BSS-REMOVED "
82*a1157835SDaniel Fojt /** No suitable network was found */
83*a1157835SDaniel Fojt #define WPA_EVENT_NETWORK_NOT_FOUND "CTRL-EVENT-NETWORK-NOT-FOUND "
84*a1157835SDaniel Fojt /** Change in the signal level was reported by the driver */
85*a1157835SDaniel Fojt #define WPA_EVENT_SIGNAL_CHANGE "CTRL-EVENT-SIGNAL-CHANGE "
86*a1157835SDaniel Fojt /** Beacon loss reported by the driver */
87*a1157835SDaniel Fojt #define WPA_EVENT_BEACON_LOSS "CTRL-EVENT-BEACON-LOSS "
88*a1157835SDaniel Fojt /** Regulatory domain channel */
89*a1157835SDaniel Fojt #define WPA_EVENT_REGDOM_CHANGE "CTRL-EVENT-REGDOM-CHANGE "
90*a1157835SDaniel Fojt /** Channel switch started (followed by freq=<MHz> and other channel parameters)
91*a1157835SDaniel Fojt  */
92*a1157835SDaniel Fojt #define WPA_EVENT_CHANNEL_SWITCH_STARTED "CTRL-EVENT-STARTED-CHANNEL-SWITCH "
93*a1157835SDaniel Fojt /** Channel switch (followed by freq=<MHz> and other channel parameters) */
94*a1157835SDaniel Fojt #define WPA_EVENT_CHANNEL_SWITCH "CTRL-EVENT-CHANNEL-SWITCH "
95*a1157835SDaniel Fojt /** SAE authentication failed due to unknown password identifier */
96*a1157835SDaniel Fojt #define WPA_EVENT_SAE_UNKNOWN_PASSWORD_IDENTIFIER \
97*a1157835SDaniel Fojt 	"CTRL-EVENT-SAE-UNKNOWN-PASSWORD-IDENTIFIER "
98*a1157835SDaniel Fojt 
99*a1157835SDaniel Fojt /** IP subnet status change notification
100*a1157835SDaniel Fojt  *
101*a1157835SDaniel Fojt  * When using an offloaded roaming mechanism where driver/firmware takes care
102*a1157835SDaniel Fojt  * of roaming and IP subnet validation checks post-roaming, this event can
103*a1157835SDaniel Fojt  * indicate whether IP subnet has changed.
104*a1157835SDaniel Fojt  *
105*a1157835SDaniel Fojt  * The event has a status=<0/1/2> parameter where
106*a1157835SDaniel Fojt  * 0 = unknown
107*a1157835SDaniel Fojt  * 1 = IP subnet unchanged (can continue to use the old IP address)
108*a1157835SDaniel Fojt  * 2 = IP subnet changed (need to get a new IP address)
109*a1157835SDaniel Fojt  */
110*a1157835SDaniel Fojt #define WPA_EVENT_SUBNET_STATUS_UPDATE "CTRL-EVENT-SUBNET-STATUS-UPDATE "
1116d49e1aeSJan Lentfer 
1123ff40c12SJohn Marino /** RSN IBSS 4-way handshakes completed with specified peer */
1133ff40c12SJohn Marino #define IBSS_RSN_COMPLETED "IBSS-RSN-COMPLETED "
1143ff40c12SJohn Marino 
1153ff40c12SJohn Marino /** Notification of frequency conflict due to a concurrent operation.
1163ff40c12SJohn Marino  *
1173ff40c12SJohn Marino  * The indicated network is disabled and needs to be re-enabled before it can
1183ff40c12SJohn Marino  * be used again.
1193ff40c12SJohn Marino  */
1203ff40c12SJohn Marino #define WPA_EVENT_FREQ_CONFLICT "CTRL-EVENT-FREQ-CONFLICT "
1213ff40c12SJohn Marino /** Frequency ranges that the driver recommends to avoid */
1223ff40c12SJohn Marino #define WPA_EVENT_AVOID_FREQ "CTRL-EVENT-AVOID-FREQ "
1236d49e1aeSJan Lentfer /** WPS overlap detected in PBC mode */
1246d49e1aeSJan Lentfer #define WPS_EVENT_OVERLAP "WPS-OVERLAP-DETECTED "
1256d49e1aeSJan Lentfer /** Available WPS AP with active PBC found in scan results */
1266d49e1aeSJan Lentfer #define WPS_EVENT_AP_AVAILABLE_PBC "WPS-AP-AVAILABLE-PBC "
1273ff40c12SJohn Marino /** Available WPS AP with our address as authorized in scan results */
1283ff40c12SJohn Marino #define WPS_EVENT_AP_AVAILABLE_AUTH "WPS-AP-AVAILABLE-AUTH "
1296d49e1aeSJan Lentfer /** Available WPS AP with recently selected PIN registrar found in scan results
1306d49e1aeSJan Lentfer  */
1316d49e1aeSJan Lentfer #define WPS_EVENT_AP_AVAILABLE_PIN "WPS-AP-AVAILABLE-PIN "
1326d49e1aeSJan Lentfer /** Available WPS AP found in scan results */
1336d49e1aeSJan Lentfer #define WPS_EVENT_AP_AVAILABLE "WPS-AP-AVAILABLE "
1346d49e1aeSJan Lentfer /** A new credential received */
1356d49e1aeSJan Lentfer #define WPS_EVENT_CRED_RECEIVED "WPS-CRED-RECEIVED "
1366d49e1aeSJan Lentfer /** M2D received */
1376d49e1aeSJan Lentfer #define WPS_EVENT_M2D "WPS-M2D "
1386d49e1aeSJan Lentfer /** WPS registration failed after M2/M2D */
1396d49e1aeSJan Lentfer #define WPS_EVENT_FAIL "WPS-FAIL "
1406d49e1aeSJan Lentfer /** WPS registration completed successfully */
1416d49e1aeSJan Lentfer #define WPS_EVENT_SUCCESS "WPS-SUCCESS "
1426d49e1aeSJan Lentfer /** WPS enrollment attempt timed out and was terminated */
1436d49e1aeSJan Lentfer #define WPS_EVENT_TIMEOUT "WPS-TIMEOUT "
1443ff40c12SJohn Marino /* PBC mode was activated */
1453ff40c12SJohn Marino #define WPS_EVENT_ACTIVE "WPS-PBC-ACTIVE "
1463ff40c12SJohn Marino /* PBC mode was disabled */
1473ff40c12SJohn Marino #define WPS_EVENT_DISABLE "WPS-PBC-DISABLE "
1483ff40c12SJohn Marino 
1493ff40c12SJohn Marino #define WPS_EVENT_ENROLLEE_SEEN "WPS-ENROLLEE-SEEN "
1503ff40c12SJohn Marino 
1513ff40c12SJohn Marino #define WPS_EVENT_OPEN_NETWORK "WPS-OPEN-NETWORK "
1523ff40c12SJohn Marino 
1533ff40c12SJohn Marino /* WPS ER events */
1543ff40c12SJohn Marino #define WPS_EVENT_ER_AP_ADD "WPS-ER-AP-ADD "
1553ff40c12SJohn Marino #define WPS_EVENT_ER_AP_REMOVE "WPS-ER-AP-REMOVE "
1563ff40c12SJohn Marino #define WPS_EVENT_ER_ENROLLEE_ADD "WPS-ER-ENROLLEE-ADD "
1573ff40c12SJohn Marino #define WPS_EVENT_ER_ENROLLEE_REMOVE "WPS-ER-ENROLLEE-REMOVE "
1583ff40c12SJohn Marino #define WPS_EVENT_ER_AP_SETTINGS "WPS-ER-AP-SETTINGS "
1593ff40c12SJohn Marino #define WPS_EVENT_ER_SET_SEL_REG "WPS-ER-AP-SET-SEL-REG "
1603ff40c12SJohn Marino 
161*a1157835SDaniel Fojt /* DPP events */
162*a1157835SDaniel Fojt #define DPP_EVENT_AUTH_SUCCESS "DPP-AUTH-SUCCESS "
163*a1157835SDaniel Fojt #define DPP_EVENT_AUTH_INIT_FAILED "DPP-AUTH-INIT-FAILED "
164*a1157835SDaniel Fojt #define DPP_EVENT_NOT_COMPATIBLE "DPP-NOT-COMPATIBLE "
165*a1157835SDaniel Fojt #define DPP_EVENT_RESPONSE_PENDING "DPP-RESPONSE-PENDING "
166*a1157835SDaniel Fojt #define DPP_EVENT_SCAN_PEER_QR_CODE "DPP-SCAN-PEER-QR-CODE "
167*a1157835SDaniel Fojt #define DPP_EVENT_AUTH_DIRECTION "DPP-AUTH-DIRECTION "
168*a1157835SDaniel Fojt #define DPP_EVENT_CONF_RECEIVED "DPP-CONF-RECEIVED "
169*a1157835SDaniel Fojt #define DPP_EVENT_CONF_SENT "DPP-CONF-SENT "
170*a1157835SDaniel Fojt #define DPP_EVENT_CONF_FAILED "DPP-CONF-FAILED "
171*a1157835SDaniel Fojt #define DPP_EVENT_CONFOBJ_AKM "DPP-CONFOBJ-AKM "
172*a1157835SDaniel Fojt #define DPP_EVENT_CONFOBJ_SSID "DPP-CONFOBJ-SSID "
173*a1157835SDaniel Fojt #define DPP_EVENT_CONFOBJ_PASS "DPP-CONFOBJ-PASS "
174*a1157835SDaniel Fojt #define DPP_EVENT_CONFOBJ_PSK "DPP-CONFOBJ-PSK "
175*a1157835SDaniel Fojt #define DPP_EVENT_CONNECTOR "DPP-CONNECTOR "
176*a1157835SDaniel Fojt #define DPP_EVENT_C_SIGN_KEY "DPP-C-SIGN-KEY "
177*a1157835SDaniel Fojt #define DPP_EVENT_NET_ACCESS_KEY "DPP-NET-ACCESS-KEY "
178*a1157835SDaniel Fojt #define DPP_EVENT_MISSING_CONNECTOR "DPP-MISSING-CONNECTOR "
179*a1157835SDaniel Fojt #define DPP_EVENT_NETWORK_ID "DPP-NETWORK-ID "
180*a1157835SDaniel Fojt #define DPP_EVENT_RX "DPP-RX "
181*a1157835SDaniel Fojt #define DPP_EVENT_TX "DPP-TX "
182*a1157835SDaniel Fojt #define DPP_EVENT_TX_STATUS "DPP-TX-STATUS "
183*a1157835SDaniel Fojt #define DPP_EVENT_FAIL "DPP-FAIL "
184*a1157835SDaniel Fojt #define DPP_EVENT_PKEX_T_LIMIT "DPP-PKEX-T-LIMIT "
185*a1157835SDaniel Fojt #define DPP_EVENT_INTRO "DPP-INTRO "
186*a1157835SDaniel Fojt #define DPP_EVENT_CONF_REQ_RX "DPP-CONF-REQ-RX "
187*a1157835SDaniel Fojt 
188*a1157835SDaniel Fojt /* MESH events */
189*a1157835SDaniel Fojt #define MESH_GROUP_STARTED "MESH-GROUP-STARTED "
190*a1157835SDaniel Fojt #define MESH_GROUP_REMOVED "MESH-GROUP-REMOVED "
191*a1157835SDaniel Fojt #define MESH_PEER_CONNECTED "MESH-PEER-CONNECTED "
192*a1157835SDaniel Fojt #define MESH_PEER_DISCONNECTED "MESH-PEER-DISCONNECTED "
193*a1157835SDaniel Fojt /** Mesh SAE authentication failure. Wrong password suspected. */
194*a1157835SDaniel Fojt #define MESH_SAE_AUTH_FAILURE "MESH-SAE-AUTH-FAILURE "
195*a1157835SDaniel Fojt #define MESH_SAE_AUTH_BLOCKED "MESH-SAE-AUTH-BLOCKED "
196*a1157835SDaniel Fojt 
197*a1157835SDaniel Fojt /* WMM AC events */
198*a1157835SDaniel Fojt #define WMM_AC_EVENT_TSPEC_ADDED "TSPEC-ADDED "
199*a1157835SDaniel Fojt #define WMM_AC_EVENT_TSPEC_REMOVED "TSPEC-REMOVED "
200*a1157835SDaniel Fojt #define WMM_AC_EVENT_TSPEC_REQ_FAILED "TSPEC-REQ-FAILED "
201*a1157835SDaniel Fojt 
2023ff40c12SJohn Marino /** P2P device found */
2033ff40c12SJohn Marino #define P2P_EVENT_DEVICE_FOUND "P2P-DEVICE-FOUND "
2043ff40c12SJohn Marino 
2053ff40c12SJohn Marino /** P2P device lost */
2063ff40c12SJohn Marino #define P2P_EVENT_DEVICE_LOST "P2P-DEVICE-LOST "
2073ff40c12SJohn Marino 
2083ff40c12SJohn Marino /** A P2P device requested GO negotiation, but we were not ready to start the
2093ff40c12SJohn Marino  * negotiation */
2103ff40c12SJohn Marino #define P2P_EVENT_GO_NEG_REQUEST "P2P-GO-NEG-REQUEST "
2113ff40c12SJohn Marino #define P2P_EVENT_GO_NEG_SUCCESS "P2P-GO-NEG-SUCCESS "
2123ff40c12SJohn Marino #define P2P_EVENT_GO_NEG_FAILURE "P2P-GO-NEG-FAILURE "
2133ff40c12SJohn Marino #define P2P_EVENT_GROUP_FORMATION_SUCCESS "P2P-GROUP-FORMATION-SUCCESS "
2143ff40c12SJohn Marino #define P2P_EVENT_GROUP_FORMATION_FAILURE "P2P-GROUP-FORMATION-FAILURE "
2153ff40c12SJohn Marino #define P2P_EVENT_GROUP_STARTED "P2P-GROUP-STARTED "
2163ff40c12SJohn Marino #define P2P_EVENT_GROUP_REMOVED "P2P-GROUP-REMOVED "
2173ff40c12SJohn Marino #define P2P_EVENT_CROSS_CONNECT_ENABLE "P2P-CROSS-CONNECT-ENABLE "
2183ff40c12SJohn Marino #define P2P_EVENT_CROSS_CONNECT_DISABLE "P2P-CROSS-CONNECT-DISABLE "
2193ff40c12SJohn Marino /* parameters: <peer address> <PIN> */
2203ff40c12SJohn Marino #define P2P_EVENT_PROV_DISC_SHOW_PIN "P2P-PROV-DISC-SHOW-PIN "
2213ff40c12SJohn Marino /* parameters: <peer address> */
2223ff40c12SJohn Marino #define P2P_EVENT_PROV_DISC_ENTER_PIN "P2P-PROV-DISC-ENTER-PIN "
2233ff40c12SJohn Marino /* parameters: <peer address> */
2243ff40c12SJohn Marino #define P2P_EVENT_PROV_DISC_PBC_REQ "P2P-PROV-DISC-PBC-REQ "
2253ff40c12SJohn Marino /* parameters: <peer address> */
2263ff40c12SJohn Marino #define P2P_EVENT_PROV_DISC_PBC_RESP "P2P-PROV-DISC-PBC-RESP "
2273ff40c12SJohn Marino /* parameters: <peer address> <status> */
2283ff40c12SJohn Marino #define P2P_EVENT_PROV_DISC_FAILURE "P2P-PROV-DISC-FAILURE"
2293ff40c12SJohn Marino /* parameters: <freq> <src addr> <dialog token> <update indicator> <TLVs> */
2303ff40c12SJohn Marino #define P2P_EVENT_SERV_DISC_REQ "P2P-SERV-DISC-REQ "
2313ff40c12SJohn Marino /* parameters: <src addr> <update indicator> <TLVs> */
2323ff40c12SJohn Marino #define P2P_EVENT_SERV_DISC_RESP "P2P-SERV-DISC-RESP "
233*a1157835SDaniel Fojt #define P2P_EVENT_SERV_ASP_RESP "P2P-SERV-ASP-RESP "
2343ff40c12SJohn Marino #define P2P_EVENT_INVITATION_RECEIVED "P2P-INVITATION-RECEIVED "
2353ff40c12SJohn Marino #define P2P_EVENT_INVITATION_RESULT "P2P-INVITATION-RESULT "
236*a1157835SDaniel Fojt #define P2P_EVENT_INVITATION_ACCEPTED "P2P-INVITATION-ACCEPTED "
2373ff40c12SJohn Marino #define P2P_EVENT_FIND_STOPPED "P2P-FIND-STOPPED "
2383ff40c12SJohn Marino #define P2P_EVENT_PERSISTENT_PSK_FAIL "P2P-PERSISTENT-PSK-FAIL id="
2393ff40c12SJohn Marino #define P2P_EVENT_PRESENCE_RESPONSE "P2P-PRESENCE-RESPONSE "
2403ff40c12SJohn Marino #define P2P_EVENT_NFC_BOTH_GO "P2P-NFC-BOTH-GO "
2413ff40c12SJohn Marino #define P2P_EVENT_NFC_PEER_CLIENT "P2P-NFC-PEER-CLIENT "
2423ff40c12SJohn Marino #define P2P_EVENT_NFC_WHILE_CLIENT "P2P-NFC-WHILE-CLIENT "
243*a1157835SDaniel Fojt #define P2P_EVENT_FALLBACK_TO_GO_NEG "P2P-FALLBACK-TO-GO-NEG "
244*a1157835SDaniel Fojt #define P2P_EVENT_FALLBACK_TO_GO_NEG_ENABLED "P2P-FALLBACK-TO-GO-NEG-ENABLED "
2453ff40c12SJohn Marino 
2463ff40c12SJohn Marino /* parameters: <PMF enabled> <timeout in ms> <Session Information URL> */
2473ff40c12SJohn Marino #define ESS_DISASSOC_IMMINENT "ESS-DISASSOC-IMMINENT "
2483ff40c12SJohn Marino #define P2P_EVENT_REMOVE_AND_REFORM_GROUP "P2P-REMOVE-AND-REFORM-GROUP "
2493ff40c12SJohn Marino 
250*a1157835SDaniel Fojt #define P2P_EVENT_P2PS_PROVISION_START "P2PS-PROV-START "
251*a1157835SDaniel Fojt #define P2P_EVENT_P2PS_PROVISION_DONE "P2PS-PROV-DONE "
252*a1157835SDaniel Fojt 
2533ff40c12SJohn Marino #define INTERWORKING_AP "INTERWORKING-AP "
254*a1157835SDaniel Fojt #define INTERWORKING_BLACKLISTED "INTERWORKING-BLACKLISTED "
2553ff40c12SJohn Marino #define INTERWORKING_NO_MATCH "INTERWORKING-NO-MATCH "
2563ff40c12SJohn Marino #define INTERWORKING_ALREADY_CONNECTED "INTERWORKING-ALREADY-CONNECTED "
257*a1157835SDaniel Fojt #define INTERWORKING_SELECTED "INTERWORKING-SELECTED "
258*a1157835SDaniel Fojt 
259*a1157835SDaniel Fojt /* Credential block added; parameters: <id> */
260*a1157835SDaniel Fojt #define CRED_ADDED "CRED-ADDED "
261*a1157835SDaniel Fojt /* Credential block modified; parameters: <id> <field> */
262*a1157835SDaniel Fojt #define CRED_MODIFIED "CRED-MODIFIED "
263*a1157835SDaniel Fojt /* Credential block removed; parameters: <id> */
264*a1157835SDaniel Fojt #define CRED_REMOVED "CRED-REMOVED "
2653ff40c12SJohn Marino 
2663ff40c12SJohn Marino #define GAS_RESPONSE_INFO "GAS-RESPONSE-INFO "
2673ff40c12SJohn Marino /* parameters: <addr> <dialog_token> <freq> */
2683ff40c12SJohn Marino #define GAS_QUERY_START "GAS-QUERY-START "
2693ff40c12SJohn Marino /* parameters: <addr> <dialog_token> <freq> <status_code> <result> */
2703ff40c12SJohn Marino #define GAS_QUERY_DONE "GAS-QUERY-DONE "
2713ff40c12SJohn Marino 
272*a1157835SDaniel Fojt /* parameters: <addr> <result> */
273*a1157835SDaniel Fojt #define ANQP_QUERY_DONE "ANQP-QUERY-DONE "
274*a1157835SDaniel Fojt 
275*a1157835SDaniel Fojt #define RX_ANQP "RX-ANQP "
276*a1157835SDaniel Fojt #define RX_HS20_ANQP "RX-HS20-ANQP "
277*a1157835SDaniel Fojt #define RX_HS20_ANQP_ICON "RX-HS20-ANQP-ICON "
278*a1157835SDaniel Fojt #define RX_HS20_ICON "RX-HS20-ICON "
279*a1157835SDaniel Fojt #define RX_MBO_ANQP "RX-MBO-ANQP "
280*a1157835SDaniel Fojt 
281*a1157835SDaniel Fojt /* parameters: <Venue Number> <Venue URL> */
282*a1157835SDaniel Fojt #define RX_VENUE_URL "RX-VENUE-URL "
283*a1157835SDaniel Fojt 
284*a1157835SDaniel Fojt #define HS20_SUBSCRIPTION_REMEDIATION "HS20-SUBSCRIPTION-REMEDIATION "
285*a1157835SDaniel Fojt #define HS20_DEAUTH_IMMINENT_NOTICE "HS20-DEAUTH-IMMINENT-NOTICE "
286*a1157835SDaniel Fojt #define HS20_T_C_ACCEPTANCE "HS20-T-C-ACCEPTANCE "
287*a1157835SDaniel Fojt 
2883ff40c12SJohn Marino #define EXT_RADIO_WORK_START "EXT-RADIO-WORK-START "
2893ff40c12SJohn Marino #define EXT_RADIO_WORK_TIMEOUT "EXT-RADIO-WORK-TIMEOUT "
2906d49e1aeSJan Lentfer 
291*a1157835SDaniel Fojt #define RRM_EVENT_NEIGHBOR_REP_RXED "RRM-NEIGHBOR-REP-RECEIVED "
292*a1157835SDaniel Fojt #define RRM_EVENT_NEIGHBOR_REP_FAILED "RRM-NEIGHBOR-REP-REQUEST-FAILED "
293*a1157835SDaniel Fojt 
2946d49e1aeSJan Lentfer /* hostapd control interface - fixed message prefixes */
2956d49e1aeSJan Lentfer #define WPS_EVENT_PIN_NEEDED "WPS-PIN-NEEDED "
2966d49e1aeSJan Lentfer #define WPS_EVENT_NEW_AP_SETTINGS "WPS-NEW-AP-SETTINGS "
2976d49e1aeSJan Lentfer #define WPS_EVENT_REG_SUCCESS "WPS-REG-SUCCESS "
2986d49e1aeSJan Lentfer #define WPS_EVENT_AP_SETUP_LOCKED "WPS-AP-SETUP-LOCKED "
2993ff40c12SJohn Marino #define WPS_EVENT_AP_SETUP_UNLOCKED "WPS-AP-SETUP-UNLOCKED "
3003ff40c12SJohn Marino #define WPS_EVENT_AP_PIN_ENABLED "WPS-AP-PIN-ENABLED "
3013ff40c12SJohn Marino #define WPS_EVENT_AP_PIN_DISABLED "WPS-AP-PIN-DISABLED "
3023ff40c12SJohn Marino #define AP_STA_CONNECTED "AP-STA-CONNECTED "
3033ff40c12SJohn Marino #define AP_STA_DISCONNECTED "AP-STA-DISCONNECTED "
304*a1157835SDaniel Fojt #define AP_STA_POSSIBLE_PSK_MISMATCH "AP-STA-POSSIBLE-PSK-MISMATCH "
305*a1157835SDaniel Fojt #define AP_STA_POLL_OK "AP-STA-POLL-OK "
3063ff40c12SJohn Marino 
3073ff40c12SJohn Marino #define AP_REJECTED_MAX_STA "AP-REJECTED-MAX-STA "
3083ff40c12SJohn Marino #define AP_REJECTED_BLOCKED_STA "AP-REJECTED-BLOCKED-STA "
3093ff40c12SJohn Marino 
310*a1157835SDaniel Fojt #define HS20_T_C_FILTERING_ADD "HS20-T-C-FILTERING-ADD "
311*a1157835SDaniel Fojt #define HS20_T_C_FILTERING_REMOVE "HS20-T-C-FILTERING-REMOVE "
312*a1157835SDaniel Fojt 
3133ff40c12SJohn Marino #define AP_EVENT_ENABLED "AP-ENABLED "
3143ff40c12SJohn Marino #define AP_EVENT_DISABLED "AP-DISABLED "
3153ff40c12SJohn Marino 
316*a1157835SDaniel Fojt #define INTERFACE_ENABLED "INTERFACE-ENABLED "
317*a1157835SDaniel Fojt #define INTERFACE_DISABLED "INTERFACE-DISABLED "
318*a1157835SDaniel Fojt 
3193ff40c12SJohn Marino #define ACS_EVENT_STARTED "ACS-STARTED "
3203ff40c12SJohn Marino #define ACS_EVENT_COMPLETED "ACS-COMPLETED "
3213ff40c12SJohn Marino #define ACS_EVENT_FAILED "ACS-FAILED "
3223ff40c12SJohn Marino 
3233ff40c12SJohn Marino #define DFS_EVENT_RADAR_DETECTED "DFS-RADAR-DETECTED "
3243ff40c12SJohn Marino #define DFS_EVENT_NEW_CHANNEL "DFS-NEW-CHANNEL "
3253ff40c12SJohn Marino #define DFS_EVENT_CAC_START "DFS-CAC-START "
3263ff40c12SJohn Marino #define DFS_EVENT_CAC_COMPLETED "DFS-CAC-COMPLETED "
3273ff40c12SJohn Marino #define DFS_EVENT_NOP_FINISHED "DFS-NOP-FINISHED "
328*a1157835SDaniel Fojt #define DFS_EVENT_PRE_CAC_EXPIRED "DFS-PRE-CAC-EXPIRED "
3293ff40c12SJohn Marino 
3303ff40c12SJohn Marino #define AP_CSA_FINISHED "AP-CSA-FINISHED "
3313ff40c12SJohn Marino 
332*a1157835SDaniel Fojt #define P2P_EVENT_LISTEN_OFFLOAD_STOP "P2P-LISTEN-OFFLOAD-STOPPED "
333*a1157835SDaniel Fojt #define P2P_LISTEN_OFFLOAD_STOP_REASON "P2P-LISTEN-OFFLOAD-STOP-REASON "
334*a1157835SDaniel Fojt 
335*a1157835SDaniel Fojt /* BSS Transition Management Response frame received */
336*a1157835SDaniel Fojt #define BSS_TM_RESP "BSS-TM-RESP "
337*a1157835SDaniel Fojt 
338*a1157835SDaniel Fojt /* Collocated Interference Request frame received;
339*a1157835SDaniel Fojt  * parameters: <dialog token> <automatic report enabled> <report timeout> */
340*a1157835SDaniel Fojt #define COLOC_INTF_REQ "COLOC-INTF-REQ "
341*a1157835SDaniel Fojt /* Collocated Interference Report frame received;
342*a1157835SDaniel Fojt  * parameters: <STA address> <dialog token> <hexdump of report elements> */
343*a1157835SDaniel Fojt #define COLOC_INTF_REPORT "COLOC-INTF-REPORT "
344*a1157835SDaniel Fojt 
345*a1157835SDaniel Fojt /* MBO IE with cellular data connection preference received */
346*a1157835SDaniel Fojt #define MBO_CELL_PREFERENCE "MBO-CELL-PREFERENCE "
347*a1157835SDaniel Fojt 
348*a1157835SDaniel Fojt /* BSS Transition Management Request received with MBO transition reason */
349*a1157835SDaniel Fojt #define MBO_TRANSITION_REASON "MBO-TRANSITION-REASON "
350*a1157835SDaniel Fojt 
351*a1157835SDaniel Fojt /* parameters: <STA address> <dialog token> <ack=0/1> */
352*a1157835SDaniel Fojt #define BEACON_REQ_TX_STATUS "BEACON-REQ-TX-STATUS "
353*a1157835SDaniel Fojt /* parameters: <STA address> <dialog token> <report mode> <beacon report> */
354*a1157835SDaniel Fojt #define BEACON_RESP_RX "BEACON-RESP-RX "
355*a1157835SDaniel Fojt 
356*a1157835SDaniel Fojt /* PMKSA cache entry added; parameters: <BSSID> <network_id> */
357*a1157835SDaniel Fojt #define PMKSA_CACHE_ADDED "PMKSA-CACHE-ADDED "
358*a1157835SDaniel Fojt /* PMKSA cache entry removed; parameters: <BSSID> <network_id> */
359*a1157835SDaniel Fojt #define PMKSA_CACHE_REMOVED "PMKSA-CACHE-REMOVED "
360*a1157835SDaniel Fojt 
361*a1157835SDaniel Fojt /* FILS HLP Container receive; parameters: dst=<addr> src=<addr> frame=<hexdump>
362*a1157835SDaniel Fojt  */
363*a1157835SDaniel Fojt #define FILS_HLP_RX "FILS-HLP-RX "
364*a1157835SDaniel Fojt 
365*a1157835SDaniel Fojt /* Event to indicate Probe Request frame;
366*a1157835SDaniel Fojt  * parameters: sa=<STA MAC address> signal=<signal> */
367*a1157835SDaniel Fojt #define RX_PROBE_REQUEST "RX-PROBE-REQUEST "
368*a1157835SDaniel Fojt 
369*a1157835SDaniel Fojt /* Event to indicate station's HT/VHT operation mode change information */
370*a1157835SDaniel Fojt #define STA_OPMODE_MAX_BW_CHANGED "STA-OPMODE-MAX-BW-CHANGED "
371*a1157835SDaniel Fojt #define STA_OPMODE_SMPS_MODE_CHANGED "STA-OPMODE-SMPS-MODE-CHANGED "
372*a1157835SDaniel Fojt #define STA_OPMODE_N_SS_CHANGED "STA-OPMODE-N_SS-CHANGED "
373*a1157835SDaniel Fojt 
374*a1157835SDaniel Fojt /* New interface addition or removal for 4addr WDS SDA */
375*a1157835SDaniel Fojt #define WDS_STA_INTERFACE_ADDED "WDS-STA-INTERFACE-ADDED "
376*a1157835SDaniel Fojt #define WDS_STA_INTERFACE_REMOVED "WDS-STA-INTERFACE-REMOVED "
377*a1157835SDaniel Fojt 
3783ff40c12SJohn Marino /* BSS command information masks */
3793ff40c12SJohn Marino 
3803ff40c12SJohn Marino #define WPA_BSS_MASK_ALL		0xFFFDFFFF
3813ff40c12SJohn Marino #define WPA_BSS_MASK_ID			BIT(0)
3823ff40c12SJohn Marino #define WPA_BSS_MASK_BSSID		BIT(1)
3833ff40c12SJohn Marino #define WPA_BSS_MASK_FREQ		BIT(2)
3843ff40c12SJohn Marino #define WPA_BSS_MASK_BEACON_INT		BIT(3)
3853ff40c12SJohn Marino #define WPA_BSS_MASK_CAPABILITIES	BIT(4)
3863ff40c12SJohn Marino #define WPA_BSS_MASK_QUAL		BIT(5)
3873ff40c12SJohn Marino #define WPA_BSS_MASK_NOISE		BIT(6)
3883ff40c12SJohn Marino #define WPA_BSS_MASK_LEVEL		BIT(7)
3893ff40c12SJohn Marino #define WPA_BSS_MASK_TSF		BIT(8)
3903ff40c12SJohn Marino #define WPA_BSS_MASK_AGE		BIT(9)
3913ff40c12SJohn Marino #define WPA_BSS_MASK_IE			BIT(10)
3923ff40c12SJohn Marino #define WPA_BSS_MASK_FLAGS		BIT(11)
3933ff40c12SJohn Marino #define WPA_BSS_MASK_SSID		BIT(12)
3943ff40c12SJohn Marino #define WPA_BSS_MASK_WPS_SCAN		BIT(13)
3953ff40c12SJohn Marino #define WPA_BSS_MASK_P2P_SCAN		BIT(14)
3963ff40c12SJohn Marino #define WPA_BSS_MASK_INTERNETW		BIT(15)
3973ff40c12SJohn Marino #define WPA_BSS_MASK_WIFI_DISPLAY	BIT(16)
3983ff40c12SJohn Marino #define WPA_BSS_MASK_DELIM		BIT(17)
399*a1157835SDaniel Fojt #define WPA_BSS_MASK_MESH_SCAN		BIT(18)
400*a1157835SDaniel Fojt #define WPA_BSS_MASK_SNR		BIT(19)
401*a1157835SDaniel Fojt #define WPA_BSS_MASK_EST_THROUGHPUT	BIT(20)
402*a1157835SDaniel Fojt #define WPA_BSS_MASK_FST		BIT(21)
403*a1157835SDaniel Fojt #define WPA_BSS_MASK_UPDATE_IDX		BIT(22)
404*a1157835SDaniel Fojt #define WPA_BSS_MASK_BEACON_IE		BIT(23)
405*a1157835SDaniel Fojt #define WPA_BSS_MASK_FILS_INDICATION	BIT(24)
406*a1157835SDaniel Fojt 
407*a1157835SDaniel Fojt 
408*a1157835SDaniel Fojt /* VENDOR_ELEM_* frame id values */
409*a1157835SDaniel Fojt enum wpa_vendor_elem_frame {
410*a1157835SDaniel Fojt 	VENDOR_ELEM_PROBE_REQ_P2P = 0,
411*a1157835SDaniel Fojt 	VENDOR_ELEM_PROBE_RESP_P2P = 1,
412*a1157835SDaniel Fojt 	VENDOR_ELEM_PROBE_RESP_P2P_GO = 2,
413*a1157835SDaniel Fojt 	VENDOR_ELEM_BEACON_P2P_GO = 3,
414*a1157835SDaniel Fojt 	VENDOR_ELEM_P2P_PD_REQ = 4,
415*a1157835SDaniel Fojt 	VENDOR_ELEM_P2P_PD_RESP = 5,
416*a1157835SDaniel Fojt 	VENDOR_ELEM_P2P_GO_NEG_REQ = 6,
417*a1157835SDaniel Fojt 	VENDOR_ELEM_P2P_GO_NEG_RESP = 7,
418*a1157835SDaniel Fojt 	VENDOR_ELEM_P2P_GO_NEG_CONF = 8,
419*a1157835SDaniel Fojt 	VENDOR_ELEM_P2P_INV_REQ = 9,
420*a1157835SDaniel Fojt 	VENDOR_ELEM_P2P_INV_RESP = 10,
421*a1157835SDaniel Fojt 	VENDOR_ELEM_P2P_ASSOC_REQ = 11,
422*a1157835SDaniel Fojt 	VENDOR_ELEM_P2P_ASSOC_RESP = 12,
423*a1157835SDaniel Fojt 	VENDOR_ELEM_ASSOC_REQ = 13,
424*a1157835SDaniel Fojt 	VENDOR_ELEM_PROBE_REQ = 14,
425*a1157835SDaniel Fojt 	NUM_VENDOR_ELEM_FRAMES
426*a1157835SDaniel Fojt };
4276d49e1aeSJan Lentfer 
4286d49e1aeSJan Lentfer 
4296d49e1aeSJan Lentfer /* wpa_supplicant/hostapd control interface access */
4306d49e1aeSJan Lentfer 
4316d49e1aeSJan Lentfer /**
4326d49e1aeSJan Lentfer  * wpa_ctrl_open - Open a control interface to wpa_supplicant/hostapd
4336d49e1aeSJan Lentfer  * @ctrl_path: Path for UNIX domain sockets; ignored if UDP sockets are used.
4346d49e1aeSJan Lentfer  * Returns: Pointer to abstract control interface data or %NULL on failure
4356d49e1aeSJan Lentfer  *
4366d49e1aeSJan Lentfer  * This function is used to open a control interface to wpa_supplicant/hostapd.
4376d49e1aeSJan Lentfer  * ctrl_path is usually /var/run/wpa_supplicant or /var/run/hostapd. This path
4386d49e1aeSJan Lentfer  * is configured in wpa_supplicant/hostapd and other programs using the control
4396d49e1aeSJan Lentfer  * interface need to use matching path configuration.
4406d49e1aeSJan Lentfer  */
4416d49e1aeSJan Lentfer struct wpa_ctrl * wpa_ctrl_open(const char *ctrl_path);
4426d49e1aeSJan Lentfer 
443*a1157835SDaniel Fojt /**
444*a1157835SDaniel Fojt  * wpa_ctrl_open2 - Open a control interface to wpa_supplicant/hostapd
445*a1157835SDaniel Fojt  * @ctrl_path: Path for UNIX domain sockets; ignored if UDP sockets are used.
446*a1157835SDaniel Fojt  * @cli_path: Path for client UNIX domain sockets; ignored if UDP socket
447*a1157835SDaniel Fojt  *            is used.
448*a1157835SDaniel Fojt  * Returns: Pointer to abstract control interface data or %NULL on failure
449*a1157835SDaniel Fojt  *
450*a1157835SDaniel Fojt  * This function is used to open a control interface to wpa_supplicant/hostapd
451*a1157835SDaniel Fojt  * when the socket path for client need to be specified explicitly. Default
452*a1157835SDaniel Fojt  * ctrl_path is usually /var/run/wpa_supplicant or /var/run/hostapd and client
453*a1157835SDaniel Fojt  * socket path is /tmp.
454*a1157835SDaniel Fojt  */
455*a1157835SDaniel Fojt struct wpa_ctrl * wpa_ctrl_open2(const char *ctrl_path, const char *cli_path);
456*a1157835SDaniel Fojt 
4576d49e1aeSJan Lentfer 
4586d49e1aeSJan Lentfer /**
4596d49e1aeSJan Lentfer  * wpa_ctrl_close - Close a control interface to wpa_supplicant/hostapd
4606d49e1aeSJan Lentfer  * @ctrl: Control interface data from wpa_ctrl_open()
4616d49e1aeSJan Lentfer  *
4626d49e1aeSJan Lentfer  * This function is used to close a control interface.
4636d49e1aeSJan Lentfer  */
4646d49e1aeSJan Lentfer void wpa_ctrl_close(struct wpa_ctrl *ctrl);
4656d49e1aeSJan Lentfer 
4666d49e1aeSJan Lentfer 
4676d49e1aeSJan Lentfer /**
4686d49e1aeSJan Lentfer  * wpa_ctrl_request - Send a command to wpa_supplicant/hostapd
4696d49e1aeSJan Lentfer  * @ctrl: Control interface data from wpa_ctrl_open()
4706d49e1aeSJan Lentfer  * @cmd: Command; usually, ASCII text, e.g., "PING"
4716d49e1aeSJan Lentfer  * @cmd_len: Length of the cmd in bytes
4726d49e1aeSJan Lentfer  * @reply: Buffer for the response
4736d49e1aeSJan Lentfer  * @reply_len: Reply buffer length
4746d49e1aeSJan Lentfer  * @msg_cb: Callback function for unsolicited messages or %NULL if not used
4756d49e1aeSJan Lentfer  * Returns: 0 on success, -1 on error (send or receive failed), -2 on timeout
4766d49e1aeSJan Lentfer  *
4776d49e1aeSJan Lentfer  * This function is used to send commands to wpa_supplicant/hostapd. Received
4786d49e1aeSJan Lentfer  * response will be written to reply and reply_len is set to the actual length
479*a1157835SDaniel Fojt  * of the reply. This function will block for up to 10 seconds while waiting
4806d49e1aeSJan Lentfer  * for the reply. If unsolicited messages are received, the blocking time may
4816d49e1aeSJan Lentfer  * be longer.
4826d49e1aeSJan Lentfer  *
4836d49e1aeSJan Lentfer  * msg_cb can be used to register a callback function that will be called for
4846d49e1aeSJan Lentfer  * unsolicited messages received while waiting for the command response. These
4856d49e1aeSJan Lentfer  * messages may be received if wpa_ctrl_request() is called at the same time as
4866d49e1aeSJan Lentfer  * wpa_supplicant/hostapd is sending such a message. This can happen only if
4876d49e1aeSJan Lentfer  * the program has used wpa_ctrl_attach() to register itself as a monitor for
4886d49e1aeSJan Lentfer  * event messages. Alternatively to msg_cb, programs can register two control
4896d49e1aeSJan Lentfer  * interface connections and use one of them for commands and the other one for
4906d49e1aeSJan Lentfer  * receiving event messages, in other words, call wpa_ctrl_attach() only for
4916d49e1aeSJan Lentfer  * the control interface connection that will be used for event messages.
4926d49e1aeSJan Lentfer  */
4936d49e1aeSJan Lentfer int wpa_ctrl_request(struct wpa_ctrl *ctrl, const char *cmd, size_t cmd_len,
4946d49e1aeSJan Lentfer 		     char *reply, size_t *reply_len,
4956d49e1aeSJan Lentfer 		     void (*msg_cb)(char *msg, size_t len));
4966d49e1aeSJan Lentfer 
4976d49e1aeSJan Lentfer 
4986d49e1aeSJan Lentfer /**
4996d49e1aeSJan Lentfer  * wpa_ctrl_attach - Register as an event monitor for the control interface
5006d49e1aeSJan Lentfer  * @ctrl: Control interface data from wpa_ctrl_open()
5016d49e1aeSJan Lentfer  * Returns: 0 on success, -1 on failure, -2 on timeout
5026d49e1aeSJan Lentfer  *
5036d49e1aeSJan Lentfer  * This function registers the control interface connection as a monitor for
5046d49e1aeSJan Lentfer  * wpa_supplicant/hostapd events. After a success wpa_ctrl_attach() call, the
5056d49e1aeSJan Lentfer  * control interface connection starts receiving event messages that can be
5066d49e1aeSJan Lentfer  * read with wpa_ctrl_recv().
5076d49e1aeSJan Lentfer  */
5086d49e1aeSJan Lentfer int wpa_ctrl_attach(struct wpa_ctrl *ctrl);
5096d49e1aeSJan Lentfer 
5106d49e1aeSJan Lentfer 
5116d49e1aeSJan Lentfer /**
5126d49e1aeSJan Lentfer  * wpa_ctrl_detach - Unregister event monitor from the control interface
5136d49e1aeSJan Lentfer  * @ctrl: Control interface data from wpa_ctrl_open()
5146d49e1aeSJan Lentfer  * Returns: 0 on success, -1 on failure, -2 on timeout
5156d49e1aeSJan Lentfer  *
5166d49e1aeSJan Lentfer  * This function unregisters the control interface connection as a monitor for
5176d49e1aeSJan Lentfer  * wpa_supplicant/hostapd events, i.e., cancels the registration done with
5186d49e1aeSJan Lentfer  * wpa_ctrl_attach().
5196d49e1aeSJan Lentfer  */
5206d49e1aeSJan Lentfer int wpa_ctrl_detach(struct wpa_ctrl *ctrl);
5216d49e1aeSJan Lentfer 
5226d49e1aeSJan Lentfer 
5236d49e1aeSJan Lentfer /**
5246d49e1aeSJan Lentfer  * wpa_ctrl_recv - Receive a pending control interface message
5256d49e1aeSJan Lentfer  * @ctrl: Control interface data from wpa_ctrl_open()
5266d49e1aeSJan Lentfer  * @reply: Buffer for the message data
5276d49e1aeSJan Lentfer  * @reply_len: Length of the reply buffer
5286d49e1aeSJan Lentfer  * Returns: 0 on success, -1 on failure
5296d49e1aeSJan Lentfer  *
530*a1157835SDaniel Fojt  * This function will receive a pending control interface message. The received
531*a1157835SDaniel Fojt  * response will be written to reply and reply_len is set to the actual length
532*a1157835SDaniel Fojt  * of the reply.
533*a1157835SDaniel Fojt 
5346d49e1aeSJan Lentfer  * wpa_ctrl_recv() is only used for event messages, i.e., wpa_ctrl_attach()
5356d49e1aeSJan Lentfer  * must have been used to register the control interface as an event monitor.
5366d49e1aeSJan Lentfer  */
5376d49e1aeSJan Lentfer int wpa_ctrl_recv(struct wpa_ctrl *ctrl, char *reply, size_t *reply_len);
5386d49e1aeSJan Lentfer 
5396d49e1aeSJan Lentfer 
5406d49e1aeSJan Lentfer /**
5416d49e1aeSJan Lentfer  * wpa_ctrl_pending - Check whether there are pending event messages
5426d49e1aeSJan Lentfer  * @ctrl: Control interface data from wpa_ctrl_open()
5436d49e1aeSJan Lentfer  * Returns: 1 if there are pending messages, 0 if no, or -1 on error
5446d49e1aeSJan Lentfer  *
5456d49e1aeSJan Lentfer  * This function will check whether there are any pending control interface
5466d49e1aeSJan Lentfer  * message available to be received with wpa_ctrl_recv(). wpa_ctrl_pending() is
5476d49e1aeSJan Lentfer  * only used for event messages, i.e., wpa_ctrl_attach() must have been used to
5486d49e1aeSJan Lentfer  * register the control interface as an event monitor.
5496d49e1aeSJan Lentfer  */
5506d49e1aeSJan Lentfer int wpa_ctrl_pending(struct wpa_ctrl *ctrl);
5516d49e1aeSJan Lentfer 
5526d49e1aeSJan Lentfer 
5536d49e1aeSJan Lentfer /**
5546d49e1aeSJan Lentfer  * wpa_ctrl_get_fd - Get file descriptor used by the control interface
5556d49e1aeSJan Lentfer  * @ctrl: Control interface data from wpa_ctrl_open()
5566d49e1aeSJan Lentfer  * Returns: File descriptor used for the connection
5576d49e1aeSJan Lentfer  *
5586d49e1aeSJan Lentfer  * This function can be used to get the file descriptor that is used for the
5596d49e1aeSJan Lentfer  * control interface connection. The returned value can be used, e.g., with
5606d49e1aeSJan Lentfer  * select() while waiting for multiple events.
5616d49e1aeSJan Lentfer  *
5626d49e1aeSJan Lentfer  * The returned file descriptor must not be used directly for sending or
5636d49e1aeSJan Lentfer  * receiving packets; instead, the library functions wpa_ctrl_request() and
5646d49e1aeSJan Lentfer  * wpa_ctrl_recv() must be used for this.
5656d49e1aeSJan Lentfer  */
5666d49e1aeSJan Lentfer int wpa_ctrl_get_fd(struct wpa_ctrl *ctrl);
5676d49e1aeSJan Lentfer 
5683ff40c12SJohn Marino #ifdef ANDROID
5693ff40c12SJohn Marino /**
5703ff40c12SJohn Marino  * wpa_ctrl_cleanup() - Delete any local UNIX domain socket files that
5713ff40c12SJohn Marino  * may be left over from clients that were previously connected to
5723ff40c12SJohn Marino  * wpa_supplicant. This keeps these files from being orphaned in the
5733ff40c12SJohn Marino  * event of crashes that prevented them from being removed as part
5743ff40c12SJohn Marino  * of the normal orderly shutdown.
5753ff40c12SJohn Marino  */
5763ff40c12SJohn Marino void wpa_ctrl_cleanup(void);
5773ff40c12SJohn Marino #endif /* ANDROID */
5783ff40c12SJohn Marino 
5796d49e1aeSJan Lentfer #ifdef CONFIG_CTRL_IFACE_UDP
5803ff40c12SJohn Marino /* Port range for multiple wpa_supplicant instances and multiple VIFs */
5816d49e1aeSJan Lentfer #define WPA_CTRL_IFACE_PORT 9877
5823ff40c12SJohn Marino #define WPA_CTRL_IFACE_PORT_LIMIT 50 /* decremented from start */
5836d49e1aeSJan Lentfer #define WPA_GLOBAL_CTRL_IFACE_PORT 9878
5843ff40c12SJohn Marino #define WPA_GLOBAL_CTRL_IFACE_PORT_LIMIT 20 /* incremented from start */
585*a1157835SDaniel Fojt 
586*a1157835SDaniel Fojt char * wpa_ctrl_get_remote_ifname(struct wpa_ctrl *ctrl);
5876d49e1aeSJan Lentfer #endif /* CONFIG_CTRL_IFACE_UDP */
5886d49e1aeSJan Lentfer 
5896d49e1aeSJan Lentfer 
5906d49e1aeSJan Lentfer #ifdef  __cplusplus
5916d49e1aeSJan Lentfer }
5926d49e1aeSJan Lentfer #endif
5936d49e1aeSJan Lentfer 
5946d49e1aeSJan Lentfer #endif /* WPA_CTRL_H */
595