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
* @remarks You must release @a app_id using free().
* 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);