Add security type and passphrase
authorJiwan Kim <ji-wan.kim@samsung.com>
Fri, 9 Jun 2017 08:29:53 +0000 (17:29 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Mon, 17 Jul 2017 02:35:36 +0000 (11:35 +0900)
- Add 'security' param on 'get_joined_mesh_network' method
- Add 'security' param on 'connection_state' signal
- Add 'passphrase' param on 'connect_mesh_network' method

include/mesh-gdbus.h
include/mesh-request.h
include/mesh.h
introspection/mesh.xml
src/mesh-gdbus.c
src/mesh-network.c
src/mesh-request.c
src/mesh-service-interface.c

index 30ab605..d0bc622 100644 (file)
@@ -49,8 +49,10 @@ int mesh_ipc_get_mesh_peers(mesh_service *service);
 int mesh_ipc_get_connected_peers(mesh_service *service);
 int mesh_ipc_get_joined_mesh_network(mesh_service *service);
 
-int mesh_ipc_create_network(mesh_service *service, gchar *mesh_id, gint channel,
-        gint security);
+int mesh_ipc_create_network(mesh_service *service, gchar *mesh_id,
+        gint channel, meshd_security_type_e sec);
+int mesh_ipc_set_passphrase(mesh_service *service, mesh_scan_result_s *info,
+        gchar *passphrase);
 int mesh_ipc_connect_network(mesh_service *service, mesh_scan_result_s *info);
 int mesh_ipc_disconnect_network(mesh_service *service, mesh_scan_result_s *info);
 int mesh_ipc_remove_network(mesh_service *service, mesh_scan_result_s *info);
index 466d304..e8ac42a 100644 (file)
@@ -33,13 +33,13 @@ int mesh_request_ipc_mesh_get_peers(mesh_service *service);
 int mesh_request_ipc_get_joined_network(mesh_service *service);
 
 int mesh_request_ipc_create_mesh_network(mesh_service *service, gchar *mesh_id,
-               gint channel, gint security);
+               gint channel, meshd_security_type_e sec);
 int mesh_request_ipc_connect_mesh_network(mesh_service *service, gchar *mesh_id,
-               gint channel, gint security);
+               gint channel, meshd_security_type_e sec, gchar *passphrase);
 int mesh_request_ipc_disconnect_mesh_network(mesh_service *service,
-               gchar *mesh_id, gint channel, gint security);
+               gchar *mesh_id, gint channel, meshd_security_type_e sec);
 int mesh_request_ipc_remove_mesh_network(mesh_service *service,
-               gchar *mesh_id, gint channel, gint security);
+               gchar *mesh_id, gint channel, meshd_security_type_e sec);
 
 int mesh_request_enable_mesh(const char* base_interface,
                const char* mesh_interface, GList *saved_network,
@@ -95,11 +95,8 @@ int mesh_request_unregister_event_handler();
 
 /* Notifications */
 void mesh_notify_scan_done();
-//void mesh_notify_joined_network();
-//void mesh_notify_left_network();
-//void mesh_notify_mesh_connected(int result);
 void mesh_notify_connection_state(const char* mesh_id, const char* bssid,
-               int channel, meshd_connection_state_e state);
+               int channel, meshd_security_type_e sec, meshd_connection_state_e state);
 void mesh_notify_station_joined(const char* bssid);
 void mesh_notify_station_left(const char* bssid);
 
index 06e45c3..33fabc1 100644 (file)
@@ -43,6 +43,12 @@ typedef enum {
        MESHD_CONNECTION_STATE_CONNECTED /**< Connected state */
 } meshd_connection_state_e;
 
+/**< Internal enum for security type. It should be matched with API side */
+typedef enum {
+       MESHD_SECURITY_NONE = 0, /**< No security */
+       MESHD_SECURITY_SAE, /**< SAE */
+} meshd_security_type_e;
+
 /**< mesh interface information structure */
 typedef struct {
        gchar *bridge_interface; /**< Bridge name between mesh and others */
@@ -60,7 +66,7 @@ typedef struct _mesh_network_info {
        char* mesh_id; /**< The mesh id */
        char* bssid; /**< BSSID */
        int channel; /**< Channel */
-       int security; /**< Security type */
+       meshd_security_type_e security; /**< Security type */
        meshd_connection_state_e state; /**< Connection state */
 } mesh_network_info_s;
 
@@ -73,6 +79,7 @@ typedef struct {
        gint rssi; /**< RSSI */
        gint channel; /**< Channel */
        gint data_rate; /**< Data rate */
+       meshd_security_type_e security; /**< Security type */
        meshd_connection_state_e state; /**< Connection state */
 } mesh_scan_result_s;
 
index 604b6f0..8eec274 100644 (file)
@@ -36,6 +36,7 @@
                        <arg type="s" name="mesh_id" direction="out"/>\r
                        <arg type="s" name="bssid" direction="out"/>\r
                        <arg type="i" name="channel" direction="out"/>\r
+                       <arg type="i" name="security" direction="out"/>\r
                        <arg type="i" name="state" direction="out"/>\r
                        <arg type="i" name="result" direction="out"/>\r
                </method>\r
@@ -73,6 +74,7 @@
                        <arg type="s" name="mesh_id" direction="in"/>\r
                        <arg type="i" name="channel" direction="in"/>\r
                        <arg type="i" name="security" direction="in"/>\r
+                       <arg type="s" name="passphrase" direction="in"/>\r
                        <arg type="i" name="result" direction="out"/>\r
                </method>\r
                <method name="disconnect_mesh_network">\r
                        <arg type="s" name="mesh_id" direction="out"/>\r
                        <arg type="s" name="bssid" direction="out"/>\r
                        <arg type="i" name="channel" direction="out"/>\r
+                       <arg type="i" name="security" direction="out"/>\r
                        <arg type="i" name="state" direction="out"/>\r
                </signal>\r
                <signal name="sta_joined">\r
index 4f7bdf7..01912d2 100644 (file)
@@ -245,7 +245,7 @@ static void _meshd_signal_handler(GDBusConnection *connection,
                }
 
                mesh_notify_connection_state(network_info.mesh_id, network_info.bssid,
-                       network_info.channel, state);
+                       network_info.channel, network_info.security, state);
 
                g_free(network_info.mesh_id);
                g_free(network_info.bssid);
@@ -592,7 +592,7 @@ static void _get_joined_network(mesh_service *service, GVariant *variant)
                                buf = g_variant_get_string(val, &len);
                                joined_info->mesh_id = g_strdup(buf);
                        }
-                       else if (strcasecmp(key, "Address") == 0)  {
+                       else if (strcasecmp(key, "BSSID") == 0)  {
                                buf = g_variant_get_string(val, &len);
                                joined_info->bssid = g_strdup(buf);
                        }
@@ -614,6 +614,13 @@ static void _get_joined_network(mesh_service *service, GVariant *variant)
                                        joined_info->state = MESHD_CONNECTION_STATE_CONNECTED;
                                }
                        }
+                       else if (strcasecmp(key, "Security") == 0)  {
+                               buf = g_variant_get_string(val, &len);
+                               if (g_strcmp0("sae", buf) == 0)
+                                       joined_info->security = MESHD_SECURITY_SAE;
+                               else
+                                       joined_info->security = MESHD_SECURITY_NONE;
+                       }
                        else if (strcasecmp(key, "Frequency") == 0)  {
                                joined_info->channel = __frequency_to_channel(g_variant_get_uint16(val));
                        }
@@ -626,9 +633,11 @@ static void _get_joined_network(mesh_service *service, GVariant *variant)
                        continue;
                }
 
-               MESH_LOGD("    Mesh ID : %s", joined_info->mesh_id);
-               MESH_LOGD("    BSSID   : %s", joined_info->bssid);
-               MESH_LOGD("    Channel : %d", joined_info->channel);
+               MESH_LOGD("    Mesh ID  : %s", joined_info->mesh_id);
+               MESH_LOGD("    BSSID    : %s", joined_info->bssid);
+               MESH_LOGD("    Channel  : %d", joined_info->channel);
+               MESH_LOGD("    Security : %s",
+                       (MESHD_SECURITY_SAE == joined_info->security) ? "SAE" : "NONE");
                service->joined_network = joined_info;
 
                g_variant_iter_free(property);
@@ -674,7 +683,7 @@ static void _get_mesh_peers(mesh_service *service, GVariant *variant)
                                scan_info->mesh_id = g_strdup(buf);
                                MESH_LOGD("    Mesh ID : %s", scan_info->mesh_id);
                        }
-                       else if (strcasecmp(key, "Address") == 0)  {
+                       else if (strcasecmp(key, "BSSID") == 0)  {
                                const char *buf = g_variant_get_string(val, &len);
                                scan_info->bssid = g_strdup(buf);
                                MESH_LOGD("    BSSID : %s", scan_info->bssid);
@@ -698,6 +707,10 @@ static void _get_mesh_peers(mesh_service *service, GVariant *variant)
                        else if (strcasecmp(key, "Security") == 0)  {
                                const char *buf = g_variant_get_string(val, &len);
                                MESH_LOGD("    Security : %s", buf);
+                               if (g_strcmp0("sae", buf) == 0)
+                                       scan_info->security = MESHD_SECURITY_SAE;
+                               else
+                                       scan_info->security = MESHD_SECURITY_NONE;
                        }
                        else if (strcasecmp(key, "Frequency") == 0)  {
                                scan_info->channel = __frequency_to_channel(g_variant_get_uint16(val));
@@ -883,7 +896,7 @@ static void _get_mesh_property(GVariant *variant, mesh_network_info_s *result)
                        result->mesh_id = g_strdup(buf);
                        MESH_LOGD("    Mesh ID : %s", result->mesh_id);
                }
-               else if (strcasecmp(key, "Address") == 0)  {
+               else if (strcasecmp(key, "BSSID") == 0)  {
                        const char *buf = g_variant_get_string(val, &len);
                        result->bssid = g_strdup(buf);
                        MESH_LOGD("    BSSID : %s", result->bssid);
@@ -907,6 +920,10 @@ static void _get_mesh_property(GVariant *variant, mesh_network_info_s *result)
                else if (strcasecmp(key, "Security") == 0)  {
                        const char *buf = g_variant_get_string(val, &len);
                        MESH_LOGD("    Security : %s", buf);
+                       if (g_strcmp0("sae", buf) == 0)
+                               result->security = MESHD_SECURITY_SAE;
+                       else
+                               result->security = MESHD_SECURITY_NONE;
                }
                else if (strcasecmp(key, "Frequency") == 0)  {
                        result->channel = __frequency_to_channel(g_variant_get_uint16(val));
@@ -957,14 +974,14 @@ static int _mesh_ipc_get_mesh_network_property(mesh_service *service,
        return MESHD_ERROR_NONE;
 }
 
-int mesh_ipc_create_network(mesh_service *service, gchar *mesh_id, gint channel,
-        gint security)
+int mesh_ipc_create_network(mesh_service *service, gchar *mesh_id,
+               gint channel, meshd_security_type_e sec)
 {
        GVariant *variant = NULL;
        GError *error = NULL;
        GVariant *var_dict = NULL;
        GVariantBuilder builder;
-       const gchar* secu = (security == 0) ? "none" : "SAE";
+       const gchar* security = (MESHD_SECURITY_SAE == sec) ? "sae" : "none";
 
        enum nl80211_band band = (channel <= 14) ? NL80211_BAND_2GHZ : NL80211_BAND_5GHZ;
        gushort freq = __channel_to_frequency(channel, band);
@@ -990,7 +1007,7 @@ int mesh_ipc_create_network(mesh_service *service, gchar *mesh_id, gint channel,
 
        g_variant_builder_open(&builder, G_VARIANT_TYPE("{sv}"));
        g_variant_builder_add(&builder, "s", "Security");
-       g_variant_builder_add(&builder, "v", g_variant_new_string(secu));
+       g_variant_builder_add(&builder, "v", g_variant_new_string(security));
        g_variant_builder_close(&builder); /* {sv} */
 
        g_variant_builder_close(&builder); /* a{sv} */
@@ -1011,6 +1028,36 @@ int mesh_ipc_create_network(mesh_service *service, gchar *mesh_id, gint channel,
 
        return MESHD_ERROR_NONE;
 }
+
+int mesh_ipc_set_passphrase(mesh_service *service, mesh_scan_result_s *info,
+        gchar *passphrase)
+{
+       GVariant *variant = NULL;
+       GError *error = NULL;
+
+       meshd_check_null_ret_error("service", service, MESHD_ERROR_INVALID_PARAMETER);
+       meshd_check_null_ret_error("passphrase", passphrase, MESHD_ERROR_INVALID_PARAMETER);
+
+       variant = g_dbus_connection_call_sync(service->connection,
+                       CONNMAN_SERVER_NAME,
+                       info->object_path,
+                       CONNMAN_INTERFACE_MESH,
+                       "SetProperty",
+                       g_variant_new("(sv)", "Passphrase", g_variant_new_string(passphrase)),
+                       NULL,
+                       G_DBUS_CALL_FLAGS_NONE,
+                       -1, NULL, &error);
+       if (variant) {
+               MESH_LOGD("Successfully requested. [SetProperty]");
+       } else if (error) {
+               LOGE("Failed DBus call [%s]", error->message);
+               g_error_free(error);
+               return MESHD_ERROR_IO_ERROR;
+       }
+
+       return MESHD_ERROR_NONE;
+}
+
 #if 0
 static void on_response_connect_network(GObject *source_object,
        GAsyncResult *res, gpointer user_data)
index 694e328..c63e1a5 100644 (file)
@@ -166,6 +166,7 @@ int mesh_network_add_mesh_network(GList **saved_network, const char *mesh_id,
        mesh_network_info_s *info = NULL;
        GList *iter = NULL;
        gboolean found = FALSE;
+       meshd_security_type_e sec = (1 == security) ? MESHD_SECURITY_SAE : MESHD_SECURITY_NONE;
 
        meshd_check_null_ret_error("saved_network", saved_network,
                        MESHD_ERROR_INVALID_PARAMETER);
@@ -175,7 +176,7 @@ int mesh_network_add_mesh_network(GList **saved_network, const char *mesh_id,
                info = (mesh_network_info_s*)iter->data;
 
                if (g_strcmp0(mesh_id, info->mesh_id) == 0) {
-                       if (info->channel == mesh_channel && info->security == security)
+                       if (info->channel == mesh_channel && info->security == sec)
                        {
                                found = TRUE;
                                break;
@@ -275,6 +276,7 @@ int mesh_network_select_saved_mesh_network(GList **saved_network,
        mesh_network_info_s *info = NULL;
        mesh_network_info_s *moved = NULL;
        gboolean found = FALSE;
+       meshd_security_type_e sec = (1 == security) ? MESHD_SECURITY_SAE : MESHD_SECURITY_NONE;
 
        meshd_check_null_ret_error("saved_network", saved_network,
                        MESHD_ERROR_INVALID_PARAMETER);
@@ -284,7 +286,7 @@ int mesh_network_select_saved_mesh_network(GList **saved_network,
                info = (mesh_network_info_s*)iter->data;
 
                if (g_strcmp0(mesh_id, info->mesh_id) == 0) {
-                       if (info->channel == mesh_channel && info->security == security)
+                       if (info->channel == mesh_channel && info->security == sec)
                        {
                                moved = g_try_new0(mesh_network_info_s, 1);
                                if (NULL == moved) {
@@ -323,6 +325,7 @@ int mesh_network_forget_saved_mesh_network(GList **saved_network,
        GList *iter = NULL;
        mesh_network_info_s *info = NULL;
        gboolean found = FALSE;
+       meshd_security_type_e sec = (1 == security) ? MESHD_SECURITY_SAE : MESHD_SECURITY_NONE;
 
        meshd_check_null_ret_error("saved_network", saved_network,
                        MESHD_ERROR_INVALID_PARAMETER);
@@ -332,7 +335,7 @@ int mesh_network_forget_saved_mesh_network(GList **saved_network,
                info = (mesh_network_info_s*)iter->data;
 
                if (g_strcmp0(mesh_id, info->mesh_id) == 0) {
-                       if (info->channel == mesh_channel && info->security == security)
+                       if (info->channel == mesh_channel && info->security == sec)
                        {
                                found = TRUE;
                                break;
index 917d26a..a835b9a 100644 (file)
@@ -797,7 +797,7 @@ int mesh_request_ipc_mesh_get_peers(mesh_service *service)
 }
 
 static int _select_matched_network(GList *scanned_network,
-               const char *mesh_id, int mesh_channel, int security,
+               const char *mesh_id, int mesh_channel, meshd_security_type_e sec,
                mesh_scan_result_s **info)
 {
        int ret = MESHD_ERROR_NONE;
@@ -805,8 +805,6 @@ static int _select_matched_network(GList *scanned_network,
        mesh_scan_result_s *item = NULL;
        gboolean found = FALSE;
 
-       NOTUSED(security);
-
        meshd_check_null_ret_error("scanned_network", scanned_network,
                        MESHD_ERROR_INVALID_PARAMETER);
 
@@ -815,7 +813,7 @@ static int _select_matched_network(GList *scanned_network,
                item = (mesh_scan_result_s*)iter->data;
 
                if (g_strcmp0(mesh_id, item->mesh_id) == 0) {
-                       if (item->channel == mesh_channel)
+                       if (item->channel == mesh_channel && item->security == sec)
                        {
                                *info = item;
                                found = TRUE;
@@ -852,7 +850,7 @@ int mesh_request_ipc_get_joined_network(mesh_service *service)
 }
 
 int mesh_request_ipc_create_mesh_network(mesh_service *service, gchar *mesh_id,
-               gint channel, gint security)
+               gint channel, meshd_security_type_e sec)
 {
        int ret;
 
@@ -863,7 +861,7 @@ int mesh_request_ipc_create_mesh_network(mesh_service *service, gchar *mesh_id,
 
        MESH_LOGD("[IPC] Create a new mesh network");
 
-       ret = mesh_ipc_create_network(service, mesh_id, channel, security);
+       ret = mesh_ipc_create_network(service, mesh_id, channel, sec);
        if(MESHD_ERROR_NONE != ret) {
                MESH_LOGE("Failed to create mesh network");
                return ret;
@@ -873,7 +871,7 @@ int mesh_request_ipc_create_mesh_network(mesh_service *service, gchar *mesh_id,
 }
 
 int mesh_request_ipc_connect_mesh_network(mesh_service *service, gchar *mesh_id,
-               gint channel, gint security)
+               gint channel, meshd_security_type_e sec, gchar *passphrase)
 {
        int ret;
        mesh_scan_result_s *info = NULL;
@@ -887,12 +885,26 @@ int mesh_request_ipc_connect_mesh_network(mesh_service *service, gchar *mesh_id,
 
        /* Get mesh_id and channel from saved network */
        ret = _select_matched_network(service->scanned_mesh_network,
-                       mesh_id, channel, security, &info);
+                       mesh_id, channel, sec, &info);
        if(MESHD_ERROR_NONE != ret) {
                MESH_LOGE("Failed to mesh_network_get_first_mesh_network");
                return ret;
        }
 
+       /* Set passphrase */
+       if (MESHD_SECURITY_NONE != sec) {
+               if (NULL != passphrase) {
+                       ret = mesh_ipc_set_passphrase(service, info, passphrase);
+                       if(MESHD_ERROR_NONE != ret) {
+                               MESH_LOGE("Failed to set passphrase for mesh network");
+                               return ret;
+                       }
+               } else {
+                       MESH_LOGE("Passphrase is required !");
+                       return MESHD_ERROR_INVALID_PARAMETER;
+               }
+       }
+
        ret = mesh_ipc_connect_network(service, info);
        if(MESHD_ERROR_NONE != ret) {
                MESH_LOGE("Failed to connect mesh network");
@@ -903,7 +915,7 @@ int mesh_request_ipc_connect_mesh_network(mesh_service *service, gchar *mesh_id,
 }
 
 int mesh_request_ipc_disconnect_mesh_network(mesh_service *service,
-               gchar *mesh_id, gint channel, gint security)
+               gchar *mesh_id, gint channel, meshd_security_type_e sec)
 {
        int ret;
        mesh_scan_result_s *info = NULL;
@@ -917,7 +929,7 @@ int mesh_request_ipc_disconnect_mesh_network(mesh_service *service,
 
        /* Get mesh_id and channel from saved network */
        ret = _select_matched_network(service->scanned_mesh_network,
-                       mesh_id, channel, security, &info);
+                       mesh_id, channel, sec, &info);
        if(MESHD_ERROR_NONE != ret) {
                MESH_LOGE("Failed to _select_matched_network");
                return ret;
@@ -933,7 +945,7 @@ int mesh_request_ipc_disconnect_mesh_network(mesh_service *service,
 }
 
 int mesh_request_ipc_remove_mesh_network(mesh_service *service,
-               gchar *mesh_id, gint channel, gint security)
+               gchar *mesh_id, gint channel, meshd_security_type_e sec)
 {
        int ret;
        mesh_scan_result_s *info = NULL;
@@ -947,7 +959,7 @@ int mesh_request_ipc_remove_mesh_network(mesh_service *service,
 
        /* Get mesh_id and channel from saved network */
        ret = _select_matched_network(service->scanned_mesh_network,
-                       mesh_id, channel, security, &info);
+                       mesh_id, channel, sec, &info);
        if(MESHD_ERROR_NONE != ret) {
                MESH_LOGE("Failed to _select_matched_network");
                return ret;
@@ -971,11 +983,12 @@ void mesh_notify_scan_done()
 }
 
 void mesh_notify_connection_state(const char* mesh_id, const char* bssid,
-               int channel, meshd_connection_state_e state)
+               int channel, meshd_security_type_e sec, meshd_connection_state_e state)
 {
        NetMesh *object = meshd_dbus_get_object();
 
-       net_mesh_emit_connection_state(object, mesh_id, bssid, channel, (int)state);
+       net_mesh_emit_connection_state(object, mesh_id, bssid, channel,
+               (int)sec, (int)state);
 }
 
 void mesh_notify_station_joined(const char* bssid)
index 85c99f4..15d3d56 100644 (file)
@@ -384,6 +384,8 @@ static gboolean _meshd_dbus_handle_get_found_mesh_networks(NetMesh *object,
                                g_variant_new_int32(scan_item->rssi));
                g_variant_builder_add(&builder, "{sv}", "channel",
                                g_variant_new_uint32(scan_item->channel));
+               g_variant_builder_add(&builder, "{sv}", "security",
+                               g_variant_new_uint32((int)scan_item->security));
                g_variant_builder_add(&builder, "{sv}", "state",
                                g_variant_new_uint32(scan_item->state));
                g_variant_builder_close(&builder);
@@ -534,14 +536,15 @@ static gboolean _meshd_dbus_handle_get_joined_mesh_network(NetMesh *object,
                if (joined) {
                        net_mesh_complete_get_joined_mesh_network(object, invocation,
                                joined->mesh_id, joined->bssid,
-                               joined->channel, joined->state, ret);
+                               joined->channel, (int)joined->security,
+                               joined->state, ret);
                } else {
                        net_mesh_complete_get_joined_mesh_network(object, invocation,
-                               "", "", 0, 0, MESHD_ERROR_NO_DATA);
+                               "", "", 0, 0, 0, MESHD_ERROR_NO_DATA);
                }
        } else {
                net_mesh_complete_get_joined_mesh_network(object, invocation,
-                       "", "", 0, 0, ret);
+                       "", "", 0, 0, 0, ret);
        }
 
        return TRUE;
@@ -699,10 +702,11 @@ static gboolean _meshd_dbus_handle_create_mesh_network(NetMesh *object,
 {
        int ret = MESHD_ERROR_NONE;
        mesh_service *service = (mesh_service *)user_data;
+       meshd_security_type_e sec = (1 == security) ? MESHD_SECURITY_SAE : MESHD_SECURITY_NONE;
 
        //ret = mesh_request_add_mesh_network(&service->saved_mesh_network,
        //              mesh_id, channel, security);
-       ret = mesh_request_ipc_create_mesh_network(service, mesh_id, channel, security);
+       ret = mesh_request_ipc_create_mesh_network(service, mesh_id, channel, sec);
 
        net_mesh_complete_create_mesh_network(object, invocation, ret);
 
@@ -755,17 +759,17 @@ static gboolean _meshd_dbus_handle_get_saved_mesh_network(NetMesh *object,
 #endif
 static gboolean _meshd_dbus_handle_connect_mesh_network(NetMesh *object,
                GDBusMethodInvocation *invocation,
-               gchar *mesh_id, gint channel, gint security,
+               gchar *mesh_id, gint channel, gint security, gchar *passphrase,
                gpointer user_data)
 {
        int ret = MESHD_ERROR_NONE;
        mesh_service *service = (mesh_service *)user_data;
-
+       meshd_security_type_e sec = (1 == security) ? MESHD_SECURITY_SAE : MESHD_SECURITY_NONE;
        //ret = mesh_request_select_saved_mesh_network(&service->saved_mesh_network,
        //              mesh_id, channel, security);
 
 /* ADDED */
-       ret = mesh_request_ipc_connect_mesh_network(service, mesh_id, channel, security);
+       ret = mesh_request_ipc_connect_mesh_network(service, mesh_id, channel, sec, passphrase);
 /* ADDED */
 
        net_mesh_complete_connect_mesh_network(object, invocation, ret);
@@ -779,8 +783,9 @@ static gboolean _meshd_dbus_handle_disconnect_mesh_network(NetMesh *object,
 {
        int ret = MESHD_ERROR_NONE;
        mesh_service *service = (mesh_service *)user_data;
+       meshd_security_type_e sec = (1 == security) ? MESHD_SECURITY_SAE : MESHD_SECURITY_NONE;
 
-       ret = mesh_request_ipc_disconnect_mesh_network(service, mesh_id, channel, security);
+       ret = mesh_request_ipc_disconnect_mesh_network(service, mesh_id, channel, sec);
 
        net_mesh_complete_disconnect_mesh_network(object, invocation, ret);
 
@@ -794,11 +799,11 @@ static gboolean _meshd_dbus_handle_forget_mesh_network(NetMesh *object,
 {
        int ret = MESHD_ERROR_NONE;
        mesh_service *service = (mesh_service *)user_data;
+       meshd_security_type_e sec = (1 == security) ? MESHD_SECURITY_SAE : MESHD_SECURITY_NONE;
 
        //ret = mesh_request_forget_saved_mesh_network(&service->saved_mesh_network,
        //              mesh_id, channel, security);
-       ret = mesh_request_ipc_remove_mesh_network(service,
-                       mesh_id, channel, security);
+       ret = mesh_request_ipc_remove_mesh_network(service, mesh_id, channel, sec);
 
        net_mesh_complete_forget_mesh_network(object, invocation, ret);