Tizen Native API
5.0
|
The Network Monitoring Specific API provides functions for provide monitoring specific.
#include <inm.h>
This set of functions is used to get information about network information provided by well-known linux functions. To use This kind of APIs, You should create a inm handle using inm_initialize(). After that, you can obtain network information. You should destroy the created inm handle if you do not need it anymore. You can detect IP collision, do dump network status, dump TCP, monitor ethernet, Wi-Fi module state, get network statistics.
This API is related with the following features:
Functions | |
int | inm_set_ethernet_cable_state_changed_cb (inm_h inm, inm_ethernet_cable_state_changed_cb callback, void *user_data) |
Sets a callback called when the Ethernet cable state is changed. | |
int | inm_unset_ethernet_cable_state_changed_cb (inm_h inm) |
Unsets the callback called when the Ethernet cable state is changed. | |
int | inm_get_ethernet_cable_state (inm_h inm, inm_ethernet_cable_state_e *state) |
Gets the Ethernet cable state. | |
int | inm_set_wifi_module_state_changed_cb (inm_h inm, inm_wifi_module_state_changed_cb callback, void *user_data) |
Sets a callback called when the Wi-Fi Module state is changed. | |
int | inm_unset_wifi_module_state_changed_cb (inm_h inm) |
Unsets the callback called when the Wi-Fi Module state is changed. | |
int | inm_get_wifi_module_state (inm_h inm, inm_wifi_module_state_e *state) |
Gets the Wi-Fi Module state. | |
int | inm_set_ip_conflict_cb (inm_h inm, inm_ip_conflict_cb callback, void *user_data) |
Sets the callback called when IP conflict state is changed. | |
int | inm_unset_ip_conflict_cb (inm_h inm) |
Unsets the callback called when IP conflict state is changed. | |
int | inm_ip_conflict_detect_is_enabled (inm_h inm, bool *state) |
Checks whether IP conflict detection is enabled. | |
int | inm_get_ip_conflict_state (inm_h inm, inm_ip_conflict_state_e *state) |
Gets the state of the IP conflict. | |
int | inm_get_statistics (inm_h inm, inm_connection_type_e connection_type, inm_statistics_type_e statistics_type, unsigned long long *size) |
Gets the statistics information. | |
int | inm_reset_statistics (inm_h inm, inm_connection_type_e connection_type, inm_statistics_type_e statistics_type) |
Resets the statistics information. | |
int | inm_set_congestion_level_cb (inm_h inm, inm_congestion_level_cb callback, void *user_data) |
Sets the callback called when the TCP congestion level is updated. | |
int | inm_unset_congestion_level_cb (inm_h inm) |
Unsets the callback called when the TCP congestion level is updated. | |
int | inm_get_congestion_level (inm_h inm, inm_congestion_level_e *level) |
Gets the TCP congestion level. | |
int | inm_set_retry_tx_rate_cb (inm_h inm, inm_retry_tx_rate_cb callback, void *user_data) |
Sets the callback called the TCP TX retry rate is updated. | |
int | inm_unset_retry_tx_rate_cb (inm_h inm) |
Unsets the callback called when the TCP TX retry rate is updated. | |
int | inm_get_retry_tx_rate (inm_h inm, int *rate) |
Gets the TCP TX retry rate. | |
int | inm_set_channel_interference_cb (inm_h inm, inm_channel_interference_cb callback, void *user_data) |
Sets the callback to be called when the channel interference is updated. | |
int | inm_unset_channel_interference_cb (inm_h inm) |
Unsets the callback called when the channel interference is updated. | |
int | inm_get_channel_interference (inm_h inm, double *ch_intf) |
Gets the channel interference of the wireless network. | |
Typedefs | |
typedef void(* | inm_ethernet_cable_state_changed_cb )(inm_ethernet_cable_state_e state, void *user_data) |
Called when the Ethernet cable state is changed. | |
typedef void(* | inm_wifi_module_state_changed_cb )(inm_wifi_module_state_e state, void *user_data) |
Called when the Wi-Fi Module state is changed. | |
typedef void(* | inm_ip_conflict_cb )(char *if_name, char *ip, inm_ip_conflict_state_e state, void *user_data) |
Called when the IP conflict state is changed. | |
typedef void(* | inm_congestion_level_cb )(inm_congestion_level_e level, void *user_data) |
Called when the TCP congestion level is updated. | |
typedef void(* | inm_retry_tx_rate_cb )(int rate, void *user_data) |
Called when the retry TX rate is updated. | |
typedef void(* | inm_channel_interference_cb )(int freq, double channel_intf, void *user_data) |
Called when the channel interference is updated. |
typedef void(* inm_channel_interference_cb)(int freq, double channel_intf, void *user_data) |
Called when the channel interference is updated.
[in] | freq | The frequency of wireless network |
[in] | channel_intf | The current channel interference |
[in] | user_data | The user data passed from the callback registration function |
typedef void(* inm_congestion_level_cb)(inm_congestion_level_e level, void *user_data) |
Called when the TCP congestion level is updated.
[in] | level | The current TCP congestion level |
[in] | user_data | The user data passed from the callback registration function |
typedef void(* inm_ethernet_cable_state_changed_cb)(inm_ethernet_cable_state_e state, void *user_data) |
Called when the Ethernet cable state is changed.
[in] | state | The Ethernet cable state |
[in] | user_data | The user data passed from the callback registration function |
typedef void(* inm_ip_conflict_cb)(char *if_name, char *ip, inm_ip_conflict_state_e state, void *user_data) |
Called when the IP conflict state is changed.
[in] | if_name | The destination interface name causing conflict |
[in] | ip | The local ip address causing conflict |
[in] | state | The current state |
[in] | user_data | The user data passed from the callback registration function |
typedef void(* inm_retry_tx_rate_cb)(int rate, void *user_data) |
Called when the retry TX rate is updated.
[in] | rate | The current TCP TX retry rate |
[in] | user_data | The user data passed from the callback registration function |
typedef void(* inm_wifi_module_state_changed_cb)(inm_wifi_module_state_e state, void *user_data) |
Called when the Wi-Fi Module state is changed.
[in] | state | The Wi-Fi Module state |
[in] | user_data | The user data passed from the callback registration function |
Enumeration for connection type.
int inm_get_channel_interference | ( | inm_h | inm, |
double * | ch_intf | ||
) |
Gets the channel interference of the wireless network.
[in] | inm | The monitoring handle |
[out] | ch_intf | The current channel interference |
INM_ERROR_NONE | Successful |
INM_ERROR_PERMISSION_DENIED | Permission Denied |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_get_congestion_level | ( | inm_h | inm, |
inm_congestion_level_e * | level | ||
) |
Gets the TCP congestion level.
[in] | inm | The monitoring handle |
[out] | level | The current TCP congestion level |
INM_ERROR_NONE | Successful |
INM_ERROR_PERMISSION_DENIED | Permission Denied |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_get_ethernet_cable_state | ( | inm_h | inm, |
inm_ethernet_cable_state_e * | state | ||
) |
Gets the Ethernet cable state.
[in] | inm | The monitor handle |
[out] | state | The Ethernet cable state |
0
on success, otherwise negative error value INM_ERROR_NONE | Successful |
INM_ERROR_PERMISSION_DENIED | Permission Denied |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_get_ip_conflict_state | ( | inm_h | inm, |
inm_ip_conflict_state_e * | state | ||
) |
Gets the state of the IP conflict.
[in] | inm | The monitoring handle |
[out] | state | The current state of IP conflict |
INM_ERROR_NONE | Successful |
INM_ERROR_PERMISSION_DENIED | Permission Denied |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_get_retry_tx_rate | ( | inm_h | inm, |
int * | rate | ||
) |
Gets the TCP TX retry rate.
[in] | inm | The monitoring handle |
[out] | rate | The current TCP TX retry rate |
INM_ERROR_NONE | Successful |
INM_ERROR_PERMISSION_DENIED | Permission Denied |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_get_statistics | ( | inm_h | inm, |
inm_connection_type_e | connection_type, | ||
inm_statistics_type_e | statistics_type, | ||
unsigned long long * | size | ||
) |
Gets the statistics information.
[in] | inm | The monitor handle |
[in] | connection_type | The type of connection Only INM_CONNECTION_TYPE_WIFI and INM_CONNECTION_TYPE_CELLULAR are supported |
[in] | statistics_type | The type of statistics |
[out] | size | The received data size of the last cellular packet data connection (bytes) |
0
on success, otherwise a negative error value INM_ERROR_NONE | Successful |
INM_ERROR_PERMISSION_DENIED | Permission Denied |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_get_wifi_module_state | ( | inm_h | inm, |
inm_wifi_module_state_e * | state | ||
) |
Gets the Wi-Fi Module state.
[in] | inm | The monitor handle |
[out] | state | The Wi-Fi Module state |
0
on success, otherwise negative error value INM_ERROR_NONE | Successful |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_ip_conflict_detect_is_enabled | ( | inm_h | inm, |
bool * | state | ||
) |
Checks whether IP conflict detection is enabled.
[in] | inm | The monitoring handle |
[out] | state | true if IP conflict detection is enabled, otherwise false if IP conflict detection is disabled. |
INM_ERROR_NONE | Successful |
INM_ERROR_PERMISSION_DENIED | Permission Denied |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_reset_statistics | ( | inm_h | inm, |
inm_connection_type_e | connection_type, | ||
inm_statistics_type_e | statistics_type | ||
) |
Resets the statistics information.
[in] | inm | The monitor handle |
[in] | connection_type | The type of connection Only INM_CONNECTION_TYPE_WIFI and INM_CONNECTION_TYPE_CELLULAR are supported |
[in] | statistics_type | The type of statistics |
0
on success, otherwise a negative error value INM_ERROR_NONE | Successful |
INM_ERROR_PERMISSION_DENIED | Permission Denied |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_set_channel_interference_cb | ( | inm_h | inm, |
inm_channel_interference_cb | callback, | ||
void * | user_data | ||
) |
Sets the callback to be called when the channel interference is updated.
[in] | inm | The monitoring handle |
[in] | callback | The callback function to be called |
[in] | user_data | The user data passed to the callback function |
INM_ERROR_NONE | Successful |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_set_congestion_level_cb | ( | inm_h | inm, |
inm_congestion_level_cb | callback, | ||
void * | user_data | ||
) |
Sets the callback called when the TCP congestion level is updated.
[in] | inm | The monitoring handle |
[in] | callback | The callback function to be called |
[in] | user_data | The user data passed to the callback function |
INM_ERROR_NONE | Successful |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_set_ethernet_cable_state_changed_cb | ( | inm_h | inm, |
inm_ethernet_cable_state_changed_cb | callback, | ||
void * | user_data | ||
) |
Sets a callback called when the Ethernet cable state is changed.
[in] | inm | The monitor handle |
[in] | callback | The callback function to be called |
[in] | user_data | The user data passed to the callback function |
0
on success, otherwise negative error value INM_ERROR_NONE | Successful |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_set_ip_conflict_cb | ( | inm_h | inm, |
inm_ip_conflict_cb | callback, | ||
void * | user_data | ||
) |
Sets the callback called when IP conflict state is changed.
[in] | inm | The monitoring handle |
[in] | callback | The callback function to be called |
[in] | user_data | The user data passed to the callback function |
INM_ERROR_NONE | Successful |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_set_retry_tx_rate_cb | ( | inm_h | inm, |
inm_retry_tx_rate_cb | callback, | ||
void * | user_data | ||
) |
Sets the callback called the TCP TX retry rate is updated.
[in] | inm | The monitoring handle |
[in] | callback | The callback function to be called |
[in] | user_data | The user data passed to the callback function |
INM_ERROR_NONE | Successful |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_set_wifi_module_state_changed_cb | ( | inm_h | inm, |
inm_wifi_module_state_changed_cb | callback, | ||
void * | user_data | ||
) |
Sets a callback called when the Wi-Fi Module state is changed.
[in] | inm | The monitor handle |
[in] | callback | The callback function to be called |
[in] | user_data | The user data passed to the callback function |
0
on success, otherwise negative error value INM_ERROR_NONE | Successful |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_unset_channel_interference_cb | ( | inm_h | inm | ) |
Unsets the callback called when the channel interference is updated.
[in] | inm | The monitoring handle |
INM_ERROR_NONE | Successful |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_unset_congestion_level_cb | ( | inm_h | inm | ) |
Unsets the callback called when the TCP congestion level is updated.
[in] | inm | The monitoring handle |
INM_ERROR_NONE | Successful |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_unset_ethernet_cable_state_changed_cb | ( | inm_h | inm | ) |
Unsets the callback called when the Ethernet cable state is changed.
[in] | inm | The monitor handle |
0
on success, otherwise negative error value INM_ERROR_NONE | Successful |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_unset_ip_conflict_cb | ( | inm_h | inm | ) |
Unsets the callback called when IP conflict state is changed.
[in] | inm | The monitoring handle |
INM_ERROR_NONE | Successful |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_unset_retry_tx_rate_cb | ( | inm_h | inm | ) |
Unsets the callback called when the TCP TX retry rate is updated.
[in] | inm | The monitoring handle |
INM_ERROR_NONE | Successful |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_unset_wifi_module_state_changed_cb | ( | inm_h | inm | ) |
Unsets the callback called when the Wi-Fi Module state is changed.
[in] | inm | The monitor handle |
0
on success, otherwise negative error value INM_ERROR_NONE | Successful |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |