2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 #endif /* __cplusplus */
23 /*****************************************************************************
25 *****************************************************************************/
32 #include <dbus/dbus.h>
34 #include <sys/types.h>
38 #include <sys/ioctl.h>
40 #include <net/if_arp.h>
41 #include <linux/if_ether.h>
43 /*****************************************************************************
45 *****************************************************************************/
47 #include "network-internal.h"
48 #include "network-dbus-request.h"
50 /*****************************************************************************
52 *****************************************************************************/
54 #define EAP_CONFIG_KEY_TYPE "Type"
55 #define EAP_CONFIG_KEY_NAME "Name"
56 #define EAP_CONFIG_KEY_SSID "SSID"
57 #define EAP_CONFIG_KEY_EAP "EAP"
58 #define EAP_CONFIG_KEY_IDENTITY "Identity"
59 #define EAP_CONFIG_KEY_PASSPHRASE "Passphrase"
61 #define EAP_CONFIG_KEY_CA_CERT "CACertFile"
62 #define EAP_CONFIG_KEY_CL_CERT "ClientCertFile"
63 #define EAP_CONFIG_KEY_PRV_KEY "PrivateKeyFile"
64 #define EAP_CONFIG_KEY_PRV_KEY_PASS "PrivateKeyPassphrase"
65 #define EAP_CONFIG_KEY_PRV_KEY_PASS_TYPE "PrivateKeyPassphraseType"
66 #define EAP_CONFIG_KEY_PHASE2 "Phase2"
68 #define EAP_TYPE_LEN_MAX 8 //tls / ttls / peap
69 #define EAP_AUTH_TYPE_LEN_MAX 16
70 #define EAP_TYPE_STR_TLS "tls"
71 #define EAP_TYPE_STR_TTLS "ttls"
72 #define EAP_TYPE_STR_PEAP "peap"
74 #define CONNMAN_STORAGE_DIR "/var/lib/connman"
76 /*****************************************************************************
77 * Local Functions Declaration
78 *****************************************************************************/
81 /*****************************************************************************
83 *****************************************************************************/
85 /*****************************************************************************
86 * Extern Global Variables
87 *****************************************************************************/
88 extern network_info_t NetworkInfo;
91 /*****************************************************************************
93 *****************************************************************************/
95 /** set all request to FALSE (0) */
96 network_request_table_t request_table[NETWORK_REQUEST_TYPE_MAX] = {{0, }, };
99 pthread_mutex_t callback_mutex;
100 pthread_mutex_t wifi_state_mutex;
103 /*****************************************************************************
104 * Local Functions Definition
105 *****************************************************************************/
107 gboolean __convert_eap_type_to_string(gchar eap_type, char * eap_str)
111 case WLAN_SEC_EAP_TYPE_PEAP:
112 memcpy(eap_str, EAP_TYPE_STR_PEAP, EAP_TYPE_LEN_MAX);
114 case WLAN_SEC_EAP_TYPE_TLS:
115 memcpy(eap_str, EAP_TYPE_STR_TLS, EAP_TYPE_LEN_MAX);
117 case WLAN_SEC_EAP_TYPE_TTLS:
118 memcpy(eap_str, EAP_TYPE_STR_TTLS, EAP_TYPE_LEN_MAX);
120 case WLAN_SEC_EAP_TYPE_SIM: //Not supported yet
121 case WLAN_SEC_EAP_TYPE_AKA: //Not supported yet
128 void __convert_eap_auth_to_string(gchar eap_auth, char * auth_str)
132 case WLAN_SEC_EAP_AUTH_NONE:
134 case WLAN_SEC_EAP_AUTH_PAP:
135 memcpy(auth_str, "PAP", strlen("PAP")+1);
137 case WLAN_SEC_EAP_AUTH_MSCHAP:
138 memcpy(auth_str, "MSCHAP", strlen("MSCHAP")+1);
140 case WLAN_SEC_EAP_AUTH_MSCHAPV2:
141 memcpy(auth_str, "MSCHAPV2", strlen("MSCHAPV2")+1);
143 case WLAN_SEC_EAP_AUTH_GTC:
144 memcpy(auth_str, "GTC", strlen("GTC")+1);
146 case WLAN_SEC_EAP_AUTH_MD5:
147 memcpy(auth_str, "MD5", strlen("MD5")+1);
155 static void __update_config(GKeyFile * keyfile, char * group,
156 const wlan_eap_info_t * eap_info, const char * essid,
157 char * eap_type, char * auth_type)
159 g_key_file_set_string(keyfile, group, EAP_CONFIG_KEY_TYPE, "wifi");
161 NETWORK_LOG(NETWORK_HIGH, "------------eap info------------------");
162 NETWORK_LOG(NETWORK_HIGH, "-essid : %s", essid);
163 NETWORK_LOG(NETWORK_HIGH, "-eap type : %s", eap_type);
164 NETWORK_LOG(NETWORK_HIGH, "-phase2 authentication type : %s", auth_type);
165 NETWORK_LOG(NETWORK_HIGH, "-username : %s", eap_info->username);
166 NETWORK_LOG(NETWORK_HIGH, "-password : %s", eap_info->password);
167 NETWORK_LOG(NETWORK_HIGH, "-ca certi filename : %s", eap_info->ca_cert_filename);
168 NETWORK_LOG(NETWORK_HIGH, "-client certi filename : %s", eap_info->client_cert_filename);
169 NETWORK_LOG(NETWORK_HIGH, "-private key filename : %s", eap_info->private_key_filename);
170 NETWORK_LOG(NETWORK_HIGH, "-private key password : %s", eap_info->private_key_passwd);
171 NETWORK_LOG(NETWORK_HIGH, "--------------------------------------");
174 g_key_file_set_string(keyfile, group, EAP_CONFIG_KEY_NAME, essid);
177 g_key_file_set_string(keyfile, group, EAP_CONFIG_KEY_EAP, eap_type);
179 if(auth_type != NULL)
180 g_key_file_set_string(keyfile, group, EAP_CONFIG_KEY_PHASE2, auth_type);
182 if((eap_info->username != NULL) && (strlen(eap_info->username) > 0))
183 g_key_file_set_string(keyfile, group, EAP_CONFIG_KEY_IDENTITY, eap_info->username);
185 if((eap_info->password != NULL) && (strlen(eap_info->password) > 0))
186 g_key_file_set_string(keyfile, group, EAP_CONFIG_KEY_PASSPHRASE, eap_info->password);
188 if((eap_info->ca_cert_filename != NULL) && (strlen(eap_info->ca_cert_filename) > 0))
189 g_key_file_set_string(keyfile, group, EAP_CONFIG_KEY_CA_CERT, eap_info->ca_cert_filename);
191 if((eap_info->client_cert_filename != NULL) && (strlen(eap_info->client_cert_filename) > 0))
192 g_key_file_set_string(keyfile, group, EAP_CONFIG_KEY_CL_CERT, eap_info->client_cert_filename);
194 if((eap_info->private_key_filename != NULL) && (strlen(eap_info->private_key_filename) > 0))
195 g_key_file_set_string(keyfile, group, EAP_CONFIG_KEY_PRV_KEY, eap_info->private_key_filename);
197 if((eap_info->private_key_passwd != NULL) && (strlen(eap_info->private_key_passwd) > 0))
198 g_key_file_set_string(keyfile, group, EAP_CONFIG_KEY_PRV_KEY_PASS, eap_info->private_key_passwd);
201 static net_err_t __net_add_eap_config(const wlan_eap_info_t * eap_info, const char * essid)
209 net_err_t Error = NET_ERR_NONE;
211 __NETWORK_FUNC_ENTER__;
213 if((eap_info->eap_type < WLAN_SEC_EAP_TYPE_PEAP) || (eap_info->eap_type > WLAN_SEC_EAP_TYPE_AKA)) {
214 NETWORK_LOG(NETWORK_HIGH, "Invalid EAP type (%d)\n", eap_info->eap_type);
215 return NET_ERR_INVALID_PARAM;
218 eap_str = (char*)calloc(EAP_TYPE_LEN_MAX, sizeof(char));
220 return NET_ERR_UNKNOWN;
222 if(__convert_eap_type_to_string(eap_info->eap_type, eap_str) == FALSE) {
223 NETWORK_LOG(NETWORK_HIGH, "Invalid EAP type (%d)\n", eap_info->eap_type);
224 NET_MEMFREE(eap_str);
225 return NET_ERR_INVALID_PARAM;
228 auth_str = (char*)calloc(EAP_AUTH_TYPE_LEN_MAX, sizeof(char));
229 if(auth_str == NULL) {
230 NET_MEMFREE(eap_str);
231 __NETWORK_FUNC_EXIT__;
232 return NET_ERR_UNKNOWN;
235 __convert_eap_auth_to_string(eap_info->eap_auth, auth_str);
237 sprintf(group, "service_%s", eap_str);
238 NETWORK_LOG(NETWORK_HIGH, "group (%s)\n", group);
240 keyfile = g_key_file_new();
242 __update_config(keyfile, group, eap_info, essid, eap_str, auth_str);
244 data = g_key_file_to_data(keyfile, &length, NULL);
246 NETWORK_LOG(NETWORK_ERROR, "-----length of data : %d\n", length);
247 Error = _net_dbus_provision_service(data, length+1);
248 if(Error != NET_ERR_NONE)
249 NETWORK_LOG(NETWORK_ERROR, "Failed to update EAP info in ConnMan\n");
251 NET_MEMFREE(eap_str);
252 NET_MEMFREE(auth_str);
254 g_key_file_free(keyfile);
262 /*****************************************************************************
263 * Global Functions Definition
264 *****************************************************************************/
266 char* _net_print_error(net_err_t error)
271 return "NET_ERR_NONE";
273 /* Common Error value */
276 case NET_ERR_UNKNOWN:
277 return "NET_ERR_UNKNOWN";
279 /* Client Register related Errors used in API return */
281 /** Application is already registered */
282 case NET_ERR_APP_ALREADY_REGISTERED:
283 return "NET_ERR_APP_ALREADY_REGISTERED";
284 /** Application is not registered */
285 case NET_ERR_APP_NOT_REGISTERED:
286 return "NET_ERR_APP_NOT_REGISTERED";
288 /* Connection Related Error */
290 /** No active connection exists for the given profile name */
291 case NET_ERR_NO_ACTIVE_CONNECTIONS:
292 return "NET_ERR_NO_ACTIVE_CONNECTIONS";
293 /** Active connection already exists for the given profile name */
294 case NET_ERR_ACTIVE_CONNECTION_EXISTS:
295 return "NET_ERR_ACTIVE_CONNECTION_EXISTS";
297 /** Connection failure : out of range */
298 case NET_ERR_CONNECTION_OUT_OF_RANGE:
299 return "NET_ERR_CONNECTION_OUT_OF_RANGE";
300 /** Connection failure : pin missing */
301 case NET_ERR_CONNECTION_PIN_MISSING:
302 return "NET_ERR_CONNECTION_PIN_MISSING";
303 /** Connection failure : dhcp failed */
304 case NET_ERR_CONNECTION_DHCP_FAILED:
305 return "NET_ERR_CONNECTION_DHCP_FAILED";
306 /** Connection failure */
307 case NET_ERR_CONNECTION_CONNECT_FAILED:
308 return "NET_ERR_CONNECTION_CONNECT_FAILED";
309 /** Connection failure : login failed */
310 case NET_ERR_CONNECTION_LOGIN_FAILED:
311 return "NET_ERR_CONNECTION_LOGIN_FAILED";
312 /** Connection failure : authentication failed */
313 case NET_ERR_CONNECTION_AUTH_FAILED:
314 return "NET_ERR_CONNECTION_AUTH_FAILED";
315 /** Connection failure : invalid key */
316 case NET_ERR_CONNECTION_INVALID_KEY:
317 return "NET_ERR_CONNECTION_INVALID_KEY";
321 /** Access is denied */
322 case NET_ERR_ACCESS_DENIED:
323 return "NET_ERR_ACCESS_DENIED";
324 /** Operation is in progress */
325 case NET_ERR_IN_PROGRESS:
326 return "NET_ERR_IN_PROGRESS";
327 /** Operation was aborted by client or network*/
328 case NET_ERR_OPERATION_ABORTED:
329 return "NET_ERR_OPERATION_ABORTED";
330 /** Invalid value of API parameter */
331 case NET_ERR_INVALID_PARAM:
332 return "NET_ERR_INVALID_PARAM";
333 /** invalid operation depending on current state */
334 case NET_ERR_INVALID_OPERATION:
335 return "NET_ERR_INVALID_OPERATION";
337 /** Feature not supported */
338 case NET_ERR_NOT_SUPPORTED:
339 return "NET_ERR_NOT_SUPPORTED";
341 case NET_ERR_TIME_OUT:
342 return "NET_ERR_TIME_OUT";
343 /** Network service is not available*/
344 case NET_ERR_NO_SERVICE:
345 return "NET_ERR_NO_SERVICE";
346 /** DBus can't find appropriate method */
347 case NET_ERR_UNKNOWN_METHOD:
348 return "NET_ERR_UNKNOWN_METHOD";
354 net_device_t _net_get_tech_type_from_path(const char *profile_name)
356 __NETWORK_FUNC_ENTER__;
358 net_device_t device_type = NET_DEVICE_UNKNOWN;
360 if (strstr(profile_name, "/wifi_") != NULL)
361 device_type = NET_DEVICE_WIFI;
362 else if (strstr(profile_name, "/cellular_") != NULL)
363 device_type = NET_DEVICE_CELLULAR;
365 __NETWORK_FUNC_EXIT__;
369 char* _net_get_string(DBusMessage* msg)
371 __NETWORK_FUNC_ENTER__;
373 DBusMessageIter args;
374 char* sigvalue = NULL;
376 if (!dbus_message_iter_init(msg, &args)) {
377 NETWORK_LOG(NETWORK_LOW, "Message does not have parameters\n");
378 } else if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING) {
379 NETWORK_LOG(NETWORK_LOW, "Argument is not string\n");
381 dbus_message_iter_get_basic(&args, &sigvalue);
384 __NETWORK_FUNC_EXIT__;
388 char* _net_get_object(DBusMessage* msg)
390 __NETWORK_FUNC_ENTER__;
392 DBusMessageIter args;
393 char* sigvalue = NULL;
395 if (!dbus_message_iter_init(msg, &args)) {
396 NETWORK_LOG(NETWORK_LOW, "Message does not have parameters\n");
397 } else if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_OBJECT_PATH) {
398 NETWORK_LOG(NETWORK_LOW, "Argument is not string\n");
400 dbus_message_iter_get_basic(&args, &sigvalue);
403 __NETWORK_FUNC_EXIT__;
407 int _net_get_boolean(DBusMessage* msg)
409 __NETWORK_FUNC_ENTER__;
411 DBusMessageIter args;
412 dbus_bool_t val = FALSE;
413 int retvalue = FALSE;
415 if (!dbus_message_iter_init(msg, &args)) {
416 NETWORK_LOG(NETWORK_LOW, "Message does not have parameters\n");
417 } else if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_BOOLEAN) {
418 NETWORK_LOG(NETWORK_LOW, "Argument is not boolean\n");
420 dbus_message_iter_get_basic(&args, &val);
428 __NETWORK_FUNC_EXIT__;
432 int _net_get_path(DBusMessage *msg, char *profile_name)
434 __NETWORK_FUNC_ENTER__;
436 char* ProfileName = NULL;
438 ProfileName = (char*)dbus_message_get_path(msg);
439 snprintf(profile_name, strlen(ProfileName) + 1, "%s", ProfileName);
441 __NETWORK_FUNC_EXIT__;
446 int _net_get_tech_state(DBusMessage* msg, network_get_tech_state_info_t* tech_state)
448 __NETWORK_FUNC_ENTER__;
450 net_err_t Error = NET_ERR_NONE;
451 DBusMessageIter args, dict;
453 if (!dbus_message_iter_init(msg, &args)) {
454 NETWORK_LOG(NETWORK_LOW, "Message does not have parameters\n");
455 Error = NET_ERR_UNKNOWN;
459 dbus_message_iter_recurse(&args, &dict);
461 while (dbus_message_iter_get_arg_type(&dict) == DBUS_TYPE_DICT_ENTRY) {
462 DBusMessageIter key_iter, sub_iter1, sub_iter2;
463 const char *key = NULL;
464 const char *tech_name = NULL;
466 dbus_message_iter_recurse(&dict, &key_iter);
467 dbus_message_iter_get_basic(&key_iter, &key);
469 if (strcmp(key, "AvailableTechnologies") == 0 ||
470 strcmp(key, "EnabledTechnologies") == 0 ||
471 strcmp(key, "ConnectedTechnologies") == 0) {
472 dbus_message_iter_next(&key_iter);
473 dbus_message_iter_recurse(&key_iter, &sub_iter1);
475 if (dbus_message_iter_get_arg_type(&sub_iter1) == DBUS_TYPE_ARRAY)
476 dbus_message_iter_recurse(&sub_iter1, &sub_iter2);
480 while (dbus_message_iter_get_arg_type(&sub_iter2) == DBUS_TYPE_STRING) {
481 dbus_message_iter_get_basic(&sub_iter2, &tech_name);
482 if (tech_name != NULL &&
483 strcmp(tech_name, tech_state->technology) == 0) {
484 if (strcmp(key, "AvailableTechnologies") == 0)
485 tech_state->AvailableTechnology = TRUE;
486 else if (strcmp(key, "EnabledTechnologies") == 0)
487 tech_state->EnabledTechnology = TRUE;
489 tech_state->ConnectedTechnology = TRUE;
492 dbus_message_iter_next(&sub_iter2);
494 } else if (strcmp(key, "DefaultTechnology") == 0) {
495 dbus_message_iter_next(&key_iter);
496 dbus_message_iter_recurse(&key_iter, &sub_iter1);
498 if (dbus_message_iter_get_arg_type(&sub_iter1) == DBUS_TYPE_STRING) {
499 dbus_message_iter_get_basic(&sub_iter1, &tech_name);
500 if (tech_name != NULL &&
501 strcmp(tech_name, tech_state->technology) == 0)
502 tech_state->AvailableTechnology = TRUE;
506 dbus_message_iter_next(&dict);
510 __NETWORK_FUNC_EXIT__;
515 /** This function is used only to open Wi-Fi connection with hidden APs */
516 int _net_open_connection_with_wifi_info(const net_wifi_connection_info_t* wifi_info)
518 __NETWORK_FUNC_ENTER__;
520 /** path = manager.ConnectService(({ "Type": "wifi", "Mode": "managed",
522 "Security": security,
523 "Passphrase": passphrase }));
526 net_err_t Error = NET_ERR_NONE;
527 char type[] = "wifi";
529 char essid[NET_WLAN_ESSID_LEN + 1] = "";
530 char security[128] = "";
531 char passphrase[NETPM_WLAN_MAX_PSK_PASSPHRASE_LEN] = "";
532 net_wifi_connect_service_info_t wifi_connection_info;
534 snprintf(mode, 128, "%s", (wifi_info->wlan_mode == NETPM_WLAN_CONNMODE_ADHOC)?"adhoc":"managed");
536 switch(wifi_info->security_info.sec_mode) {
537 case WLAN_SEC_MODE_NONE:
538 snprintf(security, 128, "%s", "none");
539 snprintf(passphrase, NETPM_WLAN_MAX_PSK_PASSPHRASE_LEN, "%s", "");
542 case WLAN_SEC_MODE_WEP:
543 snprintf(security, 128, "%s", "wep");
544 snprintf(passphrase, NETPM_WLAN_MAX_PSK_PASSPHRASE_LEN, "%s", wifi_info->security_info.authentication.wep.wepKey);
547 /** WPA-PSK(equivalent to WPA-NONE in case of Ad-Hoc) */
548 case WLAN_SEC_MODE_WPA_PSK:
549 snprintf(security, 128, "%s", "psk");
550 snprintf(passphrase, NETPM_WLAN_MAX_PSK_PASSPHRASE_LEN, "%s", wifi_info->security_info.authentication.psk.pskKey);
554 /** WPA-PSK / WPA2-PSK supported */
555 case WLAN_SEC_MODE_WPA2_PSK:
556 snprintf(security, 128, "%s", "rsn");
557 snprintf(passphrase, NETPM_WLAN_MAX_PSK_PASSPHRASE_LEN, "%s", wifi_info->security_info.authentication.psk.pskKey);
560 case WLAN_SEC_MODE_IEEE8021X:
561 snprintf(security, 128, "%s", "ieee8021x");
562 snprintf(passphrase, NETPM_WLAN_MAX_PSK_PASSPHRASE_LEN, "%s", "");
563 Error = __net_add_eap_config(&(wifi_info->security_info.authentication.eap), wifi_info->essid);
564 if(Error != NET_ERR_NONE) {
565 __NETWORK_FUNC_EXIT__;
571 NETWORK_LOG(NETWORK_ERROR, "Error!!! Invalid security type\n");
572 __NETWORK_FUNC_EXIT__;
573 return NET_ERR_INVALID_PARAM;
576 snprintf(essid, NET_WLAN_ESSID_LEN + 1, "%s", wifi_info->essid);
578 wifi_connection_info.type = type;
579 wifi_connection_info.mode = mode;
580 wifi_connection_info.ssid = essid;
581 wifi_connection_info.security = security;
582 wifi_connection_info.passphrase = passphrase;
584 NETWORK_LOG( NETWORK_HIGH,
585 "Parameters: type:\t%s\nmode:\t%s\nssid:\t%s\nsecurity:\t%s\npassphrase:\t%s\n",
586 wifi_connection_info.type, wifi_connection_info.mode,
587 wifi_connection_info.ssid, wifi_connection_info.security,
588 wifi_connection_info.passphrase);
590 if( (Error = _net_dbus_connect_service(&wifi_connection_info)) != NET_ERR_NONE ) {
591 NETWORK_LOG(NETWORK_EXCEPTION, "Error!!! Failed to request connect_service. Error [%s]\n",
592 _net_print_error(Error));
593 __NETWORK_FUNC_EXIT__;
597 NETWORK_LOG(NETWORK_HIGH, "Successfully requested to ConnMan\n");
599 __NETWORK_FUNC_EXIT__;
603 int _net_mutex_init()
605 __NETWORK_FUNC_ENTER__;
607 if (pthread_mutex_init(&networkinfo_mutex.callback_mutex, NULL) != 0) {
608 NETWORK_LOG(NETWORK_ERROR, "Mutex for callback initialization failed!\n");
609 __NETWORK_FUNC_EXIT__;
610 return NET_ERR_UNKNOWN;
613 if (pthread_mutex_init(&networkinfo_mutex.wifi_state_mutex, NULL) != 0) {
614 NETWORK_LOG(NETWORK_ERROR, "Mutex for wifi state initialization failed!\n");
615 pthread_mutex_destroy(&networkinfo_mutex.callback_mutex);
616 __NETWORK_FUNC_EXIT__;
617 return NET_ERR_UNKNOWN;
620 __NETWORK_FUNC_EXIT__;
624 void _net_mutex_destroy()
626 __NETWORK_FUNC_ENTER__;
628 pthread_mutex_destroy(&networkinfo_mutex.callback_mutex);
629 pthread_mutex_destroy(&networkinfo_mutex.wifi_state_mutex);
631 __NETWORK_FUNC_EXIT__;
634 void _net_client_callback(net_event_info_t *event_data)
636 pthread_mutex_lock(&networkinfo_mutex.callback_mutex);
637 __NETWORK_FUNC_ENTER__;
639 NETWORK_CALLBACK(event_data, NetworkInfo.user_data);
641 __NETWORK_FUNC_EXIT__;
642 pthread_mutex_unlock(&networkinfo_mutex.callback_mutex);
645 net_wifi_state_t _net_get_wifi_state()
647 pthread_mutex_lock(&networkinfo_mutex.wifi_state_mutex);
648 __NETWORK_FUNC_ENTER__;
650 net_err_t Error = NET_ERR_NONE;
651 network_get_tech_state_info_t tech_state = {{0,},};
652 net_wifi_state_t wifi_state = WIFI_UNKNOWN;
654 snprintf(tech_state.technology, NET_TECH_LENGTH_MAX, "%s", "wifi");
655 Error = _net_dbus_get_technology_state(&tech_state);
656 if (Error != NET_ERR_NONE) {
657 NETWORK_LOG(NETWORK_ERROR,
658 "Error!!! _net_dbus_get_technology_state() failed. Error [%s]\n",
659 _net_print_error(Error));
663 if (tech_state.EnabledTechnology == TRUE &&
664 tech_state.AvailableTechnology == TRUE)
665 wifi_state = WIFI_ON;
667 wifi_state = WIFI_OFF;
670 __NETWORK_FUNC_EXIT__;
671 pthread_mutex_unlock(&networkinfo_mutex.wifi_state_mutex);
675 void _net_clear_request_table()
677 __NETWORK_FUNC_ENTER__;
681 for (i = 0;i < NETWORK_REQUEST_TYPE_MAX;i++)
682 memset(&request_table[i], 0, sizeof(network_request_table_t));
684 __NETWORK_FUNC_EXIT__;
689 #endif /* __cplusplus */