X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Fconnection_extension.h;h=3f0457fa2856dbbb1fc7525e6bb92d84d4983349;hb=refs%2Fchanges%2F06%2F173506%2F3;hp=9ad8ef63be039a06bbee7ea9df02f6892c720fb3;hpb=110ed310e2c690a851b3f14c61daf83ea1d92b31;p=platform%2Fcore%2Fapi%2Fconnection.git diff --git a/include/connection_extension.h b/include/connection_extension.h index 9ad8ef6..3f0457f 100755 --- a/include/connection_extension.h +++ b/include/connection_extension.h @@ -97,32 +97,137 @@ int connection_create_cs(int tid, connection_h *connection); int connection_destroy_cs(int tid, connection_h connection); typedef enum { - CONNECTION_MPTCP_DISABLE = 0, - CONNECTION_MPTCP_ENABLE_ALL = 1, - CONNECTION_MPTCP_ENABLE_SOCKOPT = 2, + CONNECTION_MPTCP_DISABLE = 0, // disable + CONNECTION_MPTCP_ENABLE_ALL = 1, // enable + CONNECTION_MPTCP_ENABLE_SOCKOPT = 2, // enable if the MPTCP_ENABLED socket option is set } connection_mptcp_enable_e; typedef enum { - CONNECTION_MPTCP_PM_UNKNOWN, - CONNECTION_MPTCP_PM_DEFAULT, - CONNECTION_MPTCP_PM_FULLMESH, + CONNECTION_MPTCP_PM_UNKNOWN, // Unknown path manager + CONNECTION_MPTCP_PM_DEFAULT, // Default path manager - Do nothing + CONNECTION_MPTCP_PM_FULLMESH, // Full mesh of subflows } connection_mptcp_path_manager_e; typedef enum { - CONNECTION_MPTCP_SCHEDULER_UNKNOWN, - CONNECTION_MPTCP_SCHEDULER_DEFAULT, - CONNECTION_MPTCP_SCHEDULER_ROUNDROBIN, + CONNECTION_MPTCP_SCHEDULER_UNKNOWN, // Unknown scheduler + CONNECTION_MPTCP_SCHEDULER_DEFAULT, // Default scheduler + CONNECTION_MPTCP_SCHEDULER_ROUNDROBIN, // Round robin scheduler } connection_mptcp_scheduler_e; -int connection_mptcp_enable(connection_mptcp_enable_e enable); -int connection_mptcp_disable(void); -int connection_mptcp_get_enabled(connection_mptcp_enable_e* enable); +/** + * @brief Check if Multipath TCP is supported + * @since_tizen 5.0 + * @param[in] connection The connection handle + * @param[out] supported true if Multipath TCP is supported, false otherwise + * @return @c 0 on success, + * otherwise a negative error value + * @retval #CONNECTION_ERROR_NONE Successful + */ +int connection_mptcp_is_supported(connection_h connection, bool* supported); + +/** + * @brief Enable Multipath TCP + * @since_tizen 5.0 + * @param[in] connection The connection handle + * @param[in] enable The enabled value + * @return @c 0 on success, + * otherwise a negative error value + * @retval #CONNECTION_ERROR_NONE Successful + * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported + * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed + * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied + */ +int connection_mptcp_enable(connection_h connection, connection_mptcp_enable_e enable); + +/** + * @brief Disable Multipath TCP + * @since_tizen 5.0 + * @param[in] connection The connection handle + * @return @c 0 on success, + * otherwise a negative error value + * @retval #CONNECTION_ERROR_NONE Successful + * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported + * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed + * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied + */ +int connection_mptcp_disable(connection_h connection); + +/** + * @brief Get the enabled value for Multipath TCP + * @since_tizen 5.0 + * @param[in] connection The connection handle + * @param[out] enable The enabled value + * @return @c 0 on success, + * otherwise a negative error value + * @retval #CONNECTION_ERROR_NONE Successful + * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported + * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed + * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied + */ +int connection_mptcp_get_enabled(connection_h connection, connection_mptcp_enable_e* enable); + +/** + * @brief Set the path manager of Multipath TCP + * @since_tizen 5.0 + * @param[in] connection The connection handle + * @param[in] pm The path manager of Multipath TCP + * @return @c 0 on success, + * otherwise a negative error value + * @retval #CONNECTION_ERROR_NONE Successful + * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported + * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed + * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied + */ +int connection_mptcp_set_path_manager(connection_h connection, connection_mptcp_path_manager_e pm); -int connection_mptcp_set_path_manager(connection_mptcp_path_manager_e pm); -int connection_mptcp_get_path_manager(connection_mptcp_path_manager_e* pm); +/** + * @brief Get the path manager of Multipath TCP + * @since_tizen 5.0 + * @param[in] connection The connection handle + * @param[out] pm The path manager of Multipath TCP + * @return @c 0 on success, + * otherwise a negative error value + * @retval #CONNECTION_ERROR_NONE Successful + * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported + * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed + * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied + */ +int connection_mptcp_get_path_manager(connection_h connection, connection_mptcp_path_manager_e* pm); -int connection_mptcp_set_scheduler(connection_mptcp_scheduler_e scheduler); -int connection_mptcp_get_scheduler(connection_mptcp_scheduler_e* scheduler); +/** + * @brief Set the path manager of Multipath TCP + * @since_tizen 5.0 + * @param[in] connection The connection handle + * @param[in] scheduler The schedduler of Multipath TCP + * @return @c 0 on success, + * otherwise a negative error value + * @retval #CONNECTION_ERROR_NONE Successful + * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported + * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed + * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied + */ +int connection_mptcp_set_scheduler(connection_h connection, connection_mptcp_scheduler_e scheduler); + +/** + * @brief Set the path manager of Multipath TCP + * @since_tizen 5.0 + * @param[in] connection The connection handle + * @param[out] scheduler The schedduler of Multipath TCP + * @return @c 0 on success, + * otherwise a negative error value + * @retval #CONNECTION_ERROR_NONE Successful + * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported + * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed + * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied + */ +int connection_mptcp_get_scheduler(connection_h connection, connection_mptcp_scheduler_e* scheduler); /** * @}