Implement dbus-glib to GDBus
authorJaehyun Kim <jeik01.kim@samsung.com>
Fri, 26 Apr 2013 08:07:29 +0000 (17:07 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Fri, 26 Apr 2013 12:41:56 +0000 (21:41 +0900)
Change-Id: I6fd2e68f975e36730e09141ca33f890b28001def

14 files changed:
configure.ac
include/common/network-cm-error.h
include/wifi/network-wifi-intf.h
network.pc.in
packaging/libnet-client.spec
src/include/network-dbus-request.h
src/include/network-internal.h
src/network-cm-intf.c
src/network-dbus-request.c
src/network-internal.c
src/network-profile-intf.c
src/network-signal-handler.c
src/network-wifi-intf.c
test/main.c

index cfaf9b8..07ff243 100644 (file)
@@ -20,19 +20,7 @@ AC_PROG_LN_S
 LT_INIT
 
 # Checks for moduels.
-PKG_CHECK_MODULES(DBUS, dbus-glib-1)
-AC_SUBST(DBUS_CFLAGS)
-AC_SUBST(DBUS_LIBS)
-
-PKG_CHECK_MODULES(GTHREAD, gthread-2.0)
-AC_SUBST(GTHREAD_CFLAS)
-AC_SUBST(GTHREAD_LIBS)
-
-PKG_CHECK_MODULES(GLIB, glib-2.0 )
-AC_SUBST(GLIB_CFLAGS)
-AC_SUBST(GLIB_LIBS)
-
-PKG_CHECK_MODULES(DLOG, dlog )
+PKG_CHECK_MODULES(DLOG, dlog)
 AC_SUBST(DLOG_CFLAGS)
 AC_SUBST(DLOG_LIBS)
 
@@ -40,6 +28,18 @@ PKG_CHECK_MODULES(VCONF, vconf)
 AC_SUBST(VCONF_CFLAGS)
 AC_SUBST(VCONF_LIBS)
 
+PKG_CHECK_MODULES(GLIB, glib-2.0)
+AC_SUBST(GLIB_CFLAGS)
+AC_SUBST(GLIB_LIBS)
+
+PKG_CHECK_MODULES(GTHREAD, gthread-2.0)
+AC_SUBST(GTHREAD_CFLAS)
+AC_SUBST(GTHREAD_LIBS)
+
+PKG_CHECK_MODULES(DBUS, dbus-glib-1)
+AC_SUBST(DBUS_CFLAS)
+AC_SUBST(DBUS_LIBS)
+
 if (!test $ARCH = "arm"); then
        AM_CONDITIONAL(ARM_BUILD, false)
 else
index df6fd35..b5810c1 100644 (file)
@@ -141,6 +141,8 @@ typedef enum {
        NET_ERR_UNKNOWN_METHOD = -791,
        /** Operation is restricted */
        NET_ERR_SECURITY_RESTRICTED = -790,
+       /** Already exists */
+       NET_ERR_ALREADY_EXISTS = -789,
 
        /** WiFi driver on/off failed */
        NET_ERR_WIFI_DRIVER_FAILURE = -699,
index 1d7b919..ea7e25b 100644 (file)
@@ -20,6 +20,8 @@
 #ifndef __NETWORK_WIFI_INTF_H__
 #define __NETWORK_WIFI_INTF_H__
 
+#include <glib.h>
+
 #include "network-cm-intf.h"
 
 #ifdef __cplusplus
index 4069eb4..4c40699 100644 (file)
@@ -5,8 +5,7 @@ includedir=@prefix@/include
 \r
 Name: network\r
 Description: ConnMan Client Library\r
-Requires: dlog dbus-1 dbus-glib-1\r
+Requires: dlog glib-2.0 gthread-2.0 dbus-glib-1
 Version: @VERSION@\r
 Libs: -L${libdir} -lnetwork\r
 Cflags: -I${includedir} -I${includedir}/network\r
-\r
index 75edd57..e86e2bc 100644 (file)
@@ -1,15 +1,16 @@
 Name:       libnet-client
 Summary:    Network Client library (Shared library)
-Version:    0.1.77_33
+Version:    0.1.77_34
 Release:    1
 Group:      System/Network
 License:    Flora License
 Source0:    %{name}-%{version}.tar.gz
 BuildRequires:  cmake
-BuildRequires:  pkgconfig(glib-2.0)
-BuildRequires:  pkgconfig(dbus-glib-1)
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(vconf)
+BuildRequires:  pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(gthread-2.0)
+BuildRequires: pkgconfig(dbus-glib-1)
 
 %description
 Network Client library (Shared library)
index 7262360..d85ca01 100644 (file)
@@ -101,22 +101,22 @@ int _net_dbus_set_profile_ipv4(net_profile_info_t* prof_info, char* profile_name
 int _net_dbus_set_profile_dns(net_profile_info_t* prof_info, char* profile_name);
 int _net_dbus_set_proxy(net_profile_info_t* prof_info, char* profile_name);
 int _net_dbus_get_technology_state(network_tech_state_info_t* tech_state);
-DBusMessage *_net_invoke_dbus_method(const char* dest, const char* path,
+GVariant *_net_invoke_dbus_method(const char* dest, const char* path,
                char* interface_name, char* method,
-               char* param_array[], int* dbus_error);
+               GVariant *params, int* dbus_error);
 int _net_invoke_dbus_method_nonblock(const char* dest, const char* path,
                char* interface_name, char* method,
-               DBusPendingCallNotifyFunction notify_func);
+               GAsyncReadyCallback notify_func);
 int _net_dbus_load_wifi_driver(void);
 int _net_dbus_remove_wifi_driver(void);
 int _net_dbus_get_statistics(net_device_t device_type, net_statistics_type_e statistics_type, unsigned long long *size);
 int _net_dbus_set_statistics(net_device_t device_type, net_statistics_type_e statistics_type);
 int _net_dbus_add_pdp_profile(net_profile_info_t *prof_info);
 int _net_dbus_modify_pdp_profile(net_profile_info_t *prof_info, const char *profile_name);
-dbus_bool_t _net_dbus_is_pending_call_used(void);
-void _net_dbus_set_pending_call_used(dbus_bool_t used);
-DBusPendingCall *_net_dbus_get_pending_call(void);
-void _net_dbus_set_pending_call(DBusPendingCall *call);
+gboolean _net_dbus_is_pending_call_used(void);
+void _net_dbus_set_pending_call_used(gboolean used);
+//DBusPendingCall *_net_dbus_get_pending_call(void);
+void _net_dbus_set_pending_call(void *call);
 void _net_dbus_clear_pending_call(void);
 gboolean __net_dbus_abort_open_request(const char *profile_name);
 int _net_dbus_specific_scan_request(const char *ssid);
index 760523f..e4f7c5f 100644 (file)
@@ -21,8 +21,9 @@
 #define __NETWORK_INTERNAL_H__
 
 #include <glib.h>
+#include <glib-object.h>
+#include <gio/gio.h>
 #include <stdlib.h>
-#include <dbus/dbus.h>
 
 #include "network-cm-intf.h"
 #include "network-wifi-intf.h"
@@ -169,6 +170,16 @@ typedef struct
 
 typedef struct
 {
+       gpointer signal_conn;
+       GCancellable *cancellable;
+       int conn_id_connman;
+       int conn_id_connman_manager;
+       int conn_id_supplicant;
+       int conn_id_netconfig;
+} handle_connection;
+
+typedef struct
+{
        int num_of_services;
        char* ProfileName[NET_PROFILE_LIST_MAX];
 } network_services_list_t;
@@ -223,11 +234,7 @@ typedef struct
  *     Global Functions 
  *****************************************************************************/
 net_device_t _net_get_tech_type_from_path(const char *profile_name);
-char* _net_get_string(DBusMessage* msg);
-unsigned long long _net_get_uint64(DBusMessage* msg);
-char* _net_get_object(DBusMessage* msg);
-int _net_get_boolean(DBusMessage* msg);
-int _net_get_tech_state(DBusMessage* msg, network_tech_state_info_t* tech_state);
+int _net_get_tech_state(GVariant *iter, network_tech_state_info_t* tech_state);
 char* _net_print_error(net_err_t error);
 int _net_is_valid_service_type(net_service_type_t service_type);
 int _net_open_connection_with_wifi_info(const net_wifi_connection_info_t* wifi_info);
index a0c3164..2e605cc 100644 (file)
@@ -79,22 +79,24 @@ static int __net_add_route(const char *ip_addr, const char *interface)
        __NETWORK_FUNC_ENTER__;
 
        net_err_t Error = NET_ERR_NONE;
-       DBusMessage *message = NULL;
+       GVariant *message = NULL;
        char dest_ip[30];
        char netmask[30];
        char if_name[40];
-       char* param_array[] = { NULL, NULL, NULL, NULL };
-
+       GVariant *params = NULL;
+#if 0
        g_snprintf(dest_ip, 30, "string:%s", ip_addr);
        g_snprintf(netmask, 30, "string:255.255.255.255");
        g_snprintf(if_name, 40, "string:%s", interface);
+#endif
+       g_snprintf(dest_ip, 30, "%s", ip_addr);
+       g_snprintf(netmask, 30, "255.255.255.255");
+       g_snprintf(if_name, 40, "%s", interface);
 
-       param_array[0] = dest_ip;
-       param_array[1] = netmask;
-       param_array[2] = if_name;
+       params = g_variant_new("(sss)", dest_ip, netmask, if_name);
 
        message = _net_invoke_dbus_method(NETCONFIG_SERVICE, NETCONFIG_NETWORK_PATH,
-                       NETCONFIG_NETWORK_INTERFACE, "AddRoute", param_array, &Error);
+                       NETCONFIG_NETWORK_INTERFACE, "AddRoute", params, &Error);
 
        if (message == NULL) {
                NETWORK_LOG(NETWORK_ERROR, "Failed to add route\n");
@@ -102,23 +104,22 @@ static int __net_add_route(const char *ip_addr, const char *interface)
        }
 
        /** Check Reply */
-       DBusMessageIter iter;
-       int add_result = 0;
+       gboolean add_result = FALSE;
 
-       dbus_message_iter_init(message, &iter);
-       if (dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_BOOLEAN) {
-               dbus_message_iter_get_basic(&iter, &add_result);
-               NETWORK_LOG(NETWORK_HIGH, "Add route, result : %d\n", add_result);
-       }
+       g_variant_get(message, "(b)", &add_result);
+       NETWORK_LOG(NETWORK_HIGH, "Add route, result : %d\n", add_result);
 
        if (add_result)
                Error = NET_ERR_NONE;
        else
                Error = NET_ERR_UNKNOWN;
 
-       dbus_message_unref(message);
+       g_variant_unref(message);
 
 done:
+       if (params)
+               g_variant_unref(params);
+
        __NETWORK_FUNC_EXIT__;
        return Error;
 }
@@ -128,22 +129,23 @@ static int __net_remove_route(const char *ip_addr, const char *interface)
        __NETWORK_FUNC_ENTER__;
 
        net_err_t Error = NET_ERR_NONE;
-       DBusMessage *message = NULL;
+       GVariant *message = NULL;
        char dest_ip[30];
        char netmask[30];
        char if_name[40];
-       char* param_array[] = { NULL, NULL, NULL, NULL };
-
+       GVariant *params = NULL;
+#if 0
        g_snprintf(dest_ip, 30, "string:%s", ip_addr);
        g_snprintf(netmask, 30, "string:255.255.255.255");
        g_snprintf(if_name, 40, "string:%s", interface);
-
-       param_array[0] = dest_ip;
-       param_array[1] = netmask;
-       param_array[2] = if_name;
+#endif
+       g_snprintf(dest_ip, 30, "%s", ip_addr);
+       g_snprintf(netmask, 30, "255.255.255.255");
+       g_snprintf(if_name, 40, "%s", interface);
+       params = g_variant_new("(sss)", dest_ip, netmask, if_name);
 
        message = _net_invoke_dbus_method(NETCONFIG_SERVICE, NETCONFIG_NETWORK_PATH,
-                       NETCONFIG_NETWORK_INTERFACE, "RemoveRoute", param_array, &Error);
+                       NETCONFIG_NETWORK_INTERFACE, "RemoveRoute", params, &Error);
 
        if (message == NULL) {
                NETWORK_LOG(NETWORK_ERROR, "Failed to remove route\n");
@@ -151,23 +153,21 @@ static int __net_remove_route(const char *ip_addr, const char *interface)
        }
 
        /** Check Reply */
-       DBusMessageIter iter;
-       int remove_result = 0;
+       gboolean remove_result = FALSE;
 
-       dbus_message_iter_init(message, &iter);
-       if (dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_BOOLEAN) {
-               dbus_message_iter_get_basic(&iter, &remove_result);
-               NETWORK_LOG(NETWORK_HIGH, "Remove route, result : %d\n", remove_result);
-       }
+       g_variant_get(message, "(b)", &remove_result);
+       NETWORK_LOG(NETWORK_HIGH, "Remove route, result : %d\n", remove_result);
 
        if (remove_result)
                Error = NET_ERR_NONE;
        else
                Error = NET_ERR_UNKNOWN;
 
-       dbus_message_unref(message);
+       g_variant_unref(message);
 
 done:
+       if (params)
+               g_variant_unref(params);
        __NETWORK_FUNC_EXIT__;
        return Error;
 }
index 2d13179..50b09dc 100644 (file)
 /*****************************************************************************
  *     Global Variables
  *****************************************************************************/
+extern handle_connection h_connection;
+
+/* TODO: If 'pcall' is not required, we can just have the gboolean instead of
+ * below struct
+ */
 struct dbus_pending_call_data {
-       DBusPendingCall *pcall;
-       dbus_bool_t is_used;
+       void *pcall;
+       gboolean is_used;
 };
 
 static struct dbus_pending_call_data network_dbus_pending_call_data = {
@@ -126,48 +131,7 @@ static int __net_netconfig_error_string_to_enum(const char* error)
        return NET_ERR_UNKNOWN;
 }
 
-static int _net_get_error_from_message(DBusMessage *message)
-{
-       __NETWORK_FUNC_ENTER__;
-
-       int MessageType = 0;
-
-       MessageType = dbus_message_get_type(message);
-
-       if (MessageType == DBUS_MESSAGE_TYPE_ERROR) {
-               const char* str = dbus_message_get_error_name(message);
-
-               NETWORK_LOG(NETWORK_ERROR, "message %s\n", str);
-               __NETWORK_FUNC_EXIT__;
-               return __net_error_string_to_enum(str);
-       }
-
-       __NETWORK_FUNC_EXIT__;
-       return NET_ERR_NONE;
-}
-
-static int _net_get_error_from_netconfig_message(DBusMessage *message)
-{
-       __NETWORK_FUNC_ENTER__;
-
-       int MessageType = 0;
-
-       MessageType = dbus_message_get_type(message);
-
-       if (MessageType == DBUS_MESSAGE_TYPE_ERROR) {
-               const char* str = dbus_message_get_error_name(message);
-               const char* err_msg = _net_get_string(message);
-
-               NETWORK_LOG(NETWORK_ERROR, "message %s %s\n", str, err_msg);
-               __NETWORK_FUNC_EXIT__;
-               return __net_netconfig_error_string_to_enum(err_msg);
-       }
-
-       __NETWORK_FUNC_EXIT__;
-       return NET_ERR_NONE;
-}
-
-static void __net_open_connection_reply(DBusPendingCall *call, void *user_data)
+static void __net_open_connection_reply(GObject *source_object, GAsyncResult *res, gpointer user_data)
 {
        __NETWORK_FUNC_ENTER__;
 
@@ -181,8 +145,23 @@ static void __net_open_connection_reply(DBusPendingCall *call, void *user_data)
        network_request_table_t *wps_info =
                        &request_table[NETWORK_REQUEST_TYPE_ENROLL_WPS];
 
-       DBusMessage *reply = dbus_pending_call_steal_reply(call);
-       net_err_t Error = _net_get_error_from_message(reply);
+       GDBusConnection *conn = NULL;
+       GError *error = NULL;
+       GVariant *dbus_result = NULL;
+       net_err_t Error = NET_ERR_NONE;
+
+       conn = G_DBUS_CONNECTION (source_object);
+       dbus_result = g_dbus_connection_call_finish(conn, res, &error);
+
+       if (error != NULL) {
+               NETWORK_LOG(NETWORK_LOW, "error msg - [%s]\n", error->message);
+               Error = __net_error_string_to_enum(error->message);
+               g_error_free(error);
+       } else
+               NETWORK_LOG(NETWORK_LOW, "error msg is NULL\n");
+
+       if (dbus_result)
+               g_variant_unref(dbus_result);
 
        if (Error == NET_ERR_NONE)
                goto done;
@@ -255,9 +234,6 @@ static void __net_open_connection_reply(DBusPendingCall *call, void *user_data)
        }
 
 done:
-       dbus_message_unref(reply);
-       dbus_pending_call_unref(call);
-
        network_dbus_pending_call_data.is_used = FALSE;
        network_dbus_pending_call_data.pcall = NULL;
 
@@ -267,7 +243,7 @@ done:
        __NETWORK_FUNC_EXIT__;
 }
 
-static void __net_close_connection_reply(DBusPendingCall *call, void *user_data)
+static void __net_close_connection_reply(GObject *source_object, GAsyncResult *res, gpointer user_data)
 {
        __NETWORK_FUNC_ENTER__;
 
@@ -278,8 +254,20 @@ static void __net_close_connection_reply(DBusPendingCall *call, void *user_data)
        network_request_table_t *close_info =
                        &request_table[NETWORK_REQUEST_TYPE_CLOSE_CONNECTION];
 
-       DBusMessage *reply = dbus_pending_call_steal_reply(call);
-       net_err_t Error = _net_get_error_from_message(reply);
+       GDBusConnection *conn = NULL;
+       GError *error = NULL;
+       GVariant *dbus_result = NULL;
+       net_err_t Error = NET_ERR_NONE;
+
+       conn = G_DBUS_CONNECTION (source_object);
+       dbus_result = g_dbus_connection_call_finish(conn, res, &error);
+       if (error != NULL) {
+               Error = __net_netconfig_error_string_to_enum(error->message);
+               g_error_free(error);
+       }
+
+       if (dbus_result)
+               g_variant_unref(dbus_result);
 
        if (Error == NET_ERR_NONE)
                goto done;
@@ -310,9 +298,6 @@ static void __net_close_connection_reply(DBusPendingCall *call, void *user_data)
        }
 
 done:
-       dbus_message_unref(reply);
-       dbus_pending_call_unref(call);
-
        network_dbus_pending_call_data.is_used = FALSE;
        network_dbus_pending_call_data.pcall = NULL;
 
@@ -322,17 +307,29 @@ done:
        __NETWORK_FUNC_EXIT__;
 }
 
-static void __net_wifi_power_reply(DBusPendingCall *call, void *user_data)
+static void __net_wifi_power_reply(GObject *source_object, GAsyncResult *res, gpointer user_data)
 {
        __NETWORK_FUNC_ENTER__;
 
        NETWORK_LOG(NETWORK_LOW, "__net_wifi_power_reply() called\n");
 
        int callback_flag = FALSE;
-       DBusMessage *reply = dbus_pending_call_steal_reply(call);
-       net_err_t Error = _net_get_error_from_netconfig_message(reply);
+       GDBusConnection *conn = NULL;
+       GError *error = NULL;
+       GVariant *dbus_result = NULL;
+       net_err_t Error = NET_ERR_NONE;
        net_event_info_t event_data = {0,};
 
+       conn = G_DBUS_CONNECTION (source_object);
+       dbus_result = g_dbus_connection_call_finish(conn, res, &error);
+       if (error != NULL) {
+               Error = __net_netconfig_error_string_to_enum(error->message);
+               g_error_free(error);
+       }
+
+       if (dbus_result)
+               g_variant_unref(dbus_result);
+
        if (Error != NET_ERR_NONE) {
                NETWORK_LOG(NETWORK_ERROR,
                                "Wi-Fi power operation failed. Error [%d]\n", Error);
@@ -351,14 +348,11 @@ static void __net_wifi_power_reply(DBusPendingCall *call, void *user_data)
                                event_data.Datalength = sizeof(net_wifi_state_t);
                                event_data.Data = &(NetworkInfo.wifi_state);
                                event_data.Error = Error;
-
-                               callback_flag = TRUE;
                        }
                }
-       }
 
-       dbus_message_unref(reply);
-       dbus_pending_call_unref(call);
+               callback_flag = TRUE;
+       }
 
        network_dbus_pending_call_data.is_used = FALSE;
        network_dbus_pending_call_data.pcall = NULL;
@@ -369,15 +363,27 @@ static void __net_wifi_power_reply(DBusPendingCall *call, void *user_data)
        __NETWORK_FUNC_EXIT__;
 }
 
-static void __net_specific_scan_wifi_reply(DBusPendingCall *call, void *user_data)
+static void __net_specific_scan_wifi_reply(GObject *source_object, GAsyncResult *res, gpointer user_data)
 {
        __NETWORK_FUNC_ENTER__;
 
        int callback_flag = FALSE;
-       DBusMessage *reply = dbus_pending_call_steal_reply(call);
-       net_err_t Error = _net_get_error_from_netconfig_message(reply);
+       GDBusConnection *conn = NULL;
+       GError *error = NULL;
+       GVariant *dbus_result = NULL;
+       net_err_t Error = NET_ERR_NONE;
        net_event_info_t event_data = {0,};
 
+       conn = G_DBUS_CONNECTION (source_object);
+       dbus_result = g_dbus_connection_call_finish(conn, res, &error);
+       if (error != NULL) {
+               Error = __net_netconfig_error_string_to_enum(error->message);
+               g_error_free(error);
+       }
+
+       if (dbus_result)
+               g_variant_unref(dbus_result);
+
        if (Error != NET_ERR_NONE)
                NETWORK_LOG(NETWORK_ERROR, "Find hidden AP failed. Error [%d]\n", Error);
        else
@@ -404,9 +410,6 @@ static void __net_specific_scan_wifi_reply(DBusPendingCall *call, void *user_dat
                callback_flag = TRUE;
        }
 
-       dbus_message_unref(reply);
-       dbus_pending_call_unref(call);
-
        network_dbus_pending_call_data.is_used = FALSE;
        network_dbus_pending_call_data.pcall = NULL;
 
@@ -416,50 +419,7 @@ static void __net_specific_scan_wifi_reply(DBusPendingCall *call, void *user_dat
        __NETWORK_FUNC_EXIT__;
 }
 
-static void __net_scan_wifi_reply(DBusPendingCall *call, void *user_data)
-{
-       __NETWORK_FUNC_ENTER__;
-
-       NETWORK_LOG(NETWORK_LOW, "__net_scan_wifi_reply() called\n");
-
-       int callback_flag = FALSE;
-       net_event_info_t event_data = {0,};
-
-       DBusMessage *reply = dbus_pending_call_steal_reply(call);
-       net_err_t Error = _net_get_error_from_message(reply);
-
-       if (Error == NET_ERR_IN_PROGRESS || Error == NET_ERR_NONE)
-               goto done;
-
-       NETWORK_LOG(NETWORK_ERROR,
-               "Error!!! WiFi Scan reply received. Error code : [%d]\n", Error);
-
-       if (request_table[NETWORK_REQUEST_TYPE_SCAN].flag == TRUE) {
-               memset(&request_table[NETWORK_REQUEST_TYPE_SCAN],
-                               0, sizeof(network_request_table_t));
-               event_data.Error = Error;
-               event_data.Event = NET_EVENT_WIFI_SCAN_RSP;
-
-               NETWORK_LOG(NETWORK_LOW, "Sending NET_EVENT_WIFI_SCAN_RSP Error = %s\n",
-                               _net_print_error(event_data.Error));
-
-               callback_flag = TRUE;
-       }
-
-done:
-       dbus_message_unref(reply);
-       dbus_pending_call_unref(call);
-
-       network_dbus_pending_call_data.is_used = FALSE;
-       network_dbus_pending_call_data.pcall = NULL;
-
-       if (callback_flag)
-               _net_client_callback(&event_data);
-
-       __NETWORK_FUNC_EXIT__;
-}
-
-static void __net_set_default_reply(DBusPendingCall *call, void *user_data)
+static void __net_set_default_reply(GObject *source_object, GAsyncResult *res, gpointer user_data)
 {
        __NETWORK_FUNC_ENTER__;
 
@@ -469,8 +429,17 @@ static void __net_set_default_reply(DBusPendingCall *call, void *user_data)
        net_event_info_t event_data = {0,};
        int rv;
 
-       DBusMessage *reply = dbus_pending_call_steal_reply(call);
-       net_err_t Error = _net_get_error_from_message(reply);
+       GDBusConnection *conn = NULL;
+       GError *error = NULL;
+       GVariant *dbus_result = NULL;
+       net_err_t Error = NET_ERR_NONE;
+
+       conn = G_DBUS_CONNECTION (source_object);
+       dbus_result = g_dbus_connection_call_finish(conn, res, &error);
+       if (error != NULL) {
+               Error = __net_netconfig_error_string_to_enum(error->message);
+               g_error_free(error);
+       }
 
        NETWORK_LOG(NETWORK_ERROR, "Error code : [%d]\n", Error);
 
@@ -480,7 +449,7 @@ static void __net_set_default_reply(DBusPendingCall *call, void *user_data)
                event_data.Event = NET_EVENT_CELLULAR_SET_DEFAULT_RSP;
 
                if (Error == NET_ERR_NONE) {
-                       rv = _net_get_boolean(reply);
+                       g_variant_get(dbus_result, "(b)", &rv);
 
                        NETWORK_LOG(NETWORK_LOW, "Reply : [%s]\n", rv ? "TRUE" : "FALSE");
 
@@ -497,12 +466,12 @@ static void __net_set_default_reply(DBusPendingCall *call, void *user_data)
                callback_flag = TRUE;
        }
 
-       dbus_message_unref(reply);
-       dbus_pending_call_unref(call);
-
        network_dbus_pending_call_data.is_used = FALSE;
        network_dbus_pending_call_data.pcall = NULL;
 
+       if (dbus_result)
+               g_variant_unref(dbus_result);
+
        if (callback_flag)
                _net_client_callback(&event_data);
 
@@ -562,148 +531,51 @@ static char *__net_make_group_name(const char *ssid, const char *net_mode, const
        return buf;
 }
 
-static int __net_append_param(DBusMessage *message, char *param_array[])
-{
-       int count = 0;
-       dbus_uint32_t uint32 = 0;
-       DBusMessageIter iter;
-       DBusMessageIter container_iter;
-       char *args = NULL;
-       char *ch = NULL;
-
-       if (param_array == NULL)
-               return NET_ERR_NONE;
-
-       dbus_message_iter_init_append(message, &iter);
-
-       while (param_array[count] != NULL) {
-               args = param_array[count];
-               NETWORK_LOG(NETWORK_HIGH, "parameter %d [%s]",
-                               count, param_array[count]);
-
-               ch = strchr(args, ':');
-               if (ch == NULL) {
-                       NETWORK_LOG(NETWORK_ERROR, "Invalid parameter[\"%s\"]\n", args);
-                       return NET_ERR_INVALID_PARAM;
-               }
-               *ch = 0; ch++;
-
-               if (g_strcmp0(args, CONNMAN_CLIENT_DBUS_TYPE_STRING) == 0)
-                       dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &ch);
-               else if (g_strcmp0(args, CONNMAN_CLIENT_DBUS_TYPE_UINT32) == 0) {
-                       uint32 = strtoul(ch, NULL, 0);
-                       dbus_message_iter_append_basic(&iter, DBUS_TYPE_UINT32, &uint32);
-               } else if (g_strcmp0(args, CONNMAN_CLIENT_DBUS_TYPE_VARIANT) == 0) {
-                       args = ch;
-                       ch = strchr(args, ':');
-                       if (ch == NULL) {
-                               NETWORK_LOG(NETWORK_ERROR, "Invalid data format[\"%s\"]\n", args);
-                               return NET_ERR_INVALID_PARAM;
-                       }
-                       *ch = 0; ch++;
-
-                       if (g_strcmp0(args, CONNMAN_CLIENT_DBUS_TYPE_STRING) == 0) {
-                               dbus_message_iter_open_container(&iter, DBUS_TYPE_VARIANT,
-                                               DBUS_TYPE_STRING_AS_STRING, &container_iter);
-                               dbus_message_iter_append_basic(&container_iter, DBUS_TYPE_STRING, &ch);
-                               dbus_message_iter_close_container(&iter, &container_iter);
-                       } else {
-                               NETWORK_LOG(NETWORK_ERROR, "Not supported data format[\"%s\"]\n", args);
-                               return NET_ERR_INVALID_PARAM;
-                       }
-               } else {
-                       NETWORK_LOG(NETWORK_ERROR, "Not supported data format[\"%s\"]\n", args);
-                       return NET_ERR_INVALID_PARAM;
-               }
-
-               count++;
-       }
-
-       return NET_ERR_NONE;
-}
-
-static inline void __net_dict_append_strings(DBusMessageIter *dict,
-               const char *field, const char *value)
-{
-       DBusMessageIter entry;
-
-       dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY,
-                                                               NULL, &entry);
-       dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &field);
-       dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &value);
-       dbus_message_iter_close_container(dict, &entry);
-}
-
 static int __net_dbus_set_agent_field(const char *key, const char *value)
 {
-       DBusConnection* conn = NULL;
-       net_err_t Error = NET_ERR_NONE;
-       DBusError error;
-       DBusMessage *message = NULL;
-       DBusMessage *reply = NULL;
-       DBusMessageIter itr, dict;
-
        __NETWORK_FUNC_ENTER__;
 
-       conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
-       if (NULL == conn) {
-               NETWORK_LOG(NETWORK_ERROR, "Failed to get a system bus\n");
-
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
-
-       message = dbus_message_new_method_call(NETCONFIG_SERVICE,
-                       NETCONFIG_WIFI_PATH, CONNMAN_AGENT_INTERFACE,
-                       "SetField");
-       if (NULL == message) {
-               NETWORK_LOG(NETWORK_ERROR, "dbus_message_new_method_call() "
-                               "failed\n");
-               dbus_connection_unref(conn);
-
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
-
-       dbus_message_iter_init_append(message, &itr);
-
-       dbus_message_iter_open_container(&itr, DBUS_TYPE_ARRAY,
-                       (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
-                        DBUS_TYPE_STRING_AS_STRING
-                        DBUS_TYPE_STRING_AS_STRING
-                        DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &dict);
-
-       __net_dict_append_strings(&dict, key, value);
-
-       NETWORK_LOG(NETWORK_HIGH, "Adding - %s %s\n", key, value);
-
-       dbus_message_iter_close_container(&itr, &dict);
-
-       dbus_error_init(&error);
-
-       reply = dbus_connection_send_with_reply_and_block(conn, message,
-                       DBUS_REPLY_TIMEOUT, &error);
-       if (NULL == reply) {
-               Error = NET_ERR_UNKNOWN;
-               if (dbus_error_is_set (&error) == TRUE) {
+       GError *error = NULL;
+       GVariant *reply = NULL;
+       GVariant *params = NULL;
+       GVariantBuilder *builder;
+
+       builder = g_variant_builder_new(G_VARIANT_TYPE ("a{ss}"));
+       g_variant_builder_add(builder, "{ss}", key, value);
+
+       params = g_variant_new("(@a{ss})", g_variant_builder_end(builder));
+       g_variant_builder_unref(builder);
+
+       reply = g_dbus_connection_call_sync(h_connection.signal_conn,
+                                       NETCONFIG_SERVICE,
+                                       NETCONFIG_WIFI_PATH,
+                                       CONNMAN_AGENT_INTERFACE,
+                                       "SetField", params, NULL,
+                                       G_DBUS_CALL_FLAGS_NONE,
+                                       DBUS_REPLY_TIMEOUT,
+                                       h_connection.cancellable, &error);
+       if (reply == NULL) {
+               if (error != NULL) {
                        NETWORK_LOG(NETWORK_ERROR,
-                                       "dbus_connection_send_with_reply_and_block() failed, "
-                                       "Error[%s: %s]\n", error.name, error.message);
-                       Error = __net_error_string_to_enum(error.name);
-
-                       dbus_error_free(&error);
+                                               "g_dbus_connection_call_sync() failed."
+                                               "error [%d: %s]\n", error->code, error->message);
+                       g_error_free(error);
+               } else {
+                       NETWORK_LOG(NETWORK_ERROR,
+                                       "g_dbus_connection_call_sync() failed.\n");
                }
 
-               dbus_message_unref(message);
-               dbus_connection_unref(conn);
+               if (params)
+                       g_variant_unref(params);
 
                __NETWORK_FUNC_EXIT__;
-               return Error;
+               return NET_ERR_UNKNOWN;
        }
 
-       dbus_message_unref(reply);
-       dbus_message_unref(message);
-       dbus_connection_unref(conn);
+       g_variant_unref(reply);
+
+       if (params)
+               g_variant_unref(params);
 
        __NETWORK_FUNC_EXIT__;
        return NET_ERR_NONE;
@@ -712,144 +584,71 @@ static int __net_dbus_set_agent_field(const char *key, const char *value)
 /*****************************************************************************
  *     Global Functions Definition
  *****************************************************************************/
-DBusMessage *_net_invoke_dbus_method(const char* dest, const char* path,
+GVariant *_net_invoke_dbus_method(const char* dest, const char* path,
                char* interface_name, char* method,
-               char* param_array[], int* dbus_error)
+               GVariant *params, int* dbus_error)
 {
        __NETWORK_FUNC_ENTER__;
 
-       DBusError error;
-       DBusConnection* conn = NULL;
-       DBusMessage *reply = NULL;
-       DBusMessage *message = NULL;
+       GError *error = NULL;
+       GVariant *reply = NULL;
 
        *dbus_error = NET_ERR_NONE;
 
        NETWORK_LOG(NETWORK_HIGH, "[DBUS Sync] %s.%s, %s\n",
                        interface_name, method, path);
 
-       conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
-       if (conn == NULL) {
-               NETWORK_LOG(NETWORK_ERROR, "Failed to get a system bus\n");
-
-               *dbus_error = NET_ERR_UNKNOWN;
-
-               __NETWORK_FUNC_EXIT__;
-               return NULL;
-       }
-
-       message = dbus_message_new_method_call(dest, path, interface_name, method);
-       if (message == NULL) {
-               NETWORK_LOG(NETWORK_ERROR, "dbus_message_new_method_call() failed\n");
-
-               dbus_connection_unref(conn);
-               *dbus_error = NET_ERR_UNKNOWN;
-
-               __NETWORK_FUNC_EXIT__;
-               return NULL;
-       }
-
-       if (__net_append_param(message, param_array) != NET_ERR_NONE) {
-               NETWORK_LOG(NETWORK_ERROR, "__net_append_param() failed\n");
-
-               dbus_message_unref(message);
-               dbus_connection_unref(conn);
-
-               *dbus_error = NET_ERR_INVALID_PARAM;
-
-               __NETWORK_FUNC_EXIT__;
-               return NULL;
-       }
-
-       dbus_error_init(&error);
-
-       reply = dbus_connection_send_with_reply_and_block(conn, message,
-                                                               DBUS_REPLY_TIMEOUT, &error);
+       reply = g_dbus_connection_call_sync(h_connection.signal_conn,
+                                       dest, path, interface_name,
+                                       method, params, NULL,
+                                       G_DBUS_CALL_FLAGS_NONE,
+                                       DBUS_REPLY_TIMEOUT,
+                                       h_connection.cancellable, &error);
        if (reply == NULL) {
-               if (dbus_error_is_set(&error) == TRUE) {
+               if (error != NULL) {
                        NETWORK_LOG(NETWORK_ERROR,
-                                       "dbus_connection_send_with_reply_and_block() failed."
-                                       "error [%s: %s]\n", error.name, error.message);
-
-                       *dbus_error = __net_error_string_to_enum(error.name);
-                       dbus_error_free(&error);
+                                               "g_dbus_connection_call_sync() failed."
+                                               "error [%d: %s]\n", error->code, error->message);
+                       g_error_free(error);
                } else {
                        NETWORK_LOG(NETWORK_ERROR,
-                                       "dbus_connection_send_with_reply_and_block() failed\n");
-
-                       *dbus_error = NET_ERR_UNKNOWN;
+                                       "g_dbus_connection_call_sync() failed.\n");
                }
 
-               dbus_message_unref(message);
-               dbus_connection_unref(conn);
+               *dbus_error = NET_ERR_UNKNOWN;
 
                __NETWORK_FUNC_EXIT__;
                return NULL;
        }
 
-       dbus_message_unref(message);
-       dbus_connection_unref(conn);
-
        __NETWORK_FUNC_EXIT__;
        return reply;
 }
 
 int _net_invoke_dbus_method_nonblock(const char* dest, const char* path,
                char* interface_name, char* method,
-               DBusPendingCallNotifyFunction notify_func)
+               GAsyncReadyCallback notify_func)
 {
        __NETWORK_FUNC_ENTER__;
 
-       DBusConnection *conn = NULL;
-       DBusMessage *message = NULL;
-       DBusPendingCall *call;
-       dbus_bool_t result;
-
        NETWORK_LOG(NETWORK_HIGH, "[DBUS Async] %s.%s, %s\n",
                        interface_name, method, path);
 
-       conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
-       if (conn == NULL) {
-               NETWORK_LOG(NETWORK_ERROR, "Failed to get a system bus\n");
-
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
-
-       message = dbus_message_new_method_call(dest, path, interface_name, method);
-       if (message == NULL) {
-               NETWORK_LOG(NETWORK_ERROR, "dbus_message_new_method_call() Failed\n");
-
-               dbus_connection_unref(conn);
-
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
-
-       result = dbus_connection_send_with_reply(conn, message, &call,
-                       DBUS_REPLY_TIMEOUT);
-       if (result == FALSE || call == NULL) {
-               NETWORK_LOG(NETWORK_ERROR, "dbus_connection_send_with_reply() Failed\n");
+       if (h_connection.signal_conn == NULL)
+               return NET_ERR_APP_NOT_REGISTERED;
 
-               dbus_message_unref(message);
-               dbus_connection_unref(conn);
+       g_dbus_connection_call(h_connection.signal_conn,
+                       dest, path, interface_name,
+                       method, NULL, NULL,
+                       G_DBUS_CALL_FLAGS_NONE, -1, h_connection.cancellable,
+                       (GAsyncReadyCallback) notify_func, NULL);
 
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
-
-       if (notify_func == NULL)
-               dbus_pending_call_cancel(call);
-       else {
-               dbus_pending_call_set_notify(call, notify_func, NULL, NULL);
-
-               network_dbus_pending_call_data.pcall = call;
+       if (notify_func) {
+               /* TODO: Need to check if 'pcall' needs to be used */
+               network_dbus_pending_call_data.pcall = NULL;
                network_dbus_pending_call_data.is_used = TRUE;
        }
 
-       dbus_message_unref(message);
-       dbus_connection_unref(conn);
-
        __NETWORK_FUNC_EXIT__;
        return NET_ERR_NONE;
 }
@@ -888,7 +687,7 @@ int _net_dbus_scan_request(void)
 
        Error = _net_invoke_dbus_method_nonblock(CONNMAN_SERVICE,
                        CONNMAN_WIFI_TECHNOLOGY_PREFIX,
-                       CONNMAN_TECHNOLOGY_INTERFACE, "Scan", __net_scan_wifi_reply);
+                       CONNMAN_TECHNOLOGY_INTERFACE, "Scan", NULL);
 
        if (Error == NET_ERR_IN_PROGRESS)
                Error = NET_ERR_NONE;
@@ -916,23 +715,24 @@ int _net_dbus_set_bgscan_mode(net_wifi_background_scan_mode_t mode)
        __NETWORK_FUNC_ENTER__;
 
        net_err_t Error = NET_ERR_NONE;
-       DBusMessage *message = NULL;
+       GVariant *message = NULL;
+       GVariant *params = NULL;
 
-       char param0[64] = "";
        char path[CONNMAN_MAX_BUFLEN] = NETCONFIG_WIFI_PATH;
-       char* param_array[] = { NULL, NULL };
 
-       g_snprintf(param0, 64, "uint32:%d", mode);
-       param_array[0] = param0;
+       params = g_variant_new("(u)", mode);
 
        message = _net_invoke_dbus_method(NETCONFIG_SERVICE, path,
-                       NETCONFIG_WIFI_INTERFACE, "SetBgscan", param_array, &Error);
+                       NETCONFIG_WIFI_INTERFACE, "SetBgscan", params, &Error);
 
        if (Error != NET_ERR_NONE)
                NETWORK_LOG(NETWORK_ERROR, "_net_invoke_dbus_method failed\n");
 
        if (message)
-               dbus_message_unref(message);
+               g_variant_unref(message);
+
+       if (params)
+               g_variant_unref(params);
 
        __NETWORK_FUNC_EXIT__;
        return Error;
@@ -943,7 +743,7 @@ int _net_dbus_get_technology_state(network_tech_state_info_t* tech_state)
        __NETWORK_FUNC_ENTER__;
 
        net_err_t Error = NET_ERR_NONE;
-       DBusMessage *message = NULL;
+       GVariant *message = NULL;
 
        if ((tech_state == NULL) || (strlen(tech_state->technology) == 0)) {
                NETWORK_LOG(NETWORK_ERROR, "Invalid parameter\n");
@@ -968,7 +768,7 @@ int _net_dbus_get_technology_state(network_tech_state_info_t* tech_state)
                        tech_state->Powered,
                        tech_state->Connected);
 
-       dbus_message_unref(message);
+       g_variant_unref(message);
 
 done:
        __NETWORK_FUNC_EXIT__;
@@ -1059,7 +859,7 @@ done:
 int _net_dbus_get_statistics(net_device_t device_type, net_statistics_type_e statistics_type, unsigned long long *size)
 {
        net_err_t Error = NET_ERR_NONE;
-       DBusMessage *message = NULL;
+       GVariant *message = NULL;
        char *method = NULL;
 
        if (device_type == NET_DEVICE_WIFI) {
@@ -1093,10 +893,10 @@ int _net_dbus_get_statistics(net_device_t device_type, net_statistics_type_e sta
                return Error;
        }
 
-       *size = _net_get_uint64(message);
+       g_variant_get(message, "(t)", size);
 
        NETWORK_LOG(NETWORK_HIGH, "success [%s] statistics size : [%llu]\n", method, *size);
-       dbus_message_unref(message);
+       g_variant_unref(message);
 
        return Error;
 }
@@ -1104,7 +904,7 @@ int _net_dbus_get_statistics(net_device_t device_type, net_statistics_type_e sta
 int _net_dbus_set_statistics(net_device_t device_type, net_statistics_type_e statistics_type)
 {
        net_err_t Error = NET_ERR_NONE;
-       DBusMessage *message = NULL;
+       GVariant *message = NULL;
        char *method = NULL;
 
        if (device_type == NET_DEVICE_CELLULAR) {
@@ -1157,7 +957,7 @@ int _net_dbus_set_statistics(net_device_t device_type, net_statistics_type_e sta
        }
 
        NETWORK_LOG(NETWORK_HIGH, "reset [%s] statistics success\n", method);
-       dbus_message_unref(message);
+       g_variant_unref(message);
 
        return Error;
 }
@@ -1167,8 +967,11 @@ int _net_dbus_get_state(char* state)
        __NETWORK_FUNC_ENTER__;
 
        net_err_t Error = NET_ERR_NONE;
-       DBusMessage *message = NULL;
-       char *net_state = NULL;
+       GVariant *message = NULL;
+       GVariant *value = NULL;
+       GVariantIter *iter = NULL;
+       const gchar *key = NULL;
+       const gchar *net_state = NULL;
 
        message = _net_invoke_dbus_method(
                        CONNMAN_SERVICE, CONNMAN_MANAGER_PATH,
@@ -1180,123 +983,124 @@ int _net_dbus_get_state(char* state)
                return Error;
        }
 
-       net_state = _net_get_string(message);
-       g_strlcpy(state, net_state, CONNMAN_STATE_STRLEN);
+       g_variant_get(message, "(a{sv})", &iter);
+
+       while (g_variant_iter_loop(iter, "{sv}", &key, &value)) {
+               if (g_strcmp0(key, "State") == 0) {
+                       net_state = g_variant_get_string(value, NULL);
+                       g_strlcpy(state, net_state, CONNMAN_STATE_STRLEN);
+                       break;
+               }
+       }
 
        NETWORK_LOG(NETWORK_HIGH, "State: %s\n", state);
 
-       dbus_message_unref(message);
+       g_variant_iter_free(iter);
+       g_variant_unref(message);
+
+       if (value)
+               g_variant_unref(value);
 
        __NETWORK_FUNC_EXIT__;
        return Error;
 }
 
-int _net_dbus_set_eap_config_fields(
-               const net_wifi_connect_service_info_t *wifi_info)
+static void __net_create_config_reply(GObject *source_object,
+               GAsyncResult *res, gpointer user_data)
 {
        __NETWORK_FUNC_ENTER__;
 
+       NETWORK_LOG(NETWORK_LOW, "__net_create_config_reply() called\n");
+
+       GDBusConnection *conn = NULL;
+       GVariant *dbus_result =NULL;
+       GError *error = NULL;
        net_err_t Error = NET_ERR_NONE;
-       DBusError error;
-       DBusMessage *message = NULL;
-       DBusMessageIter itr, dict;
-       DBusConnection* conn = NULL;
-       DBusMessage *reply = NULL;
-
-       conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
-       if (NULL == conn) {
-               NETWORK_LOG(NETWORK_ERROR, "Failed to get a system bus\n");
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
 
-       message = dbus_message_new_method_call(NETCONFIG_SERVICE,
-                       NETCONFIG_WIFI_PATH, NETCONFIG_WIFI_INTERFACE, "CreateConfig");
-       if (NULL == message) {
-               NETWORK_LOG(NETWORK_ERROR, "dbus_message_new_method_call() failed\n");
-               dbus_connection_unref(conn);
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
+       conn = G_DBUS_CONNECTION (source_object);
+       dbus_result = g_dbus_connection_call_finish(conn, res, &error);
+
+       if (error != NULL) {
+               NETWORK_LOG(NETWORK_LOW, "error msg - [%s]\n", error->message);
+               Error = __net_error_string_to_enum(error->message);
+               g_error_free(error);
+       } else
+               NETWORK_LOG(NETWORK_LOW, "error msg is NULL\n");
+
+       if (dbus_result)
+               g_variant_unref(dbus_result);
+
+       __NETWORK_FUNC_EXIT__;
+}
+
+int _net_dbus_set_eap_config_fields(
+               const net_wifi_connect_service_info_t *wifi_info)
+{
+       __NETWORK_FUNC_ENTER__;
 
-       dbus_message_iter_init_append(message, &itr);
+       GVariant *params = NULL;
+       GVariantBuilder *builder;
 
-       dbus_message_iter_open_container(&itr, DBUS_TYPE_ARRAY,
-                       (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
-                        DBUS_TYPE_STRING_AS_STRING
-                        DBUS_TYPE_STRING_AS_STRING
-                        DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &dict);
+       builder = g_variant_builder_new(G_VARIANT_TYPE ("a{ss}"));
 
-       __net_dict_append_strings(&dict, CONNMAN_CONFIG_FIELD_TYPE, "wifi");
+       g_variant_builder_add(builder, "{ss}", CONNMAN_CONFIG_FIELD_TYPE, "wifi");
 
-       if (NULL != wifi_info->ssid)
-               __net_dict_append_strings(&dict,
+       if (wifi_info->ssid)
+               g_variant_builder_add(builder, "{ss}",
                                CONNMAN_CONFIG_FIELD_NAME, wifi_info->ssid);
 
-       if (NULL != wifi_info->eap_type)
-               __net_dict_append_strings(&dict,
+       if (wifi_info->eap_type)
+               g_variant_builder_add(builder, "{ss}",
                                CONNMAN_CONFIG_FIELD_EAP_METHOD, wifi_info->eap_type);
 
-       if (NULL != wifi_info->identity)
-               __net_dict_append_strings(&dict,
+       if (wifi_info->identity)
+               g_variant_builder_add(builder, "{ss}",
                                CONNMAN_CONFIG_FIELD_IDENTITY, wifi_info->identity);
 
-       if (NULL != wifi_info->password)
-               __net_dict_append_strings(&dict,
+       if (wifi_info->password)
+               g_variant_builder_add(builder, "{ss}",
                                CONNMAN_CONFIG_FIELD_PASSPHRASE, wifi_info->password);
 
-       if (NULL != wifi_info->eap_auth &&
+       if (wifi_info->eap_auth &&
                        g_strcmp0(wifi_info->eap_auth, "NONE") != 0)
-               __net_dict_append_strings(&dict,
+               g_variant_builder_add(builder, "{ss}",
                                CONNMAN_CONFIG_FIELD_PHASE2, wifi_info->eap_auth);
 
-       if (NULL != wifi_info->ca_cert_file)
-               __net_dict_append_strings(&dict,
+       if (wifi_info->ca_cert_file)
+               g_variant_builder_add(builder, "{ss}",
                                CONNMAN_CONFIG_FIELD_CA_CERT_FILE, wifi_info->ca_cert_file);
 
-       if (NULL != wifi_info->client_cert_file)
-               __net_dict_append_strings(&dict,
-                               CONNMAN_CONFIG_FIELD_CLIENT_CERT_FILE, wifi_info->client_cert_file);
-
-       if (NULL != wifi_info->private_key_file)
-               __net_dict_append_strings(&dict,
-                               CONNMAN_CONFIG_FIELD_PVT_KEY_FILE, wifi_info->private_key_file);
-
-       if (NULL != wifi_info->private_key_password)
-               __net_dict_append_strings(&dict,
-                               CONNMAN_CONFIG_FIELD_PVT_KEY_PASSPHRASE, wifi_info->private_key_password);
-
-       dbus_message_iter_close_container(&itr, &dict);
-
-       dbus_error_init(&error);
+       if (wifi_info->client_cert_file)
+               g_variant_builder_add(builder, "{ss}",
+                               CONNMAN_CONFIG_FIELD_CLIENT_CERT_FILE,
+                               wifi_info->client_cert_file);
 
-       reply = dbus_connection_send_with_reply_and_block(conn, message,
-                       DBUS_REPLY_TIMEOUT, &error);
-       if (NULL == reply) {
-               if (dbus_error_is_set (&error) == TRUE) {
-                       NETWORK_LOG(NETWORK_ERROR,
-                               "dbus_connection_send_with_reply_and_block() "
-                               "failed, Error[%s: %s]\n", error.name,
-                               error.message);
-                       Error = __net_error_string_to_enum(error.name);
-                       dbus_error_free(&error);
+       if (wifi_info->private_key_file)
+               g_variant_builder_add(builder, "{ss}",
+                               CONNMAN_CONFIG_FIELD_PVT_KEY_FILE,
+                               wifi_info->private_key_file);
 
-                       goto done;
-               }
+       if (wifi_info->private_key_password)
+               g_variant_builder_add(builder, "{ss}",
+                               CONNMAN_CONFIG_FIELD_PVT_KEY_PASSPHRASE,
+                               wifi_info->private_key_password);
 
-               Error = NET_ERR_UNKNOWN;
-               goto done;
-       }
+       params = g_variant_new("(@a{ss})", g_variant_builder_end(builder));
+       g_variant_builder_unref(builder);
 
-       dbus_message_unref(reply);
+       g_dbus_connection_call(h_connection.signal_conn,
+                       NETCONFIG_SERVICE, NETCONFIG_WIFI_PATH, NETCONFIG_WIFI_INTERFACE,
+                       "CreateConfig", params, NULL,
+                       G_DBUS_CALL_FLAGS_NONE, -1, h_connection.cancellable,
+                       (GAsyncReadyCallback)__net_create_config_reply, NULL);
 
        NETWORK_LOG(NETWORK_HIGH, "Successfully sent eap config fields\n");
-done:
-       dbus_message_unref(message);
-       dbus_connection_unref(conn);
+
+       if (params)
+               g_variant_unref(params);
 
        __NETWORK_FUNC_EXIT__;
-       return Error;
+       return NET_ERR_NONE;
 }
 
 int _net_dbus_set_agent_passphrase(const char *passphrase)
@@ -1454,7 +1258,6 @@ int _net_dbus_set_profile_ipv4(net_profile_info_t* prof_info, char* profile_name
        __NETWORK_FUNC_ENTER__;
 
        net_err_t Error = NET_ERR_NONE;
-       DBusError error;
 
        const char *manual_method = "manual";
        const char *dhcp_method = "dhcp";
@@ -1474,10 +1277,10 @@ int _net_dbus_set_profile_ipv4(net_profile_info_t* prof_info, char* profile_name
        char *netmask = netmask_buffer;
        char *gateway = gateway_buffer;
 
-       DBusMessage *message = NULL;
-       DBusMessage *reply = NULL;
-       DBusMessageIter itr, variant, dict, entry, sub_variant;
-       DBusConnection* conn = NULL;
+       GError *error = NULL;
+       GVariant *reply = NULL;
+       GVariant *params = NULL;
+       GVariantBuilder *builder;
 
        if ((prof_info == NULL) || (profile_name == NULL) || (strlen(profile_name) == 0)) {
                NETWORK_LOG(NETWORK_ERROR, "Invalid argument\n");
@@ -1500,112 +1303,35 @@ int _net_dbus_set_profile_ipv4(net_profile_info_t* prof_info, char* profile_name
        NETWORK_LOG(NETWORK_HIGH, "ipaddress: %s, netmask: %s, gateway: %s\n",
                        ipaddress, netmask, gateway);
 
-       conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
-       if (conn == NULL) {
-               NETWORK_LOG(NETWORK_ERROR, "Failed to get a system bus\n");
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
-
-       /** Send ipaddress, netmask, gateway configuration */
-       message = dbus_message_new_method_call(CONNMAN_SERVICE,
-                       profile_name, CONNMAN_SERVICE_INTERFACE, "SetProperty");
-       if (message == NULL) {
-               NETWORK_LOG(NETWORK_ERROR, "dbus_message_new_method_call() failed\n");
-               dbus_connection_unref(conn);
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
        NETWORK_LOG(NETWORK_HIGH, "DBus Message 1/2: %s %s %s %s\n", CONNMAN_SERVICE,
                        profile_name, CONNMAN_SERVICE_INTERFACE, "SetProperty");
 
-       dbus_message_iter_init_append(message, &itr);
-       dbus_message_iter_append_basic(&itr, DBUS_TYPE_STRING, &prop_ipv4_configuration);
-
-       dbus_message_iter_open_container
-               (&itr, DBUS_TYPE_VARIANT,
-                (DBUS_TYPE_ARRAY_AS_STRING
-                 DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
-                 DBUS_TYPE_STRING_AS_STRING
-                 DBUS_TYPE_VARIANT_AS_STRING
-                 DBUS_DICT_ENTRY_END_CHAR_AS_STRING),
-                &variant);
-       dbus_message_iter_open_container
-               (&variant, DBUS_TYPE_ARRAY,
-                (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
-                 DBUS_TYPE_STRING_AS_STRING
-                 DBUS_TYPE_VARIANT_AS_STRING
-                 DBUS_DICT_ENTRY_END_CHAR_AS_STRING),
-                &dict);
+       builder = g_variant_builder_new(G_VARIANT_TYPE ("a{sv}"));
 
        if (prof_info->ProfileInfo.Wlan.net_info.IpConfigType == NET_IP_CONFIG_TYPE_DYNAMIC ||
            prof_info->ProfileInfo.Wlan.net_info.IpConfigType == NET_IP_CONFIG_TYPE_AUTO_IP) {
-               dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
 
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &prop_method);
-               dbus_message_iter_open_container(&entry, DBUS_TYPE_VARIANT,
-                                               DBUS_TYPE_STRING_AS_STRING, &sub_variant);
-               dbus_message_iter_append_basic(&sub_variant, DBUS_TYPE_STRING, &dhcp_method);
-               dbus_message_iter_close_container(&entry, &sub_variant);
+               g_variant_builder_add(builder, "{sv}", prop_method, g_variant_new_string(dhcp_method));
 
-               dbus_message_iter_close_container(&dict, &entry);
-               NETWORK_LOG(NETWORK_HIGH, "DBus Message 2/2: %s %s\n", prop_method, dhcp_method);
        } else if (prof_info->ProfileInfo.Wlan.net_info.IpConfigType == NET_IP_CONFIG_TYPE_OFF) {
-               dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
 
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &prop_method);
-               dbus_message_iter_open_container(&entry, DBUS_TYPE_VARIANT,
-                                               DBUS_TYPE_STRING_AS_STRING, &sub_variant);
-               dbus_message_iter_append_basic(&sub_variant, DBUS_TYPE_STRING, &off_method);
-               dbus_message_iter_close_container(&entry, &sub_variant);
+               g_variant_builder_add(builder, "{sv}", prop_method, g_variant_new_string(off_method));
 
-               dbus_message_iter_close_container(&dict, &entry);
                NETWORK_LOG(NETWORK_HIGH, "DBus Message 2/2: %s %s\n", prop_method, off_method);
        } else if (prof_info->ProfileInfo.Wlan.net_info.IpConfigType == NET_IP_CONFIG_TYPE_STATIC) {
-               dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &prop_method);
-               dbus_message_iter_open_container(&entry, DBUS_TYPE_VARIANT,
-                                               DBUS_TYPE_STRING_AS_STRING, &sub_variant);
-               dbus_message_iter_append_basic(&sub_variant, DBUS_TYPE_STRING, &manual_method);
-               dbus_message_iter_close_container(&entry, &sub_variant);
 
-               dbus_message_iter_close_container(&dict, &entry);
+               g_variant_builder_add(builder, "{sv}", prop_method, g_variant_new_string(manual_method));
 
                if (strlen(ipaddress) >= NETPM_IPV4_STR_LEN_MIN) {
-                       dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-
-                       dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &prop_address);
-                       dbus_message_iter_open_container(&entry, DBUS_TYPE_VARIANT,
-                                                       DBUS_TYPE_STRING_AS_STRING, &sub_variant);
-                       dbus_message_iter_append_basic(&sub_variant, DBUS_TYPE_STRING, &ipaddress);
-                       dbus_message_iter_close_container(&entry, &sub_variant);
-
-                       dbus_message_iter_close_container(&dict, &entry);
+                       g_variant_builder_add(builder, "{sv}", prop_address, g_variant_new_string(ipaddress));
                }
 
                if (strlen(netmask) >= NETPM_IPV4_STR_LEN_MIN) {
-                       dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-
-                       dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &prop_netmask);
-                       dbus_message_iter_open_container(&entry, DBUS_TYPE_VARIANT,
-                                                       DBUS_TYPE_STRING_AS_STRING, &sub_variant);
-                       dbus_message_iter_append_basic(&sub_variant, DBUS_TYPE_STRING, &netmask);
-                       dbus_message_iter_close_container(&entry, &sub_variant);
-
-                       dbus_message_iter_close_container(&dict, &entry);
+                       g_variant_builder_add(builder, "{sv}", prop_netmask, g_variant_new_string(netmask));
                }
 
                if (strlen(gateway) >= NETPM_IPV4_STR_LEN_MIN) {
-                       dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-
-                       dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &prop_gateway);
-                       dbus_message_iter_open_container(&entry, DBUS_TYPE_VARIANT,
-                                                       DBUS_TYPE_STRING_AS_STRING, &sub_variant);
-                       dbus_message_iter_append_basic(&sub_variant, DBUS_TYPE_STRING, &gateway);
-                       dbus_message_iter_close_container(&entry, &sub_variant);
-
-                       dbus_message_iter_close_container(&dict, &entry);
+                       g_variant_builder_add(builder, "{sv}", prop_gateway, g_variant_new_string(gateway));
                }
                NETWORK_LOG(NETWORK_HIGH, "DBus Message 2/2: %s %s %s %s %s %s %s %s\n",
                                prop_method, manual_method, prop_address, ipaddress,
@@ -1616,38 +1342,39 @@ int _net_dbus_set_profile_ipv4(net_profile_info_t* prof_info, char* profile_name
                return NET_ERR_INVALID_PARAM;
        }
 
-       dbus_message_iter_close_container(&variant, &dict);
-       dbus_message_iter_close_container(&itr, &variant);
-
-       dbus_error_init(&error);
-
-       reply = dbus_connection_send_with_reply_and_block(conn,
-                       message, DBUS_REPLY_TIMEOUT,
-                       &error);
+       params = g_variant_new("(sv)", prop_ipv4_configuration, g_variant_builder_end(builder));
+       g_variant_builder_unref(builder);
 
+       reply = g_dbus_connection_call_sync(h_connection.signal_conn,
+                                       CONNMAN_SERVICE,
+                                       profile_name,
+                                       CONNMAN_SERVICE_INTERFACE,
+                                       "SetProperty", params, NULL,
+                                       G_DBUS_CALL_FLAGS_NONE, DBUS_REPLY_TIMEOUT, h_connection.cancellable, &error);
        if (reply == NULL) {
-               if (dbus_error_is_set (&error) == TRUE) {
+               if (error != NULL) {
                        NETWORK_LOG(NETWORK_ERROR,
-                               "dbus_connection_send_with_reply_and_block() failed, Error[%s: %s]\n",
-                               error.name, error.message);
-                       Error = __net_error_string_to_enum(error.name);
-                       dbus_error_free(&error);
-                       dbus_message_unref(message);
-                       __NETWORK_FUNC_EXIT__;
-                       return Error;
+                                               "g_dbus_connection_call_sync() failed."
+                                               "error [%d: %s]\n", error->code, error->message);
+                       Error = __net_error_string_to_enum(error->message);
+                       g_error_free(error);
+               } else {
+                       NETWORK_LOG(NETWORK_ERROR,
+                                       "g_dbus_connection_call_sync() failed.\n");
                }
 
-               dbus_message_unref(message);
+               if (params)
+                       g_variant_unref(params);
+
                __NETWORK_FUNC_EXIT__;
                return NET_ERR_UNKNOWN;
        }
 
-       dbus_message_unref(reply);
-       dbus_message_unref(message);
-
        NETWORK_LOG(NETWORK_HIGH, "Successfully configured IPv4.Configuration\n");
+       g_variant_unref(reply);
 
-       dbus_connection_unref(conn);
+       if (params)
+               g_variant_unref(params);
 
        __NETWORK_FUNC_EXIT__;
        return NET_ERR_NONE;
@@ -1658,16 +1385,15 @@ int _net_dbus_set_profile_dns(net_profile_info_t* prof_info, char* profile_name)
        __NETWORK_FUNC_ENTER__;
 
        net_err_t Error = NET_ERR_NONE;
-       DBusError error;
 
        const char *prop_nameserver_configuration = "Nameservers.Configuration";
        char dns_buffer[NET_DNS_ADDR_MAX][NETPM_IPV4_STR_LEN_MAX+1];
        char *dns_address[NET_DNS_ADDR_MAX];
 
-       DBusMessage *message = NULL;
-       DBusMessage *reply = NULL;
-       DBusMessageIter itr;
-       DBusConnection* conn = NULL;
+       GError *error = NULL;
+       GVariant *reply = NULL;
+       GVariant *params = NULL;
+       GVariantBuilder *builder;
        int i = 0;
 
        if ((prof_info == NULL) || (profile_name == NULL) || (strlen(profile_name) == 0) ||
@@ -1689,67 +1415,50 @@ int _net_dbus_set_profile_dns(net_profile_info_t* prof_info, char* profile_name)
                dns_address[i] = dns_buffer[i];
        }
 
-       conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
-       if (conn == NULL) {
-               NETWORK_LOG(NETWORK_ERROR, "Failed to get a system bus\n");
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
-
        if (prof_info->ProfileInfo.Wlan.net_info.IpConfigType == NET_IP_CONFIG_TYPE_STATIC) {
-               message = dbus_message_new_method_call(CONNMAN_SERVICE,
-                               profile_name, CONNMAN_SERVICE_INTERFACE, "SetProperty");
-
-               if (message == NULL) {
-                       NETWORK_LOG(NETWORK_ERROR,
-                                       "dbus_message_new_method_call() failed\n");
-                       __NETWORK_FUNC_EXIT__;
-                       return NET_ERR_UNKNOWN;
-               }
-
-               dbus_message_iter_init_append(message, &itr);
-               dbus_message_iter_append_basic(&itr, DBUS_TYPE_STRING, &prop_nameserver_configuration);
-
-               DBusMessageIter value, array;
-               dbus_message_iter_open_container(&itr, DBUS_TYPE_VARIANT,
-                               DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_STRING_AS_STRING, &value);
-
-               dbus_message_iter_open_container(&value, DBUS_TYPE_ARRAY,
-                               DBUS_TYPE_STRING_AS_STRING, &array);
 
+               builder = g_variant_builder_new(G_VARIANT_TYPE ("as"));
                for (i = 0; i < prof_info->ProfileInfo.Wlan.net_info.DnsCount; i++) {
-                       dbus_message_iter_append_basic(&array, DBUS_TYPE_STRING, &(dns_address[i]));
+                       g_variant_builder_add(builder, "s", dns_address[i]);
                }
 
-               dbus_message_iter_close_container(&value, &array);
-               dbus_message_iter_close_container(&itr, &value);
-
-               dbus_error_init(&error);
-
-               reply = dbus_connection_send_with_reply_and_block(conn,
-                               message, DBUS_REPLY_TIMEOUT,
-                               &error);
-
+               params = g_variant_new("(sv)", prop_nameserver_configuration, g_variant_builder_end(builder));
+               g_variant_builder_unref(builder);
+
+               reply = g_dbus_connection_call_sync(h_connection.signal_conn,
+                                               CONNMAN_SERVICE,
+                                               profile_name,
+                                               CONNMAN_SERVICE_INTERFACE,
+                                               "SetProperty", params, NULL,
+                                               G_DBUS_CALL_FLAGS_NONE,
+                                               DBUS_REPLY_TIMEOUT,
+                                               h_connection.cancellable, &error);
                if (reply == NULL) {
-                       if (dbus_error_is_set (&error) == TRUE) {
+                       if (error != NULL) {
                                NETWORK_LOG(NETWORK_ERROR,
-                                       "dbus_connection_send_with_reply_and_block() failed, Error[%s: %s]\n",
-                                       error.name, error.message);
-                               Error = __net_error_string_to_enum(error.name);
-                               dbus_error_free(&error);
-                               dbus_message_unref(message);
-                               __NETWORK_FUNC_EXIT__;
-                               return Error;
+                                                       "g_dbus_connection_call_sync() failed."
+                                                       "error [%d: %s]\n", error->code, error->message);
+                               Error = __net_error_string_to_enum(error->message);
+                               g_error_free(error);
+                       } else {
+                               NETWORK_LOG(NETWORK_ERROR,
+                                               "g_dbus_connection_call_sync() failed.\n");
                        }
-                       dbus_message_unref(message);
+
+                       if (params)
+                               g_variant_unref(params);
+
                        __NETWORK_FUNC_EXIT__;
                        return NET_ERR_UNKNOWN;
                }
-               dbus_message_unref(reply);
-               dbus_message_unref(message);
+
                NETWORK_LOG(NETWORK_HIGH, "Successfully configured Nameservers.Configuration\n");
+               g_variant_unref(reply);
        }
 
+       if (params)
+               g_variant_unref(params);
+
        __NETWORK_FUNC_EXIT__;
        return NET_ERR_NONE;
 }
@@ -1759,7 +1468,6 @@ int _net_dbus_set_proxy(net_profile_info_t* prof_info, char* profile_name)
        __NETWORK_FUNC_ENTER__;
 
        net_err_t Error = NET_ERR_NONE;
-       DBusError error;
 
        const char *direct_method = "direct";
        const char *auto_method = "auto";
@@ -1773,10 +1481,11 @@ int _net_dbus_set_proxy(net_profile_info_t* prof_info, char* profile_name)
        char proxy_buffer[NET_PROXY_LEN_MAX+1] = "";
        char *proxy_address = proxy_buffer;
 
-       DBusMessage *message = NULL;
-       DBusMessage *reply = NULL;
-       DBusMessageIter itr, variant, dict, entry, sub_variant, str_array;
-       DBusConnection* conn = NULL;
+       GError *error = NULL;
+       GVariant *reply = NULL;
+       GVariant *params = NULL;
+       GVariantBuilder *builder;
+       GVariantBuilder *builder_sub;
 
        if ((prof_info == NULL) || (profile_name == NULL) || (strlen(profile_name) == 0)) {
                NETWORK_LOG(NETWORK_ERROR, "Invalid argument\n");
@@ -1790,124 +1499,66 @@ int _net_dbus_set_proxy(net_profile_info_t* prof_info, char* profile_name)
        NETWORK_LOG(NETWORK_HIGH, "Method : %d, proxy address : %s\n",
                        prof_info->ProfileInfo.Wlan.net_info.ProxyMethod, proxy_address);
 
-       conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
-       if (conn == NULL) {
-               NETWORK_LOG(NETWORK_ERROR, "Failed to get a system bus\n");
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
-
-       /** Send proxy method, url, servers configuration */
-       message = dbus_message_new_method_call(CONNMAN_SERVICE, profile_name,
-                       CONNMAN_SERVICE_INTERFACE, "SetProperty");
-       if (message == NULL) {
-               NETWORK_LOG(NETWORK_ERROR, "dbus_message_new_method_call() failed\n");
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
-
-       dbus_message_iter_init_append(message, &itr);
-       dbus_message_iter_append_basic(&itr, DBUS_TYPE_STRING, &prop_proxy_configuration);
-
-       dbus_message_iter_open_container
-               (&itr, DBUS_TYPE_VARIANT,
-                (DBUS_TYPE_ARRAY_AS_STRING
-                 DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
-                 DBUS_TYPE_STRING_AS_STRING
-                 DBUS_TYPE_VARIANT_AS_STRING
-                 DBUS_DICT_ENTRY_END_CHAR_AS_STRING),
-                &variant);
-       dbus_message_iter_open_container
-               (&variant, DBUS_TYPE_ARRAY,
-                (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
-                 DBUS_TYPE_STRING_AS_STRING
-                 DBUS_TYPE_VARIANT_AS_STRING
-                 DBUS_DICT_ENTRY_END_CHAR_AS_STRING),
-                &dict);
-
-       dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-       dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &prop_method);
-       
-       dbus_message_iter_open_container(&entry, DBUS_TYPE_VARIANT,
-                       DBUS_TYPE_STRING_AS_STRING, &sub_variant);
+       builder = g_variant_builder_new(G_VARIANT_TYPE ("a{sv}"));
 
        switch (prof_info->ProfileInfo.Wlan.net_info.ProxyMethod) {
        case NET_PROXY_TYPE_AUTO:
-               dbus_message_iter_append_basic(&sub_variant, DBUS_TYPE_STRING, &auto_method);
+               g_variant_builder_add(builder, "{sv}", prop_method, g_variant_new_string(auto_method));
                break;
        case NET_PROXY_TYPE_MANUAL:
-               dbus_message_iter_append_basic(&sub_variant, DBUS_TYPE_STRING, &manual_method);
+               g_variant_builder_add(builder, "{sv}", prop_method, g_variant_new_string(manual_method));
                break;
        default:
-               dbus_message_iter_append_basic(&sub_variant, DBUS_TYPE_STRING, &direct_method);
+               g_variant_builder_add(builder, "{sv}", prop_method, g_variant_new_string(direct_method));
                break;
        }
 
-       dbus_message_iter_close_container(&entry, &sub_variant);
-       dbus_message_iter_close_container(&dict, &entry);
-
        if (prof_info->ProfileInfo.Wlan.net_info.ProxyMethod == NET_PROXY_TYPE_AUTO &&
-           proxy_address[0] != '\0') {
-               dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &prop_url);
-               
-               dbus_message_iter_open_container(&entry, DBUS_TYPE_VARIANT,
-                               DBUS_TYPE_STRING_AS_STRING, &sub_variant);
-               dbus_message_iter_append_basic(&sub_variant, DBUS_TYPE_STRING, &proxy_address);
-               
-               dbus_message_iter_close_container(&entry, &sub_variant);
-               dbus_message_iter_close_container(&dict, &entry);
+                       proxy_address[0] != '\0') {
+               g_variant_builder_add(builder, "{sv}", prop_url, g_variant_new_string(proxy_address));
        }
 
        if (prof_info->ProfileInfo.Wlan.net_info.ProxyMethod == NET_PROXY_TYPE_MANUAL &&
-           proxy_address[0] != '\0') {
-               dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &prop_servers);
-
-               dbus_message_iter_open_container(&entry, DBUS_TYPE_VARIANT,
-                               DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_STRING_AS_STRING, &sub_variant);
-
-               dbus_message_iter_open_container(&sub_variant, DBUS_TYPE_ARRAY,
-                               DBUS_TYPE_STRING_AS_STRING, &str_array);
-               dbus_message_iter_append_basic(&str_array, DBUS_TYPE_STRING, &proxy_address);
-
-               dbus_message_iter_close_container(&sub_variant, &str_array);
-               dbus_message_iter_close_container(&entry, &sub_variant);
-               dbus_message_iter_close_container(&dict, &entry);
-       }
-
-       dbus_message_iter_close_container(&variant, &dict);
-       dbus_message_iter_close_container(&itr, &variant);
-
-       dbus_error_init(&error);
-
-       reply = dbus_connection_send_with_reply_and_block(conn,
-                       message, DBUS_REPLY_TIMEOUT,
-                       &error);
-
+                       proxy_address[0] != '\0') {
+               builder_sub = g_variant_builder_new(G_VARIANT_TYPE ("as"));
+               g_variant_builder_add(builder_sub, "s", proxy_address);
+               g_variant_builder_add(builder, "{sv}", prop_servers, g_variant_builder_end(builder_sub));
+               g_variant_builder_unref(builder_sub);
+       }
+
+       params = g_variant_new("(sv)", prop_proxy_configuration, g_variant_builder_end(builder));
+       g_variant_builder_unref(builder);
+
+       reply = g_dbus_connection_call_sync(h_connection.signal_conn,
+                                               CONNMAN_SERVICE,
+                                               profile_name,
+                                               CONNMAN_SERVICE_INTERFACE,
+                                               "SetProperty", params, NULL,
+                                               G_DBUS_CALL_FLAGS_NONE, DBUS_REPLY_TIMEOUT, h_connection.cancellable, &error);
        if (reply == NULL) {
-               if (dbus_error_is_set(&error) == TRUE) {
+               if (error != NULL) {
                        NETWORK_LOG(NETWORK_ERROR,
-                               "dbus_connection_send_with_reply_and_block() failed, Error[%s: %s]\n",
-                               error.name, error.message);
-                       Error = __net_error_string_to_enum(error.name);
-                       dbus_error_free(&error);
-                       dbus_message_unref(message);
-                       __NETWORK_FUNC_EXIT__;
-                       return Error;
+                                               "g_dbus_connection_call_sync() failed."
+                                               "error [%d: %s]\n", error->code, error->message);
+                       Error = __net_error_string_to_enum(error->message);
+                       g_error_free(error);
+               } else {
+                       NETWORK_LOG(NETWORK_ERROR,
+                                       "g_dbus_connection_call_sync() failed.\n");
                }
 
-               dbus_message_unref(message);
+               if (params)
+                       g_variant_unref(params);
+
                __NETWORK_FUNC_EXIT__;
                return NET_ERR_UNKNOWN;
        }
 
-       dbus_message_unref(reply);
-       dbus_message_unref(message);
-
        NETWORK_LOG(NETWORK_HIGH, "Successfully configured Proxy.Configuration\n");
+       g_variant_unref(reply);
 
-       dbus_connection_unref(conn);
+       if (params)
+               g_variant_unref(params);
 
        __NETWORK_FUNC_EXIT__;
        return NET_ERR_NONE;
@@ -1919,7 +1570,6 @@ int _net_dbus_add_pdp_profile(net_profile_info_t *prof_info)
        __NETWORK_FUNC_ENTER__;
 
        net_err_t Error = NET_ERR_NONE;
-       DBusError error;
        const char *service_type = "svc_ctg_id";
        const char *home_url = "home_url";
        const char *proxy_addr = "proxy_addr";
@@ -1933,10 +1583,10 @@ int _net_dbus_add_pdp_profile(net_profile_info_t *prof_info)
        char buff_auth_type[10] = "";
        char *temp_ptr = NULL;
 
-       DBusMessage *message = NULL;
-       DBusMessage *reply = NULL;
-       DBusMessageIter iter, dict, entry;
-       DBusConnection* conn = NULL;
+       GError *error = NULL;
+       GVariant *reply = NULL;
+       GVariant *params = NULL;
+       GVariantBuilder *builder;
 
        if (prof_info == NULL) {
                NETWORK_LOG(NETWORK_ERROR, "Invalid argument\n");
@@ -1944,35 +1594,10 @@ int _net_dbus_add_pdp_profile(net_profile_info_t *prof_info)
                return NET_ERR_INVALID_PARAM;
        }
 
-       conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
-       if (conn == NULL) {
-               NETWORK_LOG(NETWORK_ERROR, "Failed to get a system bus\n");
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
-
-       /** Create message */
-       message = dbus_message_new_method_call(TELEPHONY_SERVICE,
-                       TELEPHONY_MASTER_PATH, TELEPHONY_MASTER_INTERFACE, "AddProfile");
-       if (message == NULL) {
-               NETWORK_LOG(NETWORK_ERROR, "dbus_message_new_method_call() failed\n");
-               dbus_connection_unref(conn);
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
-
        NETWORK_LOG(NETWORK_HIGH, "DBus Message 1/2 : %s %s %s %s\n", TELEPHONY_SERVICE,
                        TELEPHONY_MASTER_PATH, TELEPHONY_MASTER_INTERFACE, ".AddProfile");
 
-       dbus_message_iter_init_append(message, &iter);
-
-       dbus_message_iter_open_container
-               (&iter, DBUS_TYPE_ARRAY,
-                (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
-                 DBUS_TYPE_STRING_AS_STRING
-                 DBUS_TYPE_STRING_AS_STRING
-                 DBUS_DICT_ENTRY_END_CHAR_AS_STRING),
-                &dict);
+       builder = g_variant_builder_new(G_VARIANT_TYPE ("a{ss}"));
 
        g_snprintf(buff_svc_type, 10, "%d", prof_info->ProfileInfo.Pdp.ServiceType);
        temp_ptr = buff_svc_type;
@@ -1980,10 +1605,7 @@ int _net_dbus_add_pdp_profile(net_profile_info_t *prof_info)
        NETWORK_LOG(NETWORK_HIGH, "DBus Message 2/2 : %s : %s\n",
                        service_type, temp_ptr);
 
-       dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-       dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &service_type);
-       dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &temp_ptr);
-       dbus_message_iter_close_container(&dict, &entry);
+       g_variant_builder_add(builder, "{ss}", service_type, temp_ptr);
 
        if (strlen(prof_info->ProfileInfo.Pdp.HomeURL) > 0) {
                temp_ptr = prof_info->ProfileInfo.Pdp.HomeURL;
@@ -1991,10 +1613,7 @@ int _net_dbus_add_pdp_profile(net_profile_info_t *prof_info)
                NETWORK_LOG(NETWORK_HIGH, "DBus Message 2/2 : %s : %s\n",
                                home_url, temp_ptr);
 
-               dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &home_url);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &temp_ptr);
-               dbus_message_iter_close_container(&dict, &entry);
+               g_variant_builder_add(builder, "{ss}", home_url, temp_ptr);
        }
 
        if (strlen(prof_info->ProfileInfo.Pdp.net_info.ProxyAddr) > 0) {
@@ -2003,28 +1622,19 @@ int _net_dbus_add_pdp_profile(net_profile_info_t *prof_info)
                NETWORK_LOG(NETWORK_HIGH, "DBus Message 2/2 : %s : %s\n",
                                proxy_addr, temp_ptr);
 
-               dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &proxy_addr);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &temp_ptr);
-               dbus_message_iter_close_container(&dict, &entry);
+               g_variant_builder_add(builder, "{ss}", proxy_addr, temp_ptr);
        }
 
        if (strlen(prof_info->ProfileInfo.Pdp.AuthInfo.Password) > 0) {
                temp_ptr = prof_info->ProfileInfo.Pdp.AuthInfo.Password;
 
-               dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &auth_pwd);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &temp_ptr);
-               dbus_message_iter_close_container(&dict, &entry);
+               g_variant_builder_add(builder, "{ss}", auth_pwd, temp_ptr);
        }
 
        if (strlen(prof_info->ProfileInfo.Pdp.AuthInfo.UserName) > 0) {
                temp_ptr = prof_info->ProfileInfo.Pdp.AuthInfo.UserName;
 
-               dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &auth_id);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &temp_ptr);
-               dbus_message_iter_close_container(&dict, &entry);
+               g_variant_builder_add(builder, "{ss}", auth_id, temp_ptr);
        }
 
        if (prof_info->ProfileInfo.Pdp.AuthInfo.AuthType >= NET_PDP_AUTH_NONE &&
@@ -2034,82 +1644,68 @@ int _net_dbus_add_pdp_profile(net_profile_info_t *prof_info)
 
                temp_ptr = buff_auth_type;
 
-               dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &auth_type);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &temp_ptr);
-               dbus_message_iter_close_container(&dict, &entry);
+               g_variant_builder_add(builder, "{ss}", auth_type, temp_ptr);
        }
 
        if (strlen(prof_info->ProfileInfo.Pdp.Apn) > 0) {
                temp_ptr = prof_info->ProfileInfo.Pdp.Apn;
 
-               NETWORK_LOG(NETWORK_HIGH, "DBus Message 2/2 : %s : %s\n",
-                               apn, temp_ptr);
-
-               dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &apn);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &temp_ptr);
-               dbus_message_iter_close_container(&dict, &entry);
+               g_variant_builder_add(builder, "{ss}", apn, temp_ptr);
        }
 
        if (strlen(prof_info->ProfileInfo.Pdp.Keyword) > 0) {
                temp_ptr = prof_info->ProfileInfo.Pdp.Keyword;
 
-               NETWORK_LOG(NETWORK_HIGH, "DBus Message 2/2 : %s : %s\n",
-                               keyword, temp_ptr);
-
-               dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &keyword);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &temp_ptr);
-               dbus_message_iter_close_container(&dict, &entry);
+               g_variant_builder_add(builder, "{ss}", keyword, temp_ptr);
        }
 
-       dbus_message_iter_close_container(&iter, &dict);
-       dbus_error_init(&error);
+       params = g_variant_new("(@a{ss})", g_variant_builder_end(builder));
+       g_variant_builder_unref(builder);
 
-       /** Send message */
-       reply = dbus_connection_send_with_reply_and_block(conn,
-                       message, DBUS_REPLY_TIMEOUT,
-                       &error);
-
-       /** Check Error */
+       reply = g_dbus_connection_call_sync(h_connection.signal_conn,
+                                       TELEPHONY_SERVICE,
+                                       TELEPHONY_MASTER_PATH,
+                                       TELEPHONY_MASTER_INTERFACE,
+                                       "AddProfile", params, NULL,
+                                       G_DBUS_CALL_FLAGS_NONE,
+                                       DBUS_REPLY_TIMEOUT,
+                                       h_connection.cancellable, &error);
        if (reply == NULL) {
-               if (dbus_error_is_set (&error) == TRUE) {
+               if (error != NULL) {
                        NETWORK_LOG(NETWORK_ERROR,
-                               "dbus_connection_send_with_reply_and_block() failed, Error[%s: %s]\n",
-                               error.name, error.message);
-                       Error = __net_error_string_to_enum(error.name);
-                       dbus_error_free(&error);
-                       dbus_message_unref(message);
-                       __NETWORK_FUNC_EXIT__;
-                       return Error;
+                                               "g_dbus_connection_call_sync() failed."
+                                               "error [%d: %s]\n", error->code, error->message);
+                       Error = __net_error_string_to_enum(error->message);
+                       g_error_free(error);
+               } else {
+                       NETWORK_LOG(NETWORK_ERROR,
+                                       "g_dbus_connection_call_sync() failed.\n");
                }
 
-               dbus_message_unref(message);
-               dbus_connection_unref(conn);
+               if (params)
+                       g_variant_unref(params);
+
                __NETWORK_FUNC_EXIT__;
                return NET_ERR_UNKNOWN;
-       } else
-               NETWORK_LOG(NETWORK_HIGH, "Successfully requested : Add PDP profile\n");
+       }
+
+       NETWORK_LOG(NETWORK_HIGH, "Successfully requested : Add PDP profile\n");
 
        /** Check Reply */
-       DBusMessageIter iter2;
        int add_result = 0;
 
-       dbus_message_iter_init(reply, &iter2);
-       if (dbus_message_iter_get_arg_type(&iter2) == DBUS_TYPE_BOOLEAN) {
-               dbus_message_iter_get_basic(&iter2, &add_result);
-               NETWORK_LOG(NETWORK_HIGH, "Profile add result : %d\n", add_result);
-       }
+       g_variant_get(reply, "(b)", &add_result);
+       NETWORK_LOG(NETWORK_HIGH, "Profile add result : %d\n", add_result);
 
        if (add_result)
                Error = NET_ERR_NONE;
        else
                Error = NET_ERR_UNKNOWN;
 
-       dbus_message_unref(reply);
-       dbus_message_unref(message);
-       dbus_connection_unref(conn);
+       g_variant_unref(reply);
+
+       if (params)
+               g_variant_unref(params);
 
        __NETWORK_FUNC_EXIT__;
        return Error;
@@ -2122,7 +1718,6 @@ int _net_dbus_modify_pdp_profile(net_profile_info_t *prof_info, const char *prof
 
        net_err_t Error = NET_ERR_NONE;
 
-       DBusError error;
        const char *service_type = "svc_ctg_id";
        const char *home_url = "home_url";
        const char *proxy_addr = "proxy_addr";
@@ -2139,46 +1734,22 @@ int _net_dbus_modify_pdp_profile(net_profile_info_t *prof_info, const char *prof
        char buff_auth_type[10] = "";
        char *temp_ptr = NULL;
 
-       DBusMessage *message = NULL;
-       DBusMessage *reply = NULL;
-       DBusMessageIter iter, dict, entry;
-       DBusConnection* conn = NULL;
-
        if ((prof_info == NULL) || (profile_name == NULL)) {
                NETWORK_LOG(NETWORK_ERROR, "Invalid argument\n");
                __NETWORK_FUNC_EXIT__;
                return NET_ERR_INVALID_PARAM;
        }
 
-       conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
-       if (conn == NULL) {
-               NETWORK_LOG(NETWORK_ERROR, "Failed to get a system bus\n");
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
-
-       /** Create message */
-       message = dbus_message_new_method_call(TELEPHONY_SERVICE,
-                       profile_name, TELEPHONY_PROFILE_INTERFACE, "ModifyProfile");
-       if (message == NULL) {
-               NETWORK_LOG(NETWORK_ERROR, "dbus_message_new_method_call() failed\n");
-               dbus_connection_unref(conn);
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
+       GError *error = NULL;
+       GVariant *reply = NULL;
+       GVariant *params = NULL;
+       GVariantBuilder *builder;
 
        NETWORK_LOG(NETWORK_HIGH, "DBus Message 1/2 : %s %s %s %s\n", TELEPHONY_SERVICE,
                        profile_name, TELEPHONY_PROFILE_INTERFACE, ".ModifyProfile");
 
-       dbus_message_iter_init_append(message, &iter);
+       builder = g_variant_builder_new(G_VARIANT_TYPE ("a{ss}"));
 
-       dbus_message_iter_open_container
-               (&iter, DBUS_TYPE_ARRAY,
-                (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
-                 DBUS_TYPE_STRING_AS_STRING
-                 DBUS_TYPE_STRING_AS_STRING
-                 DBUS_DICT_ENTRY_END_CHAR_AS_STRING),
-                &dict);
 
        g_snprintf(buff_svc_type, 10, "%d", prof_info->ProfileInfo.Pdp.ServiceType);
        temp_ptr = buff_svc_type;
@@ -2186,51 +1757,30 @@ int _net_dbus_modify_pdp_profile(net_profile_info_t *prof_info, const char *prof
        NETWORK_LOG(NETWORK_HIGH, "DBus Message 2/2 : %s : %s\n",
                        service_type, temp_ptr);
 
-       dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-       dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &service_type);
-       dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &temp_ptr);
-       dbus_message_iter_close_container(&dict, &entry);
+       g_variant_builder_add(builder, "{ss}", service_type, temp_ptr);
 
        if (strlen(prof_info->ProfileInfo.Pdp.HomeURL) > 0) {
                temp_ptr = prof_info->ProfileInfo.Pdp.HomeURL;
 
-               NETWORK_LOG(NETWORK_HIGH, "DBus Message 2/2 : %s : %s\n",
-                               home_url, temp_ptr);
-
-               dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &home_url);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &temp_ptr);
-               dbus_message_iter_close_container(&dict, &entry);
+               g_variant_builder_add(builder, "{ss}", home_url, temp_ptr);
        }
 
        if (strlen(prof_info->ProfileInfo.Pdp.net_info.ProxyAddr) > 0) {
                temp_ptr = prof_info->ProfileInfo.Pdp.net_info.ProxyAddr;
 
-               NETWORK_LOG(NETWORK_HIGH, "DBus Message 2/2 : %s : %s\n",
-                               proxy_addr, temp_ptr);
-
-               dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &proxy_addr);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &temp_ptr);
-               dbus_message_iter_close_container(&dict, &entry);
+               g_variant_builder_add(builder, "{ss}", proxy_addr, temp_ptr);
        }
 
        if (strlen(prof_info->ProfileInfo.Pdp.AuthInfo.Password) > 0) {
                temp_ptr = prof_info->ProfileInfo.Pdp.AuthInfo.Password;
 
-               dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &auth_pwd);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &temp_ptr);
-               dbus_message_iter_close_container(&dict, &entry);
+               g_variant_builder_add(builder, "{ss}", auth_pwd, temp_ptr);
        }
 
        if (strlen(prof_info->ProfileInfo.Pdp.AuthInfo.UserName) > 0) {
                temp_ptr = prof_info->ProfileInfo.Pdp.AuthInfo.UserName;
 
-               dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &auth_id);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &temp_ptr);
-               dbus_message_iter_close_container(&dict, &entry);
+               g_variant_builder_add(builder, "{ss}", auth_id, temp_ptr);
        }
 
        if (prof_info->ProfileInfo.Pdp.AuthInfo.AuthType >= NET_PDP_AUTH_NONE &&
@@ -2239,34 +1789,19 @@ int _net_dbus_modify_pdp_profile(net_profile_info_t *prof_info, const char *prof
                                prof_info->ProfileInfo.Pdp.AuthInfo.AuthType);
                temp_ptr = buff_auth_type;
 
-               dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &auth_type);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &temp_ptr);
-               dbus_message_iter_close_container(&dict, &entry);
+               g_variant_builder_add(builder, "{ss}", auth_type, temp_ptr);
        }
 
        if (strlen(prof_info->ProfileInfo.Pdp.Apn) > 0) {
                temp_ptr = prof_info->ProfileInfo.Pdp.Apn;
 
-               NETWORK_LOG(NETWORK_HIGH, "DBus Message 2/2 : %s : %s\n",
-                               apn, temp_ptr);
-
-               dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &apn);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &temp_ptr);
-               dbus_message_iter_close_container(&dict, &entry);
+               g_variant_builder_add(builder, "{ss}", apn, temp_ptr);
        }
 
        if (strlen(prof_info->ProfileInfo.Pdp.Keyword) > 0) {
                temp_ptr = prof_info->ProfileInfo.Pdp.Keyword;
 
-               NETWORK_LOG(NETWORK_HIGH, "DBus Message 2/2 : %s : %s\n",
-                               keyword, temp_ptr);
-
-               dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &keyword);
-               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &temp_ptr);
-               dbus_message_iter_close_container(&dict, &entry);
+               g_variant_builder_add(builder, "{ss}", keyword, temp_ptr);
        }
 
        if (prof_info->ProfileInfo.Pdp.Hidden)
@@ -2277,10 +1812,7 @@ int _net_dbus_modify_pdp_profile(net_profile_info_t *prof_info, const char *prof
        NETWORK_LOG(NETWORK_HIGH, "DBus Message 2/2 : %s : %s\n",
                        hidden, temp_ptr);
 
-       dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-       dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &hidden);
-       dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &temp_ptr);
-       dbus_message_iter_close_container(&dict, &entry);
+       g_variant_builder_add(builder, "{ss}", hidden, temp_ptr);
 
        if (prof_info->ProfileInfo.Pdp.Editable)
                temp_ptr = "TRUE";
@@ -2290,10 +1822,7 @@ int _net_dbus_modify_pdp_profile(net_profile_info_t *prof_info, const char *prof
        NETWORK_LOG(NETWORK_HIGH, "DBus Message 2/2 : %s : %s\n",
                        editable, temp_ptr);
 
-       dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-       dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &editable);
-       dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &temp_ptr);
-       dbus_message_iter_close_container(&dict, &entry);
+       g_variant_builder_add(builder, "{ss}", editable, temp_ptr);
 
        if (prof_info->ProfileInfo.Pdp.DefaultConn)
                temp_ptr = "TRUE";
@@ -2303,57 +1832,54 @@ int _net_dbus_modify_pdp_profile(net_profile_info_t *prof_info, const char *prof
        NETWORK_LOG(NETWORK_HIGH, "DBus Message 2/2 : %s : %s\n",
                        default_conn, temp_ptr);
 
-       dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
-       dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &default_conn);
-       dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &temp_ptr);
-       dbus_message_iter_close_container(&dict, &entry);
-
-       dbus_message_iter_close_container(&iter, &dict);
-       dbus_error_init(&error);
+       g_variant_builder_add(builder, "{ss}", default_conn, temp_ptr);
 
-       /** Send message */
-       reply = dbus_connection_send_with_reply_and_block(conn,
-                       message, DBUS_REPLY_TIMEOUT,
-                       &error);
+       params = g_variant_new("(@a{ss})", g_variant_builder_end(builder));
+       g_variant_builder_unref(builder);
 
-       /** Check Error */
+       reply = g_dbus_connection_call_sync(h_connection.signal_conn,
+                                       TELEPHONY_SERVICE,
+                                       profile_name,
+                                       TELEPHONY_PROFILE_INTERFACE,
+                                       "ModifyProfile", params, NULL,
+                                       G_DBUS_CALL_FLAGS_NONE,
+                                       DBUS_REPLY_TIMEOUT,
+                                       h_connection.cancellable, &error);
        if (reply == NULL) {
-               if (dbus_error_is_set (&error) == TRUE) {
+               if (error != NULL) {
                        NETWORK_LOG(NETWORK_ERROR,
-                               "dbus_connection_send_with_reply_and_block() failed, Error[%s: %s]\n",
-                               error.name, error.message);
-                       Error = __net_error_string_to_enum(error.name);
-                       dbus_error_free(&error);
-                       dbus_message_unref(message);
-                       __NETWORK_FUNC_EXIT__;
-                       return Error;
+                                               "g_dbus_connection_call_sync() failed."
+                                               "error [%d: %s]\n", error->code, error->message);
+                       Error = __net_error_string_to_enum(error->message);
+                       g_error_free(error);
+               } else {
+                       NETWORK_LOG(NETWORK_ERROR,
+                                       "g_dbus_connection_call_sync() failed.\n");
                }
 
-               dbus_message_unref(message);
-               dbus_connection_unref(conn);
+               if (params)
+                       g_variant_unref(params);
+
                __NETWORK_FUNC_EXIT__;
                return NET_ERR_UNKNOWN;
-       } else
-               NETWORK_LOG(NETWORK_HIGH, "Successfully requested : Modify PDP profile\n");
+       }
+
+       NETWORK_LOG(NETWORK_HIGH, "Successfully requested : Modify PDP profile\n");
 
        /** Check Reply */
-       DBusMessageIter iter2;
        int add_result = 0;
-
-       dbus_message_iter_init(reply, &iter2);
-       if (dbus_message_iter_get_arg_type(&iter2) == DBUS_TYPE_BOOLEAN) {
-               dbus_message_iter_get_basic(&iter2, &add_result);
-               NETWORK_LOG(NETWORK_HIGH, "Profile modify result : %d\n", add_result);
-       }
+       g_variant_get(reply, "(b)", &add_result);
+       NETWORK_LOG(NETWORK_HIGH, "Profile modify result : %d\n", add_result);
 
        if (add_result)
                Error = NET_ERR_NONE;
        else
                Error = NET_ERR_UNKNOWN;
 
-       dbus_message_unref(reply);
-       dbus_message_unref(message);
-       dbus_connection_unref(conn);
+       g_variant_unref(reply);
+
+       if (params)
+               g_variant_unref(params);
 
        __NETWORK_FUNC_EXIT__;
        return Error;
@@ -2385,22 +1911,22 @@ int _net_dbus_remove_wifi_driver(void)
        return Error;
 }
 
-dbus_bool_t _net_dbus_is_pending_call_used(void)
+gboolean _net_dbus_is_pending_call_used(void)
 {
        return network_dbus_pending_call_data.is_used;
 }
 
-void _net_dbus_set_pending_call_used(dbus_bool_t used)
+void _net_dbus_set_pending_call_used(gboolean used)
 {
        network_dbus_pending_call_data.is_used = used;
 }
-
+#if 0
 DBusPendingCall *_net_dbus_get_pending_call(void)
 {
        return network_dbus_pending_call_data.pcall;
 }
-
-void _net_dbus_set_pending_call(DBusPendingCall *call)
+#endif
+void _net_dbus_set_pending_call(void *call)
 {
        network_dbus_pending_call_data.pcall = call;
 }
@@ -2408,7 +1934,8 @@ void _net_dbus_set_pending_call(DBusPendingCall *call)
 void _net_dbus_clear_pending_call(void)
 {
        if (_net_dbus_is_pending_call_used()) {
-               dbus_pending_call_cancel(_net_dbus_get_pending_call());
+               //dbus_pending_call_cancel(_net_dbus_get_pending_call());
+               //g_cancellable_cancel(h_connection.cancellable);
 
                _net_dbus_set_pending_call(NULL);
                _net_dbus_set_pending_call_used(FALSE);
@@ -2464,53 +1991,28 @@ int _net_dbus_specific_scan_request(const char *ssid)
 {
        __NETWORK_FUNC_ENTER__;
 
-       DBusMessage* message = NULL;
-       DBusConnection* conn = NULL;
-       DBusPendingCall *call = NULL;
-       dbus_bool_t result = FALSE;
-
-       conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
-       if (conn == NULL) {
-               NETWORK_LOG(NETWORK_ERROR, "Failed to get a system bus\n");
-
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
-
-       message = dbus_message_new_method_call(NETCONFIG_SERVICE,
-                       NETCONFIG_WIFI_PATH, NETCONFIG_WIFI_INTERFACE,
-                       "RequestSpecificScan");
-       if (message == NULL) {
-               NETWORK_LOG(NETWORK_ERROR, "dbus_message_new_method_call() failed\n");
-
-               dbus_connection_unref(conn);
+       GVariant *params = NULL;
 
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
+       params = g_variant_new("(s)", ssid);
 
-       dbus_message_append_args(message, DBUS_TYPE_STRING, &ssid, NULL);
-
-       result = dbus_connection_send_with_reply(conn, message, &call,
-                       6 * DBUS_REPLY_TIMEOUT);
-       if (result == FALSE || call == NULL) {
-               NETWORK_LOG(NETWORK_ERROR, "dbus_connection_send_with_reply() failed\n");
-
-               dbus_message_unref(message);
-               dbus_connection_unref(conn);
-
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
+       g_dbus_connection_call(h_connection.signal_conn,
+                       NETCONFIG_SERVICE,
+                       NETCONFIG_WIFI_PATH,
+                       NETCONFIG_WIFI_INTERFACE,
+                       "RequestSpecificScan", params, NULL,
+                       G_DBUS_CALL_FLAGS_NONE,
+                       6 * DBUS_REPLY_TIMEOUT,
+                       h_connection.cancellable,
+                       (GAsyncReadyCallback) __net_specific_scan_wifi_reply, NULL);
 
        NETWORK_LOG(NETWORK_HIGH, "Successfully configured\n");
 
-       dbus_pending_call_set_notify(call, __net_specific_scan_wifi_reply, NULL, NULL);
-       network_dbus_pending_call_data.pcall = call;
+       /* TODO: Check if anything needs to be assigned to 'pcall' */
+       network_dbus_pending_call_data.pcall = NULL;
        network_dbus_pending_call_data.is_used = TRUE;
 
-       dbus_message_unref(message);
-       dbus_connection_unref(conn);
+       if (params)
+               g_variant_unref(params);
 
        __NETWORK_FUNC_EXIT__;
        return NET_ERR_NONE;
index 40c3ae0..9ccf4c2 100644 (file)
@@ -240,91 +240,18 @@ net_device_t _net_get_tech_type_from_path(const char *profile_name)
        return device_type;
 }
 
-char* _net_get_string(DBusMessage* msg)
-{
-       __NETWORK_FUNC_ENTER__;
-
-       DBusMessageIter args;
-       char* sigvalue = NULL;
-
-       if (!dbus_message_iter_init(msg, &args))
-               NETWORK_LOG(NETWORK_LOW, "Message does not have parameters\n");
-       else if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING)
-               NETWORK_LOG(NETWORK_LOW, "Argument is not string\n");
-       else
-               dbus_message_iter_get_basic(&args, &sigvalue);
-
-       __NETWORK_FUNC_EXIT__;
-       return sigvalue;
-}
-
-unsigned long long _net_get_uint64(DBusMessage* msg)
-{
-       DBusMessageIter args;
-       unsigned long long sigvalue = 0;
-
-       if (!dbus_message_iter_init(msg, &args)) {
-               NETWORK_LOG(NETWORK_LOW, "Message does not have parameters\n");
-       } else if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_UINT64) {
-               NETWORK_LOG(NETWORK_LOW, "Argument is not uint64\n");
-       } else {
-               dbus_message_iter_get_basic(&args, &sigvalue);
-       }
-
-       return sigvalue;
-}
-
-char* _net_get_object(DBusMessage* msg)
-{
-       __NETWORK_FUNC_ENTER__;
-
-       DBusMessageIter args;
-       char* sigvalue = NULL;
-
-       if (!dbus_message_iter_init(msg, &args)) {
-               NETWORK_LOG(NETWORK_LOW, "Message does not have parameters\n");
-       } else if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_OBJECT_PATH) {
-               NETWORK_LOG(NETWORK_LOW, "Argument is not string\n");
-       } else {
-               dbus_message_iter_get_basic(&args, &sigvalue);
-       }
-
-       __NETWORK_FUNC_EXIT__;
-       return sigvalue;
-}
-
-int _net_get_boolean(DBusMessage* msg)
-{
-       __NETWORK_FUNC_ENTER__;
-
-       DBusMessageIter args;
-       dbus_bool_t val = FALSE;
-       int retvalue = FALSE;
-
-       if (!dbus_message_iter_init(msg, &args)) {
-               NETWORK_LOG(NETWORK_LOW, "Message does not have parameters\n");
-       } else if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_BOOLEAN) {
-               NETWORK_LOG(NETWORK_LOW, "Argument is not boolean\n");
-       } else {
-               dbus_message_iter_get_basic(&args, &val);
-
-               if (val)
-                       retvalue = TRUE;
-               else
-                       retvalue = FALSE;
-       }
-
-       __NETWORK_FUNC_EXIT__;
-       return retvalue;
-}
-
-int _net_get_tech_state(DBusMessage* msg, network_tech_state_info_t* tech_state)
+int _net_get_tech_state(GVariant *msg, network_tech_state_info_t* tech_state)
 {
        __NETWORK_FUNC_ENTER__;
 
        net_err_t Error = NET_ERR_NONE;
-       DBusMessageIter iter, array;
-       char *tech_prefix;
+       GVariantIter *iter_main = NULL;
+       GVariantIter *var = NULL;
+       GVariant *value = NULL;
+       gchar *tech_prefix;
+       gchar *path = NULL;
+       gchar *key = NULL;
+       gboolean data;
 
        if (g_str_equal(tech_state->technology, "wifi") == TRUE)
                tech_prefix = CONNMAN_WIFI_TECHNOLOGY_PREFIX;
@@ -340,71 +267,39 @@ int _net_get_tech_state(DBusMessage* msg, network_tech_state_info_t* tech_state)
                goto done;
        }
 
-       /* array{object, dict}: list of tuples with technology object path and
-        * dictionary of technology properties */
-       if (!dbus_message_iter_init(msg, &iter)) {
-               NETWORK_LOG(NETWORK_LOW, "Message does not have parameters\n");
-               Error = NET_ERR_UNKNOWN;
-               goto done;
-       }
-
-       dbus_message_iter_recurse(&iter, &array);
+       g_variant_get(msg, "(a(oa{sv}))", &iter_main);
+       while (g_variant_iter_loop(iter_main, "(oa{sv})", &path, &var)) {
 
-       while (dbus_message_iter_get_arg_type(&array) == DBUS_TYPE_STRUCT) {
-               DBusMessageIter entry, dict;
-               char *path = NULL;
+               if (path == NULL || g_str_equal(path, tech_prefix) != TRUE)
+                       continue;
 
-               dbus_message_iter_recurse(&array, &entry);
-               dbus_message_iter_get_basic(&entry, &path);
                NETWORK_LOG(NETWORK_LOW, "Path - [%s]", path);
 
-               dbus_message_iter_next(&entry);
-               dbus_message_iter_recurse(&entry, &dict);
+               while (g_variant_iter_loop(var, "{sv}", &key, &value)) {
+                       if (g_strcmp0(key, "Powered") == 0) {
+                               data = g_variant_get_boolean(value);
 
-               if (path == NULL || g_str_equal(path, tech_prefix) != TRUE) {
-                       dbus_message_iter_next(&array);
-                       continue;
-               }
-               while (dbus_message_iter_get_arg_type(&dict) == DBUS_TYPE_DICT_ENTRY) {
-                       DBusMessageIter entry1, value1;
-                       const char *key, *sdata;
-                       dbus_bool_t data;
-
-                       dbus_message_iter_recurse(&dict, &entry1);
-                       dbus_message_iter_get_basic(&entry1, &key);
-
-                       dbus_message_iter_next(&entry1);
-                       dbus_message_iter_recurse(&entry1, &value1);
-
-                       if (dbus_message_iter_get_arg_type(&value1) ==
-                                       DBUS_TYPE_BOOLEAN) {
-                               dbus_message_iter_get_basic(&value1, &data);
-                               NETWORK_LOG(NETWORK_LOW, "key-[%s]-[%s]",
-                                               key, data ? "True" : "False");
-
-                               if (g_strcmp0(key, "Powered") == 0) {
-                                       if (data)
-                                               tech_state->Powered = TRUE;
-                                       else
-                                               tech_state->Powered = FALSE;
-                               } else if (g_strcmp0(key, "Connected") == 0) {
-                                       if (data)
-                                               tech_state->Connected = TRUE;
-                                       else
-                                               tech_state->Connected = FALSE;
-                               } else if (g_strcmp0(key, "Tethering") == 0) {
-                                       /* For further use */
-                               }
-                       } else if (dbus_message_iter_get_arg_type(&value1) ==
-                                       DBUS_TYPE_STRING) {
-                               dbus_message_iter_get_basic(&value1, &sdata);
-                               NETWORK_LOG(NETWORK_LOW, "%s", sdata);
+                               if (data)
+                                       tech_state->Powered = TRUE;
+                               else
+                                       tech_state->Powered = FALSE;
+
+                               NETWORK_LOG(NETWORK_ERROR, "key-[%s]-[%d]", key, tech_state->Powered);
+                       } else if (g_strcmp0(key, "Connected") == 0) {
+                               data = g_variant_get_boolean(value);
+
+                               if (data)
+                                       tech_state->Connected = TRUE;
+                               else
+                                       tech_state->Connected = FALSE;
+
+                               NETWORK_LOG(NETWORK_ERROR, "key-[%s]-[%d]", key, tech_state->Connected);
+                       } else if (g_strcmp0(key, "Tethering") == 0) {
+                               /* For further use */
                        }
-                       dbus_message_iter_next(&dict);
                }
-
-               dbus_message_iter_next(&array);
        }
+       g_variant_iter_free(iter_main);
 
 done:
        __NETWORK_FUNC_EXIT__;
index a731ae5..e3ee090 100644 (file)
 /*****************************************************************************
  *     Local Functions Declaration
  *****************************************************************************/
-static int __net_extract_wifi_info(DBusMessageIter *array, net_profile_info_t* ProfInfo);
+static int __net_extract_wifi_info(GVariantIter *array, net_profile_info_t* ProfInfo);
 static int __net_get_profile_info(const char* ProfileName, net_profile_info_t* ProfInfo);
 static int __net_extract_service_info(const char* ProfileName,
-               DBusMessage *message, net_profile_info_t* ProfInfo);
+               GVariant *message, net_profile_info_t* ProfInfo);
 static int __net_pm_init_profile_info(net_device_t profile_type, net_profile_info_t* ProfInfo);
 static int __net_telephony_init_profile_info(net_telephony_profile_info_t* ProfInfo);
 static int __net_telephony_get_profile_info(net_profile_name_t* ProfileName,
-               net_telephony_profile_info_tProfileInfo);
+               net_telephony_profile_info_t *ProfileInfo);
 static int __net_telephony_get_profile_list(net_profile_name_t** ProfileName, int* ProfileCount);
-static int __net_extract_services(DBusMessage *message, net_device_t device_type,
+static int __net_extract_services(GVariantIter *message, net_device_t device_type,
                net_profile_info_t** profile_info, int* profile_count);
-static int __net_extract_ip(DBusMessageIter *iter, net_addr_t *ipAddr);
-static int __net_extract_common_info(const char *key, DBusMessageIter *variant, net_profile_info_t* ProfInfo);
-static int __net_extract_mobile_info(DBusMessageIter *array, net_profile_info_t* ProfInfo);
-static int __net_extract_ethernet_info(DBusMessageIter *array, net_profile_info_t* ProfInfo);
-static int __net_extract_bluetooth_info(DBusMessageIter *array, net_profile_info_t* ProfInfo);
+static int __net_extract_ip(const gchar *value, net_addr_t *ipAddr);
+static int __net_extract_common_info(const char *key, GVariant *variant, net_profile_info_t* ProfInfo);
+static int __net_extract_mobile_info(GVariantIter *array, net_profile_info_t* ProfInfo);
+static int __net_extract_ethernet_info(GVariantIter *array, net_profile_info_t* ProfInfo);
+static int __net_extract_bluetooth_info(GVariantIter *array, net_profile_info_t* ProfInfo);
 static int __net_telephony_search_pdp_profile(char* ProfileName, net_profile_name_t* PdpProfName);
 static int __net_telephony_modify_profile(const char* ProfileName,
                net_profile_info_t* ProfInfo, net_profile_info_t* exProfInfo);
@@ -177,79 +177,56 @@ static int __net_telephony_init_profile_info(net_telephony_profile_info_t* ProfI
        return NET_ERR_NONE;
 }
 
-static int __net_telephony_get_profile_info(net_profile_name_t* ProfileName, net_telephony_profile_info_tProfileInfo)
+static int __net_telephony_get_profile_info(net_profile_name_t* ProfileName, net_telephony_profile_info_t *ProfileInfo)
 {
        __NETWORK_FUNC_ENTER__;
 
        net_err_t Error = NET_ERR_NONE;
-       DBusMessage* result = NULL;
-       DBusMessageIter iter, array;
+       GVariant *result;
+       GVariantIter *iter;
+       const gchar *key = NULL;
+       const gchar *value = NULL;
 
        if (ProfileName == NULL || ProfileInfo == NULL) {
                NETWORK_LOG(NETWORK_ERROR, "Invalid parameter!\n");
-
                __NETWORK_FUNC_EXIT__;
                return NET_ERR_INVALID_PARAM;
        }
 
        result = _net_invoke_dbus_method(TELEPHONY_SERVICE, ProfileName->ProfileName,
                        TELEPHONY_PROFILE_INTERFACE, "GetProfile", NULL, &Error);
-
        if (result == NULL) {
                NETWORK_LOG(NETWORK_ERROR, "_net_invoke_dbus_method failed\n");
-
                __NETWORK_FUNC_EXIT__;
                return Error;
        }
 
-       /* Parsing profile info */
-       dbus_message_iter_init(result, &iter);
-       dbus_message_iter_recurse(&iter, &array);
-
        Error = __net_telephony_init_profile_info(ProfileInfo);
 
        if (Error != NET_ERR_NONE) {
-               dbus_message_unref(result);
-
+               g_variant_unref(result);
                __NETWORK_FUNC_EXIT__;
                return Error;
        }
 
-       while (dbus_message_iter_get_arg_type(&array) == DBUS_TYPE_DICT_ENTRY) {
-               DBusMessageIter entry;
-               const char *key = NULL;
-               const char *value = NULL;
-
-               dbus_message_iter_recurse(&array, &entry);
-               dbus_message_iter_get_basic(&entry, &key);
-
-               dbus_message_iter_next(&entry);
-
+       g_variant_get(result, "(a{ss})", &iter);
+       while (g_variant_iter_next(iter, "{ss}", &key, &value)) {
                if (g_strcmp0(key, "path") == 0) {
-                       dbus_message_iter_get_basic(&entry, &value);
-
                        if (value != NULL)
                                g_strlcpy(ProfileInfo->ProfileName, value, NET_PROFILE_NAME_LEN_MAX);
-
                } else if (g_strcmp0(key, "svc_ctg_id") == 0) {
                        net_service_type_t ServiceType = NET_SERVICE_UNKNOWN;
-                       dbus_message_iter_get_basic(&entry, &value);
 
                        if (value != NULL)
                                ServiceType = atoi(value);
 
                        if (ServiceType > NET_SERVICE_UNKNOWN)
                                ProfileInfo->ServiceType = ServiceType;
-
                } else if (g_strcmp0(key, "apn") == 0) {
-                       dbus_message_iter_get_basic(&entry, &value);
-
                        if (value != NULL)
                                g_strlcpy(ProfileInfo->Apn, value, NET_PDP_APN_LEN_MAX);
-
                } else if (g_strcmp0(key, "auth_type") == 0) {
                        net_auth_type_t authType = NET_PDP_AUTH_NONE;
-                       dbus_message_iter_get_basic(&entry, &value);
 
                        if (value != NULL)
                                authType = atoi(value);
@@ -258,33 +235,19 @@ static int __net_telephony_get_profile_info(net_profile_name_t* ProfileName, net
                                ProfileInfo->AuthInfo.AuthType = NET_PDP_AUTH_PAP;
                        else if (authType == NET_PDP_AUTH_CHAP)
                                ProfileInfo->AuthInfo.AuthType = NET_PDP_AUTH_CHAP;
-
                } else if (g_strcmp0(key, "auth_id") == 0) {
-                       dbus_message_iter_get_basic(&entry, &value);
-
                        if (value != NULL)
                                g_strlcpy(ProfileInfo->AuthInfo.UserName, value, NET_PDP_AUTH_USERNAME_LEN_MAX);
-
                } else if (g_strcmp0(key, "auth_pwd") == 0) {
-                       dbus_message_iter_get_basic(&entry, &value);
-
                        if (value != NULL)
                                g_strlcpy(ProfileInfo->AuthInfo.Password, value, NET_PDP_AUTH_PASSWORD_LEN_MAX);
-
                } else if (g_strcmp0(key, "proxy_addr") == 0) {
-                       dbus_message_iter_get_basic(&entry, &value);
-
                        if (value != NULL)
                                g_strlcpy(ProfileInfo->ProxyAddr, value, NET_PROXY_LEN_MAX);
-
                } else if (g_strcmp0(key, "home_url") == 0) {
-                       dbus_message_iter_get_basic(&entry, &value);
-
                        if (value != NULL)
                                g_strlcpy(ProfileInfo->HomeURL, value, NET_HOME_URL_LEN_MAX);
                } else if (g_strcmp0(key, "default_internet_conn") == 0) {
-                       dbus_message_iter_get_basic(&entry, &value);
-
                        if (value == NULL)
                                continue;
 
@@ -293,13 +256,9 @@ static int __net_telephony_get_profile_info(net_profile_name_t* ProfileName, net
                        else
                                ProfileInfo->DefaultConn = FALSE;
                } else if (g_strcmp0(key, "profile_name") == 0) {
-                       dbus_message_iter_get_basic(&entry, &value);
-
                        if (value != NULL)
                                g_strlcpy(ProfileInfo->Keyword, value, NET_PDP_APN_LEN_MAX);
                } else if (g_strcmp0(key, "editable") == 0) {
-                       dbus_message_iter_get_basic(&entry, &value);
-
                        if (value == NULL)
                                continue;
 
@@ -308,8 +267,6 @@ static int __net_telephony_get_profile_info(net_profile_name_t* ProfileName, net
                        else
                                ProfileInfo->Editable = FALSE;
                } else if (g_strcmp0(key, "hidden") == 0) {
-                       dbus_message_iter_get_basic(&entry, &value);
-
                        if (value == NULL)
                                continue;
 
@@ -318,10 +275,10 @@ static int __net_telephony_get_profile_info(net_profile_name_t* ProfileName, net
                        else
                                ProfileInfo->Hidden = FALSE;
                }
-               dbus_message_iter_next(&array);
        }
 
-       dbus_message_unref(result);
+       g_variant_iter_free(iter);
+       g_variant_unref(result);
 
        __NETWORK_FUNC_EXIT__;
        return Error;
@@ -332,75 +289,52 @@ static int __net_telephony_get_profile_list(net_profile_name_t** ProfileName, in
        __NETWORK_FUNC_ENTER__;
 
        net_err_t Error = NET_ERR_NONE;
-       DBusMessage* result = NULL;
+       GVariant *result;
+       GVariantIter *iter;
+       const char *str;
+       int count = 0, i;
+       GSList *profiles = NULL, *list;
        net_profile_name_t* profileList = NULL;
-       DBusMessageIter iter, array;
-       int count = 0;
 
        result = _net_invoke_dbus_method(TELEPHONY_SERVICE, TELEPHONY_MASTER_PATH,
                        TELEPHONY_MASTER_INTERFACE, "GetProfileList", NULL, &Error);
-
        if (result == NULL) {
                NETWORK_LOG(NETWORK_ERROR, "_net_invoke_dbus_method failed\n");
                __NETWORK_FUNC_EXIT__;
                return Error;
        }
 
-       dbus_message_iter_init(result, &iter);
-       if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY) {
-               NETWORK_LOG(NETWORK_ERROR, "There is no profiles\n");
-               *ProfileCount = 0;
-               dbus_message_unref(result);
-               __NETWORK_FUNC_EXIT__;
-               return Error;
-       }
-
-       dbus_message_iter_recurse(&iter, &array);
-
-       /* Get count of profile name from reply message */
-       while (dbus_message_iter_get_arg_type(&array) == DBUS_TYPE_STRING) {
-               count++;
-               dbus_message_iter_next(&array);
-       }
+       g_variant_get(result, "(as)", &iter);
+       while (g_variant_iter_loop(iter, "s", &str))
+               profiles = g_slist_append(profiles, g_strdup(str));
 
+       count = g_slist_length(profiles);
        if (count > 0)
-               profileList = (net_profile_name_t*)malloc(sizeof(net_profile_name_t) * count);
+               profileList =
+                               (net_profile_name_t*)malloc(sizeof(net_profile_name_t) * count);
        else {
                *ProfileCount = 0;
-               dbus_message_unref(result);
-               __NETWORK_FUNC_EXIT__;
-               return Error;
+               goto out;
        }
 
        if (profileList == NULL) {
                NETWORK_LOG(NETWORK_ERROR, "Failed to allocate memory\n");
                *ProfileCount = 0;
-               dbus_message_unref(result);
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
+               Error = NET_ERR_UNKNOWN;
+               goto out;
        }
 
-       count = 0;
-
-       /* Parsing to get profile name from reply message */
-       dbus_message_iter_init(result, &iter);
-       dbus_message_iter_recurse(&iter, &array);
-       while (dbus_message_iter_get_arg_type(&array) == DBUS_TYPE_STRING) {
-               const char *key = NULL;
-
-               dbus_message_iter_get_basic(&array, &key);
-
-               if (key != NULL)
-                       g_strlcpy(profileList[count].ProfileName, key, NET_PROFILE_NAME_LEN_MAX);
-
-               count++;
-               dbus_message_iter_next(&array);
-       }
+       for (list = profiles, i = 0; list != NULL; list = list->next, i++)
+               g_strlcpy(profileList[i].ProfileName,
+                               (const char *)list->data, NET_PROFILE_NAME_LEN_MAX);
 
        *ProfileName = profileList;
        *ProfileCount = count;
 
-       dbus_message_unref(result);
+out:
+       g_slist_free_full(profiles, g_free);
+       g_variant_iter_free(iter);
+       g_variant_unref(result);
 
        __NETWORK_FUNC_EXIT__;
        return Error;
@@ -436,13 +370,14 @@ static int __net_telephony_search_pdp_profile(char* ProfileName, net_profile_nam
 
        /* Find matching profile */
        connmanProfName = strrchr(ProfileName, '/') + 1;
-       for (i = 0;i < ProfileCount;i++) {
+       for (i = 0; i < ProfileCount; i++) {
                telephonyProfName = strrchr(ProfileList[i].ProfileName, '/') + 1;
                foundPtr = strstr(connmanProfName, telephonyProfName);
 
                if (foundPtr != NULL && g_strcmp0(foundPtr, telephonyProfName) == 0) {
                        g_strlcpy(PdpProfName->ProfileName,
                                        ProfileList[i].ProfileName, NET_PROFILE_NAME_LEN_MAX);
+
                        NETWORK_LOG(NETWORK_HIGH,
                                        "PDP profile name found in cellular profile: %s\n",
                                        PdpProfName->ProfileName);
@@ -458,13 +393,13 @@ static int __net_telephony_search_pdp_profile(char* ProfileName, net_profile_nam
        }
 
        NET_MEMFREE(ProfileList);
-       __NETWORK_FUNC_EXIT__;
 
+       __NETWORK_FUNC_EXIT__;
        return Error;
 }
 
-static int __net_extract_mobile_services(DBusMessage *message,
-               DBusMessageIter *array, network_services_list_t *service_info,
+static int __net_extract_mobile_services(GVariantIter *iter,
+               network_services_list_t *service_info,
                net_service_type_t network_type)
 {
        int count = 0, i = 0;
@@ -474,10 +409,13 @@ static int __net_extract_mobile_services(DBusMessage *message,
        const char pre_mms_suffix[] = "_4";
        const char tethering_suffix[] = "_5";
        char *suffix = NULL;
+       const char *obj = NULL;
+       GVariantIter *value = NULL;
+       gboolean found = FALSE;
 
        __NETWORK_FUNC_ENTER__;
 
-       if (message == NULL || array == NULL || service_info == NULL) {
+       if (iter == NULL || service_info == NULL) {
                NETWORK_LOG(NETWORK_ERROR, "Invalid parameter\n");
 
                __NETWORK_FUNC_EXIT__;
@@ -495,18 +433,9 @@ static int __net_extract_mobile_services(DBusMessage *message,
 
        service_info->num_of_services = 0;
 
-       while (dbus_message_iter_get_arg_type(array) == DBUS_TYPE_STRUCT) {
-               DBusMessageIter entry;
-               const char *obj;
-               gboolean found = FALSE;
-
-               dbus_message_iter_recurse(array, &entry);
-               dbus_message_iter_get_basic(&entry, &obj);
-
-               if (obj == NULL) {
-                       dbus_message_iter_next(array);
+       while (g_variant_iter_loop(iter, "(oa{sv})", &obj, &value)) {
+               if (obj == NULL)
                        continue;
-               }
 
                if (g_str_has_prefix(obj,
                                CONNMAN_CELLULAR_SERVICE_PROFILE_PREFIX) == TRUE) {
@@ -549,8 +478,6 @@ static int __net_extract_mobile_services(DBusMessage *message,
                                count++;
                        }
                }
-
-               dbus_message_iter_next(array);
        }
 
        service_info->num_of_services = count;
@@ -559,13 +486,15 @@ static int __net_extract_mobile_services(DBusMessage *message,
        return NET_ERR_NONE;
 }
 
-static int __net_extract_all_services(DBusMessageIter *array,
+static int __net_extract_all_services(GVariantIter *array,
                net_device_t device_type, const char *service_prefix,
                int *prof_count, net_profile_info_t **ProfilePtr)
 {
        int count = 0;
        net_profile_info_t ProfInfo = {0, };
        net_err_t Error = NET_ERR_NONE;
+       const gchar *obj;
+       GVariantIter *next = NULL;
 
        __NETWORK_FUNC_ENTER__;
 
@@ -576,26 +505,14 @@ static int __net_extract_all_services(DBusMessageIter *array,
                return NET_ERR_INVALID_PARAM;
        }
 
-       while (dbus_message_iter_get_arg_type(array) == DBUS_TYPE_STRUCT) {
-               DBusMessageIter entry;
-               DBusMessageIter next;
-               const char *obj;
-
-               dbus_message_iter_recurse(array, &entry);
-               dbus_message_iter_get_basic(&entry, &obj);
-
-               if (obj == NULL) {
-                       dbus_message_iter_next(array);
+       while (g_variant_iter_loop(array, "(oa{sv})", &obj, &next)) {
+               if (obj == NULL)
                        continue;
-               }
 
                if (g_str_has_prefix(obj, service_prefix) == TRUE) {
                        if (device_type == NET_DEVICE_WIFI &&
                                        g_strrstr(obj + strlen(service_prefix), "hidden") != NULL)
-                               goto get_next;
-
-                       dbus_message_iter_next(&entry);
-                       dbus_message_iter_recurse(&entry, &next);
+                               continue;
 
                        memset(&ProfInfo, 0, sizeof(net_profile_info_t));
                        if ((Error = __net_pm_init_profile_info(device_type, &ProfInfo)) != NET_ERR_NONE) {
@@ -616,25 +533,25 @@ static int __net_extract_all_services(DBusMessageIter *array,
                                g_strlcpy(ProfInfo.ProfileInfo.Wlan.net_info.ProfileName,
                                                obj, NET_PROFILE_NAME_LEN_MAX);
 
-                               Error = __net_extract_wifi_info(&next, &ProfInfo);
+                               Error = __net_extract_wifi_info(next, &ProfInfo);
                                break;
                        case NET_DEVICE_CELLULAR:
                                g_strlcpy(ProfInfo.ProfileInfo.Pdp.net_info.ProfileName,
                                                obj, NET_PROFILE_NAME_LEN_MAX);
 
-                               Error = __net_extract_mobile_info(&next, &ProfInfo);
+                               Error = __net_extract_mobile_info(next, &ProfInfo);
                                break;
                        case NET_DEVICE_ETHERNET:
                                g_strlcpy(ProfInfo.ProfileInfo.Ethernet.net_info.ProfileName,
                                                obj, NET_PROFILE_NAME_LEN_MAX);
 
-                               Error = __net_extract_ethernet_info(&next, &ProfInfo);
+                               Error = __net_extract_ethernet_info(next, &ProfInfo);
                                break;
                        case NET_DEVICE_BLUETOOTH:
                                g_strlcpy(ProfInfo.ProfileInfo.Bluetooth.net_info.ProfileName,
                                                obj, NET_PROFILE_NAME_LEN_MAX);
 
-                               Error = __net_extract_bluetooth_info(&next, &ProfInfo);
+                               Error = __net_extract_bluetooth_info(next, &ProfInfo);
                                break;
                        default:
                                NET_MEMFREE(*ProfilePtr);
@@ -668,9 +585,6 @@ static int __net_extract_all_services(DBusMessageIter *array,
                        memcpy(*ProfilePtr + count, &ProfInfo, sizeof(net_profile_info_t));
                        count++;
                }
-
-get_next:
-               dbus_message_iter_next(array);
        }
 
        *prof_count = count;
@@ -679,20 +593,16 @@ get_next:
        return NET_ERR_NONE;
 }
 
-static int __net_extract_services(DBusMessage *message, net_device_t device_type,
+static int __net_extract_services(GVariantIter *message, net_device_t device_type,
                net_profile_info_t** profile_info, int* profile_count)
 {
        __NETWORK_FUNC_ENTER__;
 
        net_err_t Error = NET_ERR_NONE;
-       DBusMessageIter iter, dict;
        net_profile_info_t *ProfilePtr = NULL;
        int prof_cnt = 0;
        char *service_prefix = NULL;
 
-       dbus_message_iter_init(message, &iter);
-       dbus_message_iter_recurse(&iter, &dict);
-
        *profile_count = 0;
 
        switch (device_type) {
@@ -716,7 +626,7 @@ static int __net_extract_services(DBusMessage *message, net_device_t device_type
                break;
        }
 
-       Error = __net_extract_all_services(&dict, device_type, service_prefix,
+       Error = __net_extract_all_services(message, device_type, service_prefix,
                        &prof_cnt, &ProfilePtr);
        if (Error != NET_ERR_NONE) {
                NETWORK_LOG(NETWORK_ERROR, "Failed to extract services from received message\n");
@@ -736,17 +646,14 @@ static int __net_extract_services(DBusMessage *message, net_device_t device_type
        return Error;
 }
 
-static int __net_extract_ip(DBusMessageIter *iter, net_addr_t *ipAddr)
+static int __net_extract_ip(const gchar *value, net_addr_t *ipAddr)
 {
        __NETWORK_FUNC_ENTER__;
 
        unsigned char *ipValue = NULL;
-       const char *value = NULL;
        char *saveptr = NULL;
        char ipString[NETPM_IPV4_STR_LEN_MAX+1];
        char* ipToken[4];
-       
-       dbus_message_iter_get_basic(iter, &value);      
 
        ipValue = (unsigned char *)&(ipAddr->Data.Ipv4.s_addr);
 
@@ -780,16 +687,17 @@ static int __net_extract_ip(DBusMessageIter *iter, net_addr_t *ipAddr)
        return NET_ERR_NONE;
 }
 
-static int __net_extract_common_info(const char *key, DBusMessageIter *variant, net_profile_info_t* ProfInfo)
+static int __net_extract_common_info(const char *key, GVariant *variant, net_profile_info_t* ProfInfo)
 {
        __NETWORK_FUNC_ENTER__;
 
        net_err_t Error = NET_ERR_NONE;
-       DBusMessageIter subIter1, subIter2, subIter3, subIter4;
-       const char *subKey = NULL;
-       const char *value = NULL;
+       const gchar *subKey = NULL;
+       const gchar *value = NULL;
        net_dev_info_t* net_info = NULL;
-       
+       GVariant *var = NULL;
+       GVariantIter *iter = NULL;
+
        if (ProfInfo->profile_type == NET_DEVICE_CELLULAR) {
                net_info = &(ProfInfo->ProfileInfo.Pdp.net_info);
        } else if (ProfInfo->profile_type == NET_DEVICE_WIFI) {
@@ -805,8 +713,8 @@ static int __net_extract_common_info(const char *key, DBusMessageIter *variant,
        }
 
        if (g_strcmp0(key, "State") == 0) {
-               dbus_message_iter_get_basic(variant, &value);
-               
+               value = g_variant_get_string(variant, NULL);
+
                if (g_strcmp0(value, "idle") == 0)
                        ProfInfo->ProfileState = NET_STATE_TYPE_IDLE;
                else if (g_strcmp0(value, "failure") == 0)
@@ -824,52 +732,34 @@ static int __net_extract_common_info(const char *key, DBusMessageIter *variant,
                else
                        ProfInfo->ProfileState = NET_STATE_TYPE_UNKNOWN;
        } else if (g_strcmp0(key, "Favorite") == 0) {
-               dbus_bool_t val;
-               
-               dbus_message_iter_get_basic(variant, &val);
-               
+               gboolean val = g_variant_get_boolean(variant);
+
                if(val)
                        ProfInfo->Favourite = TRUE;
                else
                        ProfInfo->Favourite = FALSE;
        } else if (g_strcmp0(key, "Ethernet") == 0) {
-               dbus_message_iter_recurse(variant, &subIter1);
-               
-               while (dbus_message_iter_get_arg_type(&subIter1) == DBUS_TYPE_DICT_ENTRY) {
-                       dbus_message_iter_recurse(&subIter1, &subIter2);
-                       dbus_message_iter_get_basic(&subIter2, &subKey);
-
+               g_variant_get(variant, "a{sv}", &iter);
+               while (g_variant_iter_loop(iter, "{sv}", &subKey, &var)) {
                        if (g_strcmp0(subKey, "Interface") == 0) {
-                               dbus_message_iter_next(&subIter2);
-                               dbus_message_iter_recurse(&subIter2, &subIter3);
-                               dbus_message_iter_get_basic(&subIter3, &value);
+                               value = g_variant_get_string(var, NULL);
 
                                if (value != NULL)
                                        g_strlcpy(net_info->DevName, value, NET_MAX_DEVICE_NAME_LEN);
-
                        } else if (g_strcmp0(subKey, "Address") == 0) {
-                               dbus_message_iter_next(&subIter2);
-                               dbus_message_iter_recurse(&subIter2, &subIter3);
-                               dbus_message_iter_get_basic(&subIter3, &value);
+                               value = g_variant_get_string(var, NULL);
 
                                if (value != NULL)
                                        g_strlcpy(net_info->MacAddr, value, NET_MAX_MAC_ADDR_LEN);
                        }
-                       
-                       dbus_message_iter_next(&subIter1);
                }
+               g_variant_iter_free(iter);
        } else if (g_strcmp0(key, "IPv4") == 0) {
-               dbus_message_iter_recurse(variant, &subIter1);
-               
-               while (dbus_message_iter_get_arg_type(&subIter1) == DBUS_TYPE_DICT_ENTRY) {
-                       dbus_message_iter_recurse(&subIter1, &subIter2);
-                       dbus_message_iter_get_basic(&subIter2, &subKey);
-
+               g_variant_get(variant, "a{sv}", &iter);
+               while (g_variant_iter_loop(iter, "{sv}", &subKey, &var)) {
                        if (g_strcmp0(subKey, "Method") == 0) {
-                               dbus_message_iter_next(&subIter2);
-                               dbus_message_iter_recurse(&subIter2, &subIter3);
-                               dbus_message_iter_get_basic(&subIter3, &value);
-                               
+                               value = g_variant_get_string(var, NULL);
+
                                if (g_strcmp0(value, "dhcp") == 0)
                                        net_info->IpConfigType = NET_IP_CONFIG_TYPE_DYNAMIC;
                                else if (g_strcmp0(value, "manual") == 0)
@@ -880,40 +770,32 @@ static int __net_extract_common_info(const char *key, DBusMessageIter *variant,
                                        net_info->IpConfigType = NET_IP_CONFIG_TYPE_OFF;
 
                        } else if (g_strcmp0(subKey, "Address") == 0) {
-                               dbus_message_iter_next(&subIter2);
-                               dbus_message_iter_recurse(&subIter2, &subIter3);
-                               __net_extract_ip(&subIter3, &net_info->IpAddr);
+                               value = g_variant_get_string(var, NULL);
+
+                               __net_extract_ip(value, &net_info->IpAddr);
                        } else if (g_strcmp0(subKey, "Netmask") == 0) {
-                               dbus_message_iter_next(&subIter2);
-                               dbus_message_iter_recurse(&subIter2, &subIter3);
-                               __net_extract_ip(&subIter3, &net_info->SubnetMask);
+                               value = g_variant_get_string(var, NULL);
+
+                               __net_extract_ip(value, &net_info->SubnetMask);
                                net_info->BNetmask = TRUE;
                        } else if (g_strcmp0(subKey, "Gateway") == 0) {
-                               dbus_message_iter_next(&subIter2);
-                               dbus_message_iter_recurse(&subIter2, &subIter3);
-                               __net_extract_ip(&subIter3, &net_info->GatewayAddr);
+                               value = g_variant_get_string(var, NULL);
+
+                               __net_extract_ip(value, &net_info->GatewayAddr);
                                net_info->BDefGateway = TRUE;
                        }
-                       
-                       dbus_message_iter_next(&subIter1);
                }
+               g_variant_iter_free(iter);
        } else if (g_strcmp0(key, "IPv4.Configuration") == 0) {
-
                if (net_info->IpConfigType != NET_IP_CONFIG_TYPE_DYNAMIC &&
                    net_info->IpConfigType != NET_IP_CONFIG_TYPE_STATIC &&
                    net_info->IpConfigType != NET_IP_CONFIG_TYPE_FIXED &&
                    net_info->IpConfigType != NET_IP_CONFIG_TYPE_OFF) {
 
-                       dbus_message_iter_recurse(variant, &subIter1);
-               
-                       while (dbus_message_iter_get_arg_type(&subIter1) == DBUS_TYPE_DICT_ENTRY) {
-                               dbus_message_iter_recurse(&subIter1, &subIter2);
-                               dbus_message_iter_get_basic(&subIter2, &subKey);
-
+                       g_variant_get(variant, "a{sv}", &iter);
+                       while (g_variant_iter_loop(iter, "{sv}", &subKey, &var)) {
                                if (g_strcmp0(subKey, "Method") == 0) {
-                                       dbus_message_iter_next(&subIter2);
-                                       dbus_message_iter_recurse(&subIter2, &subIter3);
-                                       dbus_message_iter_get_basic(&subIter3, &value);
+                                       value = g_variant_get_string(var, NULL);
                                        
                                        if(g_strcmp0(value, "dhcp") == 0)
                                                net_info->IpConfigType = NET_IP_CONFIG_TYPE_DYNAMIC;
@@ -926,70 +808,65 @@ static int __net_extract_common_info(const char *key, DBusMessageIter *variant,
 
                                } else if (g_strcmp0(subKey, "Address") == 0 &&
                                           net_info->IpAddr.Data.Ipv4.s_addr == 0) {
-                                       dbus_message_iter_next(&subIter2);
-                                       dbus_message_iter_recurse(&subIter2, &subIter3);
-                                       __net_extract_ip(&subIter3, &net_info->IpAddr);
+                                       value = g_variant_get_string(var, NULL);
+
+                                       __net_extract_ip(value, &net_info->IpAddr);
                                } else if (g_strcmp0(subKey, "Netmask") == 0 &&
                                           net_info->SubnetMask.Data.Ipv4.s_addr == 0) {
-                                       dbus_message_iter_next(&subIter2);
-                                       dbus_message_iter_recurse(&subIter2, &subIter3);
-                                       __net_extract_ip(&subIter3, &net_info->SubnetMask);
+                                       value = g_variant_get_string(var, NULL);
+
+                                       __net_extract_ip(value, &net_info->SubnetMask);
                                        net_info->BNetmask = TRUE;
                                } else if (g_strcmp0(subKey, "Gateway") == 0 &&
                                           net_info->GatewayAddr.Data.Ipv4.s_addr == 0) {
-                                       dbus_message_iter_next(&subIter2);
-                                       dbus_message_iter_recurse(&subIter2, &subIter3);
-                                       __net_extract_ip(&subIter3, &net_info->GatewayAddr);
+                                       value = g_variant_get_string(var, NULL);
+
+                                       __net_extract_ip(value, &net_info->GatewayAddr);
                                        net_info->BDefGateway = TRUE;
                                }
-                               
-                               dbus_message_iter_next(&subIter1);
                        }
+                       g_variant_iter_free(iter);
                }
        } else if(g_strcmp0(key, "Nameservers") == 0) {
                int dnsCount = 0;
-               dbus_message_iter_recurse(variant, &subIter1);                  
-               
-               while (dbus_message_iter_get_arg_type(&subIter1) == DBUS_TYPE_STRING) {
-                       __net_extract_ip(&subIter1, &net_info->DnsAddr[dnsCount]);
+
+               g_variant_get(variant, "as", &iter);
+               while (g_variant_iter_loop(iter, "s", &value)) {
+                       __net_extract_ip(value, &net_info->DnsAddr[dnsCount]);
+
                        dnsCount++;
                        if (dnsCount >= NET_DNS_ADDR_MAX)
-                               break;                                  
-                       
-                       dbus_message_iter_next(&subIter1);
+                               break;
                }
 
+               g_variant_iter_free(iter);
+
                net_info->DnsCount = dnsCount;
        } else if (g_strcmp0(key, "Nameservers.Configuration") == 0 && net_info->DnsCount == 0) {
                int dnsCount = 0;
-               dbus_message_iter_recurse(variant, &subIter1);
 
-               while (dbus_message_iter_get_arg_type(&subIter1) == DBUS_TYPE_STRING) {
-                       __net_extract_ip(&subIter1, &net_info->DnsAddr[dnsCount]);
+               g_variant_get(variant, "as", &iter);
+               while (g_variant_iter_loop(iter, "s", &value)) {
+                       __net_extract_ip(value, &net_info->DnsAddr[dnsCount]);
+
                        dnsCount++;
-                       if(dnsCount >= NET_DNS_ADDR_MAX)
+                       if (dnsCount >= NET_DNS_ADDR_MAX)
                                break;
-                       
-                       dbus_message_iter_next(&subIter1);
                }
+               g_variant_iter_free(iter);
 
                net_info->DnsCount = dnsCount;
        } else if (g_strcmp0(key, "Domains") == 0) {
        } else if (g_strcmp0(key, "Domains.Configuration") == 0) {
        } else if (g_strcmp0(key, "Proxy") == 0) {
-               dbus_message_iter_recurse(variant, &subIter1);
                const char *url = NULL;
                const char *servers = NULL;
-               
-               while (dbus_message_iter_get_arg_type(&subIter1) == DBUS_TYPE_DICT_ENTRY) {
-                       dbus_message_iter_recurse(&subIter1, &subIter2);
-                       dbus_message_iter_get_basic(&subIter2, &subKey);
 
+               g_variant_get(variant, "a{sv}", &iter);
+               while (g_variant_iter_loop(iter, "{sv}", &subKey, &var)) {
                        if (g_strcmp0(subKey, "Method") == 0) {
-                               dbus_message_iter_next(&subIter2);
-                               dbus_message_iter_recurse(&subIter2, &subIter3);
-                               dbus_message_iter_get_basic(&subIter3, &value);
-                               
+                               value = g_variant_get_string(var, NULL);
+
                                if (g_strcmp0(value, "direct") == 0)
                                        net_info->ProxyMethod = NET_PROXY_TYPE_DIRECT;
                                else if (g_strcmp0(value, "auto") == 0)
@@ -999,45 +876,35 @@ static int __net_extract_common_info(const char *key, DBusMessageIter *variant,
                                else
                                        net_info->ProxyMethod = NET_PROXY_TYPE_UNKNOWN;
                        } else if (g_strcmp0(subKey, "URL") == 0) {
-                               dbus_message_iter_next(&subIter2);
-                               dbus_message_iter_recurse(&subIter2, &subIter3);
-                               dbus_message_iter_get_basic(&subIter3, &url);
+                               url = g_variant_get_string(var, NULL);
                        } else if (g_strcmp0(subKey, "Servers") == 0) {
-                               dbus_message_iter_next(&subIter2);
-                               dbus_message_iter_recurse(&subIter2, &subIter3);
+                               GVariantIter *iter_sub = NULL;
 
-                               if (dbus_message_iter_get_arg_type(&subIter3) == DBUS_TYPE_ARRAY) {
-                                       dbus_message_iter_recurse(&subIter3, &subIter4);
+                               g_variant_get(var, "as", &iter_sub);
 
-                                       if (dbus_message_iter_get_arg_type(&subIter4) == DBUS_TYPE_STRING)
-                                               dbus_message_iter_get_basic(&subIter4, &servers);
-                               }
-                       }
+                               if (g_variant_iter_loop(iter_sub, "s", &servers) == FALSE)
+                                       servers = NULL;
 
-                       dbus_message_iter_next(&subIter1);
+                               g_variant_iter_free(iter_sub);
+                       }
                }
+               g_variant_iter_free(iter);
 
                if (net_info->ProxyMethod == NET_PROXY_TYPE_AUTO && url != NULL)
                        g_strlcpy(net_info->ProxyAddr, url, NET_PROXY_LEN_MAX);
                else if (net_info->ProxyMethod == NET_PROXY_TYPE_MANUAL && servers != NULL)
                        g_strlcpy(net_info->ProxyAddr, servers, NET_PROXY_LEN_MAX);
-
        } else if (g_strcmp0(key, "Proxy.Configuration") == 0 &&
                   net_info->ProxyMethod != NET_PROXY_TYPE_AUTO &&
                   net_info->ProxyMethod != NET_PROXY_TYPE_MANUAL) {
 
-               dbus_message_iter_recurse(variant, &subIter1);
                const char *url = NULL;
                const char *servers = NULL;
 
-               while (dbus_message_iter_get_arg_type(&subIter1) == DBUS_TYPE_DICT_ENTRY) {
-                       dbus_message_iter_recurse(&subIter1, &subIter2);
-                       dbus_message_iter_get_basic(&subIter2, &subKey);
-
+               g_variant_get(variant, "a{sv}", &iter);
+               while (g_variant_iter_loop(iter, "{sv}", &subKey, &var)) {
                        if (g_strcmp0(subKey, "Method") == 0) {
-                               dbus_message_iter_next(&subIter2);
-                               dbus_message_iter_recurse(&subIter2, &subIter3);
-                               dbus_message_iter_get_basic(&subIter3, &value);
+                               value = g_variant_get_string(var, NULL);
 
                                if (g_strcmp0(value, "direct") == 0)
                                        net_info->ProxyMethod = NET_PROXY_TYPE_DIRECT;
@@ -1048,34 +915,28 @@ static int __net_extract_common_info(const char *key, DBusMessageIter *variant,
                                else
                                        net_info->ProxyMethod = NET_PROXY_TYPE_UNKNOWN;
                        } else if (g_strcmp0(subKey, "URL") == 0) {
-                               dbus_message_iter_next(&subIter2);
-                               dbus_message_iter_recurse(&subIter2, &subIter3);
-                               dbus_message_iter_get_basic(&subIter3, &url);
+                               url = g_variant_get_string(var, NULL);
                        } else if (g_strcmp0(subKey, "Servers") == 0) {
-                               dbus_message_iter_next(&subIter2);
-                               dbus_message_iter_recurse(&subIter2, &subIter3);
+                               GVariantIter *iter_sub = NULL;
 
-                               if (dbus_message_iter_get_arg_type(&subIter3) == DBUS_TYPE_ARRAY) {
-                                       dbus_message_iter_recurse(&subIter3, &subIter4);
+                               g_variant_get(var, "as", &iter_sub);
 
-                                       if (dbus_message_iter_get_arg_type(&subIter4) == DBUS_TYPE_STRING)
-                                               dbus_message_iter_get_basic(&subIter4, &servers);
-                               }
-                       }
+                               if (g_variant_iter_loop(iter_sub, "s", &servers) == FALSE)
+                                       servers = NULL;
 
-                       dbus_message_iter_next(&subIter1);
+                               g_variant_iter_free(iter_sub);
+                       }
                }
+               g_variant_iter_free(iter);
 
                if (net_info->ProxyMethod == NET_PROXY_TYPE_AUTO && url != NULL)
                        g_strlcpy(net_info->ProxyAddr, url, NET_PROXY_LEN_MAX);
                else if (net_info->ProxyMethod == NET_PROXY_TYPE_MANUAL && servers != NULL)
                        g_strlcpy(net_info->ProxyAddr, servers, NET_PROXY_LEN_MAX);
-
        } else if(g_strcmp0(key, "Provider") == 0) {
        }
 
        __NETWORK_FUNC_EXIT__;
-
        return Error;
 }
 
@@ -1117,26 +978,20 @@ static wlan_eap_auth_type_t __convert_eap_auth_from_string(const char *eap_auth)
                return WLAN_SEC_EAP_AUTH_NONE;
 }
 
-static int __net_extract_wifi_info(DBusMessageIter *array, net_profile_info_t* ProfInfo)
+static int __net_extract_wifi_info(GVariantIter *array, net_profile_info_t* ProfInfo)
 {
        net_err_t Error = NET_ERR_NONE;
        net_wifi_profile_info_t *Wlan = &(ProfInfo->ProfileInfo.Wlan);
+       GVariant *var = NULL;
+       const gchar *key = NULL;
 
        __NETWORK_FUNC_ENTER__;
 
-       while (dbus_message_iter_get_arg_type(array) == DBUS_TYPE_DICT_ENTRY) {
-               DBusMessageIter entry, variant, sub_array;
-               const char *key = NULL;
-               const char *value = NULL;
-
-               dbus_message_iter_recurse(array, &entry);
-               dbus_message_iter_get_basic(&entry, &key);
-
-               dbus_message_iter_next(&entry);
-               dbus_message_iter_recurse(&entry, &variant);
+       while (g_variant_iter_loop(array, "{sv}", &key, &var)) {
+               const gchar *value = NULL;
 
                if (g_strcmp0(key, "Mode") == 0) {
-                       dbus_message_iter_get_basic(&variant, &value);
+                       value = g_variant_get_string(var, NULL);
 
                        if (g_strcmp0(value, "managed") == 0)
                                Wlan->wlan_mode = NETPM_WLAN_CONNMODE_INFRA;
@@ -1144,11 +999,12 @@ static int __net_extract_wifi_info(DBusMessageIter *array, net_profile_info_t* P
                                Wlan->wlan_mode = NETPM_WLAN_CONNMODE_ADHOC;
                        else
                                Wlan->wlan_mode = NETPM_WLAN_CONNMODE_AUTO;
+
                } else if (g_strcmp0(key, "Security") == 0) {
-                       dbus_message_iter_recurse(&variant, &sub_array);
+                       GVariantIter *iter_sub = NULL;
 
-                       while (dbus_message_iter_get_arg_type(&sub_array) == DBUS_TYPE_STRING) {
-                               dbus_message_iter_get_basic(&sub_array, &value);
+                       g_variant_get(var, "as", &iter_sub);
+                       while (g_variant_iter_loop(iter_sub, "s", &value)) {
                                if (g_strcmp0(value, "none") == 0 &&
                                    Wlan->security_info.sec_mode < WLAN_SEC_MODE_NONE)
                                        Wlan->security_info.sec_mode = WLAN_SEC_MODE_NONE;
@@ -1171,11 +1027,9 @@ static int __net_extract_wifi_info(DBusMessageIter *array, net_profile_info_t* P
                                        Wlan->security_info.wps_support = TRUE;
                                else if (Wlan->security_info.sec_mode < WLAN_SEC_MODE_NONE)
                                        Wlan->security_info.sec_mode = WLAN_SEC_MODE_NONE;
-
-                               dbus_message_iter_next(&sub_array);
                        }
                } else if (g_strcmp0(key, "EncryptionMode") == 0) {
-                       dbus_message_iter_get_basic(&variant, &value);
+                       value = g_variant_get_string(var, NULL);
 
                        if (g_strcmp0(value, "none") == 0)
                                Wlan->security_info.enc_mode = WLAN_ENC_MODE_NONE;
@@ -1188,19 +1042,16 @@ static int __net_extract_wifi_info(DBusMessageIter *array, net_profile_info_t* P
                        else if (g_strcmp0(value, "mixed") == 0)
                                Wlan->security_info.enc_mode = WLAN_ENC_MODE_TKIP_AES_MIXED;
 
-                       dbus_message_iter_next(&sub_array);
-
                } else if (g_strcmp0(key, "Strength") == 0) {
-                       dbus_message_iter_get_basic(&variant, &(Wlan->Strength));
+                       Wlan->Strength = g_variant_get_byte(var);
                } else if (g_strcmp0(key, "Name") == 0) {
-                       dbus_message_iter_get_basic(&variant, &value);
+                       value = g_variant_get_string(var, NULL);
 
                        if (value != NULL)
                                g_strlcpy(Wlan->essid, value, NET_WLAN_ESSID_LEN);
-
                } else if (g_strcmp0(key, "Passphrase") == 0) {
                        wlan_security_info_t *security_info = &(Wlan->security_info);
-                       dbus_message_iter_get_basic(&variant, &value);
+                       value = g_variant_get_string(var, NULL);
 
                        if (security_info->sec_mode == WLAN_SEC_MODE_WEP && value != NULL)
                                g_strlcpy(security_info->authentication.wep.wepKey,
@@ -1212,116 +1063,105 @@ static int __net_extract_wifi_info(DBusMessageIter *array, net_profile_info_t* P
                                                value, NETPM_WLAN_MAX_PSK_PASSPHRASE_LEN+1);
 
                } else if (g_strcmp0(key, "PassphraseRequired") == 0) {
-                       dbus_bool_t val;
+                       gboolean val;
 
-                       dbus_message_iter_get_basic(&variant, &val);
+                       val = g_variant_get_boolean(var);
 
                        if(val)
                                Wlan->PassphraseRequired = TRUE;
                        else
                                Wlan->PassphraseRequired = FALSE;
                } else if (g_strcmp0(key, "BSSID") == 0) {
-                       dbus_message_iter_get_basic(&variant, &value);
+                       value = g_variant_get_string(var, NULL);
 
                        if (value != NULL)
                                g_strlcpy(Wlan->bssid, value, NET_MAX_MAC_ADDR_LEN);
 
                } else if (g_strcmp0(key, "MaxRate") == 0) {
-                       unsigned int maxrate;
-                       dbus_message_iter_get_basic(&variant, &maxrate);
-
-                       Wlan->max_rate = maxrate;
+                       Wlan->max_rate = g_variant_get_uint32(var);
 
                } else if (g_strcmp0(key, "Frequency") == 0) {
                        unsigned short frequency;
-                       dbus_message_iter_get_basic(&variant, &frequency);
+                       frequency = g_variant_get_uint16(var);
 
                        Wlan->frequency = (unsigned int)frequency;
 
                } else if (g_str_equal(key, "EAP") == TRUE) {
-                       dbus_message_iter_get_basic(&variant, &value);
+                       value = g_variant_get_string(var, NULL);
 
                        if (value != NULL)
                                Wlan->security_info.authentication.eap.eap_type =
                                                __convert_eap_type_from_string(value);
 
                } else if (g_str_equal(key, "Phase2") == TRUE) {
-                       dbus_message_iter_get_basic(&variant, &value);
+                       value = g_variant_get_string(var, NULL);
 
                        if (value != NULL)
                                Wlan->security_info.authentication.eap.eap_auth =
                                                __convert_eap_auth_from_string(value);
 
                } else if (g_str_equal(key, "Identity") == TRUE) {
-                       dbus_message_iter_get_basic(&variant, &value);
+                       value = g_variant_get_string(var, NULL);
 
                        if (value != NULL)
                                g_strlcpy(Wlan->security_info.authentication.eap.username,
                                                value, NETPM_WLAN_USERNAME_LEN+1);
 
                } else if (g_str_equal(key, "Password") == TRUE) {
-                       dbus_message_iter_get_basic(&variant, &value);
+                       value = g_variant_get_string(var, NULL);
 
                        if (value != NULL)
                                g_strlcpy(Wlan->security_info.authentication.eap.password,
                                                value, NETPM_WLAN_PASSWORD_LEN+1);
 
                } else if (g_str_equal(key, "CACertFile") == TRUE) {
-                       dbus_message_iter_get_basic(&variant, &value);
+                       value = g_variant_get_string(var, NULL);
 
                        if (value != NULL)
                                g_strlcpy(Wlan->security_info.authentication.eap.ca_cert_filename,
                                                value, NETPM_WLAN_CA_CERT_FILENAME_LEN+1);
 
                } else if (g_str_equal(key, "ClientCertFile") == TRUE) {
-                       dbus_message_iter_get_basic(&variant, &value);
+                       value = g_variant_get_string(var, NULL);
 
                        if (value != NULL)
                                g_strlcpy(Wlan->security_info.authentication.eap.client_cert_filename,
                                                value, NETPM_WLAN_CLIENT_CERT_FILENAME_LEN+1);
 
                } else if (g_str_equal(key, "PrivateKeyFile") == TRUE) {
-                       dbus_message_iter_get_basic(&variant, &value);
+                       value = g_variant_get_string(var, NULL);
 
                        if (value != NULL)
                                g_strlcpy(Wlan->security_info.authentication.eap.private_key_filename,
                                                value, NETPM_WLAN_PRIVATE_KEY_FILENAME_LEN+1);
 
                } else if (g_str_equal(key, "PrivateKeyPassphrase") == TRUE) {
-                       dbus_message_iter_get_basic(&variant, &value);
+                       value = g_variant_get_string(var, NULL);
 
                        if (value != NULL)
                                g_strlcpy(Wlan->security_info.authentication.eap.private_key_passwd,
                                                value, NETPM_WLAN_PRIVATE_KEY_PASSWD_LEN+1);
                } else
-                       Error = __net_extract_common_info(key, &variant, ProfInfo);
-
-               dbus_message_iter_next(array);
+                       Error = __net_extract_common_info(key, var, ProfInfo);
        }
 
        __NETWORK_FUNC_EXIT__;
        return Error;
 }
 
-static int __net_extract_mobile_info(DBusMessageIter *array, net_profile_info_t *ProfInfo)
+static int __net_extract_mobile_info(GVariantIter *array, net_profile_info_t *ProfInfo)
 {
        net_err_t Error = NET_ERR_NONE;
+       GVariant *var = NULL;
+       const gchar *key = NULL;
 
        __NETWORK_FUNC_ENTER__;
 
-       while (dbus_message_iter_get_arg_type(array) == DBUS_TYPE_DICT_ENTRY) {
-               DBusMessageIter entry, variant;
-               const char *key = NULL;
-               const char *value = NULL;
-               
-               dbus_message_iter_recurse(array, &entry);
-               dbus_message_iter_get_basic(&entry, &key);
-
-               dbus_message_iter_next(&entry);
-               dbus_message_iter_recurse(&entry, &variant);
+       while (g_variant_iter_loop(array, "{sv}", &key, &var)) {
+               const gchar *value = NULL;
 
                if (g_strcmp0(key, "Mode") == 0) {
-                       dbus_message_iter_get_basic(&variant, &value);
+                       value = g_variant_get_string(var, NULL);
 
                        if (g_strcmp0(value, "gprs") == 0)
                                ProfInfo->ProfileInfo.Pdp.ProtocolType = NET_PDP_TYPE_GPRS;
@@ -1332,27 +1172,23 @@ static int __net_extract_mobile_info(DBusMessageIter *array, net_profile_info_t
                        else
                                ProfInfo->ProfileInfo.Pdp.ProtocolType = NET_PDP_TYPE_NONE;
                } else if (g_strcmp0(key, "Roaming") == 0) {
-                       dbus_bool_t val;
-                       
-                       dbus_message_iter_get_basic(&variant, &val);
+                       gboolean val;
 
+                       val = g_variant_get_boolean(var);
                        if (val)
                                ProfInfo->ProfileInfo.Pdp.Roaming = TRUE;
                        else
                                ProfInfo->ProfileInfo.Pdp.Roaming = FALSE;
                } else if (g_strcmp0(key, "SetupRequired") == 0) {
-                       dbus_bool_t val;
-                       
-                       dbus_message_iter_get_basic(&variant, &val);
+                       gboolean val;
 
+                       val = g_variant_get_boolean(var);
                        if (val)
                                ProfInfo->ProfileInfo.Pdp.SetupRequired = TRUE;
                        else
                                ProfInfo->ProfileInfo.Pdp.SetupRequired = FALSE;
                } else
-                       Error = __net_extract_common_info(key, &variant, ProfInfo);
-
-               dbus_message_iter_next(array);
+                       Error = __net_extract_common_info(key, var, ProfInfo);
        }
 
        /* Get Specific info from telephony service */
@@ -1412,99 +1248,70 @@ static int __net_extract_mobile_info(DBusMessageIter *array, net_profile_info_t
        return Error;
 }
 
-static int __net_extract_ethernet_info(DBusMessageIter *array, net_profile_info_t* ProfInfo)
+static int __net_extract_ethernet_info(GVariantIter *array, net_profile_info_t* ProfInfo)
 {
        net_err_t Error = NET_ERR_NONE;
+       GVariant *var = NULL;
+       const gchar *key = NULL;
 
        __NETWORK_FUNC_ENTER__;
 
-       while (dbus_message_iter_get_arg_type(array) == DBUS_TYPE_DICT_ENTRY) {
-               DBusMessageIter entry, variant;
-               const char *key = NULL;
-
-               dbus_message_iter_recurse(array, &entry);
-               dbus_message_iter_get_basic(&entry, &key);
-
-               dbus_message_iter_next(&entry);
-               dbus_message_iter_recurse(&entry, &variant);
-
-               Error = __net_extract_common_info(key, &variant, ProfInfo);
-
-               dbus_message_iter_next(array);
-       }
+       while (g_variant_iter_loop(array, "{sv}", &key, &var))
+               Error = __net_extract_common_info(key, var, ProfInfo);
 
        __NETWORK_FUNC_EXIT__;
        return Error;
 }
 
-static int __net_extract_bluetooth_info(DBusMessageIter *array, net_profile_info_t* ProfInfo)
+static int __net_extract_bluetooth_info(GVariantIter *array, net_profile_info_t* ProfInfo)
 {
        net_err_t Error = NET_ERR_NONE;
+       GVariant *var = NULL;
+       const gchar *key = NULL;
 
        __NETWORK_FUNC_ENTER__;
 
-       while (dbus_message_iter_get_arg_type(array) == DBUS_TYPE_DICT_ENTRY) {
-               DBusMessageIter entry, variant;
-               const char *key = NULL;
-
-               dbus_message_iter_recurse(array, &entry);
-               dbus_message_iter_get_basic(&entry, &key);
-
-               dbus_message_iter_next(&entry);
-               dbus_message_iter_recurse(&entry, &variant);
-
-               Error = __net_extract_common_info(key, &variant, ProfInfo);
-
-               dbus_message_iter_next(array);
-       }
+       while (g_variant_iter_loop(array, "{sv}", &key, &var))
+               Error = __net_extract_common_info(key, var, ProfInfo);
 
        __NETWORK_FUNC_EXIT__;
        return Error;
 }
 
 static int __net_extract_service_info(
-               const char* ProfileName, DBusMessage *message,
+               const char* ProfileName, GVariant *message,
                net_profile_info_t* ProfInfo)
 {
        __NETWORK_FUNC_ENTER__;
 
        net_err_t Error = NET_ERR_NONE;
-       DBusMessageIter iter, array;
        net_device_t profileType = NET_DEVICE_UNKNOWN;
+       gchar *key = NULL;
+       GVariantIter *iter = NULL;
+       GVariant *value = NULL;
 
-       dbus_message_iter_init(message, &iter);
-       dbus_message_iter_recurse(&iter, &array);
-
-       while (dbus_message_iter_get_arg_type(&array) == DBUS_TYPE_DICT_ENTRY) {
-               DBusMessageIter entry, dict;
-               const char *key = NULL;
-               const char *temp = NULL;
-
-               dbus_message_iter_recurse(&array, &entry);
-               dbus_message_iter_get_basic(&entry, &key);
+       g_variant_get(message, "(a{sv})", &iter);
+       while (g_variant_iter_loop(iter, "{sv}", &key, &value)) {
+               const gchar *tech = NULL;
 
                if (g_strcmp0(key, "Type") == 0) {
-                       dbus_message_iter_next(&entry);
-                       dbus_message_iter_recurse(&entry, &dict);
-                       dbus_message_iter_get_basic(&dict, &temp);
+                       tech = g_variant_get_string(value, NULL);
 
-                       if (g_strcmp0(temp, "wifi") == 0)
+                       if (g_strcmp0(tech, "wifi") == 0)
                                profileType = NET_DEVICE_WIFI;
-                       else if (g_strcmp0(temp, "cellular") == 0)
+                       else if (g_strcmp0(tech, "cellular") == 0)
                                profileType = NET_DEVICE_CELLULAR;
-                       else if (g_strcmp0(temp, "ethernet") == 0)
+                       else if (g_strcmp0(tech, "ethernet") == 0)
                                profileType = NET_DEVICE_ETHERNET;
-                       else if (g_strcmp0(temp, "bluetooth") == 0)
+                       else if (g_strcmp0(tech, "bluetooth") == 0)
                                profileType = NET_DEVICE_BLUETOOTH;
 
                        break;
                }
-
-               dbus_message_iter_next(&array);
        }
+       g_variant_iter_free(iter);
 
-       dbus_message_iter_init(message, &iter);
-       dbus_message_iter_recurse(&iter, &array);
+       g_variant_get(message, "(a{sv})", &iter);
 
        if (profileType == NET_DEVICE_WIFI) {
                if ((Error = __net_pm_init_profile_info(NET_DEVICE_WIFI, ProfInfo)) != NET_ERR_NONE) {
@@ -1518,7 +1325,7 @@ static int __net_extract_service_info(
                g_strlcpy(ProfInfo->ProfileInfo.Wlan.net_info.ProfileName,
                                ProfileName, NET_PROFILE_NAME_LEN_MAX);
 
-               Error = __net_extract_wifi_info(&array, ProfInfo);
+               Error = __net_extract_wifi_info(iter, ProfInfo);
        } else if (profileType == NET_DEVICE_CELLULAR) {
                if ((Error = __net_pm_init_profile_info(NET_DEVICE_CELLULAR, ProfInfo)) != NET_ERR_NONE) {
                        NETWORK_LOG(NETWORK_ERROR, "Failed to init profile\n");
@@ -1531,7 +1338,7 @@ static int __net_extract_service_info(
                g_strlcpy(ProfInfo->ProfileInfo.Pdp.net_info.ProfileName,
                                ProfileName, NET_PROFILE_NAME_LEN_MAX);
 
-               Error = __net_extract_mobile_info(&array, ProfInfo);
+               Error = __net_extract_mobile_info(iter, ProfInfo);
        } else if (profileType == NET_DEVICE_ETHERNET) {
                if ((Error = __net_pm_init_profile_info(NET_DEVICE_ETHERNET, ProfInfo)) != NET_ERR_NONE) {
                        NETWORK_LOG(NETWORK_ERROR, "Failed to init profile\n");
@@ -1544,7 +1351,7 @@ static int __net_extract_service_info(
                g_strlcpy(ProfInfo->ProfileInfo.Ethernet.net_info.ProfileName,
                                ProfileName, NET_PROFILE_NAME_LEN_MAX);
 
-               Error = __net_extract_ethernet_info(&array, ProfInfo);
+               Error = __net_extract_ethernet_info(iter, ProfInfo);
        } else if (profileType == NET_DEVICE_BLUETOOTH) {
                if ((Error = __net_pm_init_profile_info(NET_DEVICE_BLUETOOTH, ProfInfo)) != NET_ERR_NONE) {
                        NETWORK_LOG(NETWORK_ERROR, "Failed to init profile\n");
@@ -1557,7 +1364,7 @@ static int __net_extract_service_info(
                g_strlcpy(ProfInfo->ProfileInfo.Bluetooth.net_info.ProfileName,
                                ProfileName, NET_PROFILE_NAME_LEN_MAX);
 
-               Error = __net_extract_bluetooth_info(&array, ProfInfo);
+               Error = __net_extract_bluetooth_info(iter, ProfInfo);
        } else {
                NETWORK_LOG(NETWORK_ERROR, "Not supported profile type\n");
                __NETWORK_FUNC_EXIT__;
@@ -1571,6 +1378,8 @@ static int __net_extract_service_info(
                __NETWORK_FUNC_EXIT__;
                return Error;
        }
+       if (iter)
+               g_variant_iter_free(iter);
 
        __NETWORK_FUNC_EXIT__;
        return Error;
@@ -1582,7 +1391,7 @@ static int __net_get_profile_info(
        __NETWORK_FUNC_ENTER__;
 
        net_err_t Error = NET_ERR_NONE;
-       DBusMessage *message = NULL;
+       GVariant *message = NULL;
 
        message = _net_invoke_dbus_method(CONNMAN_SERVICE, ProfileName,
                        CONNMAN_SERVICE_INTERFACE, "GetProperties", NULL, &Error);
@@ -1592,7 +1401,7 @@ static int __net_get_profile_info(
        }
 
        Error = __net_extract_service_info(ProfileName, message, ProfInfo);
-       dbus_message_unref(message);
+       g_variant_unref(message);
 
 done:
        __NETWORK_FUNC_EXIT__;
@@ -1604,7 +1413,7 @@ static int __net_set_default_cellular_service_profile_sync(const char* ProfileNa
        __NETWORK_FUNC_ENTER__;
 
        net_err_t Error = NET_ERR_NONE;
-       DBusMessage *message = NULL;
+       GVariant *message = NULL;
        net_profile_name_t telephony_profile;
        char connman_profile[NET_PROFILE_NAME_LEN_MAX+1] = "";
 
@@ -1626,24 +1435,21 @@ static int __net_set_default_cellular_service_profile_sync(const char* ProfileNa
        }
 
        /** Check Reply */
-       DBusMessageIter iter;
-       int result = 0;
+       gboolean result = FALSE;
 
-       dbus_message_iter_init(message, &iter);
-       if (dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_BOOLEAN) {
-               dbus_message_iter_get_basic(&iter, &result);
-               NETWORK_LOG(NETWORK_HIGH, "Set default cellular profile result : %d\n", result);
-       }
+       g_variant_get(message, "(b)", &result);
+       NETWORK_LOG(NETWORK_HIGH, "Set default cellular profile result : %d\n", result);
 
        if (result)
                Error = NET_ERR_NONE;
        else
                Error = NET_ERR_UNKNOWN;
 
-       dbus_message_unref(message);
+       g_variant_unref(message);
 
 done:
        __NETWORK_FUNC_EXIT__;
+
        return Error;
 }
 
@@ -1782,9 +1588,9 @@ static int __net_wifi_delete_profile(net_profile_name_t* WifiProfName,
        __NETWORK_FUNC_ENTER__;
 
        net_err_t Error = NET_ERR_NONE;
-       DBusMessage *message = NULL;
-       char* param_array[] = {NULL, NULL};
+       GVariant *message = NULL;
        char param0[NET_PROFILE_NAME_LEN_MAX + 8] = "";
+       GVariant *params = NULL;
 
        if (WLAN_SEC_MODE_IEEE8021X != sec_mode) {
                message = _net_invoke_dbus_method(CONNMAN_SERVICE,
@@ -1794,11 +1600,11 @@ static int __net_wifi_delete_profile(net_profile_name_t* WifiProfName,
        } else {
                g_snprintf(param0, NET_PROFILE_NAME_LEN_MAX + 8, "string:%s",
                                WifiProfName->ProfileName);
-               param_array[0] = param0;
+               params = g_variant_new("(s)", param0);
 
                message = _net_invoke_dbus_method(NETCONFIG_SERVICE,
                                NETCONFIG_WIFI_PATH, NETCONFIG_WIFI_INTERFACE,
-                               "DeleteConfig", param_array, &Error);
+                               "DeleteConfig", params, &Error);
        }
 
        if (message == NULL) {
@@ -1806,8 +1612,11 @@ static int __net_wifi_delete_profile(net_profile_name_t* WifiProfName,
                goto done;
        }
 
-       dbus_message_unref(message);
+       g_variant_unref(message);
 done:
+       if (params)
+               g_variant_unref(params);
+
        __NETWORK_FUNC_EXIT__;
        return Error;
 }
@@ -1873,7 +1682,7 @@ static int __net_telephony_delete_profile(net_profile_name_t* PdpProfName)
        __NETWORK_FUNC_ENTER__;
 
        net_err_t Error = NET_ERR_NONE;
-       DBusMessage *message = NULL;
+       GVariant *message = NULL;
 
        message = _net_invoke_dbus_method(TELEPHONY_SERVICE, PdpProfName->ProfileName,
                        TELEPHONY_PROFILE_INTERFACE, "RemoveProfile", NULL, &Error);
@@ -1884,21 +1693,17 @@ static int __net_telephony_delete_profile(net_profile_name_t* PdpProfName)
        }
 
        /** Check Reply */
-       DBusMessageIter iter;
-       int remove_result = 0;
+       gboolean remove_result = FALSE;
 
-       dbus_message_iter_init(message, &iter);
-       if (dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_BOOLEAN) {
-               dbus_message_iter_get_basic(&iter, &remove_result);
-               NETWORK_LOG(NETWORK_HIGH, "Profile remove result : %d\n", remove_result);
-       }
+       g_variant_get(message, "(b)", &remove_result);
+       NETWORK_LOG(NETWORK_HIGH, "Profile remove result : %d\n", remove_result);
 
        if (remove_result)
                Error = NET_ERR_NONE;
        else
                Error = NET_ERR_UNKNOWN;
 
-       dbus_message_unref(message);
+       g_variant_unref(message);
 
 done:
        __NETWORK_FUNC_EXIT__;
@@ -1924,11 +1729,12 @@ static gboolean __net_is_cellular_default_candidate(const char* profile)
 }
 
 static int __net_extract_default_profile(
-               DBusMessageIter *array, net_profile_info_t *ProfilePtr)
+               GVariantIter *array, net_profile_info_t *ProfilePtr)
 {
        net_err_t Error = NET_ERR_NONE;
-       const char *obj = NULL;
        net_device_t device_type;
+       const gchar *key = NULL;
+       GVariantIter *value = NULL;
 
        __NETWORK_FUNC_ENTER__;
 
@@ -1938,25 +1744,14 @@ static int __net_extract_default_profile(
                return NET_ERR_INVALID_PARAM;
        }
 
-       while (dbus_message_iter_get_arg_type(array) == DBUS_TYPE_STRUCT) {
-               DBusMessageIter entry;
-               DBusMessageIter next;
-
-               dbus_message_iter_recurse(array, &entry);
-               dbus_message_iter_get_basic(&entry, &obj);
-
-               if (obj == NULL) {
-                       dbus_message_iter_next(array);
-                       continue;
-               }
-
-               if (g_str_has_prefix(obj, CONNMAN_CELLULAR_SERVICE_PROFILE_PREFIX) == TRUE)
+       while (g_variant_iter_loop(array, "(oa{sv})", &key, &value)) {
+               if (g_str_has_prefix(key, CONNMAN_CELLULAR_SERVICE_PROFILE_PREFIX) == TRUE)
                        device_type = NET_DEVICE_CELLULAR;
-               else if (g_str_has_prefix(obj, CONNMAN_WIFI_SERVICE_PROFILE_PREFIX) == TRUE)
+               else if (g_str_has_prefix(key, CONNMAN_WIFI_SERVICE_PROFILE_PREFIX) == TRUE)
                        device_type = NET_DEVICE_WIFI;
-               else if (g_str_has_prefix(obj, CONNMAN_ETHERNET_SERVICE_PROFILE_PREFIX) == TRUE)
+               else if (g_str_has_prefix(key, CONNMAN_ETHERNET_SERVICE_PROFILE_PREFIX) == TRUE)
                        device_type = NET_DEVICE_ETHERNET;
-               else if (g_str_has_prefix(obj, CONNMAN_BLUETOOTH_SERVICE_PROFILE_PREFIX) == TRUE)
+               else if (g_str_has_prefix(key, CONNMAN_BLUETOOTH_SERVICE_PROFILE_PREFIX) == TRUE)
                        device_type = NET_DEVICE_BLUETOOTH;
                else
                        return NET_ERR_NO_SERVICE;
@@ -1969,39 +1764,34 @@ static int __net_extract_default_profile(
                }
 
                ProfilePtr->profile_type = device_type;
-               g_strlcpy(ProfilePtr->ProfileName, obj, NET_PROFILE_NAME_LEN_MAX);
-
-               dbus_message_iter_next(&entry);
-               dbus_message_iter_recurse(&entry, &next);
+               g_strlcpy(ProfilePtr->ProfileName, key, NET_PROFILE_NAME_LEN_MAX);
 
                if (device_type == NET_DEVICE_CELLULAR &&
-                               __net_is_cellular_default_candidate(obj) == TRUE) {
+                               __net_is_cellular_default_candidate(key) == TRUE) {
                        g_strlcpy(ProfilePtr->ProfileInfo.Pdp.net_info.ProfileName,
-                                       obj, NET_PROFILE_NAME_LEN_MAX);
+                                       key, NET_PROFILE_NAME_LEN_MAX);
 
-                       Error = __net_extract_mobile_info(&next, ProfilePtr);
+                       Error = __net_extract_mobile_info(value, ProfilePtr);
                        break;
                } else if (device_type == NET_DEVICE_WIFI) {
                        g_strlcpy(ProfilePtr->ProfileInfo.Wlan.net_info.ProfileName,
-                                       obj, NET_PROFILE_NAME_LEN_MAX);
+                                       key, NET_PROFILE_NAME_LEN_MAX);
 
-                       Error = __net_extract_wifi_info(&next, ProfilePtr);
+                       Error = __net_extract_wifi_info(value, ProfilePtr);
                        break;
                } else if (device_type == NET_DEVICE_ETHERNET) {
                        g_strlcpy(ProfilePtr->ProfileInfo.Ethernet.net_info.ProfileName,
-                                       obj, NET_PROFILE_NAME_LEN_MAX);
+                                       key, NET_PROFILE_NAME_LEN_MAX);
 
-                       Error = __net_extract_ethernet_info(&next, ProfilePtr);
+                       Error = __net_extract_ethernet_info(value, ProfilePtr);
                        break;
                } else if (device_type == NET_DEVICE_BLUETOOTH) {
                        g_strlcpy(ProfilePtr->ProfileInfo.Bluetooth.net_info.ProfileName,
-                                       obj, NET_PROFILE_NAME_LEN_MAX);
+                                       key, NET_PROFILE_NAME_LEN_MAX);
 
-                       Error = __net_extract_bluetooth_info(&next, ProfilePtr);
+                       Error = __net_extract_bluetooth_info(value, ProfilePtr);
                        break;
                }
-
-               dbus_message_iter_next(array);
        }
 
        if (Error == NET_ERR_NONE &&
@@ -2062,13 +1852,13 @@ int _net_get_profile_list(net_device_t device_type,
        __NETWORK_FUNC_ENTER__;
 
        net_err_t Error = NET_ERR_NONE;
-       DBusMessage *message = NULL;
+       GVariant *message = NULL;
+       GVariantIter *iter = NULL;
 
        message = _net_invoke_dbus_method(CONNMAN_SERVICE, CONNMAN_MANAGER_PATH,
                        CONNMAN_MANAGER_INTERFACE, "GetServices", NULL, &Error);
        if (message == NULL) {
                NETWORK_LOG(NETWORK_ERROR, "Failed to get service(profile) list\n");
-
                __NETWORK_FUNC_EXIT__;
                return Error;
        }
@@ -2078,7 +1868,11 @@ int _net_get_profile_list(net_device_t device_type,
        case NET_DEVICE_WIFI:
        case NET_DEVICE_ETHERNET:
        case NET_DEVICE_BLUETOOTH:
-               Error = __net_extract_services(message, device_type, profile_info, profile_count);
+               g_variant_get(message, "(a(oa{sv}))", &iter);
+               Error = __net_extract_services(iter, device_type, profile_info, profile_count);
+
+               if (iter != NULL)
+                       g_variant_iter_free(iter);
                break;
 
        default :
@@ -2087,7 +1881,7 @@ int _net_get_profile_list(net_device_t device_type,
        }
 
        NETWORK_LOG(NETWORK_HIGH, "Error = %d\n", Error);
-       dbus_message_unref(message);
+       g_variant_unref(message);
 
        __NETWORK_FUNC_EXIT__;
        return Error;
@@ -2098,8 +1892,8 @@ int _net_get_service_profile(net_service_type_t service_type, net_profile_name_t
        __NETWORK_FUNC_ENTER__;
 
        net_err_t Error = NET_ERR_NONE;
-       DBusMessage *message = NULL;
-       DBusMessageIter iter, dict;
+       GVariant *message = NULL;
+       GVariantIter *iter = NULL;
        network_services_list_t service_info = {0,};
        int i = 0;
 
@@ -2112,10 +1906,10 @@ int _net_get_service_profile(net_service_type_t service_type, net_profile_name_t
                return Error;
        }
 
-       dbus_message_iter_init(message, &iter);
-       dbus_message_iter_recurse(&iter, &dict);
+       g_variant_get(message, "(a(oa{sv}))", &iter);
+       Error = __net_extract_mobile_services(iter, &service_info, service_type);
 
-       Error = __net_extract_mobile_services(message, &dict, &service_info, service_type);
+       g_variant_iter_free(iter);
 
        if (Error != NET_ERR_NONE)
                goto done;
@@ -2130,7 +1924,7 @@ int _net_get_service_profile(net_service_type_t service_type, net_profile_name_t
                NET_MEMFREE(service_info.ProfileName[i]);
 
 done:
-       dbus_message_unref(message);
+       g_variant_unref(message);
 
        __NETWORK_FUNC_EXIT__;
        return Error;
@@ -2139,8 +1933,8 @@ done:
 int _net_get_default_profile_info(net_profile_info_t *profile_info)
 {
        net_err_t Error = NET_ERR_NONE;
-       DBusMessage *message = NULL;
-       DBusMessageIter iter, dict;
+       GVariant *message = NULL;
+       GVariantIter *iter = NULL;
 
        __NETWORK_FUNC_ENTER__;
 
@@ -2152,12 +1946,11 @@ int _net_get_default_profile_info(net_profile_info_t *profile_info)
                return NET_ERR_NO_SERVICE;
        }
 
-       dbus_message_iter_init(message, &iter);
-       dbus_message_iter_recurse(&iter, &dict);
-
-       Error = __net_extract_default_profile(&dict, profile_info);
+       g_variant_get(message, "(a(oa{sv}))", &iter);
+       Error = __net_extract_default_profile(iter, profile_info);
 
-       dbus_message_unref(message);
+       g_variant_iter_free (iter);
+       g_variant_unref(message);
 
        __NETWORK_FUNC_EXIT__;
        return Error;
index 633b4bf..a570168 100644 (file)
@@ -19,9 +19,6 @@
 
 #include <vconf.h>
 
-#include <dbus/dbus.h>
-#include <dbus/dbus-glib-lowlevel.h>
-
 #include "network-internal.h"
 #include "network-dbus-request.h"
 #include "network-signal-handler.h"
  *     Extern Global Variables
  *****************************************************************************/
 extern network_info_t NetworkInfo;
+
 extern network_request_table_t request_table[NETWORK_REQUEST_TYPE_MAX];
+handle_connection h_connection;
 
 /*****************************************************************************
  *     Global Variables
  *****************************************************************************/
-DBusConnection* signal_conn = NULL;
 static net_state_type_t service_state_table[NET_DEVICE_MAX] = {NET_STATE_TYPE_UNKNOWN,};
 
 static int net_service_error = NET_ERR_NONE;
 
-/*****************************************************************************
- *     Local Functions Definition
- *****************************************************************************/
-
-static int __net_get_dbus_property_changed_basic(DBusMessage *message,
-               char **key, int type, void *value)
-{
-       int Error = NET_ERR_UNKNOWN_METHOD;
-       DBusMessageIter iter, iter_variant;
-
-       dbus_message_iter_init(message, &iter);
-       if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
-               return Error;
-
-       dbus_message_iter_get_basic(&iter, key);
-
-       dbus_message_iter_next(&iter);
-       if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_VARIANT)
-               return Error;
-
-       dbus_message_iter_recurse(&iter, &iter_variant);
-       if (dbus_message_iter_get_arg_type(&iter_variant) != type)
-               return Error;
-
-       dbus_message_iter_get_basic(&iter_variant, value);
-
-       return NET_ERR_NONE;
-}
-
 static int __net_handle_wifi_power_rsp(gboolean value)
 {
        __NETWORK_FUNC_ENTER__;
@@ -152,60 +121,48 @@ static int __net_handle_specific_scan_resp(GSList *bss_info_list)
        return NET_ERR_NONE;
 }
 
-static int __net_handle_wifi_specific_scan_rsp(DBusMessage *msg)
+static int __net_handle_wifi_specific_scan_rsp(GVariant *param)
 {
-       net_err_t Error = NET_ERR_UNKNOWN_METHOD;
-       DBusMessageIter iter, array;
-
-       dbus_message_iter_init(msg, &iter);
-       dbus_message_iter_recurse(&iter, &array);
-
+       GVariantIter *iter = NULL;
+       GVariant *value = NULL;
+       const char *key = NULL;
+       const gchar *ssid = NULL;
+       gint32 security = 0;
        GSList *bss_info_list = NULL;
+       gboolean ssid_found = FALSE;
+       gboolean sec_found = FALSE;
 
-       while (dbus_message_iter_get_arg_type(&array) == DBUS_TYPE_DICT_ENTRY) {
-               DBusMessageIter entry, dict;
-               const char *key = NULL;
-               const char *ssid = NULL;
-               const int security = 0;
-
-               dbus_message_iter_recurse(&array, &entry);
-               dbus_message_iter_get_basic(&entry, &key);
-
-               if (g_strcmp0(key, "ssid") != 0)
-                       return Error;
-
-               dbus_message_iter_next(&entry);
-               dbus_message_iter_recurse(&entry, &dict);
-               dbus_message_iter_get_basic(&dict, &ssid);
-               NETWORK_LOG(NETWORK_LOW, "Got an ssid: %s", ssid);
+       g_variant_get(param, "(a{sv})", &iter);
 
-               dbus_message_iter_next(&array);
-               if (dbus_message_iter_get_arg_type(&array) != DBUS_TYPE_DICT_ENTRY)
-                       return Error;
-
-               dbus_message_iter_recurse(&array, &entry);
-               dbus_message_iter_get_basic(&entry, &key);
-               if (g_strcmp0(key, "security") != 0)
-                       return Error;
-
-               dbus_message_iter_next(&entry);
-               dbus_message_iter_recurse(&entry, &dict);
-               dbus_message_iter_get_basic(&dict, (void *)&security);
-               NETWORK_LOG(NETWORK_LOW, "with security: %d", security);
+       while (g_variant_iter_loop(iter, "{sv}", &key, &value)) {
+               if (g_strcmp0(key, "ssid") == 0 && ssid_found == FALSE) {
+                       ssid = g_variant_get_string(value, NULL);
+                       NETWORK_LOG(NETWORK_LOW, "Got an ssid: %s", ssid);
+                       ssid_found = TRUE;
+               }
+               if (g_strcmp0(key, "security") == 0 && sec_found == FALSE) {
+                       security = g_variant_get_int16(value);
+                       NETWORK_LOG(NETWORK_LOW, "with security: %d", security);
+                       sec_found = TRUE;
+               }
 
-               net_wifi_connection_info_t *resp_data = g_try_new0(
-                               net_wifi_connection_info_t, 1);
-               g_strlcpy(resp_data->essid, ssid, NET_WLAN_ESSID_LEN);
-               resp_data->security_info.sec_mode = __net_get_wlan_sec_mode(security);
-               bss_info_list = g_slist_append(bss_info_list, resp_data);
+               if (ssid_found == TRUE && sec_found == TRUE) {
+                       net_wifi_connection_info_t *resp_data = g_try_new0(
+                                       net_wifi_connection_info_t, 1);
+                       g_strlcpy(resp_data->essid, ssid, NET_WLAN_ESSID_LEN);
+                       resp_data->security_info.sec_mode = __net_get_wlan_sec_mode(security);
+                       bss_info_list = g_slist_append(bss_info_list, resp_data);
 
-               dbus_message_iter_next(&array);
+                       ssid_found = FALSE;
+                       sec_found = FALSE;
+               }
        }
+       g_variant_iter_free(iter);
 
        NETWORK_LOG(NETWORK_LOW,
-                       "Received the signal: %s with total bss count = %d(Error = %d)",
+                       "Received the signal: %s with total bss count = %d",
                        NETCONFIG_SIGNAL_SPECIFIC_SCAN_DONE,
-                       g_slist_length(bss_info_list), Error);
+                       g_slist_length(bss_info_list));
 
        __net_handle_specific_scan_resp(bss_info_list);
 
@@ -319,17 +276,17 @@ static int string2state(const char *state)
        return NET_STATE_TYPE_UNKNOWN;
 }
 
-static int __net_handle_service_state_changed(DBusMessage *message,
+static int __net_handle_service_state_changed(const gchar *sig_path,
                const char *key, const char *state)
 {
        net_err_t Error = NET_ERR_NONE;
-       const char *sig_path = NULL;
        net_state_type_t old_state, new_state;
 
        net_event_info_t event_data = { 0, };
        net_device_t device_type = NET_DEVICE_UNKNOWN;
 
-       sig_path = dbus_message_get_path(message);
+       if (sig_path == NULL)
+               return Error;
 
        device_type = _net_get_tech_type_from_path(sig_path);
        if (device_type == NET_DEVICE_UNKNOWN)
@@ -525,8 +482,7 @@ static int string2error(const char *error)
        return NET_ERR_UNKNOWN;
 }
 
-static int __net_handle_service_set_error(DBusMessage *message,
-               const char *key, const char *error)
+static int __net_handle_service_set_error(const char *key, const char *error)
 {
        if (error == NULL || *error == '\0')
                return NET_ERR_NONE;
@@ -538,47 +494,18 @@ static int __net_handle_service_set_error(DBusMessage *message,
        return NET_ERR_NONE;
 }
 
-static int __net_handle_service_property_changed(DBusMessage *message)
-{
-       int Error = NET_ERR_NONE;
-       char *key = NULL;
-       char *value = NULL;
-
-       Error = __net_get_dbus_property_changed_basic(message,
-                                       &key, DBUS_TYPE_STRING, &value);
-       if (Error != NET_ERR_NONE)
-               return Error;
-
-       if (g_strcmp0(key, "State") == 0) {
-               Error = __net_handle_service_state_changed(message, key, value);
-       } else if (g_strcmp0(key, "Error") == 0) {
-               Error = __net_handle_service_set_error(message, key, value);
-       } else if (g_strcmp0(key, "Nameservers") == 0) {
-               /** Ignore - compared for future use */
-       } else if (g_strcmp0(key, "IPv4") == 0) {
-               /** Ignore - compared for future use */
-       } else if (g_strcmp0(key, "Ethernet") == 0) {
-               /** Ignore - compared for future use */
-       } else if (g_strcmp0(key, "Domains") == 0) {
-               /** Ignore - compared for future use */
-       } else if (g_strcmp0(key, "IPv4.Configuration") == 0) {
-               /** Ignore - compared for future use */
-       } else {
-               /** Ignore - compared for future use */
-       }
-
-       return Error;
-}
-
-static int __net_handle_scan_done(DBusMessage *message)
+static int __net_handle_scan_done(GVariant *param)
 {
        __NETWORK_FUNC_ENTER__;
 
        net_event_info_t event_data = { 0, };
 
-       if (request_table[NETWORK_REQUEST_TYPE_SPECIFIC_SCAN].flag == TRUE)
+       NETWORK_LOG(NETWORK_LOW, "ServiceChanged signal from ConnMan\n");
+
+       if (request_table[NETWORK_REQUEST_TYPE_SPECIFIC_SCAN].flag == TRUE) {
+               NETWORK_LOG(NETWORK_LOW, "Flag for specific scan is TRUE, so ignore this signal\n");
                return NET_ERR_NONE;
-       else if (request_table[NETWORK_REQUEST_TYPE_SCAN].flag == TRUE) {
+       else if (request_table[NETWORK_REQUEST_TYPE_SCAN].flag == TRUE) {
                memset(&request_table[NETWORK_REQUEST_TYPE_SCAN], 0,
                                sizeof(network_request_table_t));
 
@@ -603,67 +530,59 @@ static int __net_handle_scan_done(DBusMessage *message)
        return NET_ERR_NONE;
 }
 
-static DBusHandlerResult
-__net_signal_filter(DBusConnection* conn, DBusMessage* msg, void* user_data)
+static void __net_connman_service_signal_filter(GDBusConnection *conn,
+               const gchar *name, const gchar *path, const gchar *interface,
+               const gchar *sig, GVariant *param, gpointer user_data)
 {
-       if (msg == NULL)
-               return DBUS_HANDLER_RESULT_HANDLED;
+       const char *key = NULL;
+       const char *value = NULL;
+       GVariant *var;
 
-       if (dbus_message_is_signal(msg, CONNMAN_SERVICE_INTERFACE,
-                       SIGNAL_PROPERTY_CHANGED)) {
-               __net_handle_service_property_changed(msg);
+       if (g_strcmp0(sig, SIGNAL_PROPERTY_CHANGED) == 0) {
+               g_variant_get(param, "(sv)", &key, &var);
 
-               return DBUS_HANDLER_RESULT_HANDLED;
-       } else if (dbus_message_is_signal(msg, NETCONFIG_WIFI_INTERFACE,
-                       NETCONFIG_SIGNAL_POWERON_COMPLETED)) {
-               __net_handle_wifi_power_rsp(TRUE);
+               if (g_strcmp0(key, "State") == 0) {
+                       g_variant_get(var, "s", &value);
 
-               return DBUS_HANDLER_RESULT_HANDLED;
-       } else if (dbus_message_is_signal(msg, NETCONFIG_WIFI_INTERFACE,
-                       NETCONFIG_SIGNAL_POWEROFF_COMPLETED)) {
-               __net_handle_wifi_power_rsp(FALSE);
+                       __net_handle_service_state_changed(path, key, value);
+               } else if (g_strcmp0(key, "Error") == 0) {
+                       g_variant_get(var, "s", &value);
 
-               return DBUS_HANDLER_RESULT_HANDLED;
-       } else if (dbus_message_is_signal(msg, CONNMAN_MANAGER_INTERFACE,
-                       SIGNAL_PROPERTY_CHANGED)) {
-               /* reserved */
-       } else if (dbus_message_is_signal(msg, CONNMAN_MANAGER_INTERFACE,
-                       SIGNAL_TECHNOLOGY_ADDED)) {
-               /* reserved */
-       } else if (dbus_message_is_signal(msg, CONNMAN_MANAGER_INTERFACE,
-                       SIGNAL_TECHNOLOGY_REMOVED)) {
-               /* reserved */
-       } else if (dbus_message_is_signal(msg, CONNMAN_MANAGER_INTERFACE,
-                       SIGNAL_SERVICES_CHANGED)) {
-               /* reserved */
-       } else if (dbus_message_is_signal(msg, NETCONFIG_WIFI_INTERFACE,
-                       NETCONFIG_SIGNAL_SPECIFIC_SCAN_DONE)) {
-               __net_handle_wifi_specific_scan_rsp(msg);
-
-               return DBUS_HANDLER_RESULT_HANDLED;
-       } else if (dbus_message_is_signal(msg, SUPPLICANT_SERVICE_INTERFACE,
-                       SIGNAL_SCAN_DONE)) {
-               __net_handle_scan_done(msg);
-
-               return DBUS_HANDLER_RESULT_HANDLED;
-       } else if (dbus_message_is_signal(msg, SUPPLICANT_SERVICE_INTERFACE,
-                       SIGNAL_PROPERTIES_CHANGED)) {
-               /* reserved */
+                       __net_handle_service_set_error(key, value);
+               }
        }
-
-       return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 }
 
-static void __net_init_dbus_thread()
+static void __net_connman_manager_signal_filter(GDBusConnection *conn,
+               const gchar *name, const gchar *path, const gchar *interface,
+               const gchar *sig, GVariant *param, gpointer user_data)
 {
-       static dbus_bool_t init_required = TRUE;
+       if (g_strcmp0(sig, SIGNAL_SERVICES_CHANGED) == 0)
+               __net_handle_scan_done(param);
+}
 
-       if (init_required) {
-               dbus_g_thread_init();
-               init_required = FALSE;
+static void __net_supplicant_signal_filter(GDBusConnection *conn,
+               const gchar *name, const gchar *path, const gchar *interface,
+               const gchar *sig, GVariant *param, gpointer user_data)
+{
+       if (g_strcmp0(sig, SIGNAL_SCAN_DONE) == 0) {
+               NETWORK_LOG(NETWORK_HIGH, "ScanDone signal from wpasupplicant\n");
+       /*      __net_handle_scan_done(param); */
        }
 }
 
+static void __net_netconfig_signal_filter(GDBusConnection *conn,
+               const gchar *name, const gchar *path, const gchar *interface,
+               const gchar *sig, GVariant *param, gpointer user_data)
+{
+       if (g_strcmp0(sig, NETCONFIG_SIGNAL_POWERON_COMPLETED) == 0)
+               __net_handle_wifi_power_rsp(TRUE);
+       else if (g_strcmp0(sig, NETCONFIG_SIGNAL_POWEROFF_COMPLETED) == 0)
+               __net_handle_wifi_power_rsp(FALSE);
+       else if (g_strcmp0(sig, NETCONFIG_SIGNAL_SPECIFIC_SCAN_DONE) == 0)
+               __net_handle_wifi_specific_scan_rsp(param);
+}
+
 /*****************************************************************************
  *     Global Functions
  *****************************************************************************/
@@ -671,61 +590,37 @@ int _net_deregister_signal(void)
 {
        __NETWORK_FUNC_ENTER__;
 
-       DBusError err;
-       dbus_error_init(&err);
-
-       if (signal_conn == NULL) {
+       if (h_connection.signal_conn == NULL) {
                NETWORK_LOG(NETWORK_HIGH, "Already de-registered\n");
 
                __NETWORK_FUNC_EXIT__;
                return NET_ERR_NONE;
        }
 
-       dbus_bus_remove_match(signal_conn, CONNMAN_MANAGER_SIGNAL_FILTER, &err);
-       dbus_connection_flush(signal_conn);
-       if (dbus_error_is_set(&err)) {
-               NETWORK_LOG(NETWORK_ERROR, "Remove Match Error (%s)\n", err.message);
-               dbus_error_free(&err);
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
+       g_dbus_connection_signal_unsubscribe(h_connection.signal_conn,
+                                               h_connection.conn_id_connman);
+       g_dbus_connection_signal_unsubscribe(h_connection.signal_conn,
+                                               h_connection.conn_id_connman_manager);
+       g_dbus_connection_signal_unsubscribe(h_connection.signal_conn,
+                                               h_connection.conn_id_supplicant);
+       g_dbus_connection_signal_unsubscribe(h_connection.signal_conn,
+                                               h_connection.conn_id_netconfig);
 
-       dbus_bus_remove_match(signal_conn, CONNMAN_SERVICE_SIGNAL_FILTER, &err);
-       dbus_connection_flush(signal_conn);
-       if (dbus_error_is_set(&err)) {
-               NETWORK_LOG(NETWORK_ERROR, "Remove Match Error (%s)\n", err.message);
-               dbus_error_free(&err);
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
+       g_cancellable_cancel(h_connection.cancellable);
+       g_object_unref(h_connection.cancellable);
 
-       dbus_bus_remove_match(signal_conn, NETCONFIG_WIFI_FILTER, &err);
-       dbus_connection_flush(signal_conn);
-       if (dbus_error_is_set(&err)) {
-               NETWORK_LOG(NETWORK_ERROR, "Remove Match Error (%s)\n", err.message);
-               dbus_error_free(&err);
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
+       NETWORK_LOG(NETWORK_LOW, "Successfully remove signal filters\n");
 
-       dbus_bus_remove_match(signal_conn, SUPPLICANT_INTERFACE_SIGNAL_FILTER, &err);
-       dbus_connection_flush(signal_conn);
-       if (dbus_error_is_set(&err)) {
-               NETWORK_LOG(NETWORK_ERROR, "Remove Match Error (%s)\n", err.message);
-               dbus_error_free(&err);
-               __NETWORK_FUNC_EXIT__;
+       /* If DBusPendingCall remains, it should be released */
+       //_net_dbus_clear_pending_call();
+       if (g_dbus_connection_close_sync(h_connection.signal_conn, NULL, NULL) == FALSE) {
+               NETWORK_LOG(NETWORK_HIGH, "Failed to close dbus\n");
                return NET_ERR_UNKNOWN;
        }
 
-       dbus_connection_remove_filter(signal_conn, __net_signal_filter, NULL);
-       NETWORK_LOG(NETWORK_HIGH, "dbus_connection_remove_filter() successful\n");
-       NETWORK_LOG(NETWORK_LOW, "Successfully remove signal filters\n");
+       g_object_unref(h_connection.signal_conn);
 
-       /* If DBusPendingCall remains, it should be released */
-       _net_dbus_clear_pending_call();
-
-       dbus_connection_unref(signal_conn);
-       signal_conn = NULL;
+       NETWORK_LOG(NETWORK_LOW, "Successfully deregister \n");
 
        __NETWORK_FUNC_EXIT__;
        return NET_ERR_NONE;
@@ -735,72 +630,81 @@ int _net_register_signal(void)
 {
        __NETWORK_FUNC_ENTER__;
 
-       DBusConnection* conn = NULL;
-       DBusError err;
-
-       __net_init_dbus_thread();
+       gpointer dbus_connection;
+       GError *error = NULL;
+       gchar *addr;
 
-       dbus_error_init(&err);
+       g_type_init();
 
-       conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
-       if (conn == NULL) {
+       addr = g_dbus_address_get_for_bus_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
+       if (!addr) {
                NETWORK_LOG(NETWORK_ERROR,
-                               "Failed to connect to the D-BUS daemon: [%s]\n", err.message);
-               dbus_error_free(&err);
-
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
-
-       signal_conn = conn;
-
-       dbus_connection_setup_with_g_main(conn, NULL);
-
-       /** listening to messages from all objects as no path is specified */
-       /** see signals from the given interface */
-       dbus_bus_add_match(conn, CONNMAN_MANAGER_SIGNAL_FILTER, &err);
-       dbus_connection_flush(conn);
-       if (dbus_error_is_set(&err)) {
-               NETWORK_LOG(NETWORK_ERROR, "Add Match Error (%s)\n", err.message);
-               dbus_error_free(&err);
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
-
-       dbus_bus_add_match(conn, CONNMAN_SERVICE_SIGNAL_FILTER, &err);
-       dbus_connection_flush(conn);
-       if (dbus_error_is_set(&err)) {
-               NETWORK_LOG(NETWORK_ERROR, "Add Match Error (%s)\n", err.message);
-               dbus_error_free(&err);
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
-
-       dbus_bus_add_match(conn, NETCONFIG_WIFI_FILTER, &err);
-       dbus_connection_flush(conn);
-       if (dbus_error_is_set(&err)) {
-               NETWORK_LOG(NETWORK_ERROR, "Add Match Error (%s)\n", err.message);
-               dbus_error_free(&err);
-               __NETWORK_FUNC_EXIT__;
+                               "Failed to get D-BUS : [%s]\n", error->message);
+               g_error_free(error);
                return NET_ERR_UNKNOWN;
        }
 
-       dbus_bus_add_match(conn, SUPPLICANT_INTERFACE_SIGNAL_FILTER, &err);
-       dbus_connection_flush(conn);
-       if (dbus_error_is_set(&err)) {
-               NETWORK_LOG(NETWORK_ERROR, "Add Match Error (%s)\n", err.message);
-               dbus_error_free(&err);
-               __NETWORK_FUNC_EXIT__;
+       dbus_connection = g_dbus_connection_new_for_address_sync(addr,
+                       G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT |
+                       G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION,
+                       NULL, NULL, &error);
+       g_free(addr);
+       if (!dbus_connection) {
+               NETWORK_LOG(NETWORK_ERROR,
+                               "Failed to connect to the D-BUS daemon: [%s]\n", error->message);
+               g_error_free(error);
                return NET_ERR_UNKNOWN;
        }
 
-       if (dbus_connection_add_filter(conn, __net_signal_filter, NULL, NULL)
-                       == FALSE) {
-               NETWORK_LOG(NETWORK_ERROR, "dbus_connection_add_filter() failed\n");
-
-               __NETWORK_FUNC_EXIT__;
-               return NET_ERR_UNKNOWN;
-       }
+       h_connection.signal_conn = dbus_connection;
+       h_connection.cancellable = g_cancellable_new();
+
+       /* Create connman service connection */
+       h_connection.conn_id_connman = g_dbus_connection_signal_subscribe(dbus_connection,
+                                                       CONNMAN_SERVICE,
+                                                       CONNMAN_SERVICE_INTERFACE,
+                                                       NULL,
+                                                       NULL,
+                                                       NULL,
+                                                       G_DBUS_SIGNAL_FLAGS_NONE,
+                                                       __net_connman_service_signal_filter,
+                                                       NULL,
+                                                       NULL);
+
+       h_connection.conn_id_connman_manager = g_dbus_connection_signal_subscribe(dbus_connection,
+                                                       CONNMAN_SERVICE,
+                                                       CONNMAN_MANAGER_INTERFACE,
+                                                       NULL,
+                                                       NULL,
+                                                       NULL,
+                                                       G_DBUS_SIGNAL_FLAGS_NONE,
+                                                       __net_connman_manager_signal_filter,
+                                                       NULL,
+                                                       NULL);
+
+       /* Create supplicant service connection */
+       h_connection.conn_id_supplicant = g_dbus_connection_signal_subscribe(dbus_connection,
+                                                       SUPPLICANT_SERVICE,
+                                                       SUPPLICANT_SERVICE_INTERFACE,
+                                                       NULL,
+                                                       NULL,
+                                                       NULL,
+                                                       G_DBUS_SIGNAL_FLAGS_NONE,
+                                                       __net_supplicant_signal_filter,
+                                                       NULL,
+                                                       NULL);
+
+       /* Create net-config service connection */
+       h_connection.conn_id_netconfig = g_dbus_connection_signal_subscribe(dbus_connection,
+                                                       NETCONFIG_SERVICE,
+                                                       NETCONFIG_WIFI_INTERFACE,
+                                                       NULL,
+                                                       NETCONFIG_WIFI_PATH,
+                                                       NULL,
+                                                       G_DBUS_SIGNAL_FLAGS_NONE,
+                                                       __net_netconfig_signal_filter,
+                                                       NULL,
+                                                       NULL);
 
        NETWORK_LOG(NETWORK_LOW, "Successfully register signal filters\n");
 
index 7c2a1eb..73f5b5a 100644 (file)
@@ -236,7 +236,7 @@ EXPORT_API int net_wifi_power_on(void)
        if (NetworkInfo.wifi_state != WIFI_OFF) {
                NETWORK_LOG(NETWORK_ERROR, "Wi-Fi is powered on already!\n");
                __NETWORK_FUNC_EXIT__;
-               return NET_ERR_INVALID_OPERATION;
+               return NET_ERR_ALREADY_EXISTS;
        }
 
        if (request_table[NETWORK_REQUEST_TYPE_WIFI_POWER].flag == TRUE) {
@@ -287,7 +287,7 @@ EXPORT_API int net_wifi_power_off(void)
        if(NetworkInfo.wifi_state == WIFI_OFF) {
                NETWORK_LOG(NETWORK_ERROR, "Wi-Fi is powered off already!\n");
                __NETWORK_FUNC_EXIT__;
-               return NET_ERR_INVALID_OPERATION;
+               return NET_ERR_ALREADY_EXISTS;
        }
 
        if (request_table[NETWORK_REQUEST_TYPE_WIFI_POWER].flag == TRUE) {
index e5d6783..8e5affd 100644 (file)
@@ -26,7 +26,6 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
-#include <dbus/dbus.h>
 #include <network-cm-intf.h>
 #include <network-pm-intf.h>
 #include <network-wifi-intf.h>