Tizen(Headed) Native API  6.5
Network Monitoring General

The Network Monitoring API provides functions for getting connections.

Required Header

#include <inm.h>

Overview

This set of functions is used to get network state, get connection handles. To use This kind of APIs, You should create a inm handle using inm_initialize(). 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.ethernet
  • http://tizen.org/feature/network.wifi
  • http://tizen.org/feature/network.telephony
  • http://tizen.org/feature/network.tethering.bluetooth
  • 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_set_cellular_state_changed_cb (inm_h inm, inm_cellular_state_changed_cb callback, void *user_data)
 Sets a callback called when the cellular state is changed.
int inm_unset_cellular_state_changed_cb (inm_h inm)
 Unsets the callback called when the cellular state is changed.
int inm_get_cellular_state (inm_h inm, inm_cellular_state_e *state)
 Gets the state of the cellular connection.
int inm_set_wifi_state_changed_cb (inm_h inm, inm_wifi_state_changed_cb callback, void *user_data)
 Sets a callback called when the Wi-Fi state is changed.
int inm_unset_wifi_state_changed_cb (inm_h inm)
 Unsets the callback called when the Wi-Fi state is changed.
int inm_get_wifi_state (inm_h inm, inm_wifi_state_e *state)
 Gets the state of the Wi-Fi.
int inm_set_ethernet_state_changed_cb (inm_h inm, inm_ethernet_state_changed_cb callback, void *user_data)
 Sets a callback called when the ethernet state is changed.
int inm_unset_ethernet_state_changed_cb (inm_h inm)
 Unsets the callback called when the ethernet state is changed.
int inm_get_ethernet_state (inm_h inm, inm_ethernet_state_e *state)
 Gets the state of the ethernet.
int inm_get_current_connection (inm_h inm, inm_connection_h *connection)
 Gets the handle of the default connection.
int inm_connection_destroy (inm_connection_h *connection)
 Destroys a connection handle.
int inm_connection_clone (inm_connection_h *cloned, inm_connection_h origin)
 Clones a connection handle.
int inm_get_connection_iterator (inm_h inm, inm_connection_iterator_h *connection_iterator)
 Gets a connections iterator.
int inm_connection_iterator_next (inm_connection_iterator_h connection_iterator, inm_connection_h *connection)
 Moves the connection iterator to the next position and gets a connection handle.
int inm_destroy_connection_iterator (inm_connection_iterator_h connection_iterator)
 Destroys a connections iterator.
int inm_foreach_link (inm_h inm, inm_link_cb callback, void *user_data)
 Gets handles of the link.
int inm_refresh_links (inm_h inm)
 Refreshes link information held by a handle.
int inm_arp_request_set_packet_interval (inm_h inm, int seconds)
 Sets the ARP packet interval which is used to find targets IP on local network.
int inm_arp_request_get_packet_interval (inm_h inm, int *seconds)
 Gets the ARP packet interval which is used to find targets IP on local network.
int inm_arp_request_start (inm_h inm, const char *target_ip, inm_arp_request_ip_found_cb callback, void *user_data)
 Starts to send ARP packets to find a target_ip.
int inm_arp_request_stop (inm_h inm, const char *target_ip)
 Stops sending ARP packets.
int inm_default_gateway_start_checking (inm_h inm, int timeout, inm_default_gateway_found_cb callback, void *user_data)
 Starts to send ARP packets to find gateway during timeout, in seconds.
int inm_default_gateway_stop_checking (inm_h inm)
 Stops sending ARP packets to check default gateway.
int inm_default_dns_lookup_check (inm_h inm, inm_default_dns_lookup_result_cb callback, void *user_data)
 Checks DNS lookup of the target to check whether DNS server is valid or not.
int inm_reachable_urls_add_url_to_check (inm_h inm, const char *url)
 Adds URL to check reachability by inm_start_checking_reachable_urls() with type INM_URL_LIST_TYPE_USER.
int inm_reachable_urls_remove_url_to_check (inm_h inm, const char *url)
 Removes URL to check reachability by inm_start_checking_reachable_urls() with type INM_URL_LIST_TYPE_USER.
int inm_reachable_urls_start_checking (inm_h inm, inm_url_list_type_e type, inm_reachable_urls_check_result_cb callback, void *user_data)
 Starts to send HTTP GET requests with curl to check reachability of URLs of the given type.
int inm_reachable_urls_stop_checking (inm_h inm, inm_url_list_type_e type)
 Stops sending HTTP GET requests with curl to check reachability of URLs of the given type.
int inm_reachable_urls_is_check_running (inm_h inm, inm_url_list_type_e type, bool *is_running)
 Gets whether the reachable URLs check is running or not.

Typedefs

typedef void(* inm_cellular_state_changed_cb )(inm_cellular_state_e state, void *user_data)
 Called when the cellular state is changed.
typedef void(* inm_wifi_state_changed_cb )(inm_wifi_state_e state, void *user_data)
 Called when the Wi-Fi state is changed.
typedef void(* inm_ethernet_state_changed_cb )(inm_ethernet_state_e state, void *user_data)
 Called when the ethernet state is changed.
typedef bool(* inm_link_cb )(inm_link_h link, void *user_data)
 Called with a link handle.
typedef void(* inm_arp_request_ip_found_cb )(bool found, const char *ip, void *user_data)
 Called when the IP is found on a local network.
typedef void(* inm_default_gateway_found_cb )(bool found, const char *gateway_ip, void *user_data)
 Called when the gateway IP is found on a local network by sending ARP packets.
typedef void(* inm_default_dns_lookup_result_cb )(bool found, void *user_data)
 Called when the DNS lookup result is received.
typedef void(* inm_reachable_urls_check_result_cb )(inm_reachable_urls_check_result_e result, const char *url, void *user_data)
 Called when the URL responds to HTTP GET generated by curl.

Typedef Documentation

typedef void(* inm_arp_request_ip_found_cb)(bool found, const char *ip, void *user_data)

Called when the IP is found on a local network.

Since :
5.5
Remarks:
ip should not be freed. ip is available only in the callback. To use outside the callback, make a copy.
Parameters:
[in]foundtrue if IP is found, false if ip IP not found
[in]ipThe IP address found on a local network
[in]user_dataThe user data passed from the callback registration function
See also:
inm_arp_request_start()
inm_arp_request_stop()
typedef void(* inm_cellular_state_changed_cb)(inm_cellular_state_e state, void *user_data)

Called when the cellular state is changed.

Since :
5.0
Parameters:
[in]stateThe cellular state
[in]user_dataThe user data passed from the callback registration function
See also:
inm_set_cellular_state_changed_cb()
inm_unset_cellular_state_changed_cb()
typedef void(* inm_default_dns_lookup_result_cb)(bool found, void *user_data)

Called when the DNS lookup result is received.

Since :
5.5
Parameters:
[in]foundtrue if DNS lookup succeeded, false if DNS lookup failed
[in]user_dataThe user data passed from the callback registration function
See also:
inm_default_dns_lookup_check()
typedef void(* inm_default_gateway_found_cb)(bool found, const char *gateway_ip, void *user_data)

Called when the gateway IP is found on a local network by sending ARP packets.

Since :
5.5
Remarks:
gateway_ip should not be freed. gateway_ip is available only in the callback. To use outside the callback, make a copy.
Parameters:
[in]foundtrue if gateway IP address is found, false if gateway IP address isn't found after timeout
[in]gateway_ipThe gateway IP address found on a local network
[in]user_dataThe user data passed from the callback registration function
See also:
inm_default_gateway_start_checking()
inm_default_gateway_stop_checking()
typedef void(* inm_ethernet_state_changed_cb)(inm_ethernet_state_e state, void *user_data)

Called when the ethernet state is changed.

Since :
5.0
Parameters:
[in]stateThe ethernet state
[in]user_dataThe user data passed from the callback registration function
See also:
inm_set_ethernet_state_changed_cb()
inm_unset_ethernet_state_changed_cb()
typedef bool(* inm_link_cb)(inm_link_h link, void *user_data)

Called with a link handle.

Since :
5.5
Remarks:
If link is needed outside the callback, a copy should be made. link will be freed automatically after the execution of this callback.
Parameters:
[in]linkThe link handle
[in]user_dataThe user data passed from foreach function
Returns:
true to continue with the next iteration of the loop, false to break out of the loop
See also:
inm_foreach_link()
inm_link_clone()
typedef void(* inm_reachable_urls_check_result_cb)(inm_reachable_urls_check_result_e result, const char *url, void *user_data)

Called when the URL responds to HTTP GET generated by curl.

Since :
5.5
Remarks:
url should not be freed. url is available only in the callback. To use outside the callback, make a copy.
Parameters:
[in]resultThe enumeration value to describe the result.
[in]urlThe URL responses to HTTP GET generated by curl
[in]user_dataThe user data passed from the callback registration function
See also:
inm_reachable_urls_start_checking()
inm_reachable_urls_stop_checking()
inm_reachable_urls_is_check_running()
typedef void(* inm_wifi_state_changed_cb)(inm_wifi_state_e state, void *user_data)

Called when the Wi-Fi state is changed.

Since :
5.0
Parameters:
[in]stateThe Wi-Fi state
[in]user_dataThe user data passed from the callback registration function
See also:
inm_set_wifi_state_changed_cb()
inm_unset_wifi_state_changed_cb()

Enumeration Type Documentation

Enumeration for cellular network state.

Since :
5.0
Enumerator:
INM_CELLULAR_STATE_DEACTIVATED 

Cellular is deactivated

INM_CELLULAR_STATE_DISCONNECTED 

Disconnected

INM_CELLULAR_STATE_CONNECTED 

Connected

Enumeration for ethernet state.

Since :
5.0
Enumerator:
INM_ETHERNET_STATE_DEACTIVATED 

There is no Ethernet profile to open

INM_ETHERNET_STATE_DISCONNECTED 

Disconnected

INM_ETHERNET_STATE_CONNECTED 

Connected

Enumeration for result of checking URL callback.

Since :
5.5
Enumerator:
INM_REACHABLE_URL_CHECK_RESULT_SUCCESS 

URL accessed successfully

INM_REACHABLE_URL_CHECK_RESULT_ERROR_MALFORMED_URL 

'URL is malformed' error

INM_REACHABLE_URL_CHECK_RESULT_ERROR_DNS_RESOLVE 

'URL couldn't be resolved' error

INM_REACHABLE_URL_CHECK_RESULT_ERROR_TCP_CONNECT 

'TCP connection' error

INM_REACHABLE_URL_CHECK_RESULT_ERROR_SSL 

SSL error

INM_REACHABLE_URL_CHECK_RESULT_ERROR_HTTP 

HTTP error

INM_REACHABLE_URL_CHECK_RESULT_ERROR_FILE_NOT_FOUND 

'Remote file not found' error

INM_REACHABLE_URL_CHECK_RESULT_ERROR_UNKNOWN 

Unknown error

Enumeration for URL list type.

Since :
5.5
Enumerator:
INM_URL_LIST_TYPE_DEFAULT 

Default test URLs

INM_URL_LIST_TYPE_USER 

User registered test URLs

Enumeration for Wi-Fi state.

Since :
5.0
Enumerator:
INM_WIFI_STATE_DEACTIVATED 

Wi-Fi is deactivated

INM_WIFI_STATE_DISCONNECTED 

Disconnected

INM_WIFI_STATE_CONNECTED 

Connected


Function Documentation

int inm_arp_request_get_packet_interval ( inm_h  inm,
int *  seconds 
)

Gets the ARP packet interval which is used to find targets IP on local network.

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Parameters:
[in]inmThe monitoring handle
[out]secondsThe ARP packet interval value in seconds
Returns:
0 on success, otherwise a negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_PERMISSION_DENIEDPermission Denied
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
See also:
inm_arp_request_start()
inm_arp_request_stop()
inm_default_gateway_start_checking()
inm_default_gateway_stop_checking()
int inm_arp_request_set_packet_interval ( inm_h  inm,
int  seconds 
)

Sets the ARP packet interval which is used to find targets IP on local network.

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Parameters:
[in]inmThe monitoring handle
[in]secondsThe ARP packet interval value in seconds
Returns:
0 on success, otherwise a negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_PERMISSION_DENIEDPermission Denied
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
INM_ERROR_NOW_IN_PROGRESSNow in progress
See also:
inm_arp_request_start()
inm_arp_request_stop()
inm_default_gateway_start_checking()
inm_default_gateway_stop_checking()
int inm_arp_request_start ( inm_h  inm,
const char *  target_ip,
inm_arp_request_ip_found_cb  callback,
void *  user_data 
)

Starts to send ARP packets to find a target_ip.

User should set callback to get results by inm_arp_request_ip_found_cb()

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Parameters:
[in]inmThe monitoring handle
[in]target_ipIP address to find
[in]callbackThe callback function to be called
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_PERMISSION_DENIEDPermission Denied
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
INM_ERROR_NOW_IN_PROGRESSNow in progress
int inm_arp_request_stop ( inm_h  inm,
const char *  target_ip 
)

Stops sending ARP packets.

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Parameters:
[in]inmThe monitoring handle
[in]target_ipIP address to stop finding
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_PERMISSION_DENIEDPermission Denied
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
INM_ERROR_NOW_IN_PROGRESSNow in progress
int inm_connection_clone ( inm_connection_h cloned,
inm_connection_h  origin 
)

Clones a connection handle.

Since :
5.0
Remarks:
You must release cloned connection using inm_connection_destroy().
Parameters:
[out]clonedThe handle of the cloned connection
[in]originThe handle of the origin connection
Returns:
0 on success, otherwise a negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_OUT_OF_MEMORYOut of memory
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
See also:
inm_connection_destroy()

Destroys a connection handle.

Since :
5.0
Parameters:
[out]connectionThe connection handle
Returns:
0 on success, otherwise a negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
See also:
inm_get_current_connection()
int inm_connection_iterator_next ( inm_connection_iterator_h  connection_iterator,
inm_connection_h connection 
)

Moves the connection iterator to the next position and gets a connection handle.

Since :
5.0
Remarks:
After the iterator is created, its inner cursor is placed before the first element. The first call to inm_connection_iterator_next() gets the first element. You must release connection using inm_connection_destroy().
Parameters:
[in]connection_iteratorThe connection iterator
[out]connectionThe connection handle
Returns:
0 on success, otherwise a negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
int inm_default_dns_lookup_check ( inm_h  inm,
inm_default_dns_lookup_result_cb  callback,
void *  user_data 
)

Checks DNS lookup of the target to check whether DNS server is valid or not.

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Parameters:
[in]inmThe monitoring handle
[in]callbackThe callback function to be called
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_PERMISSION_DENIEDPermission Denied
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
INM_ERROR_NOW_IN_PROGRESSNow in progress
int inm_default_gateway_start_checking ( inm_h  inm,
int  timeout,
inm_default_gateway_found_cb  callback,
void *  user_data 
)

Starts to send ARP packets to find gateway during timeout, in seconds.

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Parameters:
[in]inmThe monitoring handle
[in]timeoutSpecifies the duration of discovery period, in seconds. If 0, then there is no limit on how long the discovery takes.
[in]callbackThe callback function to be called
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_PERMISSION_DENIEDPermission Denied
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
INM_ERROR_NOW_IN_PROGRESSNow in progress

Stops sending ARP packets to check default gateway.

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Parameters:
[in]inmThe monitoring handle
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_PERMISSION_DENIEDPermission Denied
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
INM_ERROR_NOW_IN_PROGRESSNow in progress

Destroys a connections iterator.

Since :
5.0
Parameters:
[in]connection_iteratorThe connection iterator
Returns:
0 on success, otherwise a negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
int inm_foreach_link ( inm_h  inm,
inm_link_cb  callback,
void *  user_data 
)

Gets handles of the link.

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Parameters:
[in]inmThe inm handle
[in]callbackThe callback function to invoke
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_OUT_OF_MEMORYOut of memory
INM_ERROR_PERMISSION_DENIEDPermission Denied
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
See also:
inm_link_clone()

Gets the state of the cellular connection.

The returned state is for the cellular connection state.

Since :
5.0
Parameters:
[in]inmThe inm handle
[out]stateThe state of the cellular connection
Returns:
0 on success, otherwise a negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
int inm_get_connection_iterator ( inm_h  inm,
inm_connection_iterator_h connection_iterator 
)

Gets a connections iterator.

Since :
5.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Remarks:
You must release connection_iterator using inm_destroy_connection_iterator().
Parameters:
[in]inmThe inm handle
[out]connection_iteratorThe iterator of connection
Returns:
0 on success, otherwise a negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_OUT_OF_MEMORYOut of memory
INM_ERROR_PERMISSION_DENIEDPermission Denied
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
int inm_get_current_connection ( inm_h  inm,
inm_connection_h connection 
)

Gets the handle of the default connection.

Since :
5.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Remarks:
You must release connection using inm_connection_destroy().
Parameters:
[in]inmThe inm handle
[out]connectionThe connection handle
Returns:
0 on success, otherwise a negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_OUT_OF_MEMORYOut of memory
INM_ERROR_PERMISSION_DENIEDPermission Denied
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed

Gets the state of the ethernet.

The returned state is for the ethernet connection state.

Since :
5.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Parameters:
[in]inmThe inm handle
[out]stateThe state of ethernet connection
Returns:
0 on success, otherwise a negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_PERMISSION_DENIEDPermission Denied
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
int inm_get_wifi_state ( inm_h  inm,
inm_wifi_state_e state 
)

Gets the state of the Wi-Fi.

The returned state is for the Wi-Fi connection state.

Since :
5.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Parameters:
[in]inmThe inm handle
[out]stateThe state of Wi-Fi connection
Returns:
0 on success, otherwise a negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_PERMISSION_DENIEDPermission Denied
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
int inm_reachable_urls_add_url_to_check ( inm_h  inm,
const char *  url 
)

Adds URL to check reachability by inm_start_checking_reachable_urls() with type INM_URL_LIST_TYPE_USER.

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Parameters:
[in]inmThe monitoring handle
[in]urlThe URL to check reachability
Returns:
0 on success, otherwise a negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_PERMISSION_DENIEDPermission Denied
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
See also:
inm_reachable_urls_start_checking()
inm_reachable_urls_stop_checking()
int inm_reachable_urls_is_check_running ( inm_h  inm,
inm_url_list_type_e  type,
bool *  is_running 
)

Gets whether the reachable URLs check is running or not.

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Parameters:
[in]inmThe monitoring handle
[in]typeURL type to check
[out]is_runningchecking URL is running or not
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_PERMISSION_DENIEDPermission Denied
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
int inm_reachable_urls_remove_url_to_check ( inm_h  inm,
const char *  url 
)

Removes URL to check reachability by inm_start_checking_reachable_urls() with type INM_URL_LIST_TYPE_USER.

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Parameters:
[in]inmThe monitoring handle
[in]urlThe URL to check reachability
Returns:
0 on success, otherwise a negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_PERMISSION_DENIEDPermission Denied
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
See also:
inm_reachable_urls_start_checking()
inm_reachable_urls_stop_checking()
int inm_reachable_urls_start_checking ( inm_h  inm,
inm_url_list_type_e  type,
inm_reachable_urls_check_result_cb  callback,
void *  user_data 
)

Starts to send HTTP GET requests with curl to check reachability of URLs of the given type.

This function just checks if URLs in the list can be reachable once. If you want to check again, you need to call this function again with the target URL list.

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Parameters:
[in]inmThe monitoring handle
[in]typeURL type to check. For INM_URL_LIST_TYPE_DEFAULT, the platform checks the reachability of "tizen.org". For INM_URL_LIST_TYPE_USER, the platform checks the reachability of URLs added by inm_add_url_to_check()
[in]callbackThe callback function to be called
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_PERMISSION_DENIEDPermission Denied
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
INM_ERROR_NOW_IN_PROGRESSNow in progress

Stops sending HTTP GET requests with curl to check reachability of URLs of the given type.

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Parameters:
[in]inmThe monitoring handle
[in]typeThe URL type to check
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_PERMISSION_DENIEDPermission Denied
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
int inm_refresh_links ( inm_h  inm)

Refreshes link information held by a handle.

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Parameters:
[in]inmThe inm handle
Returns:
0 on success, otherwise a negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_OUT_OF_MEMORYOut of memory
INM_ERROR_PERMISSION_DENIEDPermission Denied
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
See also:
inm_foreach_link()
int inm_set_cellular_state_changed_cb ( inm_h  inm,
inm_cellular_state_changed_cb  callback,
void *  user_data 
)

Sets a callback called when the cellular state is changed.

Since :
5.0
Parameters:
[in]inmThe monitor handle
[in]callbackThe callback function to be called
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
See also:
inm_cellular_state_changed_cb()
inm_unset_cellular_state_changed_cb()
int inm_set_ethernet_state_changed_cb ( inm_h  inm,
inm_ethernet_state_changed_cb  callback,
void *  user_data 
)

Sets a callback called when the ethernet state is changed.

Since :
5.0
Parameters:
[in]inmThe monitor handle
[in]callbackThe callback function to be called
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
See also:
inm_ethernet_state_changed_cb()
inm_unset_ethernet_state_changed_cb()
int inm_set_wifi_state_changed_cb ( inm_h  inm,
inm_wifi_state_changed_cb  callback,
void *  user_data 
)

Sets a callback called when the Wi-Fi state is changed.

Since :
5.0
Parameters:
[in]inmThe monitor handle
[in]callbackThe callback function to be called
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
See also:
inm_wifi_state_changed_cb()
inm_unset_wifi_state_changed_cb()

Unsets the callback called when the cellular state is changed.

Since :
5.0
Parameters:
[in]inmThe monitor handle
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
See also:
inm_cellular_state_changed_cb()
inm_set_cellular_state_changed_cb()

Unsets the callback called when the ethernet state is changed.

Since :
5.0
Parameters:
[in]inmThe monitor handle
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
See also:
inm_ethernet_state_changed_cb()
inm_set_ethernet_state_changed_cb()

Unsets the callback called when the Wi-Fi state is changed.

Since :
5.0
Parameters:
[in]inmThe monitor handle
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_NOT_INITIALIZEDNot initialized
INM_ERROR_OPERATION_FAILEDOperation failed
See also:
inm_wifi_state_changed_cb()
inm_set_wifi_state_changed_cb()