Tizen Native API
5.5
|
The Network Monitoring API provides functions for getting network interface related information.
#include <inm.h>
This set of functions are used to get network interface related information. To use this kind of APIs, You should create a inm handle using inm_initialize(). After that, you need to get link handle using inm_connection_get_link(), inm_link_clone(), inm_foreach_link(). You should destroy the created link handle if you do not need it anymore. You should destroy the created inm handle if you do not need it anymore.
This API is related with the following features:
Functions | |
int | inm_link_destroy (inm_link_h link) |
Destroys a link handle. | |
int | inm_link_clone (inm_link_h *cloned, inm_link_h origin) |
Clones a link handle. | |
int | inm_link_get_interface_name (inm_link_h link, char **interface_name) |
Gets the link interface name. | |
int | inm_link_get_flags (inm_link_h link, int *flags) |
Gets the link flags. | |
int | inm_link_get_operation_state (inm_link_h link, inm_link_oper_state_e *operation_state) |
Gets the link operation status. | |
int | inm_link_get_received_bytes (inm_link_h link, unsigned long long *bytes) |
Gets the bytes received by the link. | |
int | inm_link_get_sent_bytes (inm_link_h link, unsigned long long *bytes) |
Gets the bytes sent by the link. | |
int | inm_link_foreach_address (inm_link_h link, inm_link_address_cb callback, void *user_data) |
Gets all addresses of the link. | |
int | inm_link_address_destroy (inm_link_address_h address) |
Destroys a link address handle. | |
int | inm_link_address_clone (inm_link_address_h *cloned, inm_link_address_h origin) |
Clones a link address handle. | |
int | inm_link_address_get_family (inm_link_address_h address, inm_address_family_e *family) |
Gets the address family. | |
int | inm_link_address_get_prefix_length (inm_link_address_h address, int *prefix_length) |
Gets the address prefix length. | |
int | inm_link_address_get_scope (inm_link_address_h address, inm_link_scope_e *scope) |
Gets the address scope. | |
int | inm_link_address_get_string (inm_link_address_h address, char **address_string) |
Gets the address string. | |
int | inm_link_foreach_route (inm_link_h link, inm_link_route_cb callback, void *user_data) |
Gets all route tables of the link. | |
int | inm_link_route_destroy (inm_link_route_h route) |
Destroys a link route handle. | |
int | inm_link_route_clone (inm_link_route_h *cloned, inm_link_route_h origin) |
Clones a link route handle. | |
int | inm_link_route_get_destination (inm_link_route_h route, char **destination) |
Gets the route destination. | |
int | inm_link_route_get_gateway (inm_link_route_h route, char **gateway) |
Gets the route gateway. | |
int | inm_link_route_get_interface (inm_link_route_h route, char **interface) |
Gets the route interface. | |
int | inm_link_route_is_default (inm_link_route_h route, bool *is_default) |
Checks whether the route is default or not. | |
int | inm_link_route_get_type (inm_link_route_h route, inm_link_route_type_e *type) |
Gets the route type. | |
Typedefs | |
typedef bool(* | inm_link_address_cb )(inm_link_address_h address, void *user_data) |
Called with handle of the link address. | |
typedef bool(* | inm_link_route_cb )(inm_link_route_h route, void *user_data) |
Called with handle of the link route table. |
typedef bool(* inm_link_address_cb)(inm_link_address_h address, void *user_data) |
Called with handle of the link address.
[in] | address | The link address handle |
[in] | user_data | The user data passed from the foreach function |
true
to continue with the next iteration of the loop, false
to break out of the loop typedef bool(* inm_link_route_cb)(inm_link_route_h route, void *user_data) |
Called with handle of the link route table.
[in] | route | The link route handle |
[in] | user_data | The user data passed from the foreach function |
true
to continue with the next iteration of the loop, false
to break out of the loop enum inm_link_flag_e |
Enumeration for link flag.
Enumeration for link route scope.
enum inm_link_scope_e |
Enumeration for link scope.
int inm_link_address_clone | ( | inm_link_address_h * | cloned, |
inm_link_address_h | origin | ||
) |
Clones a link address handle.
[out] | cloned | The handle of the cloned link address |
[in] | origin | The handle of the origin link address |
0
on success, otherwise a negative error value INM_ERROR_NONE | Successful |
INM_ERROR_OUT_OF_MEMORY | Out of memory |
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_link_address_destroy | ( | inm_link_address_h | address | ) |
Destroys a link address handle.
[in] | address | The link address handle |
0
on success, otherwise a 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_link_address_get_family | ( | inm_link_address_h | address, |
inm_address_family_e * | family | ||
) |
Gets the address family.
[in] | address | The address handle |
[out] | family | The address family |
0
on success, otherwise a 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_link_address_get_prefix_length | ( | inm_link_address_h | address, |
int * | prefix_length | ||
) |
Gets the address prefix length.
[in] | address | The address handle |
[out] | prefix_length | The prefix length of address |
0
on success, otherwise a 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_link_address_get_scope | ( | inm_link_address_h | address, |
inm_link_scope_e * | scope | ||
) |
Gets the address scope.
[in] | address | The address handle |
[out] | scope | The address scope |
0
on success, otherwise a 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_link_address_get_string | ( | inm_link_address_h | address, |
char ** | address_string | ||
) |
Gets the address string.
[in] | address | The address handle |
[out] | address_string | The address string |
0
on success, otherwise a negative error value INM_ERROR_NONE | Successful |
INM_ERROR_OUT_OF_MEMORY | Out of memory |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
INM_ERROR_DATA_NOT_FOUND | Data not found |
int inm_link_clone | ( | inm_link_h * | cloned, |
inm_link_h | origin | ||
) |
Clones a link handle.
[out] | cloned | The handle of the cloned link |
[in] | origin | The handle of the origin link |
0
on success, otherwise a negative error value INM_ERROR_NONE | Successful |
INM_ERROR_OUT_OF_MEMORY | Out of memory |
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_link_destroy | ( | inm_link_h | link | ) |
Destroys a link handle.
[out] | link | The link handle |
0
on success, otherwise a 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_link_foreach_address | ( | inm_link_h | link, |
inm_link_address_cb | callback, | ||
void * | user_data | ||
) |
Gets all addresses of the link.
[in] | link | The link handle |
[in] | callback | The callback to be called for each address of link |
[in] | user_data | The user data passed to the callback function |
INM_ERROR_NONE | Successful |
INM_ERROR_OUT_OF_MEMORY | Out of memory |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_link_foreach_route | ( | inm_link_h | link, |
inm_link_route_cb | callback, | ||
void * | user_data | ||
) |
Gets all route tables of the link.
[in] | link | The link handle |
[in] | callback | The callback to be called for each route table of link |
[in] | user_data | The user data passed to the callback function |
INM_ERROR_NONE | Successful |
INM_ERROR_OUT_OF_MEMORY | Out of memory |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_link_get_flags | ( | inm_link_h | link, |
int * | flags | ||
) |
Gets the link flags.
[in] | link | The link handle |
[out] | flags | The flags, values of inm_link_flag_e combined with bitwise 'or' |
0
on success, otherwise a 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_link_get_interface_name | ( | inm_link_h | link, |
char ** | interface_name | ||
) |
Gets the link interface name.
[in] | link | The link handle |
[out] | interface_name | The interface name of the link |
0
on success, otherwise a negative error value INM_ERROR_NONE | Successful |
INM_ERROR_OUT_OF_MEMORY | Out of memory |
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_link_get_operation_state | ( | inm_link_h | link, |
inm_link_oper_state_e * | operation_state | ||
) |
Gets the link operation status.
[in] | link | The link handle |
[out] | operation_state | The operation status of the link |
0
on success, otherwise a 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_link_get_received_bytes | ( | inm_link_h | link, |
unsigned long long * | bytes | ||
) |
Gets the bytes received by the link.
[in] | link | The link handle |
[out] | bytes | The bytes received by the link |
0
on success, otherwise a 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_link_get_sent_bytes | ( | inm_link_h | link, |
unsigned long long * | bytes | ||
) |
Gets the bytes sent by the link.
[in] | link | The link handle |
[out] | bytes | The bytes sent by the link |
0
on success, otherwise a 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_link_route_clone | ( | inm_link_route_h * | cloned, |
inm_link_route_h | origin | ||
) |
Clones a link route handle.
[out] | cloned | The handle of the cloned link route |
[in] | origin | The handle of the origin link route |
0
on success, otherwise a negative error value INM_ERROR_NONE | Successful |
INM_ERROR_OUT_OF_MEMORY | Out of memory |
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_link_route_destroy | ( | inm_link_route_h | route | ) |
Destroys a link route handle.
[in] | route | The link route handle |
0
on success, otherwise a 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_link_route_get_destination | ( | inm_link_route_h | route, |
char ** | destination | ||
) |
Gets the route destination.
[in] | route | The route handle |
[out] | destination | The route destination |
0
on success, otherwise a negative error value INM_ERROR_NONE | Successful |
INM_ERROR_OUT_OF_MEMORY | Out of memory |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
INM_ERROR_DATA_NOT_FOUND | Data not found |
int inm_link_route_get_gateway | ( | inm_link_route_h | route, |
char ** | gateway | ||
) |
Gets the route gateway.
[in] | route | The route handle |
[out] | gateway | The route gateway |
0
on success, otherwise a negative error value INM_ERROR_NONE | Successful |
INM_ERROR_OUT_OF_MEMORY | Out of memory |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
INM_ERROR_DATA_NOT_FOUND | Data not found |
int inm_link_route_get_interface | ( | inm_link_route_h | route, |
char ** | interface | ||
) |
Gets the route interface.
[in] | route | The route handle |
[out] | interface | The route interface |
0
on success, otherwise a negative error value INM_ERROR_NONE | Successful |
INM_ERROR_OUT_OF_MEMORY | Out of memory |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
INM_ERROR_DATA_NOT_FOUND | Data not found |
int inm_link_route_get_type | ( | inm_link_route_h | route, |
inm_link_route_type_e * | type | ||
) |
Gets the route type.
[in] | route | The route handle |
[out] | type | The route type |
0
on success, otherwise a 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_link_route_is_default | ( | inm_link_route_h | route, |
bool * | is_default | ||
) |
Checks whether the route is default or not.
[in] | route | The route handle |
[out] | is_default | true if route is default, otherwise false if route is not default |
0
on success, otherwise a 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 |