Fix to handle scan events initiated by wpa_supplicant
[platform/upstream/connman.git] / gsupplicant / gsupplicant.h
1 /*
2  *
3  *  WPA supplicant library with GLib integration
4  *
5  *  Copyright (C) 2012-2013  Intel Corporation. All rights reserved.
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License version 2 as
9  *  published by the Free Software Foundation.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  */
21 #ifndef __G_SUPPLICANT_H
22 #define __G_SUPPLICANT_H
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 #define G_SUPPLICANT_EAP_METHOD_MD5     (1 << 0)
29 #define G_SUPPLICANT_EAP_METHOD_TLS     (1 << 1)
30 #define G_SUPPLICANT_EAP_METHOD_MSCHAPV2        (1 << 2)
31 #define G_SUPPLICANT_EAP_METHOD_PEAP    (1 << 3)
32 #define G_SUPPLICANT_EAP_METHOD_TTLS    (1 << 4)
33 #define G_SUPPLICANT_EAP_METHOD_GTC     (1 << 5)
34 #define G_SUPPLICANT_EAP_METHOD_OTP     (1 << 6)
35 #define G_SUPPLICANT_EAP_METHOD_LEAP    (1 << 7)
36 #define G_SUPPLICANT_EAP_METHOD_WSC     (1 << 8)
37
38 #define G_SUPPLICANT_CAPABILITY_AUTHALG_OPEN    (1 << 0)
39 #define G_SUPPLICANT_CAPABILITY_AUTHALG_SHARED  (1 << 1)
40 #define G_SUPPLICANT_CAPABILITY_AUTHALG_LEAP    (1 << 2)
41
42 #define G_SUPPLICANT_CAPABILITY_PROTO_WPA               (1 << 0)
43 #define G_SUPPLICANT_CAPABILITY_PROTO_RSN               (1 << 1)
44
45 #define G_SUPPLICANT_CAPABILITY_SCAN_ACTIVE     (1 << 0)
46 #define G_SUPPLICANT_CAPABILITY_SCAN_PASSIVE    (1 << 1)
47 #define G_SUPPLICANT_CAPABILITY_SCAN_SSID               (1 << 2)
48
49 #define G_SUPPLICANT_CAPABILITY_MODE_INFRA      (1 << 0)
50 #define G_SUPPLICANT_CAPABILITY_MODE_IBSS               (1 << 1)
51 #define G_SUPPLICANT_CAPABILITY_MODE_AP         (1 << 2)
52 #define G_SUPPLICANT_CAPABILITY_MODE_P2P        (1 << 3)
53 #if defined TIZEN_EXT_WIFI_MESH
54 #define G_SUPPLICANT_CAPABILITY_MODE_MESH      (1 << 4)
55 #endif
56
57 #define G_SUPPLICANT_KEYMGMT_NONE               (1 << 0)
58 #define G_SUPPLICANT_KEYMGMT_IEEE8021X  (1 << 1)
59 #define G_SUPPLICANT_KEYMGMT_WPA_NONE   (1 << 2)
60 #define G_SUPPLICANT_KEYMGMT_WPA_PSK    (1 << 3)
61 #define G_SUPPLICANT_KEYMGMT_WPA_PSK_256        (1 << 4)
62 #if defined TIZEN_EXT
63 #define G_SUPPLICANT_KEYMGMT_WPA_FT_EAP (1 << 5)
64 #define G_SUPPLICANT_KEYMGMT_WPA_FT_PSK (1 << 6)
65 #else
66 #define G_SUPPLICANT_KEYMGMT_WPA_FT_PSK (1 << 5)
67 #define G_SUPPLICANT_KEYMGMT_WPA_FT_EAP (1 << 6)
68 #endif
69 #define G_SUPPLICANT_KEYMGMT_WPA_EAP    (1 << 7)
70 #define G_SUPPLICANT_KEYMGMT_WPA_EAP_256        (1 << 8)
71 #define G_SUPPLICANT_KEYMGMT_WPS                (1 << 9)
72 #if defined TIZEN_EXT
73 #define G_SUPPLICANT_KEYMGMT_SAE                (1 << 10)
74 #define G_SUPPLICANT_KEYMGMT_OWE                (1 << 22)
75 #define G_SUPPLICANT_KEYMGMT_DPP                (1 << 23)
76 #endif
77
78 #define G_SUPPLICANT_PROTO_WPA          (1 << 0)
79 #define G_SUPPLICANT_PROTO_RSN          (1 << 1)
80
81 #define G_SUPPLICANT_GROUP_WEP40                (1 << 0)
82 #define G_SUPPLICANT_GROUP_WEP104               (1 << 1)
83 #define G_SUPPLICANT_GROUP_TKIP         (1 << 2)
84 #define G_SUPPLICANT_GROUP_CCMP         (1 << 3)
85
86 #define G_SUPPLICANT_PAIRWISE_NONE      (1 << 0)
87 #define G_SUPPLICANT_PAIRWISE_TKIP      (1 << 1)
88 #define G_SUPPLICANT_PAIRWISE_CCMP      (1 << 2)
89
90 #define G_SUPPLICANT_WPS_CONFIGURED     (1 << 0)
91 #define G_SUPPLICANT_WPS_PBC            (1 << 1)
92 #define G_SUPPLICANT_WPS_PIN            (1 << 2)
93 #define G_SUPPLICANT_WPS_REGISTRAR      (1 << 3)
94
95 #define G_SUPPLICANT_WPS_CONFIG_PBC     0x0080
96
97 #define G_SUPPLICANT_GROUP_ROLE_CLIENT  (1 << 0)
98 #define G_SUPPLICANT_GROUP_ROLE_GO      (1 << 1)
99
100 typedef enum {
101         G_SUPPLICANT_MODE_UNKNOWN,
102         G_SUPPLICANT_MODE_INFRA,
103         G_SUPPLICANT_MODE_IBSS,
104         G_SUPPLICANT_MODE_MASTER,
105 #if defined TIZEN_EXT_WIFI_MESH
106         G_SUPPLICANT_MODE_MESH,
107 #endif
108 } GSupplicantMode;
109
110 #if defined TIZEN_EXT_WIFI_MESH
111 typedef enum {
112         G_SUPPLICANT_IEEE80211W_UNKNOWN,
113         G_SUPPLICANT_IEEE80211W_OPTIONAL,
114         G_SUPPLICANT_IEEE80211W_REQUIRED,
115 } GSupplicantPmf;
116 #endif
117
118 typedef enum {
119         G_SUPPLICANT_SECURITY_UNKNOWN,
120         G_SUPPLICANT_SECURITY_NONE,
121         G_SUPPLICANT_SECURITY_WEP,
122         G_SUPPLICANT_SECURITY_PSK,
123         G_SUPPLICANT_SECURITY_IEEE8021X,
124 #if defined TIZEN_EXT
125         G_SUPPLICANT_SECURITY_FT_PSK,
126         G_SUPPLICANT_SECURITY_FT_IEEE8021X,
127         G_SUPPLICANT_SECURITY_SAE,
128         G_SUPPLICANT_SECURITY_OWE,
129         G_SUPPLICANT_SECURITY_DPP,
130 #endif
131 } GSupplicantSecurity;
132
133 #if defined TIZEN_EXT
134 typedef enum {
135         G_SUPPLICANT_EAP_KEYMGMT_NONE,
136         G_SUPPLICANT_EAP_KEYMGMT_FT,
137         G_SUPPLICANT_EAP_KEYMGMT_CCKM,
138         G_SUPPLICANT_EAP_KEYMGMT_OKC,
139 } GSupplicantEapKeymgmt;
140
141 typedef enum {
142         G_SUPPLICANT_MODE_IEEE80211_UNKNOWN,
143         G_SUPPLICANT_MODE_IEEE80211B,
144         G_SUPPLICANT_MODE_IEEE80211BG,
145         G_SUPPLICANT_MODE_IEEE80211BGN,
146         G_SUPPLICANT_MODE_IEEE80211A,
147         G_SUPPLICANT_MODE_IEEE80211AN,
148         G_SUPPLICANT_MODE_IEEE80211ANAC,
149 } GSupplicantPhy_mode;
150 #endif
151
152 typedef enum {
153         G_SUPPLICANT_STATE_UNKNOWN,
154         G_SUPPLICANT_STATE_DISABLED,
155         G_SUPPLICANT_STATE_DISCONNECTED,
156         G_SUPPLICANT_STATE_INACTIVE,
157         G_SUPPLICANT_STATE_SCANNING,
158         G_SUPPLICANT_STATE_AUTHENTICATING,
159         G_SUPPLICANT_STATE_ASSOCIATING,
160         G_SUPPLICANT_STATE_ASSOCIATED,
161         G_SUPPLICANT_STATE_4WAY_HANDSHAKE,
162         G_SUPPLICANT_STATE_GROUP_HANDSHAKE,
163         G_SUPPLICANT_STATE_COMPLETED,
164 } GSupplicantState;
165
166 typedef enum {
167         G_SUPPLICANT_WPS_STATE_UNKNOWN,
168         G_SUPPLICANT_WPS_STATE_SUCCESS,
169         G_SUPPLICANT_WPS_STATE_FAIL,
170 } GSupplicantWpsState;
171
172 typedef enum {
173         G_SUPPLICANT_PEER_SERVICES_CHANGED,
174         G_SUPPLICANT_PEER_GROUP_CHANGED,
175         G_SUPPLICANT_PEER_GROUP_STARTED,
176         G_SUPPLICANT_PEER_GROUP_FINISHED,
177         G_SUPPLICANT_PEER_GROUP_JOINED,
178         G_SUPPLICANT_PEER_GROUP_DISCONNECTED,
179         G_SUPPLICANT_PEER_GROUP_FAILED,
180 } GSupplicantPeerState;
181
182 struct _GSupplicantSSID {
183 #if defined TIZEN_EXT
184         void *ssid;
185 #else
186         const void *ssid;
187 #endif
188         unsigned int ssid_len;
189         unsigned int scan_ssid;
190         GSupplicantMode mode;
191         GSupplicantSecurity security;
192         unsigned int protocol;
193         unsigned int pairwise_cipher;
194         unsigned int group_cipher;
195         unsigned int freq;
196         const char *eap;
197         const char *passphrase;
198         const char *identity;
199         const char *anonymous_identity;
200         const char *ca_cert_path;
201         const char *subject_match;
202         const char *altsubject_match;
203         const char *domain_suffix_match;
204         const char *domain_match;
205         const char *client_cert_path;
206         const char *private_key_path;
207         const char *private_key_passphrase;
208         const char *phase2_auth;
209         dbus_bool_t use_wps;
210         const char *pin_wps;
211         const char *bgscan;
212 #if defined TIZEN_EXT
213         unsigned char *bssid;
214         unsigned int bssid_for_connect_len;
215         unsigned char bssid_for_connect[6];
216         GSupplicantEapKeymgmt eap_keymgmt;
217         const char *phase1;
218         const char *pac_file;
219         uint16_t ieee80211w;
220         const char *connector;
221         const char *c_sign_key;
222         const char *net_access_key;
223 #endif
224 };
225
226 typedef struct _GSupplicantSSID GSupplicantSSID;
227
228 /*
229  * Max number of SSIDs that can be scanned.
230  * In wpa_s 0.7x the limit is 4.
231  * In wps_s 0.8 or later it is 16.
232  * The value is only used if wpa_supplicant does not return any max limit
233  * for number of scannable SSIDs.
234  */
235 #define WPAS_MAX_SCAN_SSIDS 4
236
237 struct scan_ssid {
238         unsigned char ssid[32];
239         uint8_t ssid_len;
240 };
241
242 struct _GSupplicantScanParams {
243         GSList *ssids;
244
245         uint8_t num_ssids;
246
247         uint8_t num_freqs;
248         uint16_t *freqs;
249 };
250
251 typedef struct _GSupplicantScanParams GSupplicantScanParams;
252
253 struct _GSupplicantPeerParams {
254         bool master;
255         char *wps_pin;
256         char *path;
257 };
258
259 typedef struct _GSupplicantPeerParams GSupplicantPeerParams;
260
261 struct _GSupplicantP2PServiceParams {
262         int version;
263         char *service;
264         unsigned char *query;
265         int query_length;
266         unsigned char *response;
267         int response_length;
268         unsigned char *wfd_ies;
269         int wfd_ies_length;
270 };
271
272 typedef struct _GSupplicantP2PServiceParams GSupplicantP2PServiceParams;
273
274 /* global API */
275 typedef void (*GSupplicantCountryCallback) (int result,
276                                                 const char *alpha2,
277                                                         void *user_data);
278
279 int g_supplicant_set_country(const char *alpha2,
280                                 GSupplicantCountryCallback callback,
281                                                 const void *user_data);
282
283 /* Interface API */
284 struct _GSupplicantInterface;
285 struct _GSupplicantPeer;
286
287 typedef struct _GSupplicantInterface GSupplicantInterface;
288 typedef struct _GSupplicantPeer GSupplicantPeer;
289 #if defined TIZEN_EXT_WIFI_MESH
290 typedef struct _GSupplicantMeshPeer GSupplicantMeshPeer;
291 #endif
292
293 typedef void (*GSupplicantInterfaceCallback) (int result,
294                                         GSupplicantInterface *interface,
295                                                         void *user_data);
296
297 #if defined TIZEN_EXT
298 typedef void (*GSupplicantMaxSpeedCallback) (int result, int maxspeed,
299                                              int strength, void *user_data);
300 #endif
301
302 void g_supplicant_interface_cancel(GSupplicantInterface *interface);
303
304 int g_supplicant_interface_create(const char *ifname, const char *driver,
305                                         const char *bridge,
306                                         GSupplicantInterfaceCallback callback,
307                                                         void *user_data);
308 int g_supplicant_interface_remove(GSupplicantInterface *interface,
309                                         GSupplicantInterfaceCallback callback,
310                                                         void *user_data);
311 int g_supplicant_interface_scan(GSupplicantInterface *interface,
312                                         GSupplicantScanParams *scan_data,
313                                         GSupplicantInterfaceCallback callback,
314                                                         void *user_data);
315
316 #if defined TIZEN_EXT
317 int g_supplicant_interface_signalpoll(GSupplicantInterface *interface,
318                                         GSupplicantMaxSpeedCallback callback,
319                                         void *user_data);
320 #endif
321
322 int g_supplicant_interface_p2p_find(GSupplicantInterface *interface,
323                                         GSupplicantInterfaceCallback callback,
324                                                         void *user_data);
325
326 int g_supplicant_interface_p2p_stop_find(GSupplicantInterface *interface);
327
328 int g_supplicant_interface_p2p_connect(GSupplicantInterface *interface,
329                                         GSupplicantPeerParams *peer_params,
330                                         GSupplicantInterfaceCallback callback,
331                                         void *user_data);
332
333 int g_supplicant_interface_p2p_disconnect(GSupplicantInterface *interface,
334                                         GSupplicantPeerParams *peer_params);
335
336 int g_supplicant_interface_p2p_listen(GSupplicantInterface *interface,
337                                                 int period, int interval);
338
339 int g_supplicant_interface_p2p_add_service(GSupplicantInterface *interface,
340                                 GSupplicantInterfaceCallback callback,
341                                 GSupplicantP2PServiceParams *p2p_service_params,
342                                 void *user_data);
343
344 int g_supplicant_interface_p2p_del_service(GSupplicantInterface *interface,
345                                 GSupplicantP2PServiceParams *p2p_service_params);
346
347 int g_supplicant_set_widi_ies(GSupplicantP2PServiceParams *p2p_service_params,
348                                         GSupplicantInterfaceCallback callback,
349                                         void *user_data);
350
351 int g_supplicant_interface_connect(GSupplicantInterface *interface,
352                                         GSupplicantSSID *ssid,
353                                         GSupplicantInterfaceCallback callback,
354                                                         void *user_data);
355
356 int g_supplicant_interface_disconnect(GSupplicantInterface *interface,
357                                         GSupplicantInterfaceCallback callback,
358                                                         void *user_data);
359
360 int g_supplicant_interface_set_apscan(GSupplicantInterface *interface,
361                                                         unsigned int ap_scan);
362
363 void g_supplicant_interface_set_data(GSupplicantInterface *interface,
364                                                                 void *data);
365 void *g_supplicant_interface_get_data(GSupplicantInterface *interface);
366 const char *g_supplicant_interface_get_ifname(GSupplicantInterface *interface);
367 #if defined TIZEN_EXT
368 bool g_supplicant_interface_get_is_5_0_ghz_supported(GSupplicantInterface *interface);
369 #endif
370 const char *g_supplicant_interface_get_driver(GSupplicantInterface *interface);
371 GSupplicantState g_supplicant_interface_get_state(GSupplicantInterface *interface);
372 const char *g_supplicant_interface_get_wps_key(GSupplicantInterface *interface);
373 const void *g_supplicant_interface_get_wps_ssid(GSupplicantInterface *interface,
374                                                         unsigned int *ssid_len);
375 GSupplicantWpsState g_supplicant_interface_get_wps_state(GSupplicantInterface *interface);
376 unsigned int g_supplicant_interface_get_mode(GSupplicantInterface *interface);
377 dbus_bool_t g_supplicant_interface_get_ready(GSupplicantInterface *interface);
378 unsigned int g_supplicant_interface_get_max_scan_ssids(
379                                         GSupplicantInterface *interface);
380
381 int g_supplicant_interface_enable_selected_network(GSupplicantInterface *interface,
382                                                         dbus_bool_t enable);
383 int g_supplicant_interface_set_country(GSupplicantInterface *interface,
384                                         GSupplicantCountryCallback callback,
385                                                         const char *alpha2,
386                                                         void *user_data);
387 bool g_supplicant_interface_has_p2p(GSupplicantInterface *interface);
388 int g_supplicant_interface_set_p2p_device_config(GSupplicantInterface *interface,
389                                                 const char *device_name,
390                                                 const char *primary_dev_type);
391 GSupplicantPeer *g_supplicant_interface_peer_lookup(GSupplicantInterface *interface,
392                                                 const char *identifier);
393 bool g_supplicant_interface_is_p2p_finding(GSupplicantInterface *interface);
394
395 #if defined TIZEN_EXT_WIFI_MESH
396 bool g_supplicant_interface_has_mesh(GSupplicantInterface *interface);
397 int g_supplicant_mesh_interface_create(const char *ifname, const char *driver,
398                                                 const char *bridge, const char *parent_ifname,
399                                                 GSupplicantInterfaceCallback callback, void *user_data);
400 const void *g_supplicant_interface_get_mesh_group_ssid(
401                                                         GSupplicantInterface *interface,
402                                                         unsigned int *ssid_len);
403 int g_supplicant_mesh_get_disconnect_reason(GSupplicantInterface *interface);
404 const char *g_supplicant_mesh_peer_get_address(GSupplicantMeshPeer *mesh_peer);
405 int g_supplicant_mesh_peer_get_disconnect_reason(
406                                                         GSupplicantMeshPeer *mesh_peer);
407 int g_supplicant_interface_abort_scan(GSupplicantInterface *interface,
408                                 GSupplicantInterfaceCallback callback, void *user_data);
409 int g_supplicant_interface_mesh_peer_change_status(
410                                 GSupplicantInterface *interface,
411                                 GSupplicantInterfaceCallback callback, const char *peer_address,
412                                 const char *method, void *user_data);
413 #endif
414
415 /* Network and Peer API */
416 struct _GSupplicantNetwork;
417 struct _GSupplicantGroup;
418
419 typedef struct _GSupplicantNetwork GSupplicantNetwork;
420 typedef struct _GSupplicantGroup GSupplicantGroup;
421
422 GSupplicantInterface *g_supplicant_network_get_interface(GSupplicantNetwork *network);
423 const char *g_supplicant_network_get_name(GSupplicantNetwork *network);
424 const char *g_supplicant_network_get_identifier(GSupplicantNetwork *network);
425 const char *g_supplicant_network_get_path(GSupplicantNetwork *network);
426 const void *g_supplicant_network_get_ssid(GSupplicantNetwork *network,
427                                                         unsigned int *ssid_len);
428 const char *g_supplicant_network_get_mode(GSupplicantNetwork *network);
429 const char *g_supplicant_network_get_security(GSupplicantNetwork *network);
430 dbus_int16_t g_supplicant_network_get_signal(GSupplicantNetwork *network);
431 dbus_uint16_t g_supplicant_network_get_frequency(GSupplicantNetwork *network);
432 dbus_bool_t g_supplicant_network_get_wps(GSupplicantNetwork *network);
433 dbus_bool_t g_supplicant_network_is_wps_active(GSupplicantNetwork *network);
434 dbus_bool_t g_supplicant_network_is_wps_pbc(GSupplicantNetwork *network);
435 dbus_bool_t g_supplicant_network_is_wps_advertizing(GSupplicantNetwork *network);
436
437 GSupplicantInterface *g_supplicant_peer_get_interface(GSupplicantPeer *peer);
438 const char *g_supplicant_peer_get_path(GSupplicantPeer *peer);
439 const char *g_supplicant_peer_get_identifier(GSupplicantPeer *peer);
440 const void *g_supplicant_peer_get_device_address(GSupplicantPeer *peer);
441 const void *g_supplicant_peer_get_iface_address(GSupplicantPeer *peer);
442 const char *g_supplicant_peer_get_name(GSupplicantPeer *peer);
443 const unsigned char *g_supplicant_peer_get_widi_ies(GSupplicantPeer *peer,
444                                                                 int *length);
445 bool g_supplicant_peer_is_wps_pbc(GSupplicantPeer *peer);
446 bool g_supplicant_peer_is_wps_pin(GSupplicantPeer *peer);
447 bool g_supplicant_peer_is_in_a_group(GSupplicantPeer *peer);
448 GSupplicantInterface *g_supplicant_peer_get_group_interface(GSupplicantPeer *peer);
449 bool g_supplicant_peer_is_client(GSupplicantPeer *peer);
450 bool g_supplicant_peer_has_requested_connection(GSupplicantPeer *peer);
451
452 #if defined TIZEN_EXT
453 /*
454 * Description: Network client requires additional wifi specific info
455 */
456 const unsigned char *g_supplicant_network_get_bssid(
457                                                 GSupplicantNetwork *network);
458 unsigned int g_supplicant_network_get_maxrate(GSupplicantNetwork *network);
459 const char *g_supplicant_network_get_enc_mode(GSupplicantNetwork *network);
460 bool g_supplicant_network_get_rsn_mode(GSupplicantNetwork *network);
461 bool g_supplicant_network_is_hs20AP(GSupplicantNetwork *network);
462 const char *g_supplicant_network_get_eap(GSupplicantNetwork *network);
463 const char *g_supplicant_network_get_identity(GSupplicantNetwork *network);
464 const char *g_supplicant_network_get_phase2(GSupplicantNetwork *network);
465 unsigned int g_supplicant_network_get_keymgmt(GSupplicantNetwork *network);
466 void *g_supplicant_network_get_wifi_vsie(GSupplicantNetwork *network);
467 const unsigned char *g_supplicant_network_get_countrycode(GSupplicantNetwork
468                                                           *network);
469 void *g_supplicant_network_get_bssid_list(GSupplicantNetwork *network);
470 GSupplicantPhy_mode g_supplicant_network_get_phy_mode(GSupplicantNetwork *network);
471 #endif
472
473 struct _GSupplicantCallbacks {
474         void (*system_ready) (void);
475         void (*system_killed) (void);
476         void (*interface_added) (GSupplicantInterface *interface);
477         void (*interface_state) (GSupplicantInterface *interface);
478         void (*interface_removed) (GSupplicantInterface *interface);
479         void (*p2p_support) (GSupplicantInterface *interface);
480         void (*scan_started) (GSupplicantInterface *interface);
481         void (*scan_finished) (GSupplicantInterface *interface);
482         void (*ap_create_fail) (GSupplicantInterface *interface);
483         void (*network_added) (GSupplicantNetwork *network);
484         void (*network_removed) (GSupplicantNetwork *network);
485 #if defined TIZEN_EXT
486         void (*network_merged) (GSupplicantNetwork *network);
487 #endif
488         void (*network_changed) (GSupplicantNetwork *network,
489                                         const char *property);
490         void (*network_associated) (GSupplicantNetwork *network);
491 #if defined TIZEN_EXT
492         void (*system_power_off) (void);
493         void (*assoc_failed) (void *user_data);
494         void (*scan_done) (GSupplicantInterface *interface);
495 #endif
496         void (*sta_authorized) (GSupplicantInterface *interface,
497                                         const char *addr);
498         void (*sta_deauthorized) (GSupplicantInterface *interface,
499                                         const char *addr);
500         void (*peer_found) (GSupplicantPeer *peer);
501         void (*peer_lost) (GSupplicantPeer *peer);
502         void (*peer_changed) (GSupplicantPeer *peer,
503                                         GSupplicantPeerState state);
504         void (*peer_request) (GSupplicantPeer *peer);
505         void (*debug) (const char *str);
506         void (*disconnect_reasoncode)(GSupplicantInterface *interface,
507                                 int reasoncode);
508         void (*assoc_status_code)(GSupplicantInterface *interface,
509                                 int reasoncode);
510 #if defined TIZEN_EXT_WIFI_MESH
511         void (*mesh_support) (GSupplicantInterface *interface);
512         void (*mesh_group_started) (GSupplicantInterface *interface);
513         void (*mesh_group_removed) (GSupplicantInterface *interface);
514         void (*mesh_peer_connected) (GSupplicantMeshPeer *mesh_peer);
515         void (*mesh_peer_disconnected) (GSupplicantMeshPeer *mesh_peer);
516 #endif
517 };
518
519 typedef struct _GSupplicantCallbacks GSupplicantCallbacks;
520
521 int g_supplicant_register(const GSupplicantCallbacks *callbacks);
522 void g_supplicant_unregister(const GSupplicantCallbacks *callbacks);
523
524 static inline
525 void g_supplicant_free_scan_params(GSupplicantScanParams *scan_params)
526 {
527         g_slist_free_full(scan_params->ssids, g_free);
528         g_free(scan_params->freqs);
529         g_free(scan_params);
530 }
531
532 #ifdef __cplusplus
533 }
534 #endif
535
536 #endif /* __G_SUPPLICANT_H */