return CONNECTION_MPTCP_PM_DEFAULT;
if (g_strcmp0(pm, "fullmesh") == 0)
return CONNECTION_MPTCP_PM_FULLMESH;
- return CONNECTION_MPTCP_PM_UNKNOWN;
+ return CONNECTION_MPTCP_PM_UNKNOWN; //LCOV_EXCL_LINE
}
static const char* __convert_mptcp_scheduler_enum_to_str(connection_mptcp_scheduler_e scheduler)
return CONNECTION_MPTCP_SCHEDULER_DEFAULT;
if (g_strcmp0(scheduler, "roundrobin") == 0)
return CONNECTION_MPTCP_SCHEDULER_ROUNDROBIN;
- return CONNECTION_MPTCP_SCHEDULER_UNKNOWN;
+ 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");
+ CONNECTION_LOG(CONNECTION_ERROR, "Access denied"); //LCOV_EXCL_LINE
return false;
} else if (rv != NET_ERR_NONE) {
- CONNECTION_LOG(CONNECTION_ERROR, "Failed to enable MPTCP [%d]", rv);
+ CONNECTION_LOG(CONNECTION_ERROR, "Failed to enable MPTCP [%d]", rv); //LCOV_EXCL_LINE
return false;
}
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_enable((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");
- return CONNECTION_ERROR_PERMISSION_DENIED;
+ CONNECTION_LOG(CONNECTION_ERROR, "Access denied"); //LCOV_EXCL_LINE
+ return CONNECTION_ERROR_PERMISSION_DENIED; //LCOV_EXCL_LINE
} else if (rv != NET_ERR_NONE) {
- CONNECTION_LOG(CONNECTION_ERROR, "Failed to enable MPTCP [%d]", rv);
- return CONNECTION_ERROR_OPERATION_FAILED;
+ CONNECTION_LOG(CONNECTION_ERROR, "Failed to enable MPTCP [%d]", rv); //LCOV_EXCL_LINE
+ return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
}
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");
- return CONNECTION_ERROR_PERMISSION_DENIED;
+ CONNECTION_LOG(CONNECTION_ERROR, "Access denied"); //LCOV_EXCL_LINE
+ return CONNECTION_ERROR_PERMISSION_DENIED; //LCOV_EXCL_LINE
} else if (rv != NET_ERR_NONE) {
- CONNECTION_LOG(CONNECTION_ERROR, "Failed to get MPTCP enabled state [%d]", rv);
- return CONNECTION_ERROR_OPERATION_FAILED;
+ CONNECTION_LOG(CONNECTION_ERROR, "Failed to get MPTCP enabled state [%d]", rv); //LCOV_EXCL_LINE
+ return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
}
*enable = (connection_mptcp_enable_e)result;
}
-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);
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");
- return CONNECTION_ERROR_PERMISSION_DENIED;
+ CONNECTION_LOG(CONNECTION_ERROR, "Access denied"); //LCOV_EXCL_LINE
+ return CONNECTION_ERROR_PERMISSION_DENIED; //LCOV_EXCL_LINE
} else if (rv != NET_ERR_NONE) {
- CONNECTION_LOG(CONNECTION_ERROR, "Failed to set MPTCP path manager [%d]", rv);
- return CONNECTION_ERROR_OPERATION_FAILED;
+ CONNECTION_LOG(CONNECTION_ERROR, "Failed to set MPTCP path manager [%d]", rv); //LCOV_EXCL_LINE
+ return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
}
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");
- return CONNECTION_ERROR_PERMISSION_DENIED;
+ CONNECTION_LOG(CONNECTION_ERROR, "Access denied"); //LCOV_EXCL_LINE
+ return CONNECTION_ERROR_PERMISSION_DENIED; //LCOV_EXCL_LINE
} else if (rv != NET_ERR_NONE) {
- CONNECTION_LOG(CONNECTION_ERROR, "Failed to get MPTCP path manager [%d]", rv);
- return CONNECTION_ERROR_OPERATION_FAILED;
+ CONNECTION_LOG(CONNECTION_ERROR, "Failed to get MPTCP path manager [%d]", rv); //LCOV_EXCL_LINE
+ return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
}
CONNECTION_LOG(CONNECTION_ERROR, "get path manager %s", result);
}
-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);
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");
- return CONNECTION_ERROR_PERMISSION_DENIED;
+ CONNECTION_LOG(CONNECTION_ERROR, "Access denied"); //LCOV_EXCL_LINE
+ return CONNECTION_ERROR_PERMISSION_DENIED; //LCOV_EXCL_LINE
} else if (rv != NET_ERR_NONE) {
- CONNECTION_LOG(CONNECTION_ERROR, "Failed to set MPTCP scheduler [%d]", rv);
- return CONNECTION_ERROR_OPERATION_FAILED;
+ CONNECTION_LOG(CONNECTION_ERROR, "Failed to set MPTCP scheduler [%d]", rv); //LCOV_EXCL_LINE
+ return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
}
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");
- return CONNECTION_ERROR_PERMISSION_DENIED;
+ CONNECTION_LOG(CONNECTION_ERROR, "Access denied"); //LCOV_EXCL_LINE
+ return CONNECTION_ERROR_PERMISSION_DENIED; //LCOV_EXCL_LINE
} else if (rv != NET_ERR_NONE) {
- CONNECTION_LOG(CONNECTION_ERROR, "Failed to get MPTCP scheduler [%d]", rv);
- return CONNECTION_ERROR_OPERATION_FAILED;
+ CONNECTION_LOG(CONNECTION_ERROR, "Failed to get MPTCP scheduler [%d]", rv); //LCOV_EXCL_LINE
+ return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
}
CONNECTION_LOG(CONNECTION_ERROR, "get scheduler %s", result);