3 * WPA supplicant library with GLib integration
5 * Copyright (C) 2012-2013 Intel Corporation. All rights reserved.
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.
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.
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
21 #ifndef __G_SUPPLICANT_H
22 #define __G_SUPPLICANT_H
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)
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)
42 #define G_SUPPLICANT_CAPABILITY_PROTO_WPA (1 << 0)
43 #define G_SUPPLICANT_CAPABILITY_PROTO_RSN (1 << 1)
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)
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)
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)
63 #define G_SUPPLICANT_KEYMGMT_WPA_FT_EAP (1 << 5)
64 #define G_SUPPLICANT_KEYMGMT_WPA_FT_PSK (1 << 6)
66 #define G_SUPPLICANT_KEYMGMT_WPA_FT_PSK (1 << 5)
67 #define G_SUPPLICANT_KEYMGMT_WPA_FT_EAP (1 << 6)
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)
73 #define G_SUPPLICANT_KEYMGMT_SAE (1 << 10)
74 #define G_SUPPLICANT_KEYMGMT_FT_SAE (1 << 11)
75 #define G_SUPPLICANT_KEYMGMT_OWE (1 << 22)
76 #define G_SUPPLICANT_KEYMGMT_DPP (1 << 23)
79 #define G_SUPPLICANT_PROTO_WPA (1 << 0)
80 #define G_SUPPLICANT_PROTO_RSN (1 << 1)
82 #define G_SUPPLICANT_GROUP_WEP40 (1 << 0)
83 #define G_SUPPLICANT_GROUP_WEP104 (1 << 1)
84 #define G_SUPPLICANT_GROUP_TKIP (1 << 2)
85 #define G_SUPPLICANT_GROUP_CCMP (1 << 3)
87 #define G_SUPPLICANT_PAIRWISE_NONE (1 << 0)
88 #define G_SUPPLICANT_PAIRWISE_TKIP (1 << 1)
89 #define G_SUPPLICANT_PAIRWISE_CCMP (1 << 2)
91 #define G_SUPPLICANT_WPS_CONFIGURED (1 << 0)
92 #define G_SUPPLICANT_WPS_PBC (1 << 1)
93 #define G_SUPPLICANT_WPS_PIN (1 << 2)
94 #define G_SUPPLICANT_WPS_REGISTRAR (1 << 3)
96 #define G_SUPPLICANT_WPS_CONFIG_PBC 0x0080
98 #define G_SUPPLICANT_GROUP_ROLE_CLIENT (1 << 0)
99 #define G_SUPPLICANT_GROUP_ROLE_GO (1 << 1)
102 G_SUPPLICANT_MODE_UNKNOWN,
103 G_SUPPLICANT_MODE_INFRA,
104 G_SUPPLICANT_MODE_IBSS,
105 G_SUPPLICANT_MODE_MASTER,
106 #if defined TIZEN_EXT_WIFI_MESH
107 G_SUPPLICANT_MODE_MESH,
111 #if defined TIZEN_EXT_WIFI_MESH
113 G_SUPPLICANT_IEEE80211W_UNKNOWN,
114 G_SUPPLICANT_IEEE80211W_OPTIONAL,
115 G_SUPPLICANT_IEEE80211W_REQUIRED,
120 G_SUPPLICANT_SECURITY_UNKNOWN,
121 G_SUPPLICANT_SECURITY_NONE,
122 G_SUPPLICANT_SECURITY_WEP,
123 G_SUPPLICANT_SECURITY_PSK,
124 G_SUPPLICANT_SECURITY_IEEE8021X,
125 #if defined TIZEN_EXT
126 G_SUPPLICANT_SECURITY_FT_PSK,
127 G_SUPPLICANT_SECURITY_FT_IEEE8021X,
128 G_SUPPLICANT_SECURITY_SAE,
129 G_SUPPLICANT_SECURITY_OWE,
130 G_SUPPLICANT_SECURITY_DPP,
132 } GSupplicantSecurity;
134 #if defined TIZEN_EXT
136 G_SUPPLICANT_EAP_KEYMGMT_NONE,
137 G_SUPPLICANT_EAP_KEYMGMT_FT,
138 G_SUPPLICANT_EAP_KEYMGMT_CCKM,
139 G_SUPPLICANT_EAP_KEYMGMT_OKC,
140 } GSupplicantEapKeymgmt;
143 G_SUPPLICANT_MODE_IEEE80211_UNKNOWN,
144 G_SUPPLICANT_MODE_IEEE80211B,
145 G_SUPPLICANT_MODE_IEEE80211BG,
146 G_SUPPLICANT_MODE_IEEE80211BGN,
147 G_SUPPLICANT_MODE_IEEE80211A,
148 G_SUPPLICANT_MODE_IEEE80211AN,
149 G_SUPPLICANT_MODE_IEEE80211ANAC,
150 } GSupplicantPhy_mode;
154 G_SUPPLICANT_STATE_UNKNOWN,
155 G_SUPPLICANT_STATE_DISABLED,
156 G_SUPPLICANT_STATE_DISCONNECTED,
157 G_SUPPLICANT_STATE_INACTIVE,
158 G_SUPPLICANT_STATE_SCANNING,
159 G_SUPPLICANT_STATE_AUTHENTICATING,
160 G_SUPPLICANT_STATE_ASSOCIATING,
161 G_SUPPLICANT_STATE_ASSOCIATED,
162 G_SUPPLICANT_STATE_4WAY_HANDSHAKE,
163 G_SUPPLICANT_STATE_GROUP_HANDSHAKE,
164 G_SUPPLICANT_STATE_COMPLETED,
168 G_SUPPLICANT_WPS_STATE_UNKNOWN,
169 G_SUPPLICANT_WPS_STATE_SUCCESS,
170 G_SUPPLICANT_WPS_STATE_FAIL,
171 } GSupplicantWpsState;
174 G_SUPPLICANT_PEER_SERVICES_CHANGED,
175 G_SUPPLICANT_PEER_GROUP_CHANGED,
176 G_SUPPLICANT_PEER_GROUP_STARTED,
177 G_SUPPLICANT_PEER_GROUP_FINISHED,
178 G_SUPPLICANT_PEER_GROUP_JOINED,
179 G_SUPPLICANT_PEER_GROUP_DISCONNECTED,
180 G_SUPPLICANT_PEER_GROUP_FAILED,
181 } GSupplicantPeerState;
183 #if defined TIZEN_EXT
185 G_SUPPLICANT_INS_PREFERRED_FREQ_UNKNOWN,
186 G_SUPPLICANT_INS_PREFERRED_FREQ_24GHZ,
187 G_SUPPLICANT_INS_PREFERRED_FREQ_5GHZ,
188 } GSupplicantINSPreferredFreq;
191 struct _GSupplicantSSID {
192 #if defined TIZEN_EXT
197 unsigned int ssid_len;
198 unsigned int scan_ssid;
199 GSupplicantMode mode;
200 GSupplicantSecurity security;
201 unsigned int protocol;
202 unsigned int pairwise_cipher;
203 unsigned int group_cipher;
206 const char *passphrase;
207 const char *identity;
208 const char *anonymous_identity;
209 const char *ca_cert_path;
210 const char *subject_match;
211 const char *altsubject_match;
212 const char *domain_suffix_match;
213 const char *domain_match;
214 const char *client_cert_path;
215 const char *private_key_path;
216 const char *private_key_passphrase;
217 const char *phase2_auth;
221 #if defined TIZEN_EXT
222 unsigned char *bssid;
223 unsigned int bssid_for_connect_len;
224 unsigned char bssid_for_connect[6];
225 GSupplicantEapKeymgmt eap_keymgmt;
227 const char *pac_file;
229 unsigned int keymgmt;
230 const char *connector;
231 const char *c_sign_key;
232 const char *net_access_key;
236 typedef struct _GSupplicantSSID GSupplicantSSID;
239 * Max number of SSIDs that can be scanned.
240 * In wpa_s 0.7x the limit is 4.
241 * In wps_s 0.8 or later it is 16.
242 * The value is only used if wpa_supplicant does not return any max limit
243 * for number of scannable SSIDs.
245 #define WPAS_MAX_SCAN_SSIDS 4
248 unsigned char ssid[32];
252 struct _GSupplicantScanParams {
261 typedef struct _GSupplicantScanParams GSupplicantScanParams;
263 struct _GSupplicantPeerParams {
269 typedef struct _GSupplicantPeerParams GSupplicantPeerParams;
271 struct _GSupplicantP2PServiceParams {
274 unsigned char *query;
276 unsigned char *response;
278 unsigned char *wfd_ies;
282 typedef struct _GSupplicantP2PServiceParams GSupplicantP2PServiceParams;
284 #if defined TIZEN_EXT
285 #define WIFI_BSSID_STR_LEN 18
286 #define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
287 #define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
289 #define WIFI_BSSID_LEN_MAX 6
291 struct g_connman_bssids {
292 unsigned char bssid[WIFI_BSSID_LEN_MAX];
295 uint16_t assoc_reject_cnt;
296 bool is_last_connected;
298 #if defined TIZEN_EXT_INS
299 int score_last_connected_bssid;
300 int score_assoc_reject;
303 int score_est_throughput;
310 typedef void (*GSupplicantCountryCallback) (int result,
314 int g_supplicant_set_country(const char *alpha2,
315 GSupplicantCountryCallback callback,
316 const void *user_data);
319 struct _GSupplicantInterface;
320 struct _GSupplicantPeer;
322 typedef struct _GSupplicantInterface GSupplicantInterface;
323 typedef struct _GSupplicantPeer GSupplicantPeer;
324 #if defined TIZEN_EXT_WIFI_MESH
325 typedef struct _GSupplicantMeshPeer GSupplicantMeshPeer;
328 typedef void (*GSupplicantInterfaceCallback) (int result,
329 GSupplicantInterface *interface,
332 #if defined TIZEN_EXT
333 typedef void (*GSupplicantMaxSpeedCallback) (int result, int maxspeed,
334 int strength, int snr, void *user_data);
337 void g_supplicant_interface_cancel(GSupplicantInterface *interface);
339 int g_supplicant_interface_create(const char *ifname, const char *driver,
342 unsigned int mac_policy,
343 unsigned int preassoc_mac_policy,
344 unsigned int random_mac_lifetime,
345 #endif /* TIZEN_EXT */
346 GSupplicantInterfaceCallback callback,
348 int g_supplicant_interface_remove(GSupplicantInterface *interface,
349 GSupplicantInterfaceCallback callback,
351 int g_supplicant_interface_scan(GSupplicantInterface *interface,
352 GSupplicantScanParams *scan_data,
353 GSupplicantInterfaceCallback callback,
356 #if defined TIZEN_EXT
357 int g_supplicant_interface_signalpoll(GSupplicantInterface *interface,
358 GSupplicantMaxSpeedCallback callback,
362 int g_supplicant_interface_p2p_find(GSupplicantInterface *interface,
363 GSupplicantInterfaceCallback callback,
366 int g_supplicant_interface_p2p_stop_find(GSupplicantInterface *interface);
368 int g_supplicant_interface_p2p_connect(GSupplicantInterface *interface,
369 GSupplicantPeerParams *peer_params,
370 GSupplicantInterfaceCallback callback,
373 int g_supplicant_interface_p2p_disconnect(GSupplicantInterface *interface,
374 GSupplicantPeerParams *peer_params);
376 int g_supplicant_interface_p2p_listen(GSupplicantInterface *interface,
377 int period, int interval);
379 int g_supplicant_interface_p2p_add_service(GSupplicantInterface *interface,
380 GSupplicantInterfaceCallback callback,
381 GSupplicantP2PServiceParams *p2p_service_params,
384 int g_supplicant_interface_p2p_del_service(GSupplicantInterface *interface,
385 GSupplicantP2PServiceParams *p2p_service_params);
387 int g_supplicant_set_widi_ies(GSupplicantP2PServiceParams *p2p_service_params,
388 GSupplicantInterfaceCallback callback,
391 int g_supplicant_interface_connect(GSupplicantInterface *interface,
392 GSupplicantSSID *ssid,
393 GSupplicantInterfaceCallback callback,
396 int g_supplicant_interface_disconnect(GSupplicantInterface *interface,
397 GSupplicantInterfaceCallback callback,
400 int g_supplicant_interface_set_bss_expiration_age(GSupplicantInterface *interface,
401 unsigned int bss_expiration_age);
403 #if defined TIZEN_EXT
404 void g_supplicant_interface_remove_network(GSupplicantInterface *interface,
405 GSupplicantSSID *ssid);
408 int g_supplicant_interface_set_apscan(GSupplicantInterface *interface,
409 unsigned int ap_scan);
411 void g_supplicant_interface_set_data(GSupplicantInterface *interface,
413 void *g_supplicant_interface_get_data(GSupplicantInterface *interface);
414 const char *g_supplicant_interface_get_ifname(GSupplicantInterface *interface);
415 #if defined TIZEN_EXT
416 bool g_supplicant_interface_get_is_5_0_ghz_supported(GSupplicantInterface *interface);
417 unsigned char *g_supplicant_interface_get_add_network_bssid(GSupplicantInterface *interface);
419 typedef void (*GSupplicantMacPolicyCallback) (int result, unsigned int policy, void *user_data);
420 int g_supplicant_interface_set_mac_policy(GSupplicantInterface *interface,
421 GSupplicantMacPolicyCallback callback,
425 int g_supplicant_interface_set_preassoc_mac_policy(GSupplicantInterface *interface,
426 GSupplicantMacPolicyCallback callback,
430 typedef void (*GSupplicantRandomMaclifetimeCallback) (int result, unsigned int lifetime, void *user_data);
431 int g_supplicant_interface_set_random_mac_lifetime(GSupplicantInterface *interface,
432 GSupplicantRandomMaclifetimeCallback callback,
433 unsigned int lifetime,
436 const char *g_supplicant_interface_get_driver(GSupplicantInterface *interface);
437 GSupplicantState g_supplicant_interface_get_state(GSupplicantInterface *interface);
438 const char *g_supplicant_interface_get_wps_key(GSupplicantInterface *interface);
439 const void *g_supplicant_interface_get_wps_ssid(GSupplicantInterface *interface,
440 unsigned int *ssid_len);
441 GSupplicantWpsState g_supplicant_interface_get_wps_state(GSupplicantInterface *interface);
442 unsigned int g_supplicant_interface_get_mode(GSupplicantInterface *interface);
443 dbus_bool_t g_supplicant_interface_get_ready(GSupplicantInterface *interface);
444 unsigned int g_supplicant_interface_get_max_scan_ssids(
445 GSupplicantInterface *interface);
447 int g_supplicant_interface_enable_selected_network(GSupplicantInterface *interface,
449 int g_supplicant_interface_set_country(GSupplicantInterface *interface,
450 GSupplicantCountryCallback callback,
453 bool g_supplicant_interface_has_p2p(GSupplicantInterface *interface);
454 int g_supplicant_interface_set_p2p_device_config(GSupplicantInterface *interface,
455 const char *device_name,
456 const char *primary_dev_type);
457 GSupplicantPeer *g_supplicant_interface_peer_lookup(GSupplicantInterface *interface,
458 const char *identifier);
459 bool g_supplicant_interface_is_p2p_finding(GSupplicantInterface *interface);
461 #if defined TIZEN_EXT_WIFI_MESH
462 bool g_supplicant_interface_has_mesh(GSupplicantInterface *interface);
463 int g_supplicant_mesh_interface_create(const char *ifname, const char *driver,
464 const char *bridge, const char *parent_ifname,
465 GSupplicantInterfaceCallback callback, void *user_data);
466 const void *g_supplicant_interface_get_mesh_group_ssid(
467 GSupplicantInterface *interface,
468 unsigned int *ssid_len);
469 int g_supplicant_mesh_get_disconnect_reason(GSupplicantInterface *interface);
470 const char *g_supplicant_mesh_peer_get_address(GSupplicantMeshPeer *mesh_peer);
471 int g_supplicant_mesh_peer_get_disconnect_reason(
472 GSupplicantMeshPeer *mesh_peer);
473 int g_supplicant_interface_abort_scan(GSupplicantInterface *interface,
474 GSupplicantInterfaceCallback callback, void *user_data);
475 int g_supplicant_interface_mesh_peer_change_status(
476 GSupplicantInterface *interface,
477 GSupplicantInterfaceCallback callback, const char *peer_address,
478 const char *method, void *user_data);
481 /* Network and Peer API */
482 struct _GSupplicantNetwork;
483 struct _GSupplicantGroup;
485 typedef struct _GSupplicantNetwork GSupplicantNetwork;
486 typedef struct _GSupplicantGroup GSupplicantGroup;
488 GSupplicantInterface *g_supplicant_network_get_interface(GSupplicantNetwork *network);
489 const char *g_supplicant_network_get_name(GSupplicantNetwork *network);
490 const char *g_supplicant_network_get_identifier(GSupplicantNetwork *network);
491 const char *g_supplicant_network_get_path(GSupplicantNetwork *network);
492 const void *g_supplicant_network_get_ssid(GSupplicantNetwork *network,
493 unsigned int *ssid_len);
494 const char *g_supplicant_network_get_mode(GSupplicantNetwork *network);
495 const char *g_supplicant_network_get_security(GSupplicantNetwork *network);
496 dbus_int16_t g_supplicant_network_get_signal(GSupplicantNetwork *network);
497 dbus_uint16_t g_supplicant_network_get_frequency(GSupplicantNetwork *network);
498 dbus_bool_t g_supplicant_network_get_wps(GSupplicantNetwork *network);
499 dbus_bool_t g_supplicant_network_is_wps_active(GSupplicantNetwork *network);
500 dbus_bool_t g_supplicant_network_is_wps_pbc(GSupplicantNetwork *network);
501 dbus_bool_t g_supplicant_network_is_wps_advertizing(GSupplicantNetwork *network);
503 GSupplicantInterface *g_supplicant_peer_get_interface(GSupplicantPeer *peer);
504 const char *g_supplicant_peer_get_path(GSupplicantPeer *peer);
505 const char *g_supplicant_peer_get_identifier(GSupplicantPeer *peer);
506 const void *g_supplicant_peer_get_device_address(GSupplicantPeer *peer);
507 const void *g_supplicant_peer_get_iface_address(GSupplicantPeer *peer);
508 const char *g_supplicant_peer_get_name(GSupplicantPeer *peer);
509 const unsigned char *g_supplicant_peer_get_widi_ies(GSupplicantPeer *peer,
511 bool g_supplicant_peer_is_wps_pbc(GSupplicantPeer *peer);
512 bool g_supplicant_peer_is_wps_pin(GSupplicantPeer *peer);
513 bool g_supplicant_peer_is_in_a_group(GSupplicantPeer *peer);
514 GSupplicantInterface *g_supplicant_peer_get_group_interface(GSupplicantPeer *peer);
515 bool g_supplicant_peer_is_client(GSupplicantPeer *peer);
516 bool g_supplicant_peer_has_requested_connection(GSupplicantPeer *peer);
518 #if defined TIZEN_EXT
520 * Description: Network client requires additional wifi specific info
522 const unsigned char *g_supplicant_network_get_bssid(
523 GSupplicantNetwork *network);
524 unsigned int g_supplicant_network_get_maxrate(GSupplicantNetwork *network);
525 const char *g_supplicant_network_get_enc_mode(GSupplicantNetwork *network);
526 bool g_supplicant_network_get_rsn_mode(GSupplicantNetwork *network);
527 bool g_supplicant_network_is_hs20AP(GSupplicantNetwork *network);
528 const char *g_supplicant_network_get_eap(GSupplicantNetwork *network);
529 const char *g_supplicant_network_get_identity(GSupplicantNetwork *network);
530 const char *g_supplicant_network_get_phase2(GSupplicantNetwork *network);
531 unsigned int g_supplicant_network_get_keymgmt(GSupplicantNetwork *network);
532 dbus_bool_t g_supplicant_network_get_privacy(GSupplicantNetwork *network);
533 void *g_supplicant_network_get_wifi_vsie(GSupplicantNetwork *network);
534 const unsigned char *g_supplicant_network_get_countrycode(GSupplicantNetwork
536 dbus_bool_t g_supplicant_network_is_pmf_required(GSupplicantNetwork *network);
537 void *g_supplicant_network_get_bssid_list(GSupplicantNetwork *network);
538 GSupplicantPhy_mode g_supplicant_network_get_phy_mode(GSupplicantNetwork *network);
539 dbus_bool_t g_supplicant_network_get_transition_mode(GSupplicantNetwork *network);
540 const unsigned char *g_supplicant_network_get_transition_mode_bssid(GSupplicantNetwork *network);
541 const void *g_supplicant_network_get_transition_mode_ssid(GSupplicantNetwork *network,
542 unsigned int *transition_mode_ssid_len);
543 void g_supplicant_network_set_signal(GSupplicantNetwork *network, int signal);
544 void g_supplicant_network_set_bss_signal(GSupplicantNetwork *network,
545 int signal, int snr);
547 void g_supplicant_network_set_last_connected_bssid(GSupplicantNetwork *network, const unsigned char *bssid);
548 const unsigned char *g_supplicant_network_get_last_connected_bssid(GSupplicantNetwork *network);
549 void g_supplicant_network_update_assoc_reject(GSupplicantInterface *interface,
550 GSupplicantNetwork *network);
551 GHashTable *g_supplicant_network_get_assoc_reject_table(GSupplicantNetwork *network);
552 GSupplicantNetwork *g_supplicant_interface_get_network(GSupplicantInterface *interface,
554 GHashTable *g_supplicant_network_clone_assoc_reject_table(GSupplicantNetwork *network);
557 #if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
558 typedef void (*g_supplicant_eap_callback)(GSupplicantInterface *interface, bool status);
559 #endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
561 struct _GSupplicantCallbacks {
562 void (*system_ready) (void);
563 void (*system_killed) (void);
564 void (*interface_added) (GSupplicantInterface *interface);
565 void (*interface_state) (GSupplicantInterface *interface);
566 void (*interface_removed) (GSupplicantInterface *interface);
567 void (*p2p_support) (GSupplicantInterface *interface);
568 void (*scan_started) (GSupplicantInterface *interface);
569 void (*scan_finished) (GSupplicantInterface *interface);
570 void (*ap_create_fail) (GSupplicantInterface *interface);
571 void (*network_added) (GSupplicantNetwork *network);
572 void (*network_removed) (GSupplicantNetwork *network);
573 #if defined TIZEN_EXT
574 void (*network_merged) (GSupplicantNetwork *network);
576 void (*network_changed) (GSupplicantNetwork *network,
577 const char *property);
578 void (*network_associated) (GSupplicantNetwork *network);
579 #if defined TIZEN_EXT
580 void (*system_power_off) (void);
581 void (*assoc_failed) (void *user_data);
582 void (*scan_done) (GSupplicantInterface *interface);
584 void (*sta_authorized) (GSupplicantInterface *interface,
586 void (*sta_deauthorized) (GSupplicantInterface *interface,
588 void (*peer_found) (GSupplicantPeer *peer);
589 void (*peer_lost) (GSupplicantPeer *peer);
590 void (*peer_changed) (GSupplicantPeer *peer,
591 GSupplicantPeerState state);
592 void (*peer_request) (GSupplicantPeer *peer);
593 void (*debug) (const char *str);
594 void (*disconnect_reasoncode)(GSupplicantInterface *interface,
596 void (*assoc_status_code)(GSupplicantInterface *interface,
598 #if defined TIZEN_EXT_WIFI_MESH
599 void (*mesh_support) (GSupplicantInterface *interface);
600 void (*mesh_group_started) (GSupplicantInterface *interface);
601 void (*mesh_group_removed) (GSupplicantInterface *interface);
602 void (*mesh_peer_connected) (GSupplicantMeshPeer *mesh_peer);
603 void (*mesh_peer_disconnected) (GSupplicantMeshPeer *mesh_peer);
606 #if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
607 g_supplicant_eap_callback eap;
608 #endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
611 typedef struct _GSupplicantCallbacks GSupplicantCallbacks;
613 #if defined TIZEN_EXT && defined TIZEN_EXT_INS
614 void g_supplicant_set_ins_settings(GSupplicantINSPreferredFreq preferred_freq_bssid,
615 bool last_connected_bssid, bool assoc_reject, bool signal_bssid,
616 unsigned int preferred_freq_bssid_score, unsigned int last_connected_bssid_score,
617 unsigned int assoc_reject_score, int signal_level3_5ghz, int signal_level3_24ghz);
618 #endif /* defined TIZEN_EXT && defined TIZEN_EXT_INS */
620 #if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
621 void g_supplicant_replace_config_file(const char *ifname, const char *config_file);
622 void g_supplicant_register_eap_callback(g_supplicant_eap_callback cb);
623 void g_supplicant_unregister_eap_callback(void);
624 #endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
626 #if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
627 int g_supplicant_register(GSupplicantCallbacks *callbacks);
628 #else /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
629 int g_supplicant_register(const GSupplicantCallbacks *callbacks);
630 #endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
631 void g_supplicant_unregister(const GSupplicantCallbacks *callbacks);
634 void g_supplicant_free_scan_params(GSupplicantScanParams *scan_params)
636 g_slist_free_full(scan_params->ssids, g_free);
637 g_free(scan_params->freqs);
645 #endif /* __G_SUPPLICANT_H */