Set PMF using Wi-Fi Mesh CAPI input
[platform/core/connectivity/wifi-mesh-manager.git] / src / wmesh-service-interface.c
index 3ff949f..7a113fe 100644 (file)
@@ -48,6 +48,7 @@ typedef struct _meshd_dbus_client_s {
 
 #define CASE_TO_STR(x) case x: return #x;
 
+/* LCOV_EXCL_START */
 static const char* wifi_error_to_string(wifi_manager_error_e err)
 {
        switch (err) {
@@ -73,12 +74,14 @@ static const char* wifi_error_to_string(wifi_manager_error_e err)
                return "WIFI_MANAGER_ERROR_UNKNOWN";
        }
 }
+/* LCOV_EXCL_STOP */
 
 NetWmesh* wmeshd_dbus_get_object()
 {
        return meshd_dbus_object;
 }
 
+/* LCOV_EXCL_START */
 int64_t wmeshd_dbus_generate_signal_number()
 {
        static int64_t i = 0;
@@ -108,6 +111,7 @@ static int _wmeshd_dbus_client_list_compare_bus_name(const void *a, const void *
 
        return g_strcmp0(client->bus_name, b);
 }
+/* LCOV_EXCL_STOP */
 
 static inline GList* _wmeshd_dbus_client_list_find_client(const gchar *owner)
 {
@@ -140,15 +144,19 @@ static void _wmeshd_dbus_name_owner_changed_cb(GDBusConnection *conn,
                g_mutex_lock(&meshd_dbus_client_list_mutex);
                client = _wmeshd_dbus_client_list_find_client(old_owner);
                if (client) { /* found bus name in our bus list */
+                       /* LCOV_EXCL_START */
                        WMESH_LOGD("bus(%s) stopped", old_owner);
                        meshd_dbus_client_list = g_list_remove_link(meshd_dbus_client_list, client);
+                       /* LCOV_EXCL_STOP */
                }
                g_mutex_unlock(&meshd_dbus_client_list_mutex);
 
                if (client) {
+                       /* LCOV_EXCL_START */
                        ret = _wmeshd_dbus_client_list_cleanup(client);
                        if (WMESHD_ERROR_NONE != ret)
                                WMESH_LOGE("_wmeshd_dbus_client_list_cleanup() Fail(%d)", ret);
+                       /* LCOV_EXCL_STOP */
                }
        }
 }
@@ -168,8 +176,10 @@ static int _wmeshd_dbus_subscribe_name_owner_changed(GDBusConnection *conn)
                        NULL,
                        NULL);
        if (0 == id) {
+               /* LCOV_EXCL_START */
                WMESH_LOGE("g_dbus_connection_signal_subscribe() Fail");
                return WMESHD_ERROR_IO_ERROR;
+               /* LCOV_EXCL_STOP */
        }
 
        return WMESHD_ERROR_NONE;
@@ -188,23 +198,30 @@ static gboolean _wmeshd_dbus_handle_enable(Manager *object,
 
        /* Initialize Wi-Fi driver */
        ret = wifi_manager_initialize(&wifi_handle);
-       if (WIFI_MANAGER_ERROR_NONE != ret)
+       if (WIFI_MANAGER_ERROR_NONE != ret) {
+               /* LCOV_EXCL_START */
                WMESH_LOGE("Failed to get wifi manager handle ! [%s(%X)]",
                        wifi_error_to_string(ret), ret);
+               /* LCOV_EXCL_STOP */
+       }
 
        wifi_manager_is_activated(wifi_handle, &wifi_activated);
        if (false == wifi_activated) {
+               /* LCOV_EXCL_START */
                ret = wifi_manager_activate(wifi_handle, NULL, NULL);
                if (WIFI_MANAGER_ERROR_NONE != ret)
                        WMESH_LOGE("Failed to activate wifi ! [%s(%X)]",
                                wifi_error_to_string(ret), ret);
+               /* LCOV_EXCL_STOP */
        }
        wifi_manager_deinitialize(wifi_handle);
 
        if (service->mesh_activated) {
+               /* LCOV_EXCL_START */
                /* Already activated */
                manager_complete_enable(object, invocation, WMESHD_ERROR_NONE);
                goto FINISH;
+               /* LCOV_EXCL_STOP */
        }
 
        /* Do API response first */
@@ -214,18 +231,22 @@ static gboolean _wmeshd_dbus_handle_enable(Manager *object,
        wmeshd_check_null_ret_error("info", info, FALSE);
 
        /* Register event handler first */
-       ret = wmesh_request_register_event_handler();
+       ret = wmesh_request_register_event_handler(service);
        if (WMESHD_ERROR_IN_PROGRESS == ret) {
+               /* LCOV_EXCL_START */
                WMESH_LOGE("Currently set netlink event handler !! [%d]", ret);
                ret = WMESHD_ERROR_NONE;
+               /* LCOV_EXCL_STOP */
        } else if (WMESHD_ERROR_NONE != ret) {
-               WMESH_LOGE("Failed to register mesh event handler !! [%d]", ret);
+               WMESH_LOGE("Failed to register mesh event handler !! [%d]", ret); //LCOV_EXCL_LINE
        }
 
        ret = wmesh_interface_initialize(service->interface_info);
        if (WMESHD_ERROR_NONE != ret) {
+               /* LCOV_EXCL_START */
                WMESH_LOGE("Failed to wmesh_interface_initialize [%d]", ret);
                goto FINISH;
+               /* LCOV_EXCL_STOP */
        }
 
 FINISH:
@@ -249,7 +270,7 @@ static gboolean _wmeshd_dbus_handle_disable(Manager *object,
 
        ret = wmesh_request_unregister_event_handler();
        if (WMESHD_ERROR_NONE != ret)
-               WMESH_LOGE("Failed to unregister mesh event handler !! [%d]", ret);
+               WMESH_LOGE("Failed to unregister mesh event handler !! [%d]", ret); //LCOV_EXCL_LINE
 
        /* Terminate daemon */
        wmeshd_service_exit(service);
@@ -269,7 +290,7 @@ static gboolean _wmeshd_dbus_handle_scan(NetWmesh *object,
 
        ret = wmesh_request_scan(service);
        if (WMESHD_ERROR_NONE != ret)
-               WMESH_LOGE("Failed to wmesh_request_scan !");
+               WMESH_LOGE("Failed to wmesh_request_scan !"); //LCOV_EXCL_LINE
 
        net_wmesh_complete_scan(object, invocation, ret);
 
@@ -290,7 +311,7 @@ static gboolean _wmeshd_dbus_handle_specific_scan(NetWmesh *object,
 
        ret = wmesh_request_specific_scan(service, mesh_id, channel);
        if (WMESHD_ERROR_NONE != ret)
-               WMESH_LOGE("Failed to wmesh_request_specific_scan !");
+               WMESH_LOGE("Failed to wmesh_request_specific_scan !"); //LCOV_EXCL_LINE
 
        net_wmesh_complete_specific_scan(object, invocation, ret);
 
@@ -306,13 +327,14 @@ static gboolean _wmeshd_dbus_handle_cancel_scan(NetWmesh *object,
 
        ret = wmesh_request_cancel_scan(service);
        if (WMESHD_ERROR_NONE != ret)
-               WMESH_LOGE("Failed to wmesh_request_cancel_scan");
+               WMESH_LOGE("Failed to wmesh_request_cancel_scan"); //LCOV_EXCL_LINE
 
        net_wmesh_complete_cancel_scan(object, invocation, ret);
 
        return TRUE;
 }
 
+/* LCOV_EXCL_START */
 static void _on_scan_result_destroy(gpointer data)
 {
        wmesh_scan_result_s *scan_item = (wmesh_scan_result_s *)data;
@@ -354,6 +376,7 @@ static void _on_mpath_list_destroy(gpointer data)
                g_free(info);
        }
 }
+/* LCOV_EXCL_STOP */
 
 static gboolean _wmeshd_dbus_handle_get_found_mesh_networks(NetWmesh *object,
                GDBusMethodInvocation *invocation,
@@ -371,13 +394,14 @@ static gboolean _wmeshd_dbus_handle_get_found_mesh_networks(NetWmesh *object,
 
        ret = wmesh_request_get_networks(service);
        if (WMESHD_ERROR_NONE != ret)
-               WMESH_LOGE("Failed to wmesh_request_get_networks");
+               WMESH_LOGE("Failed to wmesh_request_get_networks"); //LCOV_EXCL_LINE
 
        g_variant_builder_init(&builder, G_VARIANT_TYPE("aa{sv}"));
 
        /* scanned_mesh_network would be filled above request */
        iter = service->scanned_mesh_network;
        while (iter != NULL) {
+               /* LCOV_EXCL_START */
                scan_item = (wmesh_scan_result_s*)iter->data;
 
                g_variant_builder_open(&builder, G_VARIANT_TYPE_VARDICT);
@@ -398,6 +422,7 @@ static gboolean _wmeshd_dbus_handle_get_found_mesh_networks(NetWmesh *object,
                g_variant_builder_close(&builder);
 
                iter = g_list_next(iter);
+               /* LCOV_EXCL_STOP */
        }
 
        networks = g_variant_builder_end(&builder);
@@ -417,7 +442,7 @@ static gboolean _wmeshd_dbus_handle_enable_mesh(NetWmesh *object,
        /* It handles creating virtual network and bridge */
        ret = wmesh_request_enable_network(service);
        if (WMESHD_ERROR_NONE != ret)
-               WMESH_LOGE("Failed to wmesh_request_enable_network [%d]", ret);
+               WMESH_LOGE("Failed to wmesh_request_enable_network [%d]", ret); //LCOV_EXCL_LINE
 
        wmesh_start_monitor_service(service);
 
@@ -437,15 +462,17 @@ static gboolean _wmeshd_dbus_handle_disable_mesh(NetWmesh *object,
        wmeshd_check_null_ret_error("info", info, FALSE);
 
        if (FALSE == service->mesh_activated) {
+               /* LCOV_EXCL_START */
                WMESH_LOGD("Mesh network is not activated yet");
                ret = WMESHD_ERROR_OPERATION_FAILED;
                net_wmesh_complete_disable_mesh(object, invocation, ret);
                return TRUE;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = wmesh_request_disable_network(service);
        if (WMESHD_ERROR_NONE != ret)
-               WMESH_LOGE("Failed to disable mesh network !");
+               WMESH_LOGE("Failed to disable mesh network !"); //LCOV_EXCL_LINE
 
        /* Stop Mesh Node Monitoring Service */
        wmesh_stop_monitor_service(service);
@@ -455,6 +482,28 @@ static gboolean _wmeshd_dbus_handle_disable_mesh(NetWmesh *object,
        return TRUE;
 }
 
+static gboolean _wmeshd_dbus_handle_is_mesh_enabled(NetWmesh *object,
+               GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       int ret = WMESHD_ERROR_NONE;
+       gboolean state = TRUE;
+       wmesh_service *service = (wmesh_service *)user_data;
+
+       /* It handles creating virtual network and bridge */
+       ret = wmesh_interface_check(service->interface_info->mesh_interface);
+       if (WMESHD_ERROR_NONE != ret) {
+               /* LCOV_EXCL_START */
+               WMESH_LOGE("Mesh Interface doesn't exists");
+               state = FALSE;
+               /* LCOV_EXCL_STOP */
+       }
+
+       net_wmesh_complete_is_mesh_enabled(object, invocation, state);
+
+       return TRUE;
+}
+
 static gboolean _wmeshd_dbus_handle_is_joined(NetWmesh *object,
                GDBusMethodInvocation *invocation,
                gpointer user_data)
@@ -465,8 +514,10 @@ static gboolean _wmeshd_dbus_handle_is_joined(NetWmesh *object,
 
        ret = wmesh_request_get_joined_network(service);
        if (WMESHD_ERROR_NONE == ret) {
+               /* LCOV_EXCL_START */
                if (service->joined_network)
                        state = TRUE;
+               /* LCOV_EXCL_STOP */
        }
 
        net_wmesh_complete_is_joined(object, invocation, state, ret);
@@ -486,17 +537,20 @@ static gboolean _wmeshd_dbus_handle_get_joined_mesh_network(NetWmesh *object,
        if (WMESHD_ERROR_NONE == ret) {
                joined = service->joined_network;
                if (joined) {
+                       /* LCOV_EXCL_START */
                        net_wmesh_complete_get_joined_mesh_network(object, invocation,
                                joined->mesh_id, joined->bssid,
                                joined->channel, (int)joined->security,
-                               joined->state, ret);
+                               joined->state, joined->ipv4_type, joined->ipv4_address,
+                               joined->ipv4_netmask, ret);
+                       /* LCOV_EXCL_STOP */
                } else {
                        net_wmesh_complete_get_joined_mesh_network(object, invocation,
-                               "", "", 0, 0, 0, WMESHD_ERROR_NO_DATA);
+                               "", "", 0, 0, 0, 0, "", "", WMESHD_ERROR_NO_DATA); /* LCOV_EXCL_LINE */
                }
        } else {
                net_wmesh_complete_get_joined_mesh_network(object, invocation,
-                       "", "", 0, 0, 0, ret);
+                       "", "", 0, 0, 0, 0, "", "", ret); /* LCOV_EXCL_LINE */
        }
 
        return TRUE;
@@ -518,11 +572,12 @@ static gboolean _wmeshd_dbus_handle_get_connected_peers(NetWmesh *object,
 
        ret = wmesh_request_get_connected_peers(service);
        if (WMESHD_ERROR_NONE != ret)
-               WMESH_LOGE("Failed to wmesh_request_get_connected_peers");
+               WMESH_LOGE("Failed to wmesh_request_get_connected_peers"); //LCOV_EXCL_LINE
        g_variant_builder_init(&builder, G_VARIANT_TYPE("aa{sv}"));
 
        iter = service->connected_mesh_peers;
        while (iter != NULL) {
+               /* LCOV_EXCL_START */
                peer = (wmesh_peer_info_s*)iter->data;
 
                g_variant_builder_open(&builder, G_VARIANT_TYPE_VARDICT);
@@ -531,6 +586,7 @@ static gboolean _wmeshd_dbus_handle_get_connected_peers(NetWmesh *object,
                g_variant_builder_close(&builder);
 
                iter = g_list_next(iter);
+               /* LCOV_EXCL_STOP */
        }
 
        peer_list = g_variant_builder_end(&builder);
@@ -559,13 +615,13 @@ static gboolean _wmeshd_dbus_handle_set_gate(NetWmesh *object,
        /* Set STP and gate_announce for connmand */
        ret = wmesh_gdbus_set_mesh_gate(service);
        if (WMESHD_ERROR_NONE != ret)
-               WMESH_LOGE("Failed to wmesh_gdbus_set_mesh_gate [%d]", ret);
+               WMESH_LOGE("Failed to wmesh_gdbus_set_mesh_gate [%d]", ret); //LCOV_EXCL_LINE
 
        /* Set STP and gate_announce right now */
        ret = wmesh_request_set_mesh_gate(info->bridge_interface,
                        info->mesh_interface, info->external_interface);
        if (WMESHD_ERROR_NONE != ret)
-               WMESH_LOGE("Failed to wmesh_gdbus_set_mesh_gate [%d]", ret);
+               WMESH_LOGE("Failed to wmesh_gdbus_set_mesh_gate [%d]", ret); //LCOV_EXCL_LINE
 
 
        net_wmesh_complete_set_gate(object, invocation, ret);
@@ -588,13 +644,13 @@ static gboolean _wmeshd_dbus_handle_unset_gate(NetWmesh *object,
        /* Set STP and gate_announce for connmand */
        ret = wmesh_gdbus_set_mesh_gate(service);
        if (WMESHD_ERROR_NONE != ret)
-               WMESH_LOGE("Failed to wmesh_gdbus_set_mesh_gate [%d]", ret);
+               WMESH_LOGE("Failed to wmesh_gdbus_set_mesh_gate [%d]", ret); //LCOV_EXCL_LINE
 
        /* Unset STP and Gate Annouce right now */
        ret = wmesh_request_unset_mesh_gate(info->bridge_interface,
                        info->mesh_interface, info->external_interface);
        if (WMESHD_ERROR_NONE != ret)
-               WMESH_LOGE("Failed to wmesh_request_unset_mesh_gate [%d]", ret);
+               WMESH_LOGE("Failed to wmesh_request_unset_mesh_gate [%d]", ret); //LCOV_EXCL_LINE
 
        net_wmesh_complete_unset_gate(object, invocation, ret);
 
@@ -623,13 +679,52 @@ static gboolean _wmeshd_dbus_handle_set_softap(NetWmesh *object,
                ssid, mode, channel, visibility, max_sta,
                security, passphrase);
        if (WMESHD_ERROR_NONE != ret)
-               WMESH_LOGE("Failed to wmesh_request_set_softap_config [%d]", ret);
+               WMESH_LOGE("Failed to wmesh_request_set_softap_config [%d]", ret); //LCOV_EXCL_LINE
 
        net_wmesh_complete_set_softap(object, invocation, ret);
 
        return TRUE;
 }
 
+static gboolean _wmeshd_dbus_handle_get_softap(NetWmesh *object,
+               GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       int ret = WMESHD_ERROR_NONE;
+       wmesh_service *service = (wmesh_service *)user_data;
+       char *interface, *ssid, *mode, *passphrase;
+       int channel, visibility, max_sta, security;
+       (void) service; // unused
+
+       /* Get softAP information */
+       ret = wmesh_request_get_softap_config(&interface, &ssid, &mode, &channel,
+                                               &visibility, &max_sta, &security, &passphrase);
+       if (WMESHD_ERROR_NONE != ret) {
+               /* LCOV_EXCL_START */
+               WMESH_LOGE("Failed to wmesh_request_get_softap_config [%d]", ret);
+               net_wmesh_complete_get_softap(object, invocation, "", "", 0, 0, 0, 0,
+                                                               "", ret);
+               return FALSE;
+               /* LCOV_EXCL_STOP */
+       }
+
+       WMESH_LOGD("SSID      : %s", ssid);
+       WMESH_LOGD("mode      : %s", mode);
+       WMESH_LOGD("channel   : %d", channel);
+       WMESH_LOGD("visibility: %d", visibility);
+       WMESH_LOGD("max_sta   : %d", max_sta);
+       WMESH_LOGD("security  : %d", security);
+       WMESH_LOGD("Passphrase  : %s", passphrase ? passphrase : "NULL");
+
+       if (security == 1)
+               net_wmesh_complete_get_softap(object, invocation, ssid, mode, channel,
+                                                               visibility, max_sta, security, passphrase, ret); /* LCOV_EXCL_LINE */
+       else
+               net_wmesh_complete_get_softap(object, invocation, ssid, mode, channel,
+                                                               visibility, max_sta, security, "", ret); /* LCOV_EXCL_LINE */
+
+       return TRUE;
+}
+
 static gboolean _wmeshd_dbus_handle_enable_softap(NetWmesh *object,
                GDBusMethodInvocation *invocation, gpointer user_data)
 {
@@ -640,7 +735,7 @@ static gboolean _wmeshd_dbus_handle_enable_softap(NetWmesh *object,
        /* Check softAP interface and execute it */
        ret = wmesh_request_enable_softap(info->bridge_interface, info->softap_interface);
        if (WMESHD_ERROR_NONE != ret)
-               WMESH_LOGE("Failed to wmesh_request_enable_softap [%d]", ret);
+               WMESH_LOGE("Failed to wmesh_request_enable_softap [%d]", ret); //LCOV_EXCL_LINE
 
        net_wmesh_complete_enable_softap(object, invocation, ret);
 
@@ -657,23 +752,38 @@ static gboolean _wmeshd_dbus_handle_disable_softap(NetWmesh *object,
        /* Destroy softAP */
        ret = wmesh_request_disable_softap(info->bridge_interface, info->softap_interface);
        if (WMESHD_ERROR_NONE != ret)
-               WMESH_LOGE("Failed to wmesh_request_disable_softap [%d]", ret);
+               WMESH_LOGE("Failed to wmesh_request_disable_softap [%d]", ret); //LCOV_EXCL_LINE
 
        net_wmesh_complete_disable_softap(object, invocation, ret);
 
        return TRUE;
 }
 
+static gboolean _wmeshd_dbus_handle_is_softap_enabled(NetWmesh *object,
+               GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       bool status;
+       (void) user_data;
+
+       /* Check SoftAP status */
+       status = wmesh_request_check_softap_status();
+       WMESH_LOGD("SoftAP is %s", status ? "enabled" : "disabled");
+
+       net_wmesh_complete_is_softap_enabled(object, invocation, status);
+
+       return TRUE;
+}
+
 static gboolean _wmeshd_dbus_handle_create_mesh_network(NetWmesh *object,
                GDBusMethodInvocation *invocation,
-               gchar *mesh_id, gint channel, gint security,
+               gchar *mesh_id, gint channel, gint security, gint pmf,
                gpointer user_data)
 {
        int ret = WMESHD_ERROR_NONE;
        wmesh_service *service = (wmesh_service *)user_data;
        wmeshd_security_type_e sec = (1 == security) ? WMESHD_SECURITY_SAE : WMESHD_SECURITY_NONE;
 
-       ret = wmesh_request_create_mesh_network(service, mesh_id, channel, sec);
+       ret = wmesh_request_create_mesh_network(service, mesh_id, channel, sec, pmf);
 
        net_wmesh_complete_create_mesh_network(object, invocation, ret);
 
@@ -758,7 +868,7 @@ static gboolean _wmeshd_dbus_handle_set_interfaces(NetWmesh *object,
 }
 
 static gboolean _wmeshd_dbus_handle_get_station_info(NetWmesh *object,
-               GDBusMethodInvocation *invocation,
+               GDBusMethodInvocation *invocation, gint station_type,
                gpointer user_data)
 {
        int ret = WMESHD_ERROR_NONE;
@@ -770,55 +880,84 @@ static gboolean _wmeshd_dbus_handle_get_station_info(NetWmesh *object,
        wmesh_service *service = (wmesh_service *)user_data;
        wmesh_interface_s *info = service->interface_info;
 
-       /* Clear mesh station list */
-       g_list_free_full(service->station_list, _on_station_list_destroy);
-       service->station_list = NULL;
+       if (station_type == WMESHD_STATION_TYPE_MESH_POINT) {
+               /* LCOV_EXCL_START */
+               /* Clear mesh station list */
+               g_list_free_full(service->station_list, _on_station_list_destroy);
+               service->station_list = NULL;
+
+               ret = wmesh_request_get_station_info(
+                                                               info->mesh_interface, &service->station_list);
+       } else if (station_type == WMESHD_STATION_TYPE_SOFTAP) {
+               /* Clear softAP station list */
+               g_list_free_full(service->softap_station_list,
+                                                _on_station_list_destroy);
+               service->softap_station_list = NULL;
+
+               ret = wmesh_request_get_station_info(
+                                                               info->softap_interface,
+                                                               &service->softap_station_list);
+       } else {
+               WMESH_LOGE("Invalid station type");
+
+               g_dbus_method_invocation_return_error(invocation,
+                               G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "Invalid station type");
+
+               return FALSE;
+               /* LCOV_EXCL_STOP */
+       }
 
-       ret = wmesh_request_get_station_info(
-                               info->mesh_interface, &service->station_list);
        if (WMESHD_ERROR_NONE != ret) {
+               /* LCOV_EXCL_START */
                WMESH_LOGE("Failed to wmesh_request_get_station_info");
 
                g_dbus_method_invocation_return_error(invocation,
                                G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "Request Failed");
+               /* LCOV_EXCL_STOP */
        } else {
-       /*
-        * sh-3.2#  iw mesh0 station dump
-        * Station 7c:dd:90:62:37:cf (on mesh0)
-        * inactive time:       1685 ms
-        * rx bytes:    34174
-        * rx packets:  1181
-        * tx bytes:    6877
-        * tx packets:  76
-        * tx retries:  0
-        * tx failed:   0
-        * beacon loss: 0
-        * signal:              -64 dBm
-        * signal avg:  -63 dBm
-        * tx bitrate:  54.0 MBit/s
-        * rx bitrate:  5.5 MBit/s
-        * mesh llid:   51731
-        * mesh plid:   35432
-        * mesh plink:  ESTAB
-        * mesh local PS mode:  ACTIVE
-        * mesh peer PS mode:   ACTIVE
-        * mesh non-peer PS mode:       ACTIVE
-        * authorized:  yes
-        * authenticated:       yes
-        * associated:  yes
-        * preamble:    long
-        * WMM/WME:     yes
-        * MFP:         no
-        * TDLS peer:   no
-        * DTIM period: 0
-        * beacon interval:1000
-        * short slot time:yes
-        * connected time:      256 seconds
-        */
+               /*
+                * sh-3.2#  iw mesh0 station dump
+                * Station 7c:dd:90:62:37:cf (on mesh0)
+                * inactive time:       1685 ms
+                * rx bytes:    34174
+                * rx packets:  1181
+                * tx bytes:    6877
+                * tx packets:  76
+                * tx retries:  0
+                * tx failed:   0
+                * beacon loss: 0
+                * signal:              -64 dBm
+                * signal avg:  -63 dBm
+                * tx bitrate:  54.0 MBit/s
+                * rx bitrate:  5.5 MBit/s
+                * mesh llid:   51731
+                * mesh plid:   35432
+                * mesh plink:  ESTAB
+                * mesh local PS mode:  ACTIVE
+                * mesh peer PS mode:   ACTIVE
+                * mesh non-peer PS mode:       ACTIVE
+                * authorized:  yes
+                * authenticated:       yes
+                * associated:  yes
+                * preamble:    long
+                * WMM/WME:     yes
+                * MFP:         no
+                * TDLS peer:   no
+                * DTIM period: 0
+                * beacon interval:1000
+                * short slot time:yes
+                * connected time:      256 seconds
+                */
+
+               /* LCOV_EXCL_START */
                /* Get station information and make variant data */
                g_variant_builder_init(&builder, G_VARIANT_TYPE("aa{sv}"));
 
-               iter = service->station_list;
+               if (station_type == WMESHD_STATION_TYPE_MESH_POINT)
+                       iter = service->station_list;
+               else
+                       iter = service->softap_station_list;
+
                while (iter != NULL) {
                        wmesh_station_info_s *item = (wmesh_station_info_s*)iter->data;
 
@@ -853,20 +992,24 @@ static gboolean _wmeshd_dbus_handle_get_station_info(NetWmesh *object,
                                                g_variant_new_uint32(item->tx_bitrate)); /* 10 times */
                        g_variant_builder_add(&builder, "{sv}", "rx_bitrate",
                                                g_variant_new_uint32(item->rx_bitrate)); /* 10 times */
-                       g_variant_builder_add(&builder, "{sv}", "mesh_llid",
-                                               g_variant_new_uint16(item->llid));
-                       g_variant_builder_add(&builder, "{sv}", "mesh_plid",
-                                               g_variant_new_uint16(item->plid));
-                       g_variant_builder_add(&builder, "{sv}", "mesh_plink",
-                                               g_variant_new_byte(item->mesh_plink)); /* 0 : DISCON, 1 : ESTAB */
-                       g_variant_builder_add(&builder, "{sv}", "local_ps_mode",
-                                               g_variant_new_uint32(item->local_ps_mode)); /* 0 : INACTIVE, 1 : ACTIVE */
-                       g_variant_builder_add(&builder, "{sv}", "peer_ps_mode",
-                                               g_variant_new_uint32(item->peer_ps_mode)); /* 0 : INACTIVE, 1 : ACTIVE */
-                       g_variant_builder_add(&builder, "{sv}", "non_peer_ps_mode",
-                                               g_variant_new_uint32(item->non_peer_ps_mode)); /* 0 : INACTIVE, 1 : ACTIVE */
+                       if (station_type == WMESHD_STATION_TYPE_MESH_POINT) {
+                               g_variant_builder_add(&builder, "{sv}", "mesh_llid",
+                                                               g_variant_new_uint16(item->llid));
+                               g_variant_builder_add(&builder, "{sv}", "mesh_plid",
+                                                               g_variant_new_uint16(item->plid));
+                               g_variant_builder_add(&builder, "{sv}", "mesh_plink",
+                                                               g_variant_new_byte(item->mesh_plink)); /* 0 : DISCON, 1 : ESTAB */
+                               g_variant_builder_add(&builder, "{sv}", "local_ps_mode",
+                                                               g_variant_new_uint32(item->local_ps_mode)); /* 0 : INACTIVE, 1 : ACTIVE */
+                               g_variant_builder_add(&builder, "{sv}", "peer_ps_mode",
+                                                               g_variant_new_uint32(item->peer_ps_mode)); /* 0 : INACTIVE, 1 : ACTIVE */
+                               g_variant_builder_add(&builder, "{sv}", "non_peer_ps_mode",
+                                                               g_variant_new_uint32(item->non_peer_ps_mode)); /* 0 : INACTIVE, 1 : ACTIVE */
+                       }
                        g_variant_builder_add(&builder, "{sv}", "authorized",
                                                g_variant_new_boolean(item->authorized));
+                       g_variant_builder_add(&builder, "{sv}", "authenticated",
+                                               g_variant_new_boolean(item->authenticated));
                        g_variant_builder_add(&builder, "{sv}", "associated",
                                                g_variant_new_boolean(item->associated));
                        g_variant_builder_add(&builder, "{sv}", "preamble",
@@ -895,6 +1038,7 @@ static gboolean _wmeshd_dbus_handle_get_station_info(NetWmesh *object,
 
                g_object_unref(station);
        }
+       /* LCOV_EXCL_STOP */
 
        return TRUE;
 }
@@ -918,16 +1062,20 @@ static gboolean _wmeshd_dbus_handle_get_mpath_info(NetWmesh *object,
        ret = wmesh_request_get_mpath_info(
                                info->mesh_interface, &service->mpath_list);
        if (WMESHD_ERROR_NONE != ret) {
+               /* LCOV_EXCL_START */
                WMESH_LOGE("Failed to wmesh_request_get_mpath_info");
 
                g_dbus_method_invocation_return_error(invocation,
                                G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "Request Failed");
+               /* LCOV_EXCL_STOP */
        } else {
-       /*
-        * Example) sh-3.2# iw mesh0 mpath dump
-        * DEST ADDR         NEXT HOP          IFACE    SN      METRIC  QLEN    EXPTIME         DTIM    DRET    FLAGS
-        * 7c:dd:90:62:37:cf 7c:dd:90:62:37:cf mesh0    221     152             0               10                      100             0               0x5
-        */
+               /*
+                * Example) sh-3.2# iw mesh0 mpath dump
+                * DEST ADDR         NEXT HOP          IFACE    SN      METRIC  QLEN    EXPTIME         DTIM    DRET    FLAGS
+                * 7c:dd:90:62:37:cf 7c:dd:90:62:37:cf mesh0    221     152             0               10                      100             0               0x5
+                */
+
+               /* LCOV_EXCL_START */
                /* Get mesh path information and make variant data */
                g_variant_builder_init(&builder, G_VARIANT_TYPE("aa{sv}"));
 
@@ -965,6 +1113,7 @@ static gboolean _wmeshd_dbus_handle_get_mpath_info(NetWmesh *object,
                net_wmesh_complete_get_mpath_info(object, invocation, mpath_data, ret);
 
                g_object_unref(mpath_data);
+               /* LCOV_EXCL_STOP */
        }
 
        return TRUE;
@@ -983,10 +1132,12 @@ static gboolean _wmeshd_dbus_handle_get_meshconf_info(NetWmesh *object,
 
        ret = wmesh_request_get_meshconf_info(service);
        if (WMESHD_ERROR_NONE != ret) {
+               /* LCOV_EXCL_START */
                WMESH_LOGE("Failed to wmesh_request_get_mpath_info");
 
                g_dbus_method_invocation_return_error(invocation,
                                G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "Request Failed");
+               /* LCOV_EXCL_STOP */
        } else {
                /* Get mesh path information and make variant data */
                g_variant_builder_init(&builder, G_VARIANT_TYPE("a{sv}"));
@@ -1017,6 +1168,8 @@ static gboolean _wmeshd_dbus_handle_get_meshconf_info(NetWmesh *object,
                                                          g_variant_new_byte(item->element_ttl));
                g_variant_builder_add(&builder, "{sv}", "HWMP_RANN_INTERVAL",
                                                          g_variant_new_uint16(item->hwmp_rann_interval));
+               g_variant_builder_add(&builder, "{sv}", "GATE_ANNOUNCEMENTS",
+                                                         g_variant_new_byte(item->gate_announcements));
 
 
                meshconf_data = g_variant_builder_end(&builder);
@@ -1042,8 +1195,10 @@ static void _wmeshd_dbus_on_activator_bus_acquired(GDBusConnection *conn,
 
        meshd_activator_dbus_object = manager_skeleton_new();
        if (NULL == meshd_activator_dbus_object) {
+               /* LCOV_EXCL_START */
                WMESH_LOGE("manager_skeleton_new() Fail");
                return;
+               /* LCOV_EXCL_STOP */
        }
 
        g_signal_connect(meshd_activator_dbus_object, "handle-enable",
@@ -1055,8 +1210,10 @@ static void _wmeshd_dbus_on_activator_bus_acquired(GDBusConnection *conn,
                                G_DBUS_INTERFACE_SKELETON(meshd_activator_dbus_object),
                                conn, WMESH_DBUS_MANAGER_OBJPATH, &error);
        if (FALSE == ret) {
+               /* LCOV_EXCL_START */
                WMESH_LOGE("g_dbus_interface_skeleton_export() Fail(%s)", error->message);
                g_error_free(error);
+               /* LCOV_EXCL_STOP */
        }
 }
 
@@ -1071,8 +1228,10 @@ static void _wmeshd_dbus_on_bus_acquired(GDBusConnection *conn, const gchar *nam
 
        meshd_dbus_object = net_wmesh_skeleton_new();
        if (NULL == meshd_dbus_object) {
+               /* LCOV_EXCL_START */
                WMESH_LOGE("net_wmesh_skeleton_new() Fail");
                return;
+               /* LCOV_EXCL_STOP */
        }
 
        g_signal_connect(meshd_dbus_object, "handle-scan",
@@ -1087,6 +1246,8 @@ static void _wmeshd_dbus_on_bus_acquired(GDBusConnection *conn, const gchar *nam
                        G_CALLBACK(_wmeshd_dbus_handle_enable_mesh), service);
        g_signal_connect(meshd_dbus_object, "handle-disable-mesh",
                        G_CALLBACK(_wmeshd_dbus_handle_disable_mesh), service);
+       g_signal_connect(meshd_dbus_object, "handle-is-mesh-enabled",
+                       G_CALLBACK(_wmeshd_dbus_handle_is_mesh_enabled), service);
        g_signal_connect(meshd_dbus_object, "handle-is-joined",
                        G_CALLBACK(_wmeshd_dbus_handle_is_joined), service);
        g_signal_connect(meshd_dbus_object, "handle-get-joined-mesh-network",
@@ -1099,10 +1260,14 @@ static void _wmeshd_dbus_on_bus_acquired(GDBusConnection *conn, const gchar *nam
                        G_CALLBACK(_wmeshd_dbus_handle_unset_gate), service);
        g_signal_connect(meshd_dbus_object, "handle-set-softap",
                        G_CALLBACK(_wmeshd_dbus_handle_set_softap), service);
+       g_signal_connect(meshd_dbus_object, "handle-get-softap",
+                       G_CALLBACK(_wmeshd_dbus_handle_get_softap), service);
        g_signal_connect(meshd_dbus_object, "handle-enable-softap",
                        G_CALLBACK(_wmeshd_dbus_handle_enable_softap), service);
        g_signal_connect(meshd_dbus_object, "handle-disable-softap",
                        G_CALLBACK(_wmeshd_dbus_handle_disable_softap), service);
+       g_signal_connect(meshd_dbus_object, "handle-is-softap-enabled",
+                       G_CALLBACK(_wmeshd_dbus_handle_is_softap_enabled), NULL);
        g_signal_connect(meshd_dbus_object, "handle-create-mesh-network",
                        G_CALLBACK(_wmeshd_dbus_handle_create_mesh_network), service);
        g_signal_connect(meshd_dbus_object, "handle-connect-mesh-network",
@@ -1123,17 +1288,22 @@ static void _wmeshd_dbus_on_bus_acquired(GDBusConnection *conn, const gchar *nam
        ret = g_dbus_interface_skeleton_export(G_DBUS_INTERFACE_SKELETON(meshd_dbus_object),
                        conn, WMESH_DBUS_OBJPATH, &error);
        if (FALSE == ret) {
+               /* LCOV_EXCL_START */
                WMESH_LOGE("g_dbus_interface_skeleton_export() Fail(%s)", error->message);
                g_error_free(error);
+               /* LCOV_EXCL_STOP */
        }
 
        ret = _wmeshd_dbus_subscribe_name_owner_changed(conn);
        if (WMESHD_ERROR_NONE != ret) {
+               /* LCOV_EXCL_START */
                WMESH_LOGE("_wmeshd_dbus_subscribe_name_owner_changed() Fail(%d)", ret);
                return;
+               /* LCOV_EXCL_STOP */
        }
 }
 
+/* LCOV_EXCL_START */
 static void _wmeshd_dbus_on_name_lost(GDBusConnection *conn, const gchar *name,
                gpointer user_data)
 {
@@ -1142,6 +1312,7 @@ static void _wmeshd_dbus_on_name_lost(GDBusConnection *conn, const gchar *name,
 
        WMESH_LOGD("Lost the name %s", name);
 }
+/* LCOV_EXCL_STOP */
 
 static void _wmeshd_dbus_on_name_acquired(GDBusConnection *conn, const gchar *name,
                gpointer user_data)
@@ -1167,8 +1338,10 @@ static gboolean _wmeshd_dbus_interface_init(wmesh_service *service)
                        service,
                        NULL);
        if (0 == id) {
+               /* LCOV_EXCL_START */
                WMESH_LOGE("g_bus_own_name() Fail");
                return FALSE;
+               /* LCOV_EXCL_STOP */
        }
 
        /* Get D-Bus owner to activate mesh service daemon */
@@ -1217,32 +1390,39 @@ static void _wmeshd_dbus_deinit(wmesh_service *service)
                g_free(info->external_interface);
 
        if (service->joined_network) {
+               /* LCOV_EXCL_START */
                g_free(service->joined_network->mesh_id);
                g_free(service->joined_network->bssid);
                g_free(service->joined_network);
                service->joined_network = NULL;
+               /* LCOV_EXCL_STOP */
        }
 
        /* Clear scan list */
        if (service->scanned_mesh_network)
-               g_list_free_full(service->scanned_mesh_network, _on_scan_result_destroy);
+               g_list_free_full(service->scanned_mesh_network, _on_scan_result_destroy); /* LCOV_EXCL_LINE */
        service->scanned_mesh_network = NULL;
 
        /* Clear connected peers list */
        if (service->connected_mesh_peers)
-               g_list_free_full(service->connected_mesh_peers, _on_peer_info_destroy);
+               g_list_free_full(service->connected_mesh_peers, _on_peer_info_destroy); /* LCOV_EXCL_LINE */
        service->connected_mesh_peers = NULL;
 
        /* Clear mesh path list */
        if (service->mpath_list)
-               g_list_free_full(service->mpath_list, _on_mpath_list_destroy);
+               g_list_free_full(service->mpath_list, _on_mpath_list_destroy); /* LCOV_EXCL_LINE */
        service->mpath_list = NULL;
 
        /* Clear mesh station list */
        if (service->station_list)
-               g_list_free_full(service->station_list, _on_station_list_destroy);
+               g_list_free_full(service->station_list, _on_station_list_destroy); /* LCOV_EXCL_LINE */
        service->station_list = NULL;
 
+       /* Clear mesh station list */
+       if (service->softap_station_list)
+               g_list_free_full(service->softap_station_list, _on_station_list_destroy); /* LCOV_EXCL_LINE */
+       service->softap_station_list = NULL;
+
        g_free(service->interface_info);
        service->interface_info = NULL;
 }
@@ -1256,8 +1436,10 @@ gboolean wmeshd_service_interface_init(wmesh_service *service)
        /* Initialize dbus interface */
        ret = _wmeshd_dbus_interface_init(service);
        if (FALSE == ret) {
+               /* LCOV_EXCL_START */
                WMESH_LOGE("_wmeshd_dbus_interface_init failed!!!");
                return FALSE;
+               /* LCOV_EXCL_STOP */
        }
 
        return TRUE;