Remove unnecessary information from wpa_supplicant mon 30/194830/1
authorYu <jiung.yu@samsung.com>
Fri, 7 Dec 2018 08:33:54 +0000 (17:33 +0900)
committerYu <jiung.yu@samsung.com>
Fri, 7 Dec 2018 08:35:13 +0000 (17:35 +0900)
Description: Connman can provide most of BSS and network
informations. Also, we don't use p2p and supplicant
specific information currently.

Change-Id: I9e4bf25cf2d505fc0f008570686dcedd5ed871d8
Signed-off-by: Yu Jiung <jiung.yu@samsung.com>
include/inm-supplicant.h
src/CMakeLists.txt
src/inm-supplicant-iface.c
src/inm-supplicant-internal.h
src/inm-supplicant.c

index 7e192a41e3901069c1106ca3380c89f928dd250e..385250634f848bf4d16e5ba2635d6324c5adae10 100644 (file)
@@ -56,43 +56,14 @@ typedef enum {
 
 typedef enum {
        IFACE_SIGNAL_SCANDONE,
-       IFACE_SIGNAL_BSSADDED,
-       IFACE_SIGNAL_BSSREMOVED,
-       IFACE_SIGNAL_BLOBADDED,
-       IFACE_SIGNAL_BLOBREMOVED,
-       IFACE_SIGNAL_NETWORKADDED,
-       IFACE_SIGNAL_NETWORKREMOVED,
-       IFACE_SIGNAL_NETWORKSELECTED,
        IFACE_SIGNAL_STAAUTHORIZED,
        IFACE_SIGNAL_STADEAUTHORIZED,
        IFACE_SIGNAL_PROPERTIESCHANGED,
-       IFACE_SIGNAL_CERTIFICATION,
-       IFACE_SIGNAL_EAP,
-       IFACE_SIGNAL_NETWORKREQUEST,
-       IFACE_SIGNAL_PROBEREQUEST,
+       IFACE_SIGNAL_WPS_EVENT,
+       IFACE_SIGNAL_WPS_CRED,
        IFACE_SIGNAL_MAX,
 } inm_supplicant_iface_signal_e;
 
-typedef struct {
-       /*
-        * BSSID of the BSS.
-        */
-       guchar bssid[BSSID_LEN];
-       /*
-        * SSID of the BSS.
-        */
-       gchar ssid[SSID_LEN + 1];
-       /*
-        * Frequency of the BSS in MHz.
-        */
-       guint16 frequency;
-
-       /*
-        * Signal strength of the BSS.
-        */
-       gint16 signal;
-} inm_supplicant_bss_s;
-
 typedef struct {
        guint pairwise;
        guint group;
@@ -126,18 +97,6 @@ typedef struct {
         * subscribing property changed signal of the technology.
         */
        guint subscriber_id[IFACE_SIGNAL_MAX];
-       /*
-        * BSS which wpa_supplicant is associated with.
-        */
-       gpointer current_bss;
-       /*
-        * configured network which wpa_supplicant uses at the moment
-        */
-       gpointer current_network;
-       /*
-        * List of BSSs known to the interface
-        */
-       GHashTable *bss_tbl;
        /*
         * Wi-Fi P2P properties of the interface
         */
index 7dbd3b17f312aebc76a3dc5661353a7da9eaecfe..f7cb596311bdeb0881e3ed756a29e7c3e0ec19a1 100644 (file)
@@ -52,9 +52,6 @@ SET(SRCS
        ${CMAKE_SOURCE_DIR}/src/inm-supplicant.c
        ${CMAKE_SOURCE_DIR}/src/inm-supplicant-iface.c
        ${CMAKE_SOURCE_DIR}/src/inm-supplicant-wps.c
-       ${CMAKE_SOURCE_DIR}/src/inm-supplicant-bss.c
-       ${CMAKE_SOURCE_DIR}/src/inm-supplicant-network.c
-       ${CMAKE_SOURCE_DIR}/src/inm-supplicant-p2p.c
        ${CMAKE_SOURCE_DIR}/src/inm-telephony.c
        ${CMAKE_SOURCE_DIR}/src/inm-wfd-manager.c
        ${CMAKE_SOURCE_DIR}/src/inm-mobileap.c
index b86ee2c661eb67da5a7dfe8460ba191d99dc2c36..3a433c99572f221ac697bb404fa044c88efdeaa7 100644 (file)
 #include "inm-supplicant.h"
 #include "inm-supplicant-internal.h"
 
-static void __handle_scan_done(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data);
-
-static void __handle_bss_added(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data);
-
-static void __handle_bss_removed(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data);
-
-static void __handle_blob_added(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data);
-
-static void __handle_blob_removed(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data);
-
-static void __handle_network_added(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data);
-
-static void __handle_network_removed(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data);
-
-static void __handle_network_selected(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data);
-
-static void __handle_sta_authorized(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data);
-
-static void __handle_sta_deauthorized(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data);
-
-static void __iface_properties_changed(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data);
-
-static void __handle_certification(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data);
-
-static void __handle_eap(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data);
-
-static void __handle_network_request(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data);
-
-static void __handle_probe_request(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data);
-
-static void __handle_wps_event(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data);
-
-static void __handle_wps_credentials(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data);
+DECLARE_DBUS_SIGNAL_HANDLER(handle_scan_done);
+DECLARE_DBUS_SIGNAL_HANDLER(handle_sta_authorized);
+DECLARE_DBUS_SIGNAL_HANDLER(handle_sta_deauthorized);
+DECLARE_DBUS_SIGNAL_HANDLER(iface_properties_changed);
+DECLARE_DBUS_SIGNAL_HANDLER(handle_wps_event);
+DECLARE_DBUS_SIGNAL_HANDLER(handle_wps_credentials);
+
+static inm_supplicant_iface_changed_callback g_iface_prop_changed_cb;
+static gpointer g_iface_prop_changed_cb_user_data;
+static GHashTable *g_supplicant_iface_tbl = NULL;
 
 static signal_param_s iface_signal_params[] = {
                {
@@ -165,69 +57,6 @@ static signal_param_s iface_signal_params[] = {
                        .callback = __handle_scan_done,
                        .subscriber_id  = 0,
                },
-               {
-                       .sender = SUPPLICANT_SERVICE,
-                       .interface_name = SUPPLICANT_IFACE_INTERFACE,
-                       .member = "BSSAdded",
-                       .object_path = NULL,
-                       .arg0 = NULL,
-                       .callback = __handle_bss_added,
-                       .subscriber_id  = 0,
-               },
-               {
-                       .sender = SUPPLICANT_SERVICE,
-                       .interface_name = SUPPLICANT_IFACE_INTERFACE,
-                       .member = "BSSRemoved",
-                       .object_path = NULL,
-                       .arg0 = NULL,
-                       .callback = __handle_bss_removed,
-                       .subscriber_id  = 0,
-               },
-               {
-                       .sender = SUPPLICANT_SERVICE,
-                       .interface_name = SUPPLICANT_IFACE_INTERFACE,
-                       .member = "BlobAdded",
-                       .object_path = NULL,
-                       .arg0 = NULL,
-                       .callback = __handle_blob_added,
-                       .subscriber_id  = 0,
-               },
-               {
-                       .sender = SUPPLICANT_SERVICE,
-                       .interface_name = SUPPLICANT_IFACE_INTERFACE,
-                       .member = "BlobRemoved",
-                       .object_path = NULL,
-                       .arg0 = NULL,
-                       .callback = __handle_blob_removed,
-                       .subscriber_id  = 0,
-               },
-               {
-                       .sender = SUPPLICANT_SERVICE,
-                       .interface_name = SUPPLICANT_IFACE_INTERFACE,
-                       .member = "NetworkAdded",
-                       .object_path = NULL,
-                       .arg0 = NULL,
-                       .callback = __handle_network_added,
-                       .subscriber_id  = 0,
-               },
-               {
-                       .sender = SUPPLICANT_SERVICE,
-                       .interface_name = SUPPLICANT_IFACE_INTERFACE,
-                       .member = "NetworkRemoved",
-                       .object_path = NULL,
-                       .arg0 = NULL,
-                       .callback = __handle_network_removed,
-                       .subscriber_id  = 0,
-               },
-               {
-                       .sender = SUPPLICANT_SERVICE,
-                       .interface_name = SUPPLICANT_IFACE_INTERFACE,
-                       .member = "NetworkSelected",
-                       .object_path = NULL,
-                       .arg0 = NULL,
-                       .callback = __handle_network_selected,
-                       .subscriber_id  = 0,
-               },
                {
                        .sender = SUPPLICANT_SERVICE,
                        .interface_name = SUPPLICANT_IFACE_INTERFACE,
@@ -255,42 +84,6 @@ static signal_param_s iface_signal_params[] = {
                        .callback = __iface_properties_changed,
                        .subscriber_id  = 0,
                },
-               {
-                       .sender = SUPPLICANT_SERVICE,
-                       .interface_name = SUPPLICANT_IFACE_INTERFACE,
-                       .member = "Certification",
-                       .object_path = NULL,
-                       .arg0 = NULL,
-                       .callback = __handle_certification,
-                       .subscriber_id  = 0,
-               },
-               {
-                       .sender = SUPPLICANT_SERVICE,
-                       .interface_name = SUPPLICANT_IFACE_INTERFACE,
-                       .member = "EAP",
-                       .object_path = NULL,
-                       .arg0 = NULL,
-                       .callback = __handle_eap,
-                       .subscriber_id  = 0,
-               },
-               {
-                       .sender = SUPPLICANT_SERVICE,
-                       .interface_name = SUPPLICANT_IFACE_INTERFACE,
-                       .member = "NetworkRequest",
-                       .object_path = NULL,
-                       .arg0 = NULL,
-                       .callback = __handle_network_request,
-                       .subscriber_id  = 0,
-               },
-               {
-                       .sender = SUPPLICANT_SERVICE,
-                       .interface_name = SUPPLICANT_IFACE_INTERFACE,
-                       .member = "ProbeRequest",
-                       .object_path = NULL,
-                       .arg0 = NULL,
-                       .callback = __handle_probe_request,
-                       .subscriber_id  = 0,
-               },
                {
                        .sender = SUPPLICANT_SERVICE,
                        .interface_name = SUPPLICANT_IFACE_WPS,
@@ -311,26 +104,6 @@ static signal_param_s iface_signal_params[] = {
                },
 };
 
-static method_param_s get_iface_property_method_param = {
-               .bus_name = SUPPLICANT_SERVICE,
-               .object_path = NULL,
-               .interface_name = DBUS_PROPERTIES_INTERFACE,
-               .method_name = DBUS_PROPERTIES_METHOD_GETALL,
-               .parameters = NULL,
-};
-
-static method_param_s signal_poll_method_param = {
-               .bus_name = SUPPLICANT_SERVICE,
-               .object_path = NULL,
-               .interface_name = SUPPLICANT_IFACE_INTERFACE,
-               .method_name = "SignalPoll",
-               .parameters = NULL,
-};
-
-inm_supplicant_iface_changed_callback g_iface_prop_changed_cb;
-gpointer g_iface_prop_changed_cb_user_data;
-GHashTable *g_supplicant_iface_tbl = NULL;
-
 static inline int __subscribe_iface_signal(const gchar *path, inm_supplicant_iface_s *iface_data)
 {
        int ret = INM_GDBUS_ERROR_NONE;
@@ -343,7 +116,7 @@ static inline int __subscribe_iface_signal(const gchar *path, inm_supplicant_ifa
        }
 
        INM_LOGI("path [%s]", path);
-       for (signal_idx = IFACE_SIGNAL_SCANDONE; signal_idx < IFACE_SIGNAL_MAX; signal_idx++) {
+       for (signal_idx = IFACE_SIGNAL_SCANDONE; signal_idx < IFACE_SIGNAL_MAX; ++signal_idx) {
                iface_signal_params[signal_idx].object_path = path;
                ret = inm_gdbus_subscribe_signal(&(iface_signal_params[signal_idx]));
                if (ret != INM_GDBUS_ERROR_NONE)
@@ -368,7 +141,7 @@ static inline int __unsubscribe_iface_signal(inm_supplicant_iface_s *iface_data)
                return INM_SUPPLICANT_ERROR_INVALID_PARAM;
        }
 
-       for (signal_idx = IFACE_SIGNAL_SCANDONE; signal_idx < IFACE_SIGNAL_PROBEREQUEST; signal_idx++) {
+       for (signal_idx = IFACE_SIGNAL_SCANDONE; signal_idx < IFACE_SIGNAL_MAX; ++signal_idx) {
 
                if (iface_data->subscriber_id[signal_idx] == 0)
                        continue;
@@ -390,10 +163,6 @@ static void __destroy_iface_data(gpointer data)
        inm_supplicant_iface_s *iface_data = (inm_supplicant_iface_s *)data;
        __INM_FUNC_ENTER__;
 
-       g_hash_table_remove_all(iface_data->bss_tbl);
-       g_hash_table_unref(iface_data->bss_tbl);
-       iface_data->bss_tbl = NULL;
-
        __unsubscribe_iface_signal(iface_data);
 
        g_free(iface_data);
@@ -652,65 +421,12 @@ static inline void __get_iface_ifname(GVariant *value, inm_supplicant_iface_s *i
        g_strlcpy(iface->Ifname, str, IFNAME_MAX + 1);
 }
 
-static inline void __get_iface_current_bss(GVariant *value, inm_supplicant_iface_s *iface)
+static inline void __get_iface_disconnect_reason(GVariant *value, inm_supplicant_iface_s *iface)
 {
-       const gchar *path = NULL;
-       gpointer bss = NULL;
-       __INM_FUNC_ENTER__;
-
-       g_variant_get(value, "&o", &path);
-       if (!path)
-               return;
-
-       if (g_strcmp0(path, "/") == 0) {
-               INM_LOGI("Null path");
-               iface->current_bss = NULL;
-               return;
-       }
-
-       bss = g_hash_table_lookup(iface->bss_tbl, path);
-       if (bss)
-               iface->current_bss = bss;
-       else
-               iface->current_bss = NULL;
-
-       __INM_FUNC_EXIT__;
-}
-
-static inline void __get_iface_bsss(GVariant *value, inm_supplicant_iface_s *iface)
-{
-       GVariantIter *iter = NULL;
-       const gchar *obj = NULL;
-
-       g_variant_get(value, "ao", &iter);
-       if (!iter || !iface) {
-               INM_LOGW("Invalid params");
-               __INM_FUNC_EXIT__;
-               return;
-       }
-
-       while (g_variant_iter_loop(iter, "o", &obj))
-               inm_supplicant_bss_add_by_path(obj, iface->bss_tbl);
-
-       g_variant_iter_free(iter);
-}
+       int reason;
 
-static inline void __get_iface_current_network(GVariant *value, inm_supplicant_iface_s *iface)
-{
-       const gchar *obj = NULL;
-
-       g_variant_get(value, "&o", &obj);
-
-       g_free(iface->current_network);
-       iface->current_network = NULL;
-
-       if (g_strcmp0(obj, "/") == 0) {
-               INM_LOGI("Null path");
-               return;
-       }
-
-       inm_supplicant_network_add_by_path(obj, &(iface->current_network));
-       return;
+       g_variant_get(value, "i", &reason);
+       PRINT_LOG("<WPA event:Disconnect reason %d>", reason);
 }
 
 static inline void __get_iface_property(const gchar *key, GVariant *value, inm_supplicant_iface_s *iface)
@@ -723,45 +439,8 @@ static inline void __get_iface_property(const gchar *key, GVariant *value, inm_s
                __get_iface_scanning(value, iface);
        else if (g_strcmp0(key, "Ifname") == 0)
                __get_iface_ifname(value, iface);
-       else if (g_strcmp0(key, "CurrentBSS") == 0)
-               __get_iface_current_bss(value, iface);
-       else if (g_strcmp0(key, "BSSs") == 0)
-               __get_iface_bsss(value, iface);
-       else if (g_strcmp0(key, "CurrentNetwork") == 0)
-               __get_iface_current_network(value, iface);
-/*
-       else if (g_strcmp0(key, "CurrentAuthMode") == 0)
-               __get_iface_current_auth_mode(value, iface);
-       else if (g_strcmp0(key, "Blobs") == 0)
-               __get_iface_blobs(value, iface);
-       else if (g_strcmp0(key, "Networks") == 0)
-               __get_iface_networks(value, iface);
-*/
-}
-
-static inline void __get_iface_property_without_bss(const gchar *key, GVariant *value, inm_supplicant_iface_s *iface)
-{
-       INM_LOGI("Prop %s", key);
-       if (g_strcmp0(key, "Capabilities") == 0)
-               __get_iface_capabilities(value, iface);
-       else if (g_strcmp0(key, "State") == 0)
-               __get_iface_state(value, iface);
-       else if (g_strcmp0(key, "Scanning") == 0)
-               __get_iface_scanning(value, iface);
-       else if (g_strcmp0(key, "Ifname") == 0)
-               __get_iface_ifname(value, iface);
-       else if (g_strcmp0(key, "CurrentBSS") == 0)
-               __get_iface_current_bss(value, iface);
-       else if (g_strcmp0(key, "CurrentNetwork") == 0)
-               __get_iface_current_network(value, iface);
-/*
-       else if (g_strcmp0(key, "CurrentAuthMode") == 0)
-               __get_iface_current_auth_mode(value, iface);
-       else if (g_strcmp0(key, "Blobs") == 0)
-               __get_iface_blobs(value, iface);
-       else if (g_strcmp0(key, "Networks") == 0)
-               __get_iface_networks(value, iface);
-*/
+       else if (g_strcmp0(key, "DisconnectReason") == 0)
+               __get_iface_disconnect_reason(value, iface);
 }
 
 void __get_iface_properties(GVariant *value, gpointer user_data)
@@ -787,341 +466,37 @@ void __get_iface_properties(GVariant *value, gpointer user_data)
        return;
 }
 
-void __get_iface_properties_without_bss(GVariant *value, gpointer user_data)
-{
-       GVariantIter *iter = NULL;
-       const gchar *key = NULL;
-       GVariant *var = NULL;
-       inm_supplicant_iface_s *iface = NULL;
-
-       if (!value || !user_data)
-               return;
-
-       g_variant_get(value, "(a{sv})", &iter);
-       if (!iter) {
-               INM_LOGI("null iter!");
-               return;
-       }
-
-       iface = (inm_supplicant_iface_s *)user_data;
-       while (g_variant_iter_loop(iter, "{sv}", &key, &var))
-               __get_iface_property_without_bss(key, var, iface);
-
-       g_variant_iter_free(iter);
-
-       return;
-}
-static void __handle_scan_done(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data)
-{
-       __INM_FUNC_ENTER__;
-
-       __INM_FUNC_EXIT__;
-       return;
-}
-
-static void __handle_bss_added(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data)
-{
-       inm_supplicant_iface_s *iface = NULL;
-       GVariantIter *iter = NULL;
-       const gchar *path = NULL;
-       gint ret = 0;
-       __INM_FUNC_ENTER__;
-
-       g_variant_get(parameters, "(oa{sv})", &path, &iter);
-       if (!path || !iter) {
-               __INM_FUNC_EXIT__;
-               return;
-       }
-
-       iface = g_hash_table_lookup(g_supplicant_iface_tbl, object_path);
-       if (!iface) {
-               __INM_FUNC_EXIT__;
-               INM_LOGI("iface not found");
-               return;
-       }
-
-       ret = inm_supplicant_bss_add(path, iter, iface->bss_tbl);
-       if (ret < 0) {
-               __INM_FUNC_EXIT__;
-               INM_LOGI("inm_supplicant_bss_add failed");
-               return;
-       }
-
-       __INM_FUNC_EXIT__;
-       return;
-}
-
-static void __handle_bss_removed(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data)
-{
-       __INM_FUNC_ENTER__;
-       inm_supplicant_iface_s *iface = NULL;
-       const gchar *path = NULL;
-       gint ret = 0;
-       __INM_FUNC_ENTER__;
-
-       g_variant_get(parameters, "(o)", &path);
-       if (!path) {
-               __INM_FUNC_EXIT__;
-               return;
-       }
-
-       iface = g_hash_table_lookup(g_supplicant_iface_tbl, object_path);
-       if (!iface) {
-               __INM_FUNC_EXIT__;
-               INM_LOGI("iface not found");
-               return;
-       }
-
-       ret = inm_supplicant_bss_remove(path, iface->bss_tbl);
-       if (ret < 0) {
-               __INM_FUNC_EXIT__;
-               INM_LOGI("inm_supplicant_bss_remove failed");
-               return;
-       }
-
-       __INM_FUNC_EXIT__;
-       return;
-}
-
-static void __handle_blob_added(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data)
-{
-       __INM_FUNC_ENTER__;
-
-       __INM_FUNC_EXIT__;
-       return;
-}
-
-static void __handle_blob_removed(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data)
-{
-       __INM_FUNC_ENTER__;
-
-       __INM_FUNC_EXIT__;
-       return;
-}
-
-static void __handle_network_added(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data)
-{
-       __INM_FUNC_ENTER__;
-
-       __INM_FUNC_ENTER__;
-       inm_supplicant_iface_s *iface = NULL;
-       GVariantIter *iter = NULL;
-       const gchar *path = NULL;
-       gint ret = 0;
-       __INM_FUNC_ENTER__;
-
-       g_variant_get(parameters, "(oa{sv})", &path, &iter);
-       if (!path || !iter) {
-               __INM_FUNC_EXIT__;
-               return;
-       }
-
-       iface = g_hash_table_lookup(g_supplicant_iface_tbl, object_path);
-       if (!iface) {
-               __INM_FUNC_EXIT__;
-               INM_LOGI("iface not found");
-               return;
-       }
-
-       ret = inm_supplicant_network_add(path, iter, &(iface->current_network));
-       if (ret < 0) {
-               __INM_FUNC_EXIT__;
-               INM_LOGI("inm_supplicant_network_add failed");
-               return;
-       }
-
-       __INM_FUNC_EXIT__;
-       return;
-}
-
-static void __handle_network_removed(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data)
-{
-       __INM_FUNC_ENTER__;
-       inm_supplicant_iface_s *iface = NULL;
-       const gchar *path = NULL;
-       gint ret = 0;
-       __INM_FUNC_ENTER__;
-
-       g_variant_get(parameters, "(o)", &path);
-       if (!path) {
-               __INM_FUNC_EXIT__;
-               return;
-       }
-
-       iface = g_hash_table_lookup(g_supplicant_iface_tbl, object_path);
-       if (!iface) {
-               __INM_FUNC_EXIT__;
-               INM_LOGI("iface not found");
-               return;
-       }
-
-       ret = inm_supplicant_network_remove(path, iface->current_network);
-       if (ret < 0) {
-               __INM_FUNC_EXIT__;
-               INM_LOGI("inm_supplicant_network_remove failed");
-               return;
-       }
-       iface->current_network = NULL;
-
-       __INM_FUNC_EXIT__;
-       return;
-}
-
-static void __handle_network_selected(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data)
-{
-       __INM_FUNC_ENTER__;
-       inm_supplicant_iface_s *iface = NULL;
-       const gchar *path = NULL;
-       gint ret = 0;
-
-       g_variant_get(parameters, "(o)", &path);
-       if (!path) {
-               __INM_FUNC_EXIT__;
-               return;
-       }
-
-       iface = g_hash_table_lookup(g_supplicant_iface_tbl, object_path);
-       if (!iface) {
-               __INM_FUNC_EXIT__;
-               INM_LOGI("iface not found");
-               return;
-       }
-
-       ret = inm_supplicant_network_select(path, iface->current_network);
-       if (ret < 0) {
-               __INM_FUNC_EXIT__;
-               INM_LOGI("inm_supplicant_network_select failed");
-               return;
-       }
-
-       __INM_FUNC_EXIT__;
-       return;
-}
-
-static void __handle_sta_authorized(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data)
+DECLARE_DBUS_SIGNAL_HANDLER(handle_scan_done)
 {
        __INM_FUNC_ENTER__;
 
-       __INM_FUNC_EXIT__;
-       return;
-}
-
-static void __handle_sta_deauthorized(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data)
-{
-       __INM_FUNC_ENTER__;
+       PRINT_STR("<WPA event:Scan done>");
 
        __INM_FUNC_EXIT__;
        return;
 }
 
-static void __handle_certification(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data)
+DECLARE_DBUS_SIGNAL_HANDLER(handle_sta_authorized)
 {
        __INM_FUNC_ENTER__;
 
-       __INM_FUNC_EXIT__;
-       return;
-}
-
-static void __handle_eap(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data)
-{
-       __INM_FUNC_ENTER__;
+       PRINT_STR("<WPA event:Sta authorized>");
 
        __INM_FUNC_EXIT__;
        return;
 }
 
-static void __handle_network_request(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data)
+DECLARE_DBUS_SIGNAL_HANDLER(handle_sta_deauthorized)
 {
        __INM_FUNC_ENTER__;
 
-       __INM_FUNC_EXIT__;
-       return;
-}
-
-static void __handle_probe_request(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data)
-{
-       __INM_FUNC_ENTER__;
+       PRINT_STR("<WPA event:Sta deauthorized>");
 
        __INM_FUNC_EXIT__;
        return;
 }
 
-static void __handle_wps_event(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data)
+DECLARE_DBUS_SIGNAL_HANDLER(handle_wps_event)
 {
        __INM_FUNC_ENTER__;
 
@@ -1143,12 +518,7 @@ static void __handle_wps_event(const gchar *sender_name,
        return;
 }
 
-static void __handle_wps_credentials(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data)
+DECLARE_DBUS_SIGNAL_HANDLER(handle_wps_credentials)
 {
        __INM_FUNC_ENTER__;
 
@@ -1158,12 +528,7 @@ static void __handle_wps_credentials(const gchar *sender_name,
        return;
 }
 
-static void __iface_properties_changed(const gchar *sender_name,
-               const gchar *object_path,
-               const gchar *interface_name,
-               const gchar *signal,
-               GVariant *parameters,
-               gpointer user_data)
+DECLARE_DBUS_SIGNAL_HANDLER(iface_properties_changed)
 {
        inm_supplicant_iface_s *iface = NULL;
        inm_supplicant_iface_property_e changed = INM_SUPPLICANT_IFACE_PROPERTY_NONE;
@@ -1183,7 +548,7 @@ static void __iface_properties_changed(const gchar *sender_name,
        scanning = iface->scanning;
 
        if (parameters)
-               __get_iface_properties_without_bss(parameters, iface);
+               __get_iface_properties(parameters, iface);
 
        if (iface->state == IFACE_STATE_COMPLETED)
                inm_supplicant_iface_signal_poll(object_path);
@@ -1207,17 +572,6 @@ static inline int __init_iface(const gchar *path, inm_supplicant_iface_s *iface)
        gchar *key = NULL;
        gint ret = 0;
        __INM_FUNC_ENTER__;
-       iface->bss_tbl = g_hash_table_new_full(g_str_hash,
-                       g_str_equal,
-                       g_free,
-                       inm_supplicant_bss_destroy
-                       );
-
-       if (!iface->bss_tbl) {
-               INM_LOGI("Error! Failed to allocate bss tbl");
-               __INM_FUNC_EXIT__;
-               return -1;
-       }
 
        key = g_strdup(path);
        if (g_hash_table_replace(g_supplicant_iface_tbl, key, iface))
@@ -1231,10 +585,6 @@ static inline int __init_iface(const gchar *path, inm_supplicant_iface_s *iface)
                return -1;
        }
 
-       ret = inm_supplicant_p2p_init(path, &(iface->p2p));
-       if (ret != INM_GDBUS_ERROR_NONE)
-               INM_LOGI("inm_supplicant_p2p_init failed");
-
        return 0;
 }
 
@@ -1295,11 +645,6 @@ int inm_supplicant_iface_remove(const gchar *path)
                return INM_SUPPLICANT_ERROR_OPERATION_FAILED;
        }
 
-       ret = inm_supplicant_p2p_deinit(iface->p2p);
-       if (ret != INM_SUPPLICANT_ERROR_NONE)
-               INM_LOGI("inm_supplicant_p2p_deinit failed");
-       iface->p2p = NULL;
-
        g_hash_table_remove(g_supplicant_iface_tbl, path);
 
        __INM_FUNC_EXIT__;
@@ -1311,6 +656,14 @@ static inline void __dbus_get_iface_properties(const gchar *path, inm_supplicant
        int ret = INM_GDBUS_ERROR_NONE;
        __INM_FUNC_ENTER__;
 
+       method_param_s get_iface_property_method_param = {
+                       .bus_name = SUPPLICANT_SERVICE,
+                       .object_path = NULL,
+                       .interface_name = DBUS_PROPERTIES_INTERFACE,
+                       .method_name = DBUS_PROPERTIES_METHOD_GETALL,
+                       .parameters = NULL,
+       };
+
        get_iface_property_method_param.object_path = path;
        get_iface_property_method_param.parameters = g_variant_new("(s)",
                        SUPPLICANT_IFACE_INTERFACE);
@@ -1352,6 +705,15 @@ int inm_supplicant_iface_signal_poll(const gchar *path)
                return INM_SUPPLICANT_ERROR_INVALID_PARAM;
        }
 
+
+       method_param_s signal_poll_method_param = {
+                       .bus_name = SUPPLICANT_SERVICE,
+                       .object_path = NULL,
+                       .interface_name = SUPPLICANT_IFACE_INTERFACE,
+                       .method_name = "SignalPoll",
+                       .parameters = NULL,
+       };
+
        signal_poll_method_param.object_path = path;
 
        ret = inm_gdbus_method_call(&signal_poll_method_param,
index d1c93feb4ec6c5630d4582a602a0189dd834fe13..e9350281f48cd65986d94ddad193b64bb8b83b53 100644 (file)
@@ -41,28 +41,6 @@ extern "C" {
 #define SUPPLICANT_IFACE_BSS                   SUPPLICANT_INTERFACE ".BSS"
 #define SUPPLICANT_IFACE_NETWORK               SUPPLICANT_INTERFACE ".NETWORK"
 
-typedef enum {
-       EAP_METHOD_UNKNOWN = 0x00,
-       EAP_METHOD_MD5 = 0x01,
-       EAP_METHOD_TLS = 0x02,
-       EAP_METHOD_MSCHPV2 = 0x04,
-       EAP_METHOD_PEAP = 0x08,
-       EAP_METHOD_TTLS = 0x10,
-       EAP_METHOD_GTC = 0x20,
-       EAP_METHOD_OTP = 0x40,
-       EAP_METHOD_LEAP = 0x80,
-       EAP_METHOD_WSC = 0x100,
-} supplicant_eap_method_e;
-
-typedef enum {
-
-       CAPABILITY_UNKNOWN = 0x00,
-       CAPABILITY_AP = 0x01,
-       CAPABILITY_IBSS_RSN = 0x02,
-       CAPABILITY_P2P = 0x04,
-       CAPABILITY_INTERWORKING = 0x08,
-} supplicant_capability_e;
-
 typedef enum {
        PAIRWISE_CAP_NONE = 0x01,
        PAIRWISE_CAP_CCMP = 0x02,
@@ -144,9 +122,6 @@ typedef enum {
        P2P_ROLE_GO,
 } p2p_role_e;
 
-int inm_supplicant_get_eap_methods(unsigned int *eap_methods);
-int inm_supplicant_get_capabilities(unsigned int *capabilities);
-int inm_supplicant_get_wfd_ies(unsigned char *ies, unsigned int *length);
 int inm_supplicant_iface_state_changed(inm_supplicant_iface_s *iface);
 
 int inm_supplicant_iface_init();
@@ -159,20 +134,6 @@ int inm_supplicant_iface_signal_poll(const gchar *path);
 void inm_supplicant_wps_handle_event_signal(const gchar *event, GVariantIter *iter);
 void inm_supplicant_wps_handle_event_credentials(GVariant *credentials);
 
-int inm_supplicant_bss_add(const gchar *path, GVariantIter *iter, GHashTable *bss_tbl);
-int inm_supplicant_bss_add_by_path(const gchar *path, GHashTable *bss_tbl);
-int inm_supplicant_bss_remove(const gchar *path, GHashTable *bss_tbls);
-void inm_supplicant_bss_destroy(gpointer data);
-
-int inm_supplicant_network_add(const gchar *path, GVariantIter *iter, gpointer *network);
-int inm_supplicant_network_add_by_path(const gchar *path, gpointer *network);
-int inm_supplicant_network_remove(const gchar *path, gpointer network);
-int inm_supplicant_network_select(const gchar *path, gpointer network);
-void inm_supplicant_network_destroy(gpointer data);
-
-int inm_supplicant_p2p_init(const gchar *path, gpointer *p2p);
-int inm_supplicant_p2p_deinit(gpointer p2p);
-
 #ifdef __cplusplus
 }
 #endif
index 7b87d2726ce3db2f07924f6be7cdd9bd2114eae3..95923c3c1bd594697ec8526928ec80be1e9eb114 100644 (file)
@@ -45,54 +45,17 @@ typedef enum {
        SIGNAL_IFACE_ADDED,
        SIGNAL_IFACE_REMOVED,
        SIGNAL_PROP_CHANGED,
-       SIGNAL_NAME_OWNER_CHANGED,
        SIGNAL_MAX,
 
 } supplicant_signal_e;
 
-typedef struct {
-       gboolean is_initialized;
-       guint eap_methods;
-       guint capabilities;
-       guchar ies[WFDIE_SUBELEM_LEN_DEV_INFO + 3];
-
-} supplicant_mon_s;
-
-supplicant_mon_s supplicant_mon;
-
-void __iface_added(
-               const gchar *sender_name,
-        const gchar *object_path,
-        const gchar *interface_name,
-        const gchar *signal_name,
-        GVariant *parameters,
-        gpointer user_data);
-
-void __iface_removed(
-               const gchar *sender_name,
-        const gchar *object_path,
-        const gchar *interface_name,
-        const gchar *signal_name,
-        GVariant *parameters,
-        gpointer user_data);
-
-void __supplicant_properties_changed(
-               const gchar *sender_name,
-        const gchar *object_path,
-        const gchar *interface_name,
-        const gchar *signal_name,
-        GVariant *parameters,
-        gpointer user_data);
-
-static void __name_owner_changed_cb(
-               const gchar *sender_name,
-        const gchar *object_path,
-        const gchar *interface_name,
-        const gchar *signal_name,
-        GVariant *parameters,
-        gpointer user_data);
-
-static signal_param_s signal_param[] = {
+static gboolean is_initialized = FALSE;
+
+static DECLARE_DBUS_SIGNAL_HANDLER(iface_added);
+static DECLARE_DBUS_SIGNAL_HANDLER(iface_removed);
+static DECLARE_DBUS_SIGNAL_HANDLER(supplicant_properties_changed);
+
+signal_param_s signal_param[] = {
                {
                                .sender = SUPPLICANT_SERVICE,
                                .interface_name = SUPPLICANT_INTERFACE,
@@ -120,82 +83,8 @@ static signal_param_s signal_param[] = {
                                .callback = __supplicant_properties_changed,
                                .subscriber_id  = 0,
                },
-               {
-                               .sender = DBUS_SERVICE_DBUS,
-                               .interface_name = DBUS_INTERFACE_DBUS,
-                               .member = DBUS_SIGNAL_NAME_CHANGED,
-                               .object_path = NULL,
-                               .arg0 = SUPPLICANT_SERVICE,
-                               .callback = __name_owner_changed_cb,
-                               .subscriber_id  = 0,
-               },
-};
-
-static method_param_s get_supplicant_property_method_param = {
-               .bus_name = SUPPLICANT_SERVICE,
-               .object_path = SUPPLICANT_PATH,
-               .interface_name = DBUS_PROPERTIES_INTERFACE,
-               .method_name = DBUS_PROPERTIES_METHOD_GETALL,
-               .parameters = NULL,
 };
 
-static gboolean __unpack_ays(unsigned char *dst, GVariant *src, int size)
-{
-       GVariantIter *iter = NULL;
-       int length = 0;
-       int res = FALSE;
-
-       if (!dst || !src || size == 0) {
-               INM_LOGW("Invalid parameter");
-               return FALSE;
-       }
-
-       g_variant_get(src, "ay", &iter);
-       if (iter == NULL) {
-               INM_LOGW("failed to get iterator");
-               return FALSE;
-       }
-
-       while (g_variant_iter_loop(iter, "y", &dst[length])) {
-               length++;
-               if (length >= size)
-                       break;
-       }
-       g_variant_iter_free(iter);
-
-       if (length < size) {
-               INM_LOGW("array is shorter than size");
-               res = FALSE;
-       }
-
-       return res;
-}
-
-static void __name_owner_changed_cb(
-               const gchar *sender_name,
-        const gchar *object_path,
-        const gchar *interface_name,
-        const gchar *signal_name,
-        GVariant *parameters,
-        gpointer user_data)
-{
-       gchar *name = NULL;
-       gchar *old = NULL;
-       gchar *new = NULL;
-       __INM_FUNC_ENTER__;
-
-       if (parameters == NULL)
-               return;
-
-       g_variant_get(parameters, "(&s&s&s)", &name, &old, &new);
-
-       if (g_strcmp0(name, SUPPLICANT_SERVICE) == 0 && *new == '\0')
-               INM_LOGI("Supplicant destroyed: name %s, old %s, new %s", name, old, new);
-
-       __INM_FUNC_EXIT__;
-       return;
-}
-
 static inline void __get_supplicant_interface(GVariant *value)
 {
        GVariantIter *iter = NULL;
@@ -211,78 +100,12 @@ static inline void __get_supplicant_interface(GVariant *value)
        __INM_FUNC_EXIT__;
 }
 
-static inline void __get_supplicant_eap_method(GVariant *value, supplicant_mon_s *supp)
-{
-       GVariantIter *iter = NULL;
-       const gchar *method = NULL;
-       __INM_FUNC_ENTER__;
-
-       g_variant_get(value, "as", &iter);
-
-       supp->eap_methods = EAP_METHOD_UNKNOWN;
-       while (g_variant_iter_loop(iter, "s", &method)) {
-               /* Check Type of DNS Address */
-               if (g_strcmp0(method, "MD5") == 0)
-                       supp->eap_methods |= CAPABILITY_AP;
-               else if (g_strcmp0(method, "TLS") == 0)
-                       supp->eap_methods |= EAP_METHOD_TLS;
-               else if (g_strcmp0(method, "MSCHAPV2") == 0)
-                       supp->eap_methods |= EAP_METHOD_MSCHPV2;
-               else if (g_strcmp0(method, "PEAP") == 0)
-                       supp->eap_methods |= EAP_METHOD_PEAP;
-               else if (g_strcmp0(method, "TTLS") == 0)
-                       supp->eap_methods |= EAP_METHOD_TTLS;
-               else if (g_strcmp0(method, "GTC") == 0)
-                       supp->eap_methods |= EAP_METHOD_GTC;
-               else if (g_strcmp0(method, "OTP") == 0)
-                       supp->eap_methods |= EAP_METHOD_OTP;
-               else if (g_strcmp0(method, "LEAP") == 0)
-                       supp->eap_methods |= EAP_METHOD_LEAP;
-               else if (g_strcmp0(method, "WSC") == 0)
-                       supp->eap_methods |= EAP_METHOD_WSC;
-       }
-       g_variant_iter_free(iter);
-       __INM_FUNC_EXIT__;
-}
-
-static inline void __get_supplicant_capability(GVariant *value, supplicant_mon_s *supp)
-{
-       GVariantIter *iter = NULL;
-       const gchar *cap = NULL;
-       __INM_FUNC_ENTER__;
-
-       g_variant_get(value, "as", &iter);
-
-       supp->capabilities = CAPABILITY_UNKNOWN;
-       while (g_variant_iter_loop(iter, "s", &cap)) {
-               /* Check Type of DNS Address */
-               if (g_strcmp0(cap, "ap") == 0)
-                       supp->capabilities |= CAPABILITY_AP;
-               else if (g_strcmp0(cap, "ibss-rsn") == 0)
-                       supp->capabilities |= CAPABILITY_IBSS_RSN ;
-               else if (g_strcmp0(cap, "p2p") == 0)
-                       supp->capabilities |= CAPABILITY_P2P ;
-               else if (g_strcmp0(cap, "interworking") == 0)
-                       supp->capabilities |= CAPABILITY_INTERWORKING  ;
-       }
-       g_variant_iter_free(iter);
-       __INM_FUNC_EXIT__;
-}
-
-void __get_supplicant_property(gchar *key, GVariant *value, supplicant_mon_s *supp)
+void __get_supplicant_property(gchar *key, GVariant *value)
 {
        __INM_FUNC_ENTER__;
 
        if (g_strcmp0(key, "Interfaces") == 0)
                __get_supplicant_interface(value);
-       else if (g_strcmp0(key, "EapMethods") == 0)
-               __get_supplicant_eap_method(value, supp);
-       else if (g_strcmp0(key, "Capabilities") == 0)
-               __get_supplicant_capability(value, supp);
-       else if (g_strcmp0(key, "WFDIEs") == 0)
-               if (__unpack_ays(supp->ies, value, WFDIE_SUBELEM_LEN_DEV_INFO + 3)) {
-                       INM_LOGI("WFDIEs valid");
-       }
 
        __INM_FUNC_EXIT__;
 }
@@ -292,10 +115,9 @@ void __get_supplicant_properties(GVariant *value, void *user_data)
        GVariantIter *iter = NULL;
        gchar *key = NULL;
        GVariant *var = NULL;
-       supplicant_mon_s *supp = NULL;
        __INM_FUNC_ENTER__;
 
-       if (!value || !user_data) {
+       if (!value) {
                __INM_FUNC_EXIT__;
                return;
        }
@@ -306,9 +128,8 @@ void __get_supplicant_properties(GVariant *value, void *user_data)
                return;
        }
 
-       supp = (supplicant_mon_s *)user_data;
        while (g_variant_iter_loop(iter, "{sv}", &key, &var))
-               __get_supplicant_property(key, var, supp);
+               __get_supplicant_property(key, var);
 
        g_variant_iter_free(iter);
 
@@ -316,19 +137,14 @@ void __get_supplicant_properties(GVariant *value, void *user_data)
        return;
 }
 
-void __iface_added(
-               const gchar *sender_name,
-        const gchar *object_path,
-        const gchar *interface_name,
-        const gchar *signal_name,
-        GVariant *parameters,
-        gpointer user_data)
+
+static DECLARE_DBUS_SIGNAL_HANDLER(iface_added)
 {
        __INM_FUNC_ENTER__;
        const gchar *path = NULL;
        GVariantIter *iter = NULL;
 
-       g_variant_get(parameters, "(oa{sv})", &path, &iter);
+       g_variant_get(parameters, "(&oa{sv})", &path, &iter);
 
        if (path && iter)
                inm_supplicant_iface_add(path, iter);
@@ -340,18 +156,12 @@ void __iface_added(
        return;
 }
 
-void __iface_removed(
-               const gchar *sender_name,
-        const gchar *object_path,
-        const gchar *interface_name,
-        const gchar *signal_name,
-        GVariant *parameters,
-        gpointer user_data)
+static DECLARE_DBUS_SIGNAL_HANDLER(iface_removed)
 {
        __INM_FUNC_ENTER__;
        const gchar *path = NULL;
 
-       g_variant_get(parameters, "(o)", &path);
+       g_variant_get(parameters, "(&o)", &path);
        if (path)
                inm_supplicant_iface_remove(path);
        else
@@ -361,34 +171,33 @@ void __iface_removed(
        return;
 }
 
-void __supplicant_properties_changed(
-               const gchar *sender_name,
-        const gchar *object_path,
-        const gchar *interface_name,
-        const gchar *signal_name,
-        GVariant *parameters,
-        gpointer user_data)
+static DECLARE_DBUS_SIGNAL_HANDLER(supplicant_properties_changed)
 {
        __INM_FUNC_ENTER__;
 
        if (parameters)
-               __get_supplicant_properties(parameters, &supplicant_mon);
+               __get_supplicant_properties(parameters, NULL);
 
        __INM_FUNC_EXIT__;
 }
 
-
 int inm_supplicant_get_properties()
 {
        int ret = INM_SUPPLICANT_ERROR_NONE;
        __INM_FUNC_ENTER__;
 
-       get_supplicant_property_method_param.parameters = g_variant_new("(s)",
-                       SUPPLICANT_INTERFACE);
+       method_param_s get_supplicant_property_method_param = {
+                       .bus_name = SUPPLICANT_SERVICE,
+                       .object_path = SUPPLICANT_PATH,
+                       .interface_name = DBUS_PROPERTIES_INTERFACE,
+                       .method_name = DBUS_PROPERTIES_METHOD_GETALL,
+                       .parameters = g_variant_new("(s)",
+                                       SUPPLICANT_INTERFACE),
+       };
 
        ret = inm_gdbus_method_call(&get_supplicant_property_method_param,
                        __get_supplicant_properties,
-                       (gpointer)&supplicant_mon);
+                       NULL);
        if (ret != INM_GDBUS_ERROR_NONE) {
                __INM_FUNC_EXIT__;
                return INM_SUPPLICANT_ERROR_METHOD_CALL_FAILED;
@@ -398,68 +207,22 @@ int inm_supplicant_get_properties()
        return INM_SUPPLICANT_ERROR_NONE;
 }
 
-int inm_supplicant_get_eap_methods(unsigned int *eap_methods)
-{
-       int ret = INM_SUPPLICANT_ERROR_NONE;
-       __INM_FUNC_ENTER__;
-
-       if (!supplicant_mon.is_initialized) {
-               __INM_FUNC_EXIT__;
-               return INM_SUPPLICANT_ERROR_NOT_INITIALIZED;
-       }
-
-       if (!eap_methods) {
-               __INM_FUNC_EXIT__;
-               return INM_SUPPLICANT_ERROR_INVALID_PARAM;
-       }
-
-       *eap_methods = supplicant_mon.eap_methods;
-
-
-       __INM_FUNC_EXIT__;
-       return ret;
-}
-
-int inm_supplicant_get_capabilities(unsigned int *capabilities)
-{
-       int ret = INM_SUPPLICANT_ERROR_NONE;
-       __INM_FUNC_ENTER__;
-
-       if (!supplicant_mon.is_initialized) {
-               __INM_FUNC_EXIT__;
-               return INM_SUPPLICANT_ERROR_NOT_INITIALIZED;
-       }
-
-       if (!capabilities) {
-               __INM_FUNC_EXIT__;
-               return INM_SUPPLICANT_ERROR_INVALID_PARAM;
-       }
-
-       *capabilities = supplicant_mon.capabilities;
-
-       __INM_FUNC_EXIT__;
-       return ret;
-}
-
-int inm_supplicant_get_wfd_ies(unsigned char *ies, unsigned int *length)
+static inline int __subscribe_supplicant_signal()
 {
        int ret = INM_SUPPLICANT_ERROR_NONE;
-       __INM_FUNC_ENTER__;
 
-       if (!supplicant_mon.is_initialized) {
-               __INM_FUNC_EXIT__;
-               return INM_SUPPLICANT_ERROR_NOT_INITIALIZED;
-       }
+       ret = inm_gdbus_subscribe_signal(&(signal_param[SIGNAL_IFACE_ADDED]));
+       if (ret != INM_GDBUS_ERROR_NONE)
+               return INM_SUPPLICANT_ERROR_SIGNAL_SUBSCRIBE_FAILED;
 
-       if (!ies || !length) {
-               __INM_FUNC_EXIT__;
-               return INM_SUPPLICANT_ERROR_INVALID_PARAM;
-       }
+       ret = inm_gdbus_subscribe_signal(&(signal_param[SIGNAL_IFACE_REMOVED]));
+       if (ret != INM_GDBUS_ERROR_NONE)
+               return INM_SUPPLICANT_ERROR_SIGNAL_SUBSCRIBE_FAILED;
 
-       memcpy(ies, supplicant_mon.ies, WFDIE_SUBELEM_LEN_DEV_INFO + 3);
-       *length = WFDIE_SUBELEM_LEN_DEV_INFO + 3;
+       ret = inm_gdbus_subscribe_signal(&(signal_param[SIGNAL_PROP_CHANGED]));
+       if (ret != INM_GDBUS_ERROR_NONE)
+               return INM_SUPPLICANT_ERROR_SIGNAL_SUBSCRIBE_FAILED;
 
-       __INM_FUNC_EXIT__;
        return ret;
 }
 
@@ -468,8 +231,8 @@ int inm_supplicant_init()
        int ret = INM_SUPPLICANT_ERROR_NONE;
        __INM_FUNC_ENTER__;
 
-       memset(&supplicant_mon, 0x00, sizeof(supplicant_mon));
-       supplicant_mon.is_initialized = TRUE;
+       if (is_initialized)
+               return ret;
 
        ret = inm_gdbus_subscribe_signal(&(signal_param[SIGNAL_IFACE_ADDED]));
        if (ret != INM_GDBUS_ERROR_NONE) {
@@ -489,12 +252,6 @@ int inm_supplicant_init()
                return INM_SUPPLICANT_ERROR_SIGNAL_SUBSCRIBE_FAILED;
        }
 
-       ret = inm_gdbus_subscribe_signal(&(signal_param[SIGNAL_NAME_OWNER_CHANGED]));
-       if (ret != INM_GDBUS_ERROR_NONE) {
-               __INM_FUNC_EXIT__;
-               return INM_SUPPLICANT_ERROR_SIGNAL_SUBSCRIBE_FAILED;
-       }
-
        ret = inm_supplicant_iface_init();
        if (ret != INM_SUPPLICANT_ERROR_NONE) {
                __INM_FUNC_EXIT__;
@@ -510,7 +267,7 @@ int inm_supplicant_deinit()
        int ret = INM_SUPPLICANT_ERROR_NONE;
        __INM_FUNC_ENTER__;
 
-       if (!supplicant_mon.is_initialized) {
+       if (!is_initialized) {
                __INM_FUNC_EXIT__;
                return INM_SUPPLICANT_ERROR_NOT_INITIALIZED;
        }
@@ -524,10 +281,8 @@ int inm_supplicant_deinit()
        inm_gdbus_unsubscribe_signal(&(signal_param[SIGNAL_IFACE_ADDED]));
        inm_gdbus_unsubscribe_signal(&(signal_param[SIGNAL_IFACE_REMOVED]));
        inm_gdbus_unsubscribe_signal(&(signal_param[SIGNAL_PROP_CHANGED]));
-       inm_gdbus_unsubscribe_signal(&(signal_param[SIGNAL_NAME_OWNER_CHANGED]));
 
-       memset(&supplicant_mon, 0x00, sizeof(supplicant_mon));
-       supplicant_mon.is_initialized = FALSE;
+       is_initialized = FALSE;
 
        __INM_FUNC_EXIT__;
        return ret;