X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Fconnection_extension.h;h=18a654554632b3f1942517e62c04c6962fc4c552;hb=b02530e18fa455f3f1ecdcac7f1cd56936c92002;hp=0a8cd15b816279ad1c459846f78d9a29729bdaad;hpb=59d7765e2a3ddea4be053bc9c511c53f8367be19;p=platform%2Fcore%2Fapi%2Fconnection.git diff --git a/include/connection_extension.h b/include/connection_extension.h index 0a8cd15..18a6545 100755 --- a/include/connection_extension.h +++ b/include/connection_extension.h @@ -18,7 +18,7 @@ #define __TIZEN_NETWORK_CONNECTION_EXTENSION_H__ #include "net_connection.h" -#include "network-mptcp-intf.h" +#include #ifdef __cplusplus extern "C" { @@ -29,6 +29,14 @@ extern "C" { */ /** + * @brief Enumeration for extended network connection type. + * @since_tizen 5.0 + */ +typedef enum { + CONNECTION_PROFILE_TYPE_MESH = CONNECTION_PROFILE_TYPE_BT + 1, /**< Wi-Fi Mesh type */ +} connection_profile_type_extended_e; + +/** * @brief Start TCP Dump. * * @param[in] connection The connection handle @@ -65,34 +73,169 @@ int connection_profile_stop_tcpdump(connection_h connection); */ int connection_profile_get_tcpdump_state(connection_h connection, gboolean *tcpdump_state); +/** + * @brief Creates a handle for managing data connections in C# API. + * @since_tizen 5.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/network.get + * @remarks You must release @a handle using connection_destroy_cs(). + * @param[in] tid TID in C# + * @param[out] 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_OUT_OF_MEMORY Out of memory + * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied + * @see connection_destroy_cs() + */ +int connection_create_cs(int tid, connection_h *connection); + +/** + * @brief Destroys the connection handle in C# API. + * @since_tizen 5.0 + * @param[in] tid TID in C# + * @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 + * @see connection_create_cs() + */ +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); -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 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); -int connection_mptcp_set_scheduler(connection_mptcp_scheduler_e scheduler); -int connection_mptcp_get_scheduler(connection_mptcp_scheduler_e* scheduler); +/** + * @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); + +/** + * @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); + +/** + * @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); /** * @}