2 * Smart Traffic Control (STC)
4 * Copyright (c) 2017 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #ifndef __TIZEN_STC_H__
21 #define __TIZEN_STC_H__
31 /*****************************************************************************
33 *****************************************************************************/
38 /*****************************************************************************
40 *****************************************************************************/
43 * @addtogroup CAPI_NETWORK_STC_MODULE
48 * @brief The smart traffic control handle.
58 * @addtogroup CAPI_NETWORK_STC_STATISTICS_MODULE
63 * @brief The statistics rule handle.
66 typedef void *stc_stats_rule_h;
69 * @brief The statistics information handle.
72 typedef void *stc_stats_info_h;
78 /*****************************************************************************
80 *****************************************************************************/
83 * @addtogroup CAPI_NETWORK_STC_MODULE
87 #ifndef TIZEN_ERROR_STC
88 #define TIZEN_ERROR_STC -0x02F80000
92 * @brief Enumeration for Smart Traffic Control (STC) error type.
96 STC_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
97 STC_ERROR_NOT_PERMITTED = TIZEN_ERROR_NOT_PERMITTED, /**< Operation not permitted(1) */
98 STC_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory(12) */
99 STC_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied(13) */
100 STC_ERROR_RESOURCE_BUSY = TIZEN_ERROR_RESOURCE_BUSY, /**< Device or resource busy(16) */
101 STC_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid operation(38) */
102 STC_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid function parameter(22) */
103 STC_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
105 STC_ERROR_OPERATION_FAILED = TIZEN_ERROR_STC|0x01, /**< Operation failed */
106 STC_ERROR_NOT_INITIALIZED = TIZEN_ERROR_STC|0x02, /**< Not initialized */
107 STC_ERROR_ALREADY_INITIALIZED = TIZEN_ERROR_STC|0x03, /**< Already initialized */
108 STC_ERROR_IN_PROGRESS = TIZEN_ERROR_STC|0x04, /**< In progress */
117 * @addtogroup CAPI_NETWORK_STC_MANAGER_MODULE
122 * @brief Enumeration for time period.
126 STC_TIME_PERIOD_UNKNOWN = 0, /**< Unknown */
127 STC_TIME_PERIOD_HOUR = 3600, /**< Hour */
128 STC_TIME_PERIOD_DAY = 86400, /**< Day */
129 STC_TIME_PERIOD_WEEK = 604800, /**< Week */
130 STC_TIME_PERIOD_MONTH = 2419200, /**< Month */
134 * @brief Enumeration for network interface type.
138 STC_IFACE_UNKNOWN, /**< Unknown interface */
139 STC_IFACE_DATACALL, /**< Mobile data */
140 STC_IFACE_WIFI, /**< Wifi data */
141 STC_IFACE_WIRED, /**< Wired interface */
142 STC_IFACE_BLUETOOTH, /**< Bluetooth interface */
143 STC_IFACE_ALL, /**< Enumerate all network interface types */
147 * @brief Enumeration for network roaming type.
151 STC_ROAMING_UNKNOWN, /**< Roaming unknown */
152 STC_ROAMING_ENABLED, /**< In roaming */
153 STC_ROAMING_DISABLED, /**< Not in roaming */
154 } stc_roaming_type_e;
157 * @brief Enumeration for hardware network protocol type.
161 STC_PROTOCOL_UNKNOWN, /**< Network unknown */
162 STC_PROTOCOL_DATACALL_NOSVC, /**< Network no service */
163 STC_PROTOCOL_DATACALL_EMERGENCY, /**< Network emergency */
164 STC_PROTOCOL_DATACALL_SEARCH, /**< Network search 1900 */
165 STC_PROTOCOL_DATACALL_2G, /**< Network 2G */
166 STC_PROTOCOL_DATACALL_2_5G, /**< Network 2.5G */
167 STC_PROTOCOL_DATACALL_2_5G_EDGE, /**< Network EDGE */
168 STC_PROTOCOL_DATACALL_3G, /**< Network UMTS */
169 STC_PROTOCOL_DATACALL_HSDPA, /**< Network HSDPA */
170 STC_PROTOCOL_DATACALL_LTE, /**< Network LTE */
171 } stc_protocol_type_e;
174 * @brief Enumeration for monitored process state.
178 STC_PROCESS_STATE_UNKNOWN, /**< Unknown state */
179 STC_PROCESS_STATE_FOREGROUND, /**< Foreground state */
180 STC_PROCESS_STATE_BACKGROUND, /**< Background state */
181 } stc_process_state_e;
184 * @brief Enumeration for network connection period type.
185 * @details Last received/sent mean counting data from the first connection of each interface.
189 STC_CONN_PERIOD_UNKNOWN, /**< Unknown period */
190 STC_CONN_PERIOD_LAST_RECEIVED_DATA, /**< Last received data */
191 STC_CONN_PERIOD_LAST_SENT_DATA, /**< Last sent data */
192 STC_CONN_PERIOD_TOTAL_RECEIVED_DATA, /**< Total received data */
193 STC_CONN_PERIOD_TOTAL_SENT_DATA, /**< Total sent data */
197 * @brief Enumeration for return type of the callback.
201 STC_CALLBACK_CANCEL, /**< Cancel */
202 STC_CALLBACK_CONTINUE, /**< Continue */
203 } stc_callback_ret_e;
209 /*****************************************************************************
211 *****************************************************************************/
214 * @addtogroup CAPI_NETWORK_STC_MANAGER_MODULE
219 * @brief Called for each available statistics information.
222 * @param[in] result The result, one of:\n
223 * #STC_ERROR_INVALID_OPERATION No reply\n
224 * #STC_ERROR_OPERATION_FAILED Operation failed\n
225 * #STC_ERROR_PERMISSION_DENIED Access or permission denied
226 * @param[in] info The statistics information handle
227 * @param[in] user_data The user data passed from the statistics provider function
228 * @return #STC_CALLBACK_CONTINUE to continue with the next iteration of the loop,
229 * otherwise #STC_CALLBACK_CANCEL to break out of the loop
231 * @pre stc_get_stats() will invoke this callback.
232 * @pre stc_foreach_stats() will invoke this callback.
233 * @pre stc_get_total_stats() will invoke this callback.
234 * @see stc_stats_info_get_app_id()
235 * @see stc_stats_info_get_iface_name()
236 * @see stc_stats_info_get_time_interval()
237 * @see stc_stats_info_get_iface_type()
238 * @see stc_stats_info_get_counter()
239 * @see stc_stats_info_get_roaming_type()
240 * @see stc_stats_info_get_protocol_type()
241 * @see stc_stats_info_get_process_state()
242 * @see stc_get_stats()
243 * @see stc_foreach_stats()
244 * @see stc_get_total_stats()
246 typedef stc_callback_ret_e (*stc_stats_info_cb)(
247 stc_error_e result, stc_stats_info_h info, void *user_data);
254 /*****************************************************************************
256 *****************************************************************************/
260 * @addtogroup CAPI_NETWORK_STC_MODULE
265 * @brief Initializes STC (Smart Traffic Control).
268 * @privilege %http://tizen.org/privilege/network.get
269 * @remarks You must release @a handle using stc_deinitialize().
271 * @param[out] stc The STC handle
273 * @return 0 on success, otherwise a negative error value
274 * @retval #STC_ERROR_NONE Successful
275 * @retval #STC_ERROR_OPERATION_FAILED General error
276 * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
277 * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
278 * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
279 * @retval #STC_ERROR_NOT_SUPPORTED Not supported
280 * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
283 * @see stc_deinitialize()
285 int stc_initialize(stc_h *stc);
288 * @brief Deinitializes STC.
291 * @param[in] stc The STC handle
293 * @return 0 on success, otherwise a negative error value
294 * @retval #STC_ERROR_NONE Successful
295 * @retval #STC_ERROR_OPERATION_FAILED General error
296 * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
297 * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
298 * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
299 * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
300 * @retval #STC_ERROR_NOT_SUPPORTED Not supported
303 * @see stc_initialize()
305 int stc_deinitialize(stc_h stc);
313 * @addtogroup CAPI_NETWORK_STC_MANAGER_MODULE
318 * @brief Gets the statistics information an application matched rule asynchronously.
321 * @privilege %http://tizen.org/privilege/network.get
323 * @param[in] stc The STC handle
324 * @param[in] rule The statistics rule handle
325 * @param[in] info_cb The callback is called for each application
326 * that used network in between timestamps specified
327 * @param[in] user_data The user data passed to the callback function
329 * @return 0 on success, otherwise a negative error value
330 * @retval #STC_ERROR_NONE Successful
331 * @retval #STC_ERROR_OPERATION_FAILED General error
332 * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
333 * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
334 * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
335 * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
336 * @retval #STC_ERROR_NOT_SUPPORTED Not supported
337 * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
340 * @see stc_stats_rule_h
341 * @see stc_initialize()
342 * @see stc_stats_rule_create()
343 * @see stc_stats_rule_destroy()
344 * @see stc_stats_rule_set_app_id()
345 * @see stc_stats_rule_set_time_interval()
346 * @see stc_stats_rule_set_iface_type()
347 * @see stc_stats_rule_set_time_period()
348 * @see stc_stats_rule_get_app_id()
349 * @see stc_stats_rule_get_time_interval()
350 * @see stc_stats_rule_get_iface_type()
351 * @see stc_stats_rule_get_time_period()
352 * @see stc_stats_info_cb()
353 * @see stc_foreach_stats()
354 * @see stc_get_total_stats()
356 int stc_get_stats(stc_h stc, stc_stats_rule_h rule,
357 stc_stats_info_cb info_cb, void *user_data);
360 * @brief Gets the statistics information of each application asynchronously.
361 * @details The callback is called for each application that used network
362 * in between timestamps specified.
363 * If interface name is not specified, each application will only appear
364 * once with the total traffic used over all interfaces.
368 * @privilege %http://tizen.org/privilege/network.get
370 * @param[in] stc The STC handle
371 * @param[in] rule The statistics rule handle
372 * @param[in] info_cb The callback is called for each application
373 * that used network in between timestamps specified
374 * @param[in] user_data The user data passed to the callback function
376 * @return 0 on success, otherwise a negative error value
377 * @retval #STC_ERROR_NONE Successful
378 * @retval #STC_ERROR_OPERATION_FAILED General error
379 * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
380 * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
381 * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
382 * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
383 * @retval #STC_ERROR_NOT_SUPPORTED Not supported
384 * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
387 * @see stc_stats_rule_h
388 * @see stc_initialize()
389 * @see stc_stats_rule_create()
390 * @see stc_stats_rule_destroy()
391 * @see stc_stats_rule_set_app_id()
392 * @see stc_stats_rule_set_time_interval()
393 * @see stc_stats_rule_set_iface_type()
394 * @see stc_stats_rule_set_time_period()
395 * @see stc_stats_rule_get_app_id()
396 * @see stc_stats_rule_get_time_interval()
397 * @see stc_stats_rule_get_iface_type()
398 * @see stc_stats_rule_get_time_period()
399 * @see stc_stats_info_cb()
400 * @see stc_get_stats()
401 * @see stc_get_total_stats()
403 int stc_foreach_stats(stc_h stc, stc_stats_rule_h rule,
404 stc_stats_info_cb info_cb, void *user_data);
407 * @brief Gets the total statistics information by interface type asynchronously.
410 * @privilege %http://tizen.org/privilege/network.get
412 * @param[in] stc The STC handle
413 * @param[in] rule The statistics rule handle
414 * @param[in] info_cb The callback is called for each application
415 * that used network in between timestamps specified
416 * @param[in] user_data The user data passed to the callback function
418 * @return 0 on success, otherwise a negative error value
419 * @retval #STC_ERROR_NONE Successful
420 * @retval #STC_ERROR_OPERATION_FAILED General error
421 * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
422 * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
423 * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
424 * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
425 * @retval #STC_ERROR_NOT_SUPPORTED Not supported
426 * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
429 * @see stc_stats_rule_h
430 * @see stc_initialize()
431 * @see stc_stats_rule_create()
432 * @see stc_stats_rule_destroy()
433 * @see stc_stats_rule_set_app_id()
434 * @see stc_stats_rule_set_time_interval()
435 * @see stc_stats_rule_set_iface_type()
436 * @see stc_stats_rule_set_time_period()
437 * @see stc_stats_rule_get_app_id()
438 * @see stc_stats_rule_get_time_interval()
439 * @see stc_stats_rule_get_iface_type()
440 * @see stc_stats_rule_get_time_period()
441 * @see stc_stats_info_cb()
442 * @see stc_get_stats()
443 * @see stc_foreach_stats()
445 int stc_get_total_stats(stc_h stc, stc_stats_rule_h rule,
446 stc_stats_info_cb info_cb, void *user_data);
453 * @addtogroup CAPI_NETWORK_STC_STATISTICS_MODULE
459 * @brief Creates the statistics rule handle.
461 * @remarks You must release @a handle using stc_stats_rule_destroy().
463 * @param[in] stc The STC handle
464 * @param[out] rule The statistics rule handle
466 * @return 0 on success, otherwise a negative error value
467 * @retval #STC_ERROR_NONE Successful
468 * @retval #STC_ERROR_OPERATION_FAILED General error
469 * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
470 * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
471 * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
472 * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
473 * @retval #STC_ERROR_NOT_SUPPORTED Not supported
476 * @see stc_stats_rule_h
477 * @see stc_initialize()
478 * @see stc_stats_rule_destroy()
480 int stc_stats_rule_create(stc_h stc, stc_stats_rule_h *rule);
483 * @brief Destroys the statistics rule handle.
486 * @param[in] rule The statistics rule handle
488 * @return 0 on success, otherwise a negative error value
489 * @retval #STC_ERROR_NONE Successful
490 * @retval #STC_ERROR_OPERATION_FAILED General error
491 * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
492 * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
493 * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
494 * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
495 * @retval #STC_ERROR_NOT_SUPPORTED Not supported
497 * @see stc_stats_rule_h
498 * @see stc_stats_rule_create()
500 int stc_stats_rule_destroy(stc_stats_rule_h rule);
503 * @brief Sets the application ID for statistics rule.
506 * @param[in] rule The statistics rule handle
507 * @param[in] app_id The application ID
509 * @return 0 on success, otherwise a negative error value
510 * @retval #STC_ERROR_NONE Successful
511 * @retval #STC_ERROR_OPERATION_FAILED General error
512 * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
513 * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
514 * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
515 * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
516 * @retval #STC_ERROR_NOT_SUPPORTED Not supported
518 * @see stc_stats_rule_h
519 * @see stc_stats_rule_create()
520 * @see stc_stats_rule_destroy()
521 * @see stc_stats_rule_get_app_id()
523 int stc_stats_rule_set_app_id(stc_stats_rule_h rule,
527 * @brief Sets the time interval for statistics rule.
530 * @param[in] rule The statistics rule handle
531 * @param[in] from The beginning of the time interval
532 * @param[in] to The end of the time interval
534 * @return 0 on success, otherwise a negative error value
535 * @retval #STC_ERROR_NONE Successful
536 * @retval #STC_ERROR_OPERATION_FAILED General error
537 * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
538 * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
539 * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
540 * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
541 * @retval #STC_ERROR_NOT_SUPPORTED Not supported
543 * @see stc_stats_rule_h
544 * @see stc_stats_rule_create()
545 * @see stc_stats_rule_destroy()
546 * @see stc_stats_rule_get_time_interval()
548 int stc_stats_rule_set_time_interval(stc_stats_rule_h rule,
549 time_t from, time_t to);
552 * @brief Sets the interface type for statistics rule.
555 * @param[in] rule The stats rule handle
556 * @param[in] iface_type The interface type
558 * @return 0 on success, otherwise a negative error value
559 * @retval #STC_ERROR_NONE Successful
560 * @retval #STC_ERROR_OPERATION_FAILED General error
561 * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
562 * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
563 * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
564 * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
565 * @retval #STC_ERROR_NOT_SUPPORTED Not supported
567 * @see stc_stats_rule_h
568 * @see stc_iface_type_e
569 * @see stc_stats_rule_create()
570 * @see stc_stats_rule_destroy()
571 * @see stc_stats_rule_get_iface_type()
573 int stc_stats_rule_set_iface_type(stc_stats_rule_h rule,
574 stc_iface_type_e iface_type);
577 * @brief Sets the time period for statistics rule.
580 * @param[in] rule The statistics rule handle
581 * @param[in] time_period The time period
583 * @return 0 on success, otherwise a negative error value
584 * @retval #STC_ERROR_NONE Successful
585 * @retval #STC_ERROR_OPERATION_FAILED General error
586 * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
587 * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
588 * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
589 * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
590 * @retval #STC_ERROR_NOT_SUPPORTED Not supported
592 * @see stc_stats_rule_h
593 * @see stc_time_period_e
594 * @see stc_stats_rule_create()
595 * @see stc_stats_rule_destroy()
596 * @see stc_stats_rule_get_time_period()
598 int stc_stats_rule_set_time_period(stc_stats_rule_h rule,
599 stc_time_period_e time_period);
602 * @brief Gets the application ID for statistics rule.
604 * @remarks You must release @a app_id using free().
606 * @param[in] rule The statistics rule handle
607 * @param[out] app_id The application ID
609 * @return 0 on success, otherwise a negative error value
610 * @retval #STC_ERROR_NONE Successful
611 * @retval #STC_ERROR_OPERATION_FAILED General error
612 * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
613 * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
614 * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
615 * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
616 * @retval #STC_ERROR_NOT_SUPPORTED Not supported
618 * @see stc_stats_rule_h
619 * @see stc_stats_rule_create()
620 * @see stc_stats_rule_destroy()
621 * @see stc_stats_rule_set_app_id()
623 int stc_stats_rule_get_app_id(stc_stats_rule_h rule, char **app_id);
626 * @brief Gets the time interval for statistics rule.
629 * @param[in] rule The statistics rule handle
630 * @param[out] from The beginning of the time interval
631 * @param[out] to The end of the time interval
633 * @return 0 on success, otherwise a negative error value
634 * @retval #STC_ERROR_NONE Successful
635 * @retval #STC_ERROR_OPERATION_FAILED General error
636 * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
637 * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
638 * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
639 * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
640 * @retval #STC_ERROR_NOT_SUPPORTED Not supported
642 * @see stc_stats_rule_h
643 * @see stc_stats_rule_create()
644 * @see stc_stats_rule_destroy()
645 * @see stc_stats_rule_set_time_interval()
647 int stc_stats_rule_get_time_interval(stc_stats_rule_h rule,
648 time_t *from, time_t *to);
651 * @brief Gets the interface type for statistics rule.
654 * @param[in] rule The statistics rule handle
655 * @param[out] iface_type The interface type
657 * @return 0 on success, otherwise a negative error value
658 * @retval #STC_ERROR_NONE Successful
659 * @retval #STC_ERROR_OPERATION_FAILED General error
660 * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
661 * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
662 * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
663 * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
664 * @retval #STC_ERROR_NOT_SUPPORTED Not supported
666 * @see stc_stats_rule_h
667 * @see stc_iface_type_e
668 * @see stc_stats_rule_create()
669 * @see stc_stats_rule_destroy()
670 * @see stc_stats_rule_set_iface_type()
672 int stc_stats_rule_get_iface_type(stc_stats_rule_h rule,
673 stc_iface_type_e *iface_type);
676 * @brief Gets the time period for statistics rule.
679 * @param[in] rule The statistics rule handle
680 * @param[out] time_period The time period
682 * @return 0 on success, otherwise a negative error value
683 * @retval #STC_ERROR_NONE Successful
684 * @retval #STC_ERROR_OPERATION_FAILED General error
685 * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
686 * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
687 * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
688 * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
689 * @retval #STC_ERROR_NOT_SUPPORTED Not supported
691 * @see stc_stats_rule_h
692 * @see stc_time_period_e
693 * @see stc_stats_rule_create()
694 * @see stc_stats_rule_destroy()
695 * @see stc_stats_rule_set_time_period()
697 int stc_stats_rule_get_time_period(stc_stats_rule_h rule,
698 stc_time_period_e *time_period);
701 * @brief Gets the application ID from statistics information.
703 * @remarks You must release @a app_id using free().
705 * @param[in] info The statistics information handle
706 * @param[out] app_id The application ID
708 * @return 0 on success, otherwise a negative error value
709 * @retval #STC_ERROR_NONE Successful
710 * @retval #STC_ERROR_OPERATION_FAILED General error
711 * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
712 * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
713 * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
714 * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
715 * @retval #STC_ERROR_NOT_SUPPORTED Not supported
717 * @see stc_stats_info_h
718 * @see stc_stats_info_cb()
720 int stc_stats_info_get_app_id(stc_stats_info_h info, char **app_id);
723 * @brief Gets the interface name from statistics information.
725 * @remarks You must release @a iface_name using free().
727 * @param[in] info The statistics information handle
728 * @param[out] iface_name The interface name
730 * @return 0 on success, otherwise a negative error value
731 * @retval #STC_ERROR_NONE Successful
732 * @retval #STC_ERROR_OPERATION_FAILED General error
733 * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
734 * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
735 * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
736 * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
737 * @retval #STC_ERROR_NOT_SUPPORTED Not supported
739 * @see stc_stats_info_h
740 * @see stc_stats_info_cb()
742 int stc_stats_info_get_iface_name(stc_stats_info_h info, char **iface_name);
745 * @brief Gets the time interval from statistics information.
748 * @param[in] info The statistics information handle
749 * @param[out] from The beginning of the time interval
750 * @param[out] to The end of the time interval
752 * @return 0 on success, otherwise a negative error value
753 * @retval #STC_ERROR_NONE Successful
754 * @retval #STC_ERROR_OPERATION_FAILED General error
755 * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
756 * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
757 * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
758 * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
759 * @retval #STC_ERROR_NOT_SUPPORTED Not supported
761 * @see stc_stats_info_h
762 * @see stc_stats_info_cb()
764 int stc_stats_info_get_time_interval(stc_stats_info_h info,
765 time_t *from, time_t *to);
768 * @brief Gets the interface type from statistics information.
771 * @param[in] info The statistics information handle
772 * @param[out] iface_type The interface type
774 * @return 0 on success, otherwise a negative error value
775 * @retval #STC_ERROR_NONE Successful
776 * @retval #STC_ERROR_OPERATION_FAILED General error
777 * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
778 * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
779 * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
780 * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
781 * @retval #STC_ERROR_NOT_SUPPORTED Not supported
783 * @see stc_stats_info_h
784 * @see stc_iface_type_e
785 * @see stc_stats_info_cb()
787 int stc_stats_info_get_iface_type(stc_stats_info_h info,
788 stc_iface_type_e *iface_type);
791 * @brief Gets the counters from statistics information.
794 * @param[in] info The statistics information handle
795 * @param[out] incoming The incoming counter
796 * @param[out] outgoing The outgoing counter
798 * @return 0 on success, otherwise a negative error value
799 * @retval #STC_ERROR_NONE Successful
800 * @retval #STC_ERROR_OPERATION_FAILED General error
801 * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
802 * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
803 * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
804 * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
805 * @retval #STC_ERROR_NOT_SUPPORTED Not supported
807 * @see stc_stats_info_h
808 * @see stc_stats_info_cb()
810 int stc_stats_info_get_counter(stc_stats_info_h info,
811 int64_t *incoming, int64_t *outgoing);
814 * @brief Gets the roaming type from statistics information.
817 * @param[in] info The statistics information handle
818 * @param[out] roaming_type The roaming type
820 * @return 0 on success, otherwise a negative error value
821 * @retval #STC_ERROR_NONE Successful
822 * @retval #STC_ERROR_OPERATION_FAILED General error
823 * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
824 * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
825 * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
826 * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
827 * @retval #STC_ERROR_NOT_SUPPORTED Not supported
829 * @see stc_stats_info_h
830 * @see stc_roaming_type_e
831 * @see stc_stats_info_cb()
833 int stc_stats_info_get_roaming_type(stc_stats_info_h info,
834 stc_roaming_type_e *roaming_type);
837 * @brief Gets the protocol type from statistics information.
840 * @param[in] info The statistics information handle
841 * @param[out] protocol The protocol type
843 * @return 0 on success, otherwise a negative error value
844 * @retval #STC_ERROR_NONE Successful
845 * @retval #STC_ERROR_OPERATION_FAILED General error
846 * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
847 * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
848 * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
849 * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
850 * @retval #STC_ERROR_NOT_SUPPORTED Not supported
852 * @see stc_stats_info_h
853 * @see stc_protocol_type_e
854 * @see stc_stats_info_cb()
856 int stc_stats_info_get_protocol_type(stc_stats_info_h info,
857 stc_protocol_type_e *protocol);
860 * @brief Gets the process state from statistics information.
863 * @param[in] info The statistics information handle
864 * @param[out] state The process state
866 * @return 0 on success, otherwise a negative error value
867 * @retval #STC_ERROR_NONE Successful
868 * @retval #STC_ERROR_OPERATION_FAILED General error
869 * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
870 * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
871 * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
872 * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
873 * @retval #STC_ERROR_NOT_SUPPORTED Not supported
875 * @see stc_stats_info_h
876 * @see stc_process_state_e
877 * @see stc_stats_info_cb()
879 int stc_stats_info_get_process_state(stc_stats_info_h info,
880 stc_process_state_e *state);
891 #endif /* __TIZEN_STC_H__ */