EXPORT_API int connection_mptcp_enable(connection_h connection, connection_mptcp_enable_e enable)
{
- if (!(_connection_check_handle_validity(connection))) {
- CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
- return CONNECTION_ERROR_INVALID_PARAMETER;
- }
-
// check MPTCP support
if (_connection_libnet_mptcp_supported() == FALSE) {
CONNECTION_LOG(CONNECTION_ERROR, "MPTCP is not supported");
return CONNECTION_ERROR_NOT_SUPPORTED;
}
+ if (!(_connection_check_handle_validity(connection))) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
if (enable == CONNECTION_MPTCP_DISABLE) {
CONNECTION_LOG(CONNECTION_ERROR, "Use connection_mptcp_disable()");
return CONNECTION_ERROR_INVALID_PARAMETER;
EXPORT_API int connection_mptcp_disable(connection_h connection)
{
- if (!(_connection_check_handle_validity(connection))) {
- CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
- return CONNECTION_ERROR_INVALID_PARAMETER;
- }
-
// check MPTCP support
if (_connection_libnet_mptcp_supported() == FALSE) {
CONNECTION_LOG(CONNECTION_ERROR, "MPTCP is not supported");
return CONNECTION_ERROR_NOT_SUPPORTED;
}
- return _connection_libnet_mptcp_enable(CONNECTION_MPTCP_DISABLE);
-}
-
-EXPORT_API int connection_mptcp_get_enabled(connection_h connection, connection_mptcp_enable_e* enable)
-{
if (!(_connection_check_handle_validity(connection))) {
CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
return CONNECTION_ERROR_INVALID_PARAMETER;
}
+ return _connection_libnet_mptcp_enable(CONNECTION_MPTCP_DISABLE);
+}
+
+EXPORT_API int connection_mptcp_get_enabled(connection_h connection, connection_mptcp_enable_e* enable)
+{
// check MPTCP support
if (_connection_libnet_mptcp_supported() == FALSE) {
CONNECTION_LOG(CONNECTION_ERROR, "MPTCP is not supported");
return CONNECTION_ERROR_NOT_SUPPORTED;
}
+ if (!(_connection_check_handle_validity(connection))) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
if (enable == NULL) {
CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
return CONNECTION_ERROR_INVALID_PARAMETER;
EXPORT_API int connection_mptcp_set_path_manager(connection_h connection, connection_mptcp_path_manager_e pm)
{
- if (!(_connection_check_handle_validity(connection))) {
- CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
- return CONNECTION_ERROR_INVALID_PARAMETER;
- }
-
// check MPTCP support
if (_connection_libnet_mptcp_supported() == FALSE) {
CONNECTION_LOG(CONNECTION_ERROR, "MPTCP is not supported");
return CONNECTION_ERROR_NOT_SUPPORTED;
}
- return _connection_libnet_mptcp_set_path_manager(pm);
-}
-
-EXPORT_API int connection_mptcp_get_path_manager(connection_h connection, connection_mptcp_path_manager_e* pm)
-{
if (!(_connection_check_handle_validity(connection))) {
CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
return CONNECTION_ERROR_INVALID_PARAMETER;
}
+ return _connection_libnet_mptcp_set_path_manager(pm);
+}
+
+EXPORT_API int connection_mptcp_get_path_manager(connection_h connection, connection_mptcp_path_manager_e* pm)
+{
// check MPTCP support
if (_connection_libnet_mptcp_supported() == FALSE) {
CONNECTION_LOG(CONNECTION_ERROR, "MPTCP is not supported");
return CONNECTION_ERROR_NOT_SUPPORTED;
}
+ if (!(_connection_check_handle_validity(connection))) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
if (pm == NULL) {
CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
return CONNECTION_ERROR_INVALID_PARAMETER;
EXPORT_API int connection_mptcp_set_scheduler(connection_h connection, connection_mptcp_scheduler_e scheduler)
{
- if (!(_connection_check_handle_validity(connection))) {
- CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
- return CONNECTION_ERROR_INVALID_PARAMETER;
- }
-
// check MPTCP support
if (_connection_libnet_mptcp_supported() == FALSE) {
CONNECTION_LOG(CONNECTION_ERROR, "MPTCP is not supported");
return CONNECTION_ERROR_NOT_SUPPORTED;
}
- return _connection_libnet_mptcp_set_scheduler(scheduler);
-}
-
-EXPORT_API int connection_mptcp_get_scheduler(connection_h connection, connection_mptcp_scheduler_e* scheduler)
-{
if (!(_connection_check_handle_validity(connection))) {
CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
return CONNECTION_ERROR_INVALID_PARAMETER;
}
+ return _connection_libnet_mptcp_set_scheduler(scheduler);
+}
+
+EXPORT_API int connection_mptcp_get_scheduler(connection_h connection, connection_mptcp_scheduler_e* scheduler)
+{
// check MPTCP support
if (_connection_libnet_mptcp_supported() == FALSE) {
CONNECTION_LOG(CONNECTION_ERROR, "MPTCP is not supported");
return CONNECTION_ERROR_NOT_SUPPORTED;
}
+ if (!(_connection_check_handle_validity(connection))) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
if (scheduler == NULL) {
CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
return CONNECTION_ERROR_INVALID_PARAMETER;