2 * Network Configuration Module
4 * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
24 #include <vconf-keys.h>
32 #include "wifi-bssid-scan.h"
33 #include "wifi-agent.h"
34 #include "wifi-power.h"
35 #include "wifi-state.h"
36 #include "netsupplicant.h"
37 #include "network-state.h"
38 #include "cellular-state.h"
39 #include "signal-handler.h"
40 #include "wifi-background-scan.h"
41 #include "wifi-tdls.h"
43 #include "ip-conflict-detect.h"
44 #include "wifi-key-encryption.h"
45 #include "clatd-handler.h"
46 #if defined TIZEN_DEBUG_ENABLE
47 #include "network-dump.h"
48 #define NETWORK_LOG_DUMP_SCRIPT "/opt/var/lib/net-config/network_log_dump.sh"
49 #define MAX_SIZE_ERROR_BUFFER 256
52 #define DBUS_SERVICE_DBUS "org.freedesktop.DBus"
53 #define DBUS_INTERFACE_DBUS "org.freedesktop.DBus"
54 #define SIGNAL_INTERFACE_REMOVED "InterfaceRemoved"
55 #define SIGNAL_SCAN_DONE "ScanDone"
56 #define SIGNAL_SCAN_CHANGED "ScanChanged"
57 #define SIGNAL_BSS_ADDED "BSSAdded"
58 #define SIGNAL_PROPERTIES_CHANGED "PropertiesChanged"
59 #define SIGNAL_PROPERTIES_DRIVER_HANGED "DriverHanged"
60 #define SIGNAL_PROPERTIES_SESSION_OVERLAPPED "SessionOverlapped"
61 #define SIGNAL_TDLS_CONNECTED "TDLSConnected"
62 #define SIGNAL_TDLS_DISCONNECTED "TDLSDisconnected"
63 #define SIGNAL_TDLS_PEER_FOUND "TDLSPeerFound"
65 #define SIGNAL_DPP_AUTH_SUCCESS "DPPAuthSuccess"
66 #define SIGNAL_DPP_AUTH_FAILED "DPPAuthFailed"
67 #define SIGNAL_DPP_NOT_COMPATIBLE "DPPNotCompatible"
68 #define SIGNAL_DPP_CONF_FAILED "DPPConfFailed"
69 #define SIGNAL_DPP_SCAN_PEER_QR "DPPScanPeerQrCode"
70 #define SIGNAL_DPP_NETWORK_ID "DPPNetworkID"
71 #define SIGNAL_DPP_CONF_SENT "DPPConfSent"
72 #define SIGNAL_DPP_CONF_RECEIVED "DPPConfReceived"
73 #define SIGNAL_DPP_CONF_OBJ "DPPConfObj"
75 #define SIGNAL_WPS_CONNECTED "WPSConnected"
76 #define SIGNAL_WPS_EVENT "Event"
77 #define SIGNAL_WPS_CREDENTIALS "Credentials"
79 #define CONNMAN_SIGNAL_SERVICES_CHANGED "ServicesChanged"
80 #define CONNMAN_SIGNAL_PROPERTY_CHANGED "PropertyChanged"
81 #define SIGNAL_NAME_OWNER_CHANGED "NameOwnerChanged"
83 #define MAX_SIG_LEN 64
84 #define TOTAL_CONN_SIGNALS 6
85 #define MAX_SOCKET_OPEN_RETRY 5
88 SIG_INTERFACE_REMOVED = 0,
89 SIG_PROPERTIES_CHANGED,
93 SIG_SESSION_OVERLAPPED,
95 SIG_TDLS_DISCONNECTED,
99 SIG_DPP_NOT_COMPATIBLE,
101 SIG_DPP_SCAN_PEER_QR,
104 SIG_DPP_CONF_RECEIVED,
109 static int conn_subscription_ids[TOTAL_CONN_SIGNALS] = {0};
110 static const char supplicant_signals[SIG_MAX][MAX_SIG_LEN] = {
111 SIGNAL_INTERFACE_REMOVED,
112 SIGNAL_PROPERTIES_CHANGED,
115 SIGNAL_PROPERTIES_DRIVER_HANGED,
116 SIGNAL_PROPERTIES_SESSION_OVERLAPPED,
117 SIGNAL_TDLS_CONNECTED,
118 SIGNAL_TDLS_DISCONNECTED,
119 SIGNAL_TDLS_PEER_FOUND,
120 SIGNAL_DPP_AUTH_SUCCESS,
121 SIGNAL_DPP_AUTH_FAILED,
122 SIGNAL_DPP_NOT_COMPATIBLE,
123 SIGNAL_DPP_CONF_FAILED,
124 SIGNAL_DPP_SCAN_PEER_QR,
125 SIGNAL_DPP_NETWORK_ID,
126 SIGNAL_DPP_CONF_SENT,
127 SIGNAL_DPP_CONF_RECEIVED,
130 static const char *supplicant_iface_for_sig[SIG_MAX] = {
131 SUPPLICANT_INTERFACE,
132 SUPPLICANT_IFACE_INTERFACE,
133 SUPPLICANT_IFACE_INTERFACE,
134 SUPPLICANT_IFACE_INTERFACE,
135 SUPPLICANT_IFACE_INTERFACE,
136 SUPPLICANT_IFACE_INTERFACE,
137 SUPPLICANT_IFACE_INTERFACE,
138 SUPPLICANT_IFACE_INTERFACE,
139 SUPPLICANT_IFACE_INTERFACE,
140 SUPPLICANT_IFACE_DPP,
141 SUPPLICANT_IFACE_DPP,
142 SUPPLICANT_IFACE_DPP,
143 SUPPLICANT_IFACE_DPP,
144 SUPPLICANT_IFACE_DPP,
145 SUPPLICANT_IFACE_DPP,
146 SUPPLICANT_IFACE_DPP,
147 SUPPLICANT_IFACE_DPP,
148 SUPPLICANT_IFACE_DPP,
151 static int supp_subscription_ids[SIG_MAX] = {0};
152 #if defined TIZEN_DEBUG_ENABLE
153 static int dumpservice_subscription_id = 0;
156 typedef void (*supplicant_signal_cb)(GDBusConnection *conn,
157 const gchar *name, const gchar *path, const gchar *interface,
158 const gchar *sig, GVariant *param, gpointer user_data);
159 typedef void (*connman_signal_cb)(GDBusConnection *conn,
160 const gchar *name, const gchar *path, const gchar *interface,
161 const gchar *sig, GVariant *param, gpointer user_data);
163 static void __netconfig_extract_ipv4_signal_data(GVariant *dictionary,
164 const gchar *profile)
167 const gchar *value = NULL;
168 GVariant *var = NULL;
170 GVariantBuilder *builder;
173 g_variant_iter_init(&iter, dictionary);
174 while (g_variant_iter_loop(&iter, "{sv}", &key, &var)) {
175 if (g_strcmp0(key, "Address") == 0) {
176 g_variant_get(var, "&s", &value);
177 char *old_ip = vconf_get_str(VCONFKEY_NETWORK_IP);
179 DBG("Old IPv4.Address [%s] Received new IPv4.Address [%s]", old_ip,
181 if (g_strcmp0(old_ip, value) != 0) {
182 builder = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
185 vconf_set_str(VCONFKEY_NETWORK_IP, value);
186 g_variant_builder_add(builder, "{sv}", "IPv4Address",
187 g_variant_new_string(value));
188 } else if (old_ip != NULL && strlen(old_ip) > 0) {
189 vconf_set_str(VCONFKEY_NETWORK_IP, "");
190 g_variant_builder_add(builder, "{sv}", "IPv4Address",
191 g_variant_new_string(""));
194 params = g_variant_new("(@a{sv})",
195 g_variant_builder_end(builder));
197 g_variant_builder_unref(builder);
199 netconfig_dbus_emit_signal(NULL, NETCONFIG_NETWORK_PATH,
200 NETCONFIG_NETWORK_INTERFACE, "NetworkConfigChanged",
208 static void __netconfig_extract_ipv6_signal_data(GVariant *dictionary,
209 const gchar *profile)
212 const gchar *value = NULL;
213 GVariant *var = NULL;
215 GVariantBuilder *builder;
218 g_variant_iter_init(&iter, dictionary);
219 while (g_variant_iter_loop(&iter, "{sv}", &key, &var)) {
220 if (g_strcmp0(key, "Address") == 0) {
221 g_variant_get(var, "&s", &value);
222 char *old_ip6 = vconf_get_str(VCONFKEY_NETWORK_IP6);
224 DBG("Old IPv6.Address [%s] Received new IPv6.Address [%s]", old_ip6,
226 if (g_strcmp0(old_ip6, value) != 0) {
227 builder = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
230 vconf_set_str(VCONFKEY_NETWORK_IP6, value);
231 g_variant_builder_add(builder, "{sv}", "IPv6Address",
232 g_variant_new_string(value));
233 } else if (old_ip6 != NULL && strlen(old_ip6) > 0) {
234 vconf_set_str(VCONFKEY_NETWORK_IP6, "");
235 g_variant_builder_add(builder, "{sv}", "IPv6Address",
236 g_variant_new_string(""));
239 params = g_variant_new("(@a{sv})",
240 g_variant_builder_end(builder));
241 g_variant_builder_unref(builder);
243 netconfig_dbus_emit_signal(NULL, NETCONFIG_NETWORK_PATH,
244 NETCONFIG_NETWORK_INTERFACE, "NetworkConfigChanged",
252 #if defined TIZEN_DEBUG_ENABLE
253 static int __netconfig_handle_execute_file(const char *file_path,
254 char *const args[], char *const envs[])
260 register unsigned int index = 0;
261 char error_buf[MAX_SIZE_ERROR_BUFFER] = {0, };
263 while (args[index] != NULL) {
264 DBG("%s", args[index]);
268 if (!(pid = fork())) {
269 DBG("pid(%d), ppid (%d)", getpid(), getppid());
270 DBG("Inside child, exec (%s) command", file_path);
273 if (execve(file_path, args, envs) == -1) {
274 DBG("Fail to execute command (%s)",
275 strerror_r(errno, error_buf, MAX_SIZE_ERROR_BUFFER));
278 } else if (pid > 0) {
279 if (waitpid(pid, &status, 0) == -1)
280 DBG("wait pid (%u) status (%d)", pid, status);
282 if (WIFEXITED(status)) {
283 rv = WEXITSTATUS(status);
284 DBG("exited, status=%d", rv);
285 } else if (WIFSIGNALED(status)) {
286 DBG("killed by signal %d", WTERMSIG(status));
287 } else if (WIFSTOPPED(status)) {
288 DBG("stopped by signal %d", WSTOPSIG(status));
289 } else if (WIFCONTINUED(status)) {
296 DBG("failed to fork(%s)",
297 strerror_r(errno, error_buf, MAX_SIZE_ERROR_BUFFER));
301 static int _start_dump()
304 gchar *path = NETWORK_LOG_DUMP_SCRIPT;
305 char *const args[] = { NETWORK_LOG_DUMP_SCRIPT, NULL };
306 char *const envs[] = { NULL };
308 rv = __netconfig_handle_execute_file(path, args, envs);
310 ERR("Fail to execute network log dump shell");
317 static void _technology_signal_cb(GDBusConnection *conn,
318 const gchar *name, const gchar *path, const gchar *interface,
319 const gchar *sig, GVariant *param, gpointer user_data)
322 gboolean value = FALSE;
323 GVariant *var = NULL;
328 if (g_str_has_prefix(path, CONNMAN_WIFI_TECHNOLOGY_PREFIX) == TRUE) {
329 g_variant_get(param, "(sv)", &key, &var);
330 if (g_strcmp0(key, "Powered") == 0) {
332 value = g_variant_get_boolean(var);
334 wifi_state_update_power_state(TRUE);
336 wifi_state_update_power_state(FALSE);
337 } else if (g_strcmp0(key, "Connected") == 0) {
338 /* Connection state */
339 value = g_variant_get_boolean(var);
341 wifi_state_set_tech_state(NETCONFIG_WIFI_TECH_CONNECTED);
343 wifi_state_set_tech_state(NETCONFIG_WIFI_TECH_POWERED);
344 } else if (g_strcmp0(key, "Tethering") == 0) {
345 /* Tethering state */
346 wifi_state_set_tech_state(NETCONFIG_WIFI_TECH_TETHERED);
349 g_variant_unref(var);
353 static void _service_signal_cb(GDBusConnection *conn,
354 const gchar *name, const gchar *path,
355 const gchar *interface, const gchar *sig,
356 GVariant *param, gpointer user_data)
358 gchar *sigvalue = NULL;
360 GVariant *variant = NULL, *var;
362 const gchar *value = NULL;
363 struct sock_data *sd = NULL;
367 if (path == NULL || param == NULL)
370 g_variant_get(param, "(sv)", &sigvalue, &variant);
371 if (sigvalue == NULL)
374 if (g_strcmp0(sig, CONNMAN_SIGNAL_PROPERTY_CHANGED) != 0)
377 if (g_strcmp0(sigvalue, "State") == 0) {
378 g_variant_get(variant, "s", &property);
380 DBG("[%s] %s", property, path);
382 if (netconfig_is_wifi_profile(path) == TRUE) {
385 netconfig_vconf_get_int(VCONFKEY_WIFI_STATE, &wifi_state);
386 if (wifi_state == VCONFKEY_WIFI_OFF) {
391 if (g_strcmp0(property, "ready") == 0 || g_strcmp0(property, "online") == 0) {
392 if (wifi_state >= VCONFKEY_WIFI_CONNECTED) {
397 netconfig_update_default_profile(path);
399 wifi_state_set_service_state(NETCONFIG_WIFI_CONNECTED);
401 } else if (g_strcmp0(property, "failure") == 0 || g_strcmp0(property, "disconnect") == 0 || g_strcmp0(property, "idle") == 0) {
402 if (netconfig_get_default_profile() == NULL ||
403 netconfig_is_wifi_profile(netconfig_get_default_profile())
405 if (g_strcmp0(property, "failure") == 0)
406 wifi_state_set_service_state(NETCONFIG_WIFI_FAILURE);
408 wifi_state_set_service_state(NETCONFIG_WIFI_IDLE);
413 if (g_strcmp0(path, netconfig_get_default_profile()) != 0) {
418 netconfig_update_default_profile(NULL);
420 if (g_strcmp0(property, "failure") == 0)
421 wifi_state_set_service_state(NETCONFIG_WIFI_FAILURE);
423 wifi_state_set_service_state(NETCONFIG_WIFI_IDLE);
425 } else if (g_strcmp0(property, "association") == 0 || g_strcmp0(property, "configuration") == 0) {
426 if (netconfig_get_default_profile() == NULL ||
427 netconfig_is_wifi_profile(netconfig_get_default_profile()) != TRUE) {
428 if (g_strcmp0(property, "association") == 0)
429 wifi_state_set_service_state(NETCONFIG_WIFI_ASSOCIATION);
431 wifi_state_set_service_state(NETCONFIG_WIFI_CONFIGURATION);
436 if (g_strcmp0(path, netconfig_get_default_profile()) != 0) {
441 netconfig_update_default_profile(NULL);
443 if (g_strcmp0(property, "association") == 0)
444 wifi_state_set_service_state(NETCONFIG_WIFI_ASSOCIATION);
446 wifi_state_set_service_state(NETCONFIG_WIFI_CONFIGURATION);
450 if (g_strcmp0(property, "ready") == 0 || g_strcmp0(property, "online") == 0) {
451 if (netconfig_get_default_profile() == NULL) {
452 if (!netconfig_is_cellular_profile(path)) {
453 netconfig_update_default_profile(path);
455 if (netconfig_is_cellular_internet_profile(path)) {
456 netconfig_update_default_profile(path);
460 pf = netconfig_get_connected_cellular_internet_ipv6only_profile(NULL);
465 /* Enable clatd if it is not in running state */
466 DBG("Connected to ipv6 only cellular, enable clatd");
467 netconfig_clatd_enable();
471 if (netconfig_is_cellular_profile(path) && netconfig_is_cellular_internet_profile(path))
472 cellular_state_set_service_state(NETCONFIG_CELLULAR_ONLINE);
474 } else if (g_strcmp0(property, "failure") == 0 || g_strcmp0(property, "disconnect") == 0 || g_strcmp0(property, "idle") == 0) {
475 if (netconfig_get_default_profile() == NULL) {
480 if (netconfig_is_cellular_profile(path) && netconfig_is_cellular_internet_profile(path)) {
481 cellular_state_set_service_state(NETCONFIG_CELLULAR_IDLE);
483 /* Disable clatd if it is in running state */
484 DBG("disable clatd");
485 netconfig_clatd_disable();
488 if (g_strcmp0(path, netconfig_get_default_profile()) != 0) {
493 netconfig_update_default_profile(NULL);
494 } else if (g_strcmp0(property, "association") == 0 || g_strcmp0(property, "configuration") == 0) {
495 if (netconfig_get_default_profile() == NULL) {
500 if (netconfig_is_cellular_profile(path) && netconfig_is_cellular_internet_profile(path))
501 cellular_state_set_service_state(NETCONFIG_CELLULAR_CONNECTING);
503 if (g_strcmp0(path, netconfig_get_default_profile()) != 0) {
508 netconfig_update_default_profile(NULL);
512 if (netconfig_is_wifi_profile(path) || netconfig_is_ethernet_profile(path)) {
513 if (g_strcmp0(property, "ready") == 0) {
514 for (idx = 0; idx < MAX_SOCKET_OPEN_RETRY; idx++) {
515 sd = start_ip_conflict_mon();
519 } else if (g_strcmp0(property, "online") == 0) {
522 stop_ip_conflict_mon();
527 } else if (g_strcmp0(sigvalue, "Proxy") == 0) {
528 if (netconfig_is_wifi_profile(path) != TRUE || g_strcmp0(path, netconfig_get_default_profile()) != 0)
531 if (!g_variant_is_of_type(variant, G_VARIANT_TYPE_ARRAY))
534 g_variant_get(variant, "a{sv}", &iter);
535 while (g_variant_iter_loop(iter, "{sv}", &property, &var)) {
536 GVariantBuilder *builder;
537 GVariant *sig_params;
538 if (g_strcmp0(property, "Servers") == 0) {
539 GVariantIter *iter_sub = NULL;
541 builder = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
543 g_variant_get(var, "as", &iter_sub);
544 g_variant_iter_loop(iter_sub, "s", &value);
545 g_variant_iter_free(iter_sub);
547 DBG("Proxy - [%s]", value);
548 vconf_set_str(VCONFKEY_NETWORK_PROXY, value);
550 g_variant_builder_add(builder, "{sv}", "ProxyAddress",
551 g_variant_new_string(value));
553 sig_params = g_variant_new("(@a{sv})",
554 g_variant_builder_end(builder));
555 g_variant_builder_unref(builder);
557 netconfig_dbus_emit_signal(NULL, NETCONFIG_NETWORK_PATH,
558 NETCONFIG_NETWORK_INTERFACE, "NetworkConfigChanged",
562 g_variant_unref(var);
564 } else if (g_strcmp0(property, "Method") == 0) {
565 value = g_variant_get_string(var, NULL);
566 DBG("Method - [%s]", value);
568 if (g_strcmp0(value, "direct") == 0) {
569 builder = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
571 vconf_set_str(VCONFKEY_NETWORK_PROXY, "");
572 g_variant_builder_add(builder, "{sv}", "ProxyAddress",
573 g_variant_new_string(""));
575 sig_params = g_variant_new("(@a{sv})",
576 g_variant_builder_end(builder));
577 g_variant_builder_unref(builder);
579 netconfig_dbus_emit_signal(NULL, NETCONFIG_NETWORK_PATH,
580 NETCONFIG_NETWORK_INTERFACE,
581 "NetworkConfigChanged", sig_params);
585 g_variant_unref(var);
590 g_variant_iter_free(iter);
591 } else if (g_strcmp0(sigvalue, "IPv4") == 0) {
592 __netconfig_extract_ipv4_signal_data(variant, path);
593 } else if (g_strcmp0(sigvalue, "IPv6") == 0) {
594 __netconfig_extract_ipv6_signal_data(variant, path);
595 } else if (g_strcmp0(sigvalue, "Error") == 0) {
596 g_variant_get(variant, "s", &property);
597 INFO("[%s] Property : %s", sigvalue, property);
598 #if defined TIZEN_DEBUG_ENABLE
599 if (g_strcmp0(property, "dhcp-failed") == 0
600 || g_strcmp0(property, "connect-failed") == 0
601 || g_strcmp0(property, "login-failed") == 0
602 || g_strcmp0(property, "auth-failed") == 0
603 || g_strcmp0(property, "invalid-key") == 0) {
615 g_variant_unref(variant);
620 static void _dbus_name_changed_cb(GDBusConnection *conn,
621 const gchar *Name, const gchar *path, const gchar *interface,
622 const gchar *sig, GVariant *param, gpointer user_data)
631 g_variant_get(param, "(sss)", &name, &old, &new);
633 if (g_strcmp0(name, CONNMAN_SERVICE) == 0 && *new == '\0') {
634 DBG("ConnMan destroyed: name %s, old %s, new %s", name, old, new);
636 connman_register_agent();
637 } else if (g_strcmp0(name, CLATD_SERVICE) == 0 && *new == '\0') {
638 DBG("Clat destroyed: name %s, old %s, new %s", name, old, new);
640 /* If clatd is terminated unexpectedly, reset and enable clat service. */
641 if (NETCONFIG_CELLULAR_ONLINE == cellular_state_get_service_state())
642 netconfig_clatd_reset();
651 static void _services_changed_cb(GDBusConnection *conn, const gchar *name,
652 const gchar *path, const gchar *interface, const gchar *sig,
653 GVariant *param, gpointer user_data)
655 gchar *property, *value;
657 GVariant *variant = NULL;
658 GVariantIter *added = NULL, *removed = NULL, *next = NULL;
660 if (path == NULL || param == NULL)
663 if (g_strcmp0(sig, CONNMAN_SIGNAL_SERVICES_CHANGED) != 0)
666 if (netconfig_get_default_profile() != NULL)
669 g_variant_get(param, "(a(oa{sv})ao)", &added, &removed);
671 while (g_variant_iter_loop(added, "(oa{sv})", &service_path, &next)) {
672 gboolean is_wifi_prof, is_cell_prof, is_cell_internet_prof;
673 is_wifi_prof = netconfig_is_wifi_profile(service_path);
674 is_cell_prof = netconfig_is_cellular_profile(service_path);
675 is_cell_internet_prof = netconfig_is_cellular_internet_profile(
677 if (service_path != NULL) {
678 while (next && g_variant_iter_loop(next, "{sv}", &property,
680 if (g_strcmp0(property, "State") == 0) {
681 g_variant_get(variant, "s", &value);
682 DBG("Profile %s State %s", service_path,
684 if (g_strcmp0(value, "ready") != 0 &&
689 g_variant_unref(variant);
694 netconfig_update_default_profile(
696 else if (is_cell_internet_prof) {
697 netconfig_update_default_profile(
701 wifi_state_set_service_state(
702 NETCONFIG_WIFI_CONNECTED);
703 else if (is_cell_prof &&
704 is_cell_internet_prof)
705 cellular_state_set_service_state(
706 NETCONFIG_CELLULAR_ONLINE);
709 g_variant_unref(variant);
716 g_variant_iter_free(added);
719 g_variant_iter_free(next);
722 g_variant_iter_free(removed);
727 static void _scan_changed_cb(GDBusConnection *conn,
728 const gchar *name, const gchar *path, const gchar *interface,
729 const gchar *sig, GVariant *param, gpointer user_data)
731 const char *key = NULL;
733 gboolean value = false;
735 if (g_strcmp0(sig, SIGNAL_SCAN_CHANGED) == 0) {
736 g_variant_get(param, "(sv)", &key, &var);
738 if (g_strcmp0(key, "scan_started") == 0)
740 else if (g_strcmp0(key, "scan_done") == 0)
743 DBG("Scan changed [%s]", (value == true) ? "Started" : "Done");
744 netconfig_battery_update_wifi_scan(value);
747 g_variant_unref(var);
751 static void _supplicant_interface_removed(GDBusConnection *conn,
752 const gchar *name, const gchar *path, const gchar *interface,
753 const gchar *sig, GVariant *param, gpointer user_data)
755 DBG("Interface removed handling!");
756 if (netconfig_wifi_is_bssid_scan_started() == TRUE)
757 netconfig_wifi_bssid_signal_scanaborted();
762 static void _supplicant_properties_changed(GDBusConnection *conn,
763 const gchar *name, const gchar *path, const gchar *interface,
764 const gchar *sig, GVariant *param, gpointer user_data)
766 DBG("Properties changed handling!");
768 const gchar *state = NULL;
769 GVariantIter *iter = NULL;
770 GVariant *variant = NULL;
771 gboolean scanning = FALSE;
776 g_variant_get(param, "(a{sv})", &iter);
777 while (g_variant_iter_loop(iter, "{sv}", &key, &variant)) {
778 if (g_strcmp0(key, "Scanning") == 0) {
779 scanning = g_variant_get_boolean(variant);
780 DBG("setting scanning %s", scanning ? "TRUE" : "FALSE");
781 if (scanning == TRUE)
782 netconfig_wifi_set_scanning(TRUE);
784 netconfig_wifi_set_scanning(FALSE);
786 g_variant_unref(variant);
791 } else if (g_strcmp0(key, "State") == 0) {
792 state = g_variant_get_string(variant, NULL);
794 ERR("Supplicant state : %s", state);
796 g_variant_unref(variant);
801 } else if (g_strcmp0(key, "DisconnectReason") == 0) {
802 int reason = g_variant_get_int32(variant);
803 ERR("Supplicant DisconnReason : %d", reason);
805 g_variant_unref(variant);
812 value = g_variant_print(variant, TRUE);
813 DBG("Supplicant %s : %s", key, value);
819 g_variant_iter_free(iter);
824 static void _supplicant_bss_added(GDBusConnection *conn,
825 const gchar *name, const gchar *path, const gchar *interface,
826 const gchar *sig, GVariant *param, gpointer user_data)
828 DBG("BSS added handling!");
829 wifi_state_set_bss_found(TRUE);
834 static void _supplicant_scan_done(GDBusConnection *conn,
835 const gchar *name, const gchar *path, const gchar *interface,
836 const gchar *sig, GVariant *param, gpointer user_data)
838 DBG("Scan Done handling!");
839 netconfig_wifi_set_scanning(FALSE);
841 if (netconfig_wifi_is_bssid_scan_started() == TRUE) {
842 netconfig_wifi_bssid_signal_scandone();
843 if (wifi_state_get_technology_state(FALSE) < NETCONFIG_WIFI_TECH_POWERED)
847 if (netconfig_wifi_get_bgscan_state() == TRUE) {
848 if (wifi_state_get_technology_state(FALSE) >=
849 NETCONFIG_WIFI_TECH_POWERED)
850 netconfig_wifi_bgscan_start(FALSE);
852 wifi_start_timer_network_notification();
858 static void _supplicant_driver_hanged(GDBusConnection *conn,
859 const gchar *name, const gchar *path, const gchar *interface,
860 const gchar *sig, GVariant *param, gpointer user_data)
862 DBG("Driver Hanged handling!");
863 ERR("Critical. Wi-Fi firmware crashed");
865 #if !defined TIZEN_WEARABLE
866 netconfig_send_message_to_net_popup("Wi-Fi Error",
867 "Wi-Fi Driver Hanged. Please get log dump and report", "popup", NULL);
869 wifi_power_recover_firmware();
875 static void _supplicant_session_overlapped(GDBusConnection *conn,
876 const gchar *name, const gchar *path, const gchar *interface,
877 const gchar *sig, GVariant *param, gpointer user_data)
879 DBG("Driver session overlapped handling!");
880 ERR("WPS PBC SESSION OVERLAPPED");
881 #if defined TIZEN_WEARABLE
884 netconfig_send_message_to_net_popup("WPS Error",
885 "wps session overlapped", "popup", NULL);
889 #if defined TIZEN_DEBUG_ENABLE
890 static void __netconfig_dumpservice_handler(GDBusConnection *conn,
891 const gchar *name, const gchar *path, const gchar *interface,
892 const gchar *sig, GVariant *param, gpointer user_data)
895 gchar *signal_path = NULL;
900 g_variant_get(param, "(is)", &mode, &signal_path);
901 DBG("Path: %s and mode: %d", signal_path, mode);
903 netconfig_dump_log(signal_path);
911 static void _supplicant_tdls_connected(GDBusConnection *conn,
912 const gchar *name, const gchar *path, const gchar *interface,
913 const gchar *sig, GVariant *param, gpointer user_data)
915 DBG("Received TDLS Connected Signal");
916 netconfig_wifi_tdls_connected_event(param);
921 static void _supplicant_tdls_disconnected(GDBusConnection *conn,
922 const gchar *name, const gchar *path, const gchar *interface,
923 const gchar *sig, GVariant *param, gpointer user_data)
925 DBG("Received TDLS Disconnected Signal");
926 netconfig_wifi_tdls_disconnected_event(param);
931 static void _supplicant_tdls_peer_found(GDBusConnection *conn,
932 const gchar *name, const gchar *path, const gchar *interface,
933 const gchar *sig, GVariant *param, gpointer user_data)
935 DBG("Received TDLS Peer Found Signal");
936 netconfig_wifi_tdls_peer_found_event(param);
940 static void _supplicant_dpp_auth_success(GDBusConnection *conn,
941 const gchar *name, const gchar *path, const gchar *interface,
942 const gchar *sig, GVariant *param, gpointer user_data)
944 DBG("Received DPP Auth Success Signal");
945 netconfig_wifi_dpp_auth_success_event(param);
949 static void _supplicant_dpp_auth_failed(GDBusConnection *conn,
950 const gchar *name, const gchar *path, const gchar *interface,
951 const gchar *sig, GVariant *param, gpointer user_data)
953 DBG("Received DPP Auth Failed Signal");
954 netconfig_wifi_dpp_auth_failed_event(param);
958 static void _supplicant_dpp_not_compatible(GDBusConnection *conn,
959 const gchar *name, const gchar *path, const gchar *interface,
960 const gchar *sig, GVariant *param, gpointer user_data)
962 DBG("Received DPP Not Compatible Signal");
963 netconfig_wifi_dpp_not_compatible_event(param);
967 static void _supplicant_dpp_conf_failed(GDBusConnection *conn,
968 const gchar *name, const gchar *path, const gchar *interface,
969 const gchar *sig, GVariant *param, gpointer user_data)
971 DBG("Received DPP Conf Failed Signal");
972 netconfig_wifi_dpp_conf_failed_event(param);
976 static void _supplicant_dpp_scan_peer_qr(GDBusConnection *conn,
977 const gchar *name, const gchar *path, const gchar *interface,
978 const gchar *sig, GVariant *param, gpointer user_data)
980 DBG("Received DPP Scan Peer QR Signal");
981 netconfig_wifi_dpp_scan_peer_qr_event(param);
985 static void _supplicant_dpp_network_id(GDBusConnection *conn,
986 const gchar *name, const gchar *path, const gchar *interface,
987 const gchar *sig, GVariant *param, gpointer user_data)
989 DBG("Received DPP Network Id Signal");
990 netconfig_wifi_dpp_network_id_event(param);
994 static void _supplicant_dpp_conf_sent(GDBusConnection *conn,
995 const gchar *name, const gchar *path, const gchar *interface,
996 const gchar *sig, GVariant *param, gpointer user_data)
998 DBG("Received DPP Conf Sent Signal");
999 netconfig_wifi_dpp_conf_sent_event(param);
1003 static void _supplicant_dpp_conf_received(GDBusConnection *conn,
1004 const gchar *name, const gchar *path, const gchar *interface,
1005 const gchar *sig, GVariant *param, gpointer user_data)
1007 DBG("Received DPP Conf Received Signal");
1008 netconfig_wifi_dpp_conf_received_event(param);
1012 static void _supplicant_dpp_conf_obj(GDBusConnection *conn,
1013 const gchar *name, const gchar *path, const gchar *interface,
1014 const gchar *sig, GVariant *param, gpointer user_data)
1016 DBG("Received DPP Conf Obj Signal");
1017 netconfig_wifi_dpp_conf_obj_event(param);
1021 static void _supplicant_wifi_wps_connected(GVariant *param)
1024 char ssid[32] = {0, };
1028 int config_error = 0;
1029 int error_indication = 0;
1032 if (param == NULL) {
1033 ERR("Param is NULL");
1037 g_variant_get(param, "(sa{sv})", &name, &iter);
1038 INFO("wps Result: %s", name);
1039 while (g_variant_iter_loop(iter, "{sv}", &key, &variant)) {
1040 INFO("wps Key is %s", key);
1041 if (g_strcmp0(key, "SSID") == 0) {
1042 const char *t_key = NULL;
1043 t_key = g_variant_get_fixed_array(variant, &ssid_len, sizeof(guchar));
1044 INFO("wps ssid_len is %zd ", ssid_len);
1045 if (t_key == NULL) {
1047 g_variant_unref(variant);
1048 ERR("WPS PBC Connection Failed");
1051 if (ssid_len > 0 && ssid_len <= 32) {
1052 memcpy(ssid, t_key, ssid_len);
1054 memset(ssid, 0, sizeof(ssid));
1057 INFO("WPS PBC Connection completed with AP %s", ssid);
1058 netconfig_wifi_notify_wps_completed(ssid, ssid_len);
1062 g_variant_iter_free(iter);
1067 g_variant_iter_free(iter);
1069 error_indication = WPS_EI_OPERATION_FAILED;
1070 config_error = WPS_CFG_NO_ERROR;
1071 ERR("Error Occured! Notifying Fail Event");
1072 netconfig_wifi_notify_wps_fail_event(config_error, error_indication);
1076 static void _supplicant_wifi_wps_event(GVariant *param)
1082 gint32 config_error = 0;
1083 gint32 error_indication = 0;
1085 if (param == NULL) {
1086 ERR("Param is NULL");
1090 g_variant_get(param, "(sa{sv})", &name, &iter);
1091 INFO("Event Result: %s", name);
1092 if (g_strcmp0(name, "fail") == 0) {
1093 while (g_variant_iter_loop(iter, "{sv}", &key, &variant)) {
1096 INFO("Key is %s", key);
1097 if (g_strcmp0(key, "config_error") == 0) {
1098 config_error = g_variant_get_int32(variant);
1099 ERR("Config Error %d", config_error);
1100 } else if (g_strcmp0(key, "error_indication") == 0) {
1101 error_indication = g_variant_get_int32(variant);
1102 ERR("Error Indication %d", error_indication);
1105 netconfig_wifi_notify_wps_fail_event(config_error, error_indication);
1108 g_variant_iter_free(iter);
1113 g_variant_iter_free(iter);
1115 error_indication = WPS_EI_OPERATION_FAILED;
1116 config_error = WPS_CFG_NO_ERROR;
1117 ERR("Error Occured! Notifying Fail Event");
1118 netconfig_wifi_notify_wps_fail_event(config_error, error_indication);
1121 static void _find_service_and_set_passphrase(char *ssid, char *key)
1124 GVariant *reply = NULL;
1129 gchar *enc_passphrase;
1131 ssid_len = strlen(ssid);
1133 str = g_string_sized_new((ssid_len * 2) + 55);
1137 dev_mac_addr = vconf_get_str(VCONFKEY_WIFI_BSSID_ADDRESS);
1138 if (!dev_mac_addr) {
1139 ERR("Failed to get mac address from vconf key");
1140 g_string_free(str, TRUE);
1145 for (i = 0; dev_mac_addr[i]; i++) {
1146 if (dev_mac_addr[i] != ':')
1147 ident[j++] = dev_mac_addr[i];
1151 g_string_append_printf(str, "%s%s_", CONNMAN_WIFI_SERVICE_PROFILE_PREFIX,
1155 for (i = 0; i < ssid_len; i++) {
1157 g_string_append_printf(str, "%02x", ssid[i]);
1160 g_string_append_printf(str, "_managed_psk");
1162 service_path = g_string_free(str, FALSE);
1164 enc_passphrase = _netconfig_encrypt_passphrase(key);
1165 if (!enc_passphrase) {
1166 ERR("Failed to encrypt passphrase");
1167 g_free(service_path);
1171 INFO("wps service_path %s Passphrase %s", service_path, enc_passphrase);
1173 reply = netconfig_invoke_dbus_method(CONNMAN_SERVICE, service_path,
1174 CONNMAN_SERVICE_INTERFACE, "SetProperty",
1175 g_variant_new("(sv)", "Passphrase",
1176 g_variant_new_string(enc_passphrase)));
1178 g_variant_unref(reply);
1180 ERR("Failed to set passphrase");
1182 g_free(service_path);
1187 static void _supplicant_wifi_wps_credentials(GVariant *param)
1190 char ssid[32] = {0, };
1191 char wps_key[100] = {0, };
1194 int config_error = 0;
1195 int error_indication = 0;
1197 char *key_mgmt = NULL;
1199 if (param == NULL) {
1200 ERR("Param is NULL");
1204 g_variant_get(param, "(a{sv})", &iter);
1205 while (g_variant_iter_loop(iter, "{sv}", &key, &variant)) {
1208 INFO("wps Key is %s", key);
1209 if (g_strcmp0(key, "Key") == 0) {
1211 const char *t_key = NULL;
1212 key_len = g_variant_get_size(variant);
1214 INFO("wps password len %zd ", key_len);
1216 t_key = g_variant_get_fixed_array(variant, &key_len,
1220 g_variant_unref(variant);
1223 strncpy(wps_key, t_key, key_len);
1224 wps_key[key_len] = '\0';
1225 INFO("WPS Key in process credentials %s", wps_key);
1227 SLOGI("WPS AP Security ->Open");
1228 } else if (g_strcmp0(key, "SSID") == 0) {
1229 const char *t_key = NULL;
1230 t_key = g_variant_get_fixed_array(variant, &ssid_len,
1232 INFO("wps ssid_len is %zd ", ssid_len);
1235 g_variant_unref(variant);
1238 if (ssid_len > 0 && ssid_len <= 32) {
1239 memcpy(ssid, t_key, ssid_len);
1241 memset(ssid, 0, sizeof(ssid));
1244 INFO("SSID in process credentials %s", ssid);
1245 } else if (g_strcmp0(key, "AuthType") == 0) {
1247 GVariantIter *var_iter;
1248 g_variant_get(variant, "as", &var_iter);
1249 while (g_variant_iter_loop(var_iter, "s", &auth_type)) {
1250 INFO("wps auth_type %s", auth_type);
1251 if (g_strcmp0(auth_type, "wpa-psk") == 0 ||
1252 g_strcmp0(auth_type, "wpa2-psk") == 0)
1254 else if (g_strcmp0(auth_type, "open") == 0)
1257 g_variant_iter_free(var_iter);
1258 } else if (g_strcmp0(key, "EncrType") == 0) {
1260 GVariantIter *var_iter;
1261 g_variant_get(variant, "as", &var_iter);
1262 while (g_variant_iter_loop(var_iter, "s", &encr_type))
1263 INFO("wps encr_type %s", encr_type);
1264 g_variant_iter_free(var_iter);
1265 } else if (g_strcmp0(key, "BSSID") == 0) {
1266 const guchar *bssid;
1268 bssid = g_variant_get_fixed_array(variant, &bssid_len,
1270 if (bssid && bssid_len == 6)
1271 INFO("wps BSSID %2x:%2x:%2x:%2x:%2x:%2x", bssid[0], bssid[1],
1272 bssid[2], bssid[3], bssid[4], bssid[5]);
1276 g_variant_iter_free(iter);
1278 if (g_strcmp0(key_mgmt, "psk") == 0)
1279 _find_service_and_set_passphrase(ssid, wps_key);
1283 * Notify WPS Credentials only when requested through WPS PBC
1284 * In case of WPS PIN connman will take care of notification
1286 if (netconfig_get_wps_field() == TRUE)
1288 netconfig_wifi_notify_wps_credentials(ssid, ssid_len, wps_key);
1292 g_variant_iter_free(iter);
1293 error_indication = WPS_EI_OPERATION_FAILED;
1294 config_error = WPS_CFG_NO_ERROR;
1295 ERR("Error Occured! Notifying Fail Event");
1296 netconfig_wifi_notify_wps_fail_event(config_error, error_indication);
1299 static void __netconfig_wps_signal_filter_handler(GDBusConnection *conn,
1300 const gchar *name, const gchar *path, const gchar *interface,
1301 const gchar *sig, GVariant *param, gpointer user_data)
1303 if (g_strcmp0(sig, SIGNAL_WPS_CREDENTIALS) == 0) {
1304 INFO("Received wps CREDENTIALS Signal from Supplicant");
1305 _supplicant_wifi_wps_credentials(param);
1306 } else if (g_strcmp0(sig, SIGNAL_WPS_EVENT) == 0) {
1307 INFO("Received wps EVENT Signal from Supplicant");
1308 _supplicant_wifi_wps_event(param);
1309 } else if (g_strcmp0(sig, SIGNAL_WPS_CONNECTED) == 0) {
1310 INFO("Received WPSConnected Signal from Supplicant");
1311 _supplicant_wifi_wps_connected(param);
1317 static void __telephony_svc_cs_changed_cb(keynode_t * node, void *data)
1319 int telephony_svc_cs = 0;
1322 telephony_svc_cs = vconf_keynode_get_int(node);
1324 netconfig_vconf_get_int(VCONFKEY_TELEPHONY_SVC_CS, &telephony_svc_cs);
1326 DBG("Telephony svc cs [%d]", telephony_svc_cs);
1328 switch (telephony_svc_cs) {
1330 netconfig_battery_end_dn();
1333 netconfig_battery_start_dn();
1340 static void __telephony_rssi_changed_cb(keynode_t * node, void *data)
1345 rssi = vconf_keynode_get_int(node);
1347 netconfig_vconf_get_int(VCONFKEY_TELEPHONY_RSSI, &rssi);
1349 DBG("Telephony rssi [%d]", rssi);
1351 netconfig_battery_update_dn_rssi(rssi);
1354 static void _notify_telephony_svc_cs(void)
1356 int telephony_svc_cs = 0;
1358 netconfig_vconf_get_int(VCONFKEY_TELEPHONY_SVC_CS, &telephony_svc_cs);
1359 DBG("Telephony svc cs [%d]", telephony_svc_cs);
1361 switch (telephony_svc_cs) {
1363 netconfig_battery_end_dn();
1366 netconfig_battery_start_dn();
1372 vconf_notify_key_changed(VCONFKEY_TELEPHONY_SVC_CS, __telephony_svc_cs_changed_cb, NULL);
1375 static void _notify_telephony_rssi(void)
1379 netconfig_vconf_get_int(VCONFKEY_TELEPHONY_RSSI, &rssi);
1380 DBG("Telephony rssi [%d]", rssi);
1382 netconfig_battery_update_dn_rssi(rssi);
1384 vconf_notify_key_changed(VCONFKEY_TELEPHONY_RSSI, __telephony_rssi_changed_cb, NULL);
1387 static void _ignore_telephony_svc_cs(void)
1389 vconf_ignore_key_changed(VCONFKEY_TELEPHONY_SVC_CS, __telephony_svc_cs_changed_cb);
1392 static void _ignore_telephony_rssi(void)
1394 vconf_ignore_key_changed(VCONFKEY_TELEPHONY_RSSI, __telephony_rssi_changed_cb);
1397 static supplicant_signal_cb supplicant_cbs[SIG_MAX] = {
1398 _supplicant_interface_removed,
1399 _supplicant_properties_changed,
1400 _supplicant_bss_added,
1401 _supplicant_scan_done,
1402 _supplicant_driver_hanged,
1403 _supplicant_session_overlapped,
1404 _supplicant_tdls_connected,
1405 _supplicant_tdls_disconnected,
1406 _supplicant_tdls_peer_found,
1407 _supplicant_dpp_auth_success,
1408 _supplicant_dpp_auth_failed,
1409 _supplicant_dpp_not_compatible,
1410 _supplicant_dpp_conf_failed,
1411 _supplicant_dpp_scan_peer_qr,
1412 _supplicant_dpp_network_id,
1413 _supplicant_dpp_conf_sent,
1414 _supplicant_dpp_conf_received,
1415 _supplicant_dpp_conf_obj,
1418 void register_gdbus_signal(void)
1420 GDBusConnection *connection = NULL;
1421 SuppSigArrayIndex sig;
1422 connection = netdbus_get_connection();
1424 if (connection == NULL) {
1425 ERR("Failed to get GDbus Connection");
1429 /* listening to messages from all objects as no path is specified */
1430 /* see signals from the given interface */
1431 conn_subscription_ids[0] = g_dbus_connection_signal_subscribe(
1434 CONNMAN_TECHNOLOGY_INTERFACE,
1438 G_DBUS_SIGNAL_FLAGS_NONE,
1439 _technology_signal_cb,
1443 conn_subscription_ids[1] = g_dbus_connection_signal_subscribe(
1446 CONNMAN_SERVICE_INTERFACE,
1447 CONNMAN_SIGNAL_PROPERTY_CHANGED,
1450 G_DBUS_SIGNAL_FLAGS_NONE,
1455 conn_subscription_ids[2] = g_dbus_connection_signal_subscribe(
1458 DBUS_INTERFACE_DBUS,
1459 SIGNAL_NAME_OWNER_CHANGED,
1462 G_DBUS_SIGNAL_FLAGS_NONE,
1463 _dbus_name_changed_cb,
1467 conn_subscription_ids[3] = g_dbus_connection_signal_subscribe(
1470 CONNMAN_MANAGER_INTERFACE,
1471 CONNMAN_SIGNAL_SERVICES_CHANGED,
1474 G_DBUS_SIGNAL_FLAGS_NONE,
1475 _services_changed_cb,
1479 conn_subscription_ids[4] = g_dbus_connection_signal_subscribe(
1482 CONNMAN_MANAGER_INTERFACE,
1483 SIGNAL_SCAN_CHANGED,
1484 CONNMAN_MANAGER_PATH,
1486 G_DBUS_SIGNAL_FLAGS_NONE,
1491 INFO("Successfully register connman DBus signal filters");
1493 conn_subscription_ids[5] = g_dbus_connection_signal_subscribe(
1496 SUPPLICANT_INTERFACE ".Interface.WPS",
1500 G_DBUS_SIGNAL_FLAGS_NONE,
1501 __netconfig_wps_signal_filter_handler,
1505 INFO("Successfully register Supplicant WPS DBus signal filters");
1507 conn_subscription_ids[5] = g_dbus_connection_signal_subscribe(
1510 DBUS_INTERFACE_DBUS,
1511 SIGNAL_NAME_OWNER_CHANGED,
1514 G_DBUS_SIGNAL_FLAGS_NONE,
1515 _dbus_name_changed_cb,
1519 INFO("Successfully register clat DBus signal filters");
1521 for (sig = SIG_INTERFACE_REMOVED; sig < SIG_MAX; sig++) {
1522 supp_subscription_ids[sig] = g_dbus_connection_signal_subscribe(
1525 supplicant_iface_for_sig[sig],
1526 supplicant_signals[sig],
1529 G_DBUS_SIGNAL_FLAGS_NONE,
1530 supplicant_cbs[sig],
1535 INFO("Successfully register Supplicant DBus signal filters");
1537 #if defined TIZEN_DEBUG_ENABLE
1538 dumpservice_subscription_id = g_dbus_connection_signal_subscribe(
1541 DUMP_SERVICE_INTERFACE,
1545 G_DBUS_SIGNAL_FLAGS_NONE,
1546 __netconfig_dumpservice_handler,
1550 INFO("Successfully registered Dumpservice DBus signal filter");
1553 _notify_telephony_svc_cs();
1554 _notify_telephony_rssi();
1556 INFO("Successfully register Telephony vconf keys");
1558 /* In case ConnMan precedes this signal register,
1559 * net-config should update the default connected profile.
1561 netconfig_update_default();
1564 void deregister_gdbus_signal(void)
1566 GDBusConnection *connection = NULL;
1568 SuppSigArrayIndex sig;
1569 connection = netdbus_get_connection();
1571 ERR("Already de-registered. Nothing to be done");
1575 for (signal = 0; signal < TOTAL_CONN_SIGNALS; signal++) {
1576 if (conn_subscription_ids[signal]) {
1577 g_dbus_connection_signal_unsubscribe(connection,
1578 conn_subscription_ids[signal]);
1582 for (sig = SIG_INTERFACE_REMOVED; sig < SIG_MAX; sig++) {
1583 if (supp_subscription_ids[sig]) {
1584 g_dbus_connection_signal_unsubscribe(connection,
1585 supp_subscription_ids[sig]);
1589 #if defined TIZEN_DEBUG_ENABLE
1590 g_dbus_connection_signal_unsubscribe(connection,
1591 dumpservice_subscription_id);
1594 _ignore_telephony_svc_cs();
1595 _ignore_telephony_rssi();