Tizen(Headed) Native API
6.5
|
The Network Monitoring API provides functions for getting network interface related information.
Required Header
#include <inm.h>
Overview
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.
Related Features
This API is related with the following features:
- http://tizen.org/feature/network.inm
It is recommended to design feature related codes 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 | 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 Documentation
typedef bool(* inm_link_address_cb)(inm_link_address_h address, void *user_data) |
Called with handle of the link address.
- Since :
- 5.5
- Remarks:
- If address is needed outside the callback, a copy should be made. address will be freed automatically after the execution of this callback.
- Parameters:
-
[in] address The link address handle [in] user_data The user data passed from the foreach function
- Returns:
true
to continue with the next iteration of the loop,
false
to break out of the loop
- Precondition:
- inm_link_foreach_address() will invoke this callback.
- See also:
- inm_link_foreach_address().
typedef bool(* inm_link_route_cb)(inm_link_route_h route, void *user_data) |
Called with handle of the link route table.
- Since :
- 5.0
- Remarks:
- If route is needed outside the callback, a copy should be made. route will be freed automatically after the execution of this callback.
- Parameters:
-
[in] route The link route handle [in] user_data The user data passed from the foreach function
- Returns:
true
to continue with the next iteration of the loop,
false
to break out of the loop
- Precondition:
- inm_link_foreach_route() will invoke this callback.
- See also:
- inm_link_foreach_route().
Enumeration Type Documentation
enum inm_link_flag_e |
Enumeration for link flag.
- Since :
- 5.5
- Enumerator:
Enumeration for link route scope.
- Since :
- 5.5
- Enumerator:
enum inm_link_scope_e |
Enumeration for link scope.
- Since :
- 5.5
- Enumerator:
Function Documentation
int inm_link_address_clone | ( | inm_link_address_h * | cloned, |
inm_link_address_h | origin | ||
) |
Clones a link address handle.
- Since :
- 5.5
- Remarks:
- You must release cloned link address using inm_link_address_destroy().
- Parameters:
-
[out] cloned The handle of the cloned link address [in] origin The handle of the origin link address
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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
- See also:
- inm_link_address_destroy()
int inm_link_address_destroy | ( | inm_link_address_h | address | ) |
Destroys a link address handle.
- Since :
- 5.5
- Parameters:
-
[in] address The link address handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 5.5
- Parameters:
-
[in] address The address handle [out] family The address family
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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
- See also:
- inm_link_foreach_address()
int inm_link_address_get_prefix_length | ( | inm_link_address_h | address, |
int * | prefix_length | ||
) |
Gets the address prefix length.
- Since :
- 5.5
- Parameters:
-
[in] address The address handle [out] prefix_length The prefix length of address
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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
- See also:
- inm_link_foreach_address()
int inm_link_address_get_scope | ( | inm_link_address_h | address, |
inm_link_scope_e * | scope | ||
) |
Gets the address scope.
- Since :
- 5.5
- Parameters:
-
[in] address The address handle [out] scope The address scope
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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
- See also:
- inm_link_foreach_address()
int inm_link_address_get_string | ( | inm_link_address_h | address, |
char ** | address_string | ||
) |
Gets the address string.
- Since :
- 5.5
- Remarks:
- You must release address_string using free().
- Parameters:
-
[in] address The address handle [out] address_string The address string
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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
- See also:
- inm_link_foreach_address()
int inm_link_clone | ( | inm_link_h * | cloned, |
inm_link_h | origin | ||
) |
Clones a link handle.
- Since :
- 5.5
- Remarks:
- You must release cloned link using inm_link_destroy().
- Parameters:
-
[out] cloned The handle of the cloned link [in] origin The handle of the origin link
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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
- See also:
- inm_link_destroy()
int inm_link_destroy | ( | inm_link_h | link | ) |
Destroys a link handle.
- Since :
- 5.5
- Parameters:
-
[out] link The link handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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
- See also:
- inm_link_clone()
- inm_foreach_link()
int inm_link_foreach_address | ( | inm_link_h | link, |
inm_link_address_cb | callback, | ||
void * | user_data | ||
) |
Gets all addresses of the link.
- Since :
- 5.5
- Parameters:
-
[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
- Returns:
- 0 on success, otherwise negative error value.
- Return values:
-
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.
- Since :
- 5.0
- Parameters:
-
[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
- Returns:
- 0 on success, otherwise negative error value.
- Return values:
-
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.
- Since :
- 5.5
- Parameters:
-
[in] link The link handle [out] flags The flags, values of inm_link_flag_e combined with bitwise 'or'
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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
- See also:
- inm_foreach_link()
int inm_link_get_interface_name | ( | inm_link_h | link, |
char ** | interface_name | ||
) |
Gets the link interface name.
- Since :
- 5.5
- Remarks:
- You must release interface_name using free().
- Parameters:
-
[in] link The link handle [out] interface_name The interface name of the link
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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
- See also:
- inm_foreach_link()
int inm_link_get_operation_state | ( | inm_link_h | link, |
inm_link_oper_state_e * | operation_state | ||
) |
Gets the link operation status.
- Since :
- 5.5
- Parameters:
-
[in] link The link handle [out] operation_state The operation status of the link
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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
- See also:
- inm_foreach_link()
int inm_link_get_received_bytes | ( | inm_link_h | link, |
unsigned long long * | bytes | ||
) |
Gets the bytes received by the link.
- Since :
- 5.5
- Parameters:
-
[in] link The link handle [out] bytes The bytes received by the link
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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
- See also:
- inm_foreach_link()
int inm_link_get_sent_bytes | ( | inm_link_h | link, |
unsigned long long * | bytes | ||
) |
Gets the bytes sent by the link.
- Since :
- 5.5
- Parameters:
-
[in] link The link handle [out] bytes The bytes sent by the link
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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
- See also:
- inm_foreach_link()
int inm_link_route_clone | ( | inm_link_route_h * | cloned, |
inm_link_route_h | origin | ||
) |
Clones a link route handle.
- Since :
- 5.5
- Remarks:
- You must release cloned link route using inm_link_route_destroy().
- Parameters:
-
[out] cloned The handle of the cloned link route [in] origin The handle of the origin link route
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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
- See also:
- inm_link_route_destroy()
int inm_link_route_destroy | ( | inm_link_route_h | route | ) |
Destroys a link route handle.
- Since :
- 5.5
- Parameters:
-
[in] route The link route handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 5.5
- Remarks:
- You must release destination using free().
- Parameters:
-
[in] route The route handle [out] destination The route destination
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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
- See also:
- inm_link_foreach_route()
int inm_link_route_get_gateway | ( | inm_link_route_h | route, |
char ** | gateway | ||
) |
Gets the route gateway.
- Since :
- 5.5
- Remarks:
- You must release gateway using free().
- Parameters:
-
[in] route The route handle [out] gateway The route gateway
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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
- See also:
- inm_link_foreach_route()
int inm_link_route_get_interface | ( | inm_link_route_h | route, |
char ** | interface | ||
) |
Gets the route interface.
- Since :
- 5.5
- Remarks:
- You must release interface using free().
- Parameters:
-
[in] route The route handle [out] interface The route interface
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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
- See also:
- inm_link_foreach_route()
int inm_link_route_get_type | ( | inm_link_route_h | route, |
inm_link_route_type_e * | type | ||
) |
Gets the route type.
- Since :
- 5.5
- Parameters:
-
[in] route The route handle [out] type The route type
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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
- See also:
- inm_link_foreach_route()
int inm_link_route_is_default | ( | inm_link_route_h | route, |
bool * | is_default | ||
) |
Checks whether the route is default or not.
- Since :
- 5.5
- Parameters:
-
[in] route The route handle [out] is_default true
if route is default, otherwisefalse
if route is not default
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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
- See also:
- inm_link_foreach_route()