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