Tizen Native API  6.5

The STC statistics API provides functions for managing STC statistics.

Required Header

#include <stc.h>

Overview

To use STC statistics API, first create the STC handle using stc_initialize(). After that, you can obtain STC information. You should destroy the created STC handle if you do not need it anymore. The STC statistics API provides functions for managing STC statistics.

Related Features

This API is related with the following features:

It is recommended to use features in your application for reliability.

You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.

To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.

More details on featuring your application can be found from Feature Element.

Functions

int stc_stats_rule_create (stc_h stc, stc_stats_rule_h *rule)
 Creates the statistics rule handle.
int stc_stats_rule_destroy (stc_stats_rule_h rule)
 Destroys the statistics rule handle.
int stc_stats_rule_set_app_id (stc_stats_rule_h rule, const char *app_id)
 Sets the application ID for statistics rule.
int stc_stats_rule_set_time_interval (stc_stats_rule_h rule, time_t from, time_t to)
 Sets the time interval for statistics rule.
int stc_stats_rule_set_iface_type (stc_stats_rule_h rule, stc_iface_type_e iface_type)
 Sets the interface type for statistics rule.
int stc_stats_rule_set_time_period (stc_stats_rule_h rule, stc_time_period_e time_period)
 Sets the time period for statistics rule.
int stc_stats_rule_get_app_id (stc_stats_rule_h rule, char **app_id)
 Gets the application ID for statistics rule.
int stc_stats_rule_get_time_interval (stc_stats_rule_h rule, time_t *from, time_t *to)
 Gets the time interval for statistics rule.
int stc_stats_rule_get_iface_type (stc_stats_rule_h rule, stc_iface_type_e *iface_type)
 Gets the interface type for statistics rule.
int stc_stats_rule_get_time_period (stc_stats_rule_h rule, stc_time_period_e *time_period)
 Gets the time period for statistics rule.
int stc_stats_info_clone (stc_stats_info_h info, stc_stats_info_h *cloned)
 Clones the statistics info handle.
int stc_stats_info_destroy (stc_stats_info_h info)
 Destroys the statistics info handle.
int stc_stats_info_get_app_id (stc_stats_info_h info, char **app_id)
 Gets the application ID from statistics information.
int stc_stats_info_get_iface_name (stc_stats_info_h info, char **iface_name)
 Gets the interface name from statistics information.
int stc_stats_info_get_time_interval (stc_stats_info_h info, time_t *from, time_t *to)
 Gets the time interval from statistics information.
int stc_stats_info_get_iface_type (stc_stats_info_h info, stc_iface_type_e *iface_type)
 Gets the interface type from statistics information.
int stc_stats_info_get_counter (stc_stats_info_h info, int64_t *incoming, int64_t *outgoing)
 Gets the counters from statistics information.
int stc_stats_info_get_roaming_type (stc_stats_info_h info, stc_roaming_type_e *roaming_type)
 Gets the roaming type from statistics information.
int stc_stats_info_get_protocol_type (stc_stats_info_h info, stc_protocol_type_e *protocol)
 Gets the protocol type from statistics information.
int stc_stats_info_get_process_state (stc_stats_info_h info, stc_process_state_e *state)
 Gets the process state from statistics information.

Typedefs

typedef void * stc_stats_rule_h
 The statistics rule handle.
typedef void * stc_stats_info_h
 The handle of statistical information about network traffic.
typedef void * stc_all_stats_info_h
 The handle of all statistical information about network traffic.

Typedef Documentation

typedef void* stc_all_stats_info_h

The handle of all statistical information about network traffic.

Since :
5.5
typedef void* stc_stats_info_h

The handle of statistical information about network traffic.

Since :
4.0
typedef void* stc_stats_rule_h

The statistics rule handle.

Since :
4.0

Function Documentation

Clones the statistics info handle.

Since :
5.5
Remarks:
You must release cloned using stc_stats_info_destroy().
Parameters:
[in]infoThe origin statistics info handle
[out]clonedThe cloned statistics info handle
Returns:
0 on success, otherwise a negative error value
Return values:
STC_ERROR_NONESuccessful
STC_ERROR_OUT_OF_MEMORYOut of memory
STC_ERROR_INVALID_PARAMETERInvalid parameter
STC_ERROR_NOT_SUPPORTEDNot supported
See also:
stc_h
stc_stats_info_h
stc_initialize()
stc_stats_info_destroy()

Destroys the statistics info handle.

Since :
5.5
Parameters:
[in]infoThe statistics info handle
Returns:
0 on success, otherwise a negative error value
Return values:
STC_ERROR_NONESuccessful
STC_ERROR_INVALID_PARAMETERInvalid parameter
STC_ERROR_NOT_SUPPORTEDNot supported
See also:
stc_stats_info_h
stc_stats_info_clone()
int stc_stats_info_get_app_id ( stc_stats_info_h  info,
char **  app_id 
)

Gets the application ID from statistics information.

Since :
4.0
Remarks:
You must release app_id using free().
Parameters:
[in]infoThe statistics information handle
[out]app_idThe application ID
Returns:
0 on success, otherwise a negative error value
Return values:
STC_ERROR_NONESuccessful
STC_ERROR_OPERATION_FAILEDGeneral error
STC_ERROR_OUT_OF_MEMORYOut of memory
STC_ERROR_INVALID_PARAMETERInvalid parameter
STC_ERROR_INVALID_OPERATIONInvalid operation
STC_ERROR_NOT_INITIALIZEDNot initialized
STC_ERROR_NOT_SUPPORTEDNot supported
See also:
stc_stats_info_h
stc_stats_info_cb()
int stc_stats_info_get_counter ( stc_stats_info_h  info,
int64_t *  incoming,
int64_t *  outgoing 
)

Gets the counters from statistics information.

Since :
4.0
Parameters:
[in]infoThe statistics information handle
[out]incomingThe incoming counter
[out]outgoingThe outgoing counter
Returns:
0 on success, otherwise a negative error value
Return values:
STC_ERROR_NONESuccessful
STC_ERROR_OPERATION_FAILEDGeneral error
STC_ERROR_OUT_OF_MEMORYOut of memory
STC_ERROR_INVALID_PARAMETERInvalid parameter
STC_ERROR_INVALID_OPERATIONInvalid operation
STC_ERROR_NOT_INITIALIZEDNot initialized
STC_ERROR_NOT_SUPPORTEDNot supported
See also:
stc_stats_info_h
stc_stats_info_cb()
int stc_stats_info_get_iface_name ( stc_stats_info_h  info,
char **  iface_name 
)

Gets the interface name from statistics information.

Since :
4.0
Remarks:
You must release iface_name using free().
Parameters:
[in]infoThe statistics information handle
[out]iface_nameThe interface name
Returns:
0 on success, otherwise a negative error value
Return values:
STC_ERROR_NONESuccessful
STC_ERROR_OPERATION_FAILEDGeneral error
STC_ERROR_OUT_OF_MEMORYOut of memory
STC_ERROR_INVALID_PARAMETERInvalid parameter
STC_ERROR_INVALID_OPERATIONInvalid operation
STC_ERROR_NOT_INITIALIZEDNot initialized
STC_ERROR_NOT_SUPPORTEDNot supported
See also:
stc_stats_info_h
stc_stats_info_cb()

Gets the interface type from statistics information.

Since :
4.0
Parameters:
[in]infoThe statistics information handle
[out]iface_typeThe interface type
Returns:
0 on success, otherwise a negative error value
Return values:
STC_ERROR_NONESuccessful
STC_ERROR_OPERATION_FAILEDGeneral error
STC_ERROR_OUT_OF_MEMORYOut of memory
STC_ERROR_INVALID_PARAMETERInvalid parameter
STC_ERROR_INVALID_OPERATIONInvalid operation
STC_ERROR_NOT_INITIALIZEDNot initialized
STC_ERROR_NOT_SUPPORTEDNot supported
See also:
stc_stats_info_h
stc_iface_type_e
stc_stats_info_cb()

Gets the process state from statistics information.

Since :
4.0
Parameters:
[in]infoThe statistics information handle
[out]stateThe process state
Returns:
0 on success, otherwise a negative error value
Return values:
STC_ERROR_NONESuccessful
STC_ERROR_OPERATION_FAILEDGeneral error
STC_ERROR_OUT_OF_MEMORYOut of memory
STC_ERROR_INVALID_PARAMETERInvalid parameter
STC_ERROR_INVALID_OPERATIONInvalid operation
STC_ERROR_NOT_INITIALIZEDNot initialized
STC_ERROR_NOT_SUPPORTEDNot supported
See also:
stc_stats_info_h
stc_process_state_e
stc_stats_info_cb()

Gets the protocol type from statistics information.

Since :
4.0
Parameters:
[in]infoThe statistics information handle
[out]protocolThe protocol type
Returns:
0 on success, otherwise a negative error value
Return values:
STC_ERROR_NONESuccessful
STC_ERROR_OPERATION_FAILEDGeneral error
STC_ERROR_OUT_OF_MEMORYOut of memory
STC_ERROR_INVALID_PARAMETERInvalid parameter
STC_ERROR_INVALID_OPERATIONInvalid operation
STC_ERROR_NOT_INITIALIZEDNot initialized
STC_ERROR_NOT_SUPPORTEDNot supported
See also:
stc_stats_info_h
stc_protocol_type_e
stc_stats_info_cb()

Gets the roaming type from statistics information.

Since :
4.0
Parameters:
[in]infoThe statistics information handle
[out]roaming_typeThe roaming type
Returns:
0 on success, otherwise a negative error value
Return values:
STC_ERROR_NONESuccessful
STC_ERROR_OPERATION_FAILEDGeneral error
STC_ERROR_OUT_OF_MEMORYOut of memory
STC_ERROR_INVALID_PARAMETERInvalid parameter
STC_ERROR_INVALID_OPERATIONInvalid operation
STC_ERROR_NOT_INITIALIZEDNot initialized
STC_ERROR_NOT_SUPPORTEDNot supported
See also:
stc_stats_info_h
stc_roaming_type_e
stc_stats_info_cb()
int stc_stats_info_get_time_interval ( stc_stats_info_h  info,
time_t *  from,
time_t *  to 
)

Gets the time interval from statistics information.

Since :
4.0
Parameters:
[in]infoThe statistics information handle
[out]fromThe beginning of the time interval
[out]toThe end of the time interval
Returns:
0 on success, otherwise a negative error value
Return values:
STC_ERROR_NONESuccessful
STC_ERROR_OPERATION_FAILEDGeneral error
STC_ERROR_OUT_OF_MEMORYOut of memory
STC_ERROR_INVALID_PARAMETERInvalid parameter
STC_ERROR_INVALID_OPERATIONInvalid operation
STC_ERROR_NOT_INITIALIZEDNot initialized
STC_ERROR_NOT_SUPPORTEDNot supported
See also:
stc_stats_info_h
stc_stats_info_cb()
int stc_stats_rule_create ( stc_h  stc,
stc_stats_rule_h rule 
)

Creates the statistics rule handle.

Since :
4.0
Remarks:
You must release rule using stc_stats_rule_destroy().
Parameters:
[in]stcThe STC handle
[out]ruleThe statistics rule handle
Returns:
0 on success, otherwise a negative error value
Return values:
STC_ERROR_NONESuccessful
STC_ERROR_OPERATION_FAILEDGeneral error
STC_ERROR_OUT_OF_MEMORYOut of memory
STC_ERROR_INVALID_PARAMETERInvalid parameter
STC_ERROR_INVALID_OPERATIONInvalid operation
STC_ERROR_NOT_INITIALIZEDNot initialized
STC_ERROR_NOT_SUPPORTEDNot supported
See also:
stc_h
stc_stats_rule_h
stc_initialize()
stc_stats_rule_destroy()

Destroys the statistics rule handle.

Since :
4.0
Parameters:
[in]ruleThe statistics rule handle
Returns:
0 on success, otherwise a negative error value
Return values:
STC_ERROR_NONESuccessful
STC_ERROR_OPERATION_FAILEDGeneral error
STC_ERROR_OUT_OF_MEMORYOut of memory
STC_ERROR_INVALID_PARAMETERInvalid parameter
STC_ERROR_INVALID_OPERATIONInvalid operation
STC_ERROR_NOT_INITIALIZEDNot initialized
STC_ERROR_NOT_SUPPORTEDNot supported
See also:
stc_stats_rule_h
stc_stats_rule_create()
int stc_stats_rule_get_app_id ( stc_stats_rule_h  rule,
char **  app_id 
)

Gets the application ID for statistics rule.

Since :
4.0
Remarks:
You must release app_id using free().
Parameters:
[in]ruleThe statistics rule handle
[out]app_idThe application ID
Returns:
0 on success, otherwise a negative error value
Return values:
STC_ERROR_NONESuccessful
STC_ERROR_OPERATION_FAILEDGeneral error
STC_ERROR_OUT_OF_MEMORYOut of memory
STC_ERROR_INVALID_PARAMETERInvalid parameter
STC_ERROR_INVALID_OPERATIONInvalid operation
STC_ERROR_NOT_INITIALIZEDNot initialized
STC_ERROR_NOT_SUPPORTEDNot supported
See also:
stc_stats_rule_h
stc_stats_rule_create()
stc_stats_rule_destroy()
stc_stats_rule_set_app_id()

Gets the interface type for statistics rule.

Since :
4.0
Parameters:
[in]ruleThe statistics rule handle
[out]iface_typeThe interface type
Returns:
0 on success, otherwise a negative error value
Return values:
STC_ERROR_NONESuccessful
STC_ERROR_OPERATION_FAILEDGeneral error
STC_ERROR_OUT_OF_MEMORYOut of memory
STC_ERROR_INVALID_PARAMETERInvalid parameter
STC_ERROR_INVALID_OPERATIONInvalid operation
STC_ERROR_NOT_INITIALIZEDNot initialized
STC_ERROR_NOT_SUPPORTEDNot supported
See also:
stc_stats_rule_h
stc_iface_type_e
stc_stats_rule_create()
stc_stats_rule_destroy()
stc_stats_rule_set_iface_type()
int stc_stats_rule_get_time_interval ( stc_stats_rule_h  rule,
time_t *  from,
time_t *  to 
)

Gets the time interval for statistics rule.

Since :
4.0
Parameters:
[in]ruleThe statistics rule handle
[out]fromThe beginning of the time interval
[out]toThe end of the time interval
Returns:
0 on success, otherwise a negative error value
Return values:
STC_ERROR_NONESuccessful
STC_ERROR_OPERATION_FAILEDGeneral error
STC_ERROR_OUT_OF_MEMORYOut of memory
STC_ERROR_INVALID_PARAMETERInvalid parameter
STC_ERROR_INVALID_OPERATIONInvalid operation
STC_ERROR_NOT_INITIALIZEDNot initialized
STC_ERROR_NOT_SUPPORTEDNot supported
See also:
stc_stats_rule_h
stc_stats_rule_create()
stc_stats_rule_destroy()
stc_stats_rule_set_time_interval()

Gets the time period for statistics rule.

Since :
4.0
Parameters:
[in]ruleThe statistics rule handle
[out]time_periodThe time period
Returns:
0 on success, otherwise a negative error value
Return values:
STC_ERROR_NONESuccessful
STC_ERROR_OPERATION_FAILEDGeneral error
STC_ERROR_OUT_OF_MEMORYOut of memory
STC_ERROR_INVALID_PARAMETERInvalid parameter
STC_ERROR_INVALID_OPERATIONInvalid operation
STC_ERROR_NOT_INITIALIZEDNot initialized
STC_ERROR_NOT_SUPPORTEDNot supported
See also:
stc_stats_rule_h
stc_time_period_e
stc_stats_rule_create()
stc_stats_rule_destroy()
stc_stats_rule_set_time_period()
int stc_stats_rule_set_app_id ( stc_stats_rule_h  rule,
const char *  app_id 
)

Sets the application ID for statistics rule.

Since :
4.0
Parameters:
[in]ruleThe statistics rule handle
[in]app_idThe application ID
Returns:
0 on success, otherwise a negative error value
Return values:
STC_ERROR_NONESuccessful
STC_ERROR_OPERATION_FAILEDGeneral error
STC_ERROR_OUT_OF_MEMORYOut of memory
STC_ERROR_INVALID_PARAMETERInvalid parameter
STC_ERROR_INVALID_OPERATIONInvalid operation
STC_ERROR_NOT_INITIALIZEDNot initialized
STC_ERROR_NOT_SUPPORTEDNot supported
See also:
stc_stats_rule_h
stc_stats_rule_create()
stc_stats_rule_destroy()
stc_stats_rule_get_app_id()

Sets the interface type for statistics rule.

Since :
4.0
Parameters:
[in]ruleThe stats rule handle
[in]iface_typeThe interface type
Returns:
0 on success, otherwise a negative error value
Return values:
STC_ERROR_NONESuccessful
STC_ERROR_OPERATION_FAILEDGeneral error
STC_ERROR_OUT_OF_MEMORYOut of memory
STC_ERROR_INVALID_PARAMETERInvalid parameter
STC_ERROR_INVALID_OPERATIONInvalid operation
STC_ERROR_NOT_INITIALIZEDNot initialized
STC_ERROR_NOT_SUPPORTEDNot supported
See also:
stc_stats_rule_h
stc_iface_type_e
stc_stats_rule_create()
stc_stats_rule_destroy()
stc_stats_rule_get_iface_type()
int stc_stats_rule_set_time_interval ( stc_stats_rule_h  rule,
time_t  from,
time_t  to 
)

Sets the time interval for statistics rule.

Since :
4.0
Parameters:
[in]ruleThe statistics rule handle
[in]fromThe beginning of the time interval
[in]toThe end of the time interval
Returns:
0 on success, otherwise a negative error value
Return values:
STC_ERROR_NONESuccessful
STC_ERROR_OPERATION_FAILEDGeneral error
STC_ERROR_OUT_OF_MEMORYOut of memory
STC_ERROR_INVALID_PARAMETERInvalid parameter
STC_ERROR_INVALID_OPERATIONInvalid operation
STC_ERROR_NOT_INITIALIZEDNot initialized
STC_ERROR_NOT_SUPPORTEDNot supported
See also:
stc_stats_rule_h
stc_stats_rule_create()
stc_stats_rule_destroy()
stc_stats_rule_get_time_interval()

Sets the time period for statistics rule.

Since :
4.0
Parameters:
[in]ruleThe statistics rule handle
[in]time_periodThe time period
Returns:
0 on success, otherwise a negative error value
Return values:
STC_ERROR_NONESuccessful
STC_ERROR_OPERATION_FAILEDGeneral error
STC_ERROR_OUT_OF_MEMORYOut of memory
STC_ERROR_INVALID_PARAMETERInvalid parameter
STC_ERROR_INVALID_OPERATIONInvalid operation
STC_ERROR_NOT_INITIALIZEDNot initialized
STC_ERROR_NOT_SUPPORTEDNot supported
See also:
stc_stats_rule_h
stc_time_period_e
stc_stats_rule_create()
stc_stats_rule_destroy()
stc_stats_rule_get_time_period()