From: Jaehyun Kim Date: Mon, 25 Feb 2019 06:43:49 +0000 (+0000) Subject: Revert "Add some APIs to clone and destroy statistics info" X-Git-Tag: submit/tizen/20190311.084912~6^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2509949aa82fb7e2b6db75487f17b565b034362d;p=platform%2Fcore%2Fapi%2Fsmart-traffic-control.git Revert "Add some APIs to clone and destroy statistics info" This reverts commit 1c180f38d95990fe85cb4f8754c093fdcb12945a. Change-Id: Ide0c0bdbd53d282a7765edcc4b762346cf48809b --- diff --git a/include/stc.h b/include/stc.h index 0b84c17..7cd58c5 100755 --- a/include/stc.h +++ b/include/stc.h @@ -696,43 +696,6 @@ int stc_stats_rule_get_iface_type(stc_stats_rule_h rule, int stc_stats_rule_get_time_period(stc_stats_rule_h rule, stc_time_period_e *time_period); -/** - * @brief Clones the statistics info handle. - * @since_tizen 5.5 - * @remarks You must release @a cloned using stc_stats_info_destroy(). - * - * @param[in] info The origin statistics info handle - * @param[out] cloned The cloned statistics info handle - * - * @return 0 on success, otherwise a negative error value - * @retval #STC_ERROR_NONE Successful - * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory - * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #STC_ERROR_NOT_SUPPORTED Not supported - * - * @see stc_h - * @see stc_stats_info_h - * @see stc_initialize() - * @see stc_stats_info_destroy() - */ -int stc_stats_info_clone(stc_stats_info_h info, stc_stats_info_h *cloned); - -/** - * @brief Destroys the statistics info handle. - * @since_tizen 5.5 - * - * @param[in] info The statistics info handle - * - * @return 0 on success, otherwise a negative error value - * @retval #STC_ERROR_NONE Successful - * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #STC_ERROR_NOT_SUPPORTED Not supported - * - * @see stc_stats_info_h - * @see stc_stats_info_clone() - */ -int stc_stats_info_destroy(stc_stats_info_h info); - /** * @brief Gets the application ID from statistics information. * @since_tizen 4.0 diff --git a/src/stc-info.c b/src/stc-info.c index 140144d..affbe89 100755 --- a/src/stc-info.c +++ b/src/stc-info.c @@ -62,58 +62,6 @@ * Local Functions Definition *****************************************************************************/ -EXPORT_API int stc_stats_info_clone(stc_stats_info_h info, stc_stats_info_h *cloned) -{ - CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_STC); - - if (info == NULL || cloned == NULL) { - STC_LOGE("Invalid parameter"); - return STC_ERROR_INVALID_PARAMETER; - } - - stc_stats_info_s *stats_info = MALLOC0(stc_stats_info_s, 1); - if (!stats_info) { - STC_LOGE("Memory allocation failed"); - return STC_ERROR_OUT_OF_MEMORY; - } - - stc_stats_info_s *origin_info = (stc_stats_info_s *)info; - - g_strlcpy(stats_info->app_id, origin_info->app_id, STC_APP_ID_LEN); - g_strlcpy(stats_info->iface_name, origin_info->iface_name, STC_IFNAME_LEN); - g_strlcpy(stats_info->subscriber_id, origin_info->subscriber_id, STC_SUBSCRIBER_ID_LEN); - stats_info->interval.from = origin_info->interval.from; - stats_info->interval.to = origin_info->interval.to; - stats_info->iface_type = origin_info->iface_type; - stats_info->cnt.incoming_bytes = origin_info->cnt.incoming_bytes; - stats_info->cnt.outgoing_bytes = origin_info->cnt.outgoing_bytes; - stats_info->roaming_type = origin_info->roaming_type; - stats_info->protocol_type = origin_info->protocol_type; - stats_info->process_state = origin_info->process_state; - - *cloned = (stc_stats_info_h)stats_info; - - STC_LOGI("Stats info successfully cloned"); - - return STC_ERROR_NONE; -} - -EXPORT_API int stc_stats_info_destroy(stc_stats_info_h info) -{ - CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_STC); - - if (info == NULL) { - STC_LOGE("Invalid parameter"); - return STC_ERROR_INVALID_PARAMETER; - } - - FREE(info); - - STC_LOGI("Stats rule successfully destroyed"); - - return STC_ERROR_NONE; -} - EXPORT_API int stc_stats_info_get_app_id(stc_stats_info_h info, char **app_id) { CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_STC);