Merge "Fix wrong function name" into tizen submit/tizen/20180903.045143
authorJaehyun Kim <jeik01.kim@samsung.com>
Mon, 3 Sep 2018 04:10:45 +0000 (04:10 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Mon, 3 Sep 2018 04:10:45 +0000 (04:10 +0000)
1  2 
src/connection_mptcp.c

diff --combined src/connection_mptcp.c
@@@ -36,18 -36,19 +36,19 @@@ EXPORT_API int connection_mptcp_is_supp
  
  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 (enable == CONNECTION_MPTCP_DISABLE) {
 +      if (!(_connection_check_handle_validity(connection))) {
 +              CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
 +              return CONNECTION_ERROR_INVALID_PARAMETER;
 +      }
 +
+       if (enable <= CONNECTION_MPTCP_DISABLE
+                       || enable > CONNECTION_MPTCP_ENABLE_SOCKOPT) {
                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;