Make local handle for event loop
[platform/core/api/connection.git] / src / libnetwork_mptcp.c
index dcf1255..ebbff07 100755 (executable)
@@ -65,12 +65,12 @@ static connection_mptcp_scheduler_e __convert_mptcp_scheduler_str_to_enum(char *
        return CONNECTION_MPTCP_SCHEDULER_UNKNOWN;      //LCOV_EXCL_LINE
 }
 
-gboolean _connection_libnet_mptcp_supported()
+gboolean _connection_libnet_mptcp_supported(connection_handle_s *conn_handle)
 {
        int rv = 0;
        gboolean support = false;
 
-       rv = net_mptcp_supported(&support);
+       rv = net_mptcp_supported(conn_handle->network_info_handle, &support);
        if (rv == NET_ERR_ACCESS_DENIED) {
                CONNECTION_LOG(CONNECTION_ERROR, "Access denied");      //LCOV_EXCL_LINE
                return false;
@@ -82,11 +82,11 @@ gboolean _connection_libnet_mptcp_supported()
        return support;
 }
 
-int _connection_libnet_mptcp_enable(connection_mptcp_enable_e enable)
+int _connection_libnet_mptcp_enable(connection_handle_s *conn_handle, connection_mptcp_enable_e enable)
 {
        int rv = 0;
 
-       rv = net_mptcp_set_enabled((int)enable);
+       rv = net_mptcp_set_enabled(conn_handle->network_info_handle, (int)enable);
        if (rv == NET_ERR_ACCESS_DENIED) {
                CONNECTION_LOG(CONNECTION_ERROR, "Access denied");      //LCOV_EXCL_LINE
                return CONNECTION_ERROR_PERMISSION_DENIED;      //LCOV_EXCL_LINE
@@ -98,12 +98,12 @@ int _connection_libnet_mptcp_enable(connection_mptcp_enable_e enable)
        return CONNECTION_ERROR_NONE;
 }
 
-int _connection_libnet_mptcp_get_enabled(connection_mptcp_enable_e* enable)
+int _connection_libnet_mptcp_get_enabled(connection_handle_s *conn_handle, connection_mptcp_enable_e* enable)
 {
        int rv = 0;
        int result = 0;
 
-       rv = net_mptcp_get_enabled(&result);
+       rv = net_mptcp_get_enabled(conn_handle->network_info_handle, &result);
        if (rv == NET_ERR_ACCESS_DENIED) {
                CONNECTION_LOG(CONNECTION_ERROR, "Access denied");      //LCOV_EXCL_LINE
                return CONNECTION_ERROR_PERMISSION_DENIED;      //LCOV_EXCL_LINE
@@ -117,7 +117,7 @@ int _connection_libnet_mptcp_get_enabled(connection_mptcp_enable_e* enable)
 }
 
 
-int _connection_libnet_mptcp_set_path_manager(connection_mptcp_path_manager_e pm)
+int _connection_libnet_mptcp_set_path_manager(connection_handle_s *conn_handle, connection_mptcp_path_manager_e pm)
 {
        int rv = 0;
        const char* str = __convert_mptcp_path_manager_enum_to_str(pm);
@@ -128,7 +128,7 @@ int _connection_libnet_mptcp_set_path_manager(connection_mptcp_path_manager_e pm
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
-       rv = net_mptcp_set_path_manager(str);
+       rv = net_mptcp_set_path_manager(conn_handle->network_info_handle, str);
        if (rv == NET_ERR_ACCESS_DENIED) {
                CONNECTION_LOG(CONNECTION_ERROR, "Access denied");      //LCOV_EXCL_LINE
                return CONNECTION_ERROR_PERMISSION_DENIED;      //LCOV_EXCL_LINE
@@ -140,12 +140,12 @@ int _connection_libnet_mptcp_set_path_manager(connection_mptcp_path_manager_e pm
        return CONNECTION_ERROR_NONE;
 }
 
-int _connection_libnet_mptcp_get_path_manager(connection_mptcp_path_manager_e* pm)
+int _connection_libnet_mptcp_get_path_manager(connection_handle_s *conn_handle, connection_mptcp_path_manager_e* pm)
 {
        int rv = 0;
        char* result = NULL;
 
-       rv = net_mptcp_get_path_manager(&result);
+       rv = net_mptcp_get_path_manager(conn_handle->network_info_handle, &result);
        if (rv == NET_ERR_ACCESS_DENIED) {
                CONNECTION_LOG(CONNECTION_ERROR, "Access denied");      //LCOV_EXCL_LINE
                return CONNECTION_ERROR_PERMISSION_DENIED;      //LCOV_EXCL_LINE
@@ -161,7 +161,7 @@ int _connection_libnet_mptcp_get_path_manager(connection_mptcp_path_manager_e* p
 }
 
 
-int _connection_libnet_mptcp_set_scheduler(connection_mptcp_scheduler_e scheduler)
+int _connection_libnet_mptcp_set_scheduler(connection_handle_s *conn_handle, connection_mptcp_scheduler_e scheduler)
 {
        int rv = 0;
        const char *str = __convert_mptcp_scheduler_enum_to_str(scheduler);
@@ -172,7 +172,7 @@ int _connection_libnet_mptcp_set_scheduler(connection_mptcp_scheduler_e schedule
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
-       rv = net_mptcp_set_scheduler(str);
+       rv = net_mptcp_set_scheduler(conn_handle->network_info_handle, str);
        if (rv == NET_ERR_ACCESS_DENIED) {
                CONNECTION_LOG(CONNECTION_ERROR, "Access denied");      //LCOV_EXCL_LINE
                return CONNECTION_ERROR_PERMISSION_DENIED;      //LCOV_EXCL_LINE
@@ -184,12 +184,12 @@ int _connection_libnet_mptcp_set_scheduler(connection_mptcp_scheduler_e schedule
        return CONNECTION_ERROR_NONE;
 }
 
-int _connection_libnet_mptcp_get_scheduler(connection_mptcp_scheduler_e* scheduler)
+int _connection_libnet_mptcp_get_scheduler(connection_handle_s *conn_handle, connection_mptcp_scheduler_e* scheduler)
 {
        int rv = 0;
        char* result = NULL;
 
-       rv = net_mptcp_get_scheduler(&result);
+       rv = net_mptcp_get_scheduler(conn_handle->network_info_handle, &result);
        if (rv == NET_ERR_ACCESS_DENIED) {
                CONNECTION_LOG(CONNECTION_ERROR, "Access denied");      //LCOV_EXCL_LINE
                return CONNECTION_ERROR_PERMISSION_DENIED;      //LCOV_EXCL_LINE