[ACR-930] Added CAPI to add/remove route table 99/125799/1
authortaesub kim <taesub.kim@samsung.com>
Mon, 10 Apr 2017 09:13:00 +0000 (18:13 +0900)
committertaesub kim <taesub.kim@samsung.com>
Wed, 19 Apr 2017 02:20:42 +0000 (11:20 +0900)
Change-Id: Iadf8e5b78247185ac00ea2c8cc1464fecf08e89b
Signed-off-by: Taesub Kim <taesub.kim@samsung.com>
include/net_connection.h
include/net_connection_private.h
src/connection.c
src/libnetwork.c
test/connection_test.c

index 930cfd3..9f90859 100755 (executable)
@@ -57,12 +57,12 @@ typedef void* connection_profile_iterator_h;
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  */
 typedef enum {
-       CONNECTION_TYPE_DISCONNECTED = 0, /**< Disconnected */
-       CONNECTION_TYPE_WIFI = 1, /**< Wi-Fi type */
-       CONNECTION_TYPE_CELLULAR = 2, /**< Cellular type */
-       CONNECTION_TYPE_ETHERNET = 3, /**< Ethernet type */
-       CONNECTION_TYPE_BT = 4, /**< Bluetooth type */
-       CONNECTION_TYPE_NET_PROXY, /**< Proxy type for internet connection (Since 3.0) */
+       CONNECTION_TYPE_DISCONNECTED = 0,  /**< Disconnected */
+       CONNECTION_TYPE_WIFI = 1,          /**< Wi-Fi type */
+       CONNECTION_TYPE_CELLULAR = 2,      /**< Cellular type */
+       CONNECTION_TYPE_ETHERNET = 3,      /**< Ethernet type */
+       CONNECTION_TYPE_BT = 4,            /**< Bluetooth type */
+       CONNECTION_TYPE_NET_PROXY,         /**< Proxy type for internet connection (Since 3.0) */
 } connection_type_e;
 
 
@@ -71,12 +71,12 @@ typedef enum {
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  */
 typedef enum {
-       CONNECTION_CELLULAR_STATE_OUT_OF_SERVICE = 0, /**< Out of service */
-       CONNECTION_CELLULAR_STATE_FLIGHT_MODE = 1, /**< Flight mode */
-       CONNECTION_CELLULAR_STATE_ROAMING_OFF = 2, /**< Roaming is turned off */
+       CONNECTION_CELLULAR_STATE_OUT_OF_SERVICE = 0,      /**< Out of service */
+       CONNECTION_CELLULAR_STATE_FLIGHT_MODE = 1,         /**< Flight mode */
+       CONNECTION_CELLULAR_STATE_ROAMING_OFF = 2,         /**< Roaming is turned off */
        CONNECTION_CELLULAR_STATE_CALL_ONLY_AVAILABLE = 3, /**< Call is only available */
-       CONNECTION_CELLULAR_STATE_AVAILABLE = 4, /**< Available but not connected yet */
-       CONNECTION_CELLULAR_STATE_CONNECTED = 5, /**< Connected */
+       CONNECTION_CELLULAR_STATE_AVAILABLE = 4,           /**< Available but not connected yet */
+       CONNECTION_CELLULAR_STATE_CONNECTED = 5,           /**< Connected */
 } connection_cellular_state_e;
 
 
@@ -85,9 +85,9 @@ typedef enum {
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  */
 typedef enum {
-       CONNECTION_WIFI_STATE_DEACTIVATED = 0, /**< Wi-Fi is deactivated */
-       CONNECTION_WIFI_STATE_DISCONNECTED = 1, /**< Disconnected */
-       CONNECTION_WIFI_STATE_CONNECTED = 2, /**< Connected */
+       CONNECTION_WIFI_STATE_DEACTIVATED = 0,   /**< Wi-Fi is deactivated */
+       CONNECTION_WIFI_STATE_DISCONNECTED = 1,  /**< Disconnected */
+       CONNECTION_WIFI_STATE_CONNECTED = 2,     /**< Connected */
 } connection_wifi_state_e;
 
 
@@ -96,9 +96,9 @@ typedef enum {
  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
  */
 typedef enum {
-       CONNECTION_ETHERNET_STATE_DEACTIVATED = 0, /**< There is no Ethernet profile to open */
+       CONNECTION_ETHERNET_STATE_DEACTIVATED = 0,  /**< There is no Ethernet profile to open */
        CONNECTION_ETHERNET_STATE_DISCONNECTED = 1, /**< Disconnected */
-       CONNECTION_ETHERNET_STATE_CONNECTED = 2, /**< Connected */
+       CONNECTION_ETHERNET_STATE_CONNECTED = 2,    /**< Connected */
 } connection_ethernet_state_e;
 
 
@@ -107,9 +107,9 @@ typedef enum {
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  */
 typedef enum {
-       CONNECTION_BT_STATE_DEACTIVATED = 0, /**< There is no Bluetooth profile to open */
-       CONNECTION_BT_STATE_DISCONNECTED = 1, /**< Disconnected */
-       CONNECTION_BT_STATE_CONNECTED = 2, /**< Connected */
+       CONNECTION_BT_STATE_DEACTIVATED = 0,   /**< There is no Bluetooth profile to open */
+       CONNECTION_BT_STATE_DISCONNECTED = 1,  /**< Disconnected */
+       CONNECTION_BT_STATE_CONNECTED = 2,     /**< Connected */
 } connection_bt_state_e;
 
 
@@ -119,8 +119,8 @@ typedef enum {
  */
 typedef enum {
        CONNECTION_ITERATOR_TYPE_REGISTERED = 0, /**< The iterator of the registered profile */
-       CONNECTION_ITERATOR_TYPE_CONNECTED = 1, /**< The iterator of the connected profile */
-       CONNECTION_ITERATOR_TYPE_DEFAULT = 2, /**< The iterator of the default profile */
+       CONNECTION_ITERATOR_TYPE_CONNECTED = 1,  /**< The iterator of the connected profile */
+       CONNECTION_ITERATOR_TYPE_DEFAULT = 2,    /**< The iterator of the default profile */
 } connection_iterator_type_e;
 
 
@@ -129,8 +129,8 @@ typedef enum {
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 */
 typedef enum {
-       CONNECTION_RESET_DEFAULT_PROFILE = 0, /**< Initialized with the default profile defined by csc */
-       CONNECTION_RESET_CLEAR_PROFILE = 1, /**< Remove all profiles */
+       CONNECTION_RESET_DEFAULT_PROFILE = 0,  /**< Initialized with the default profile defined by csc */
+       CONNECTION_RESET_CLEAR_PROFILE = 1,    /**< Remove all profiles */
 } connection_reset_option_e;
 
 
@@ -139,8 +139,8 @@ typedef enum {
  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
  */
 typedef enum {
-       CONNECTION_ETHERNET_CABLE_DETACHED = 0, /**< Ethernet cable is detached */
-       CONNECTION_ETHERNET_CABLE_ATTACHED = 1, /**< Ethernet cable is attached */
+       CONNECTION_ETHERNET_CABLE_DETACHED = 0,   /**< Ethernet cable is detached */
+       CONNECTION_ETHERNET_CABLE_ATTACHED = 1,   /**< Ethernet cable is attached */
 } connection_ethernet_cable_state_e;
 
 
@@ -149,22 +149,86 @@ typedef enum {
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  */
 typedef enum {
-       CONNECTION_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
-       CONNECTION_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
-       CONNECTION_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory error */
-       CONNECTION_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid Operation */
-       CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED = TIZEN_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED, /**< Address family not supported */
-       CONNECTION_ERROR_OPERATION_FAILED = TIZEN_ERROR_CONNECTION|0x0401, /**< Operation failed */
-       CONNECTION_ERROR_ITERATOR_END = TIZEN_ERROR_CONNECTION|0x0402, /**< End of iteration */
-       CONNECTION_ERROR_NO_CONNECTION = TIZEN_ERROR_CONNECTION|0x0403, /**< There is no connection */
-       CONNECTION_ERROR_NOW_IN_PROGRESS = TIZEN_ERROR_NOW_IN_PROGRESS, /** Now in progress */
-       CONNECTION_ERROR_ALREADY_EXISTS = TIZEN_ERROR_CONNECTION|0x0404, /**< Already exists */
-       CONNECTION_ERROR_OPERATION_ABORTED = TIZEN_ERROR_CONNECTION|0x0405, /**< Operation is aborted */
-       CONNECTION_ERROR_DHCP_FAILED = TIZEN_ERROR_CONNECTION|0x0406, /**< DHCP failed */
-       CONNECTION_ERROR_INVALID_KEY = TIZEN_ERROR_CONNECTION|0x0407, /**< Invalid key */
-       CONNECTION_ERROR_NO_REPLY = TIZEN_ERROR_CONNECTION|0x0408, /**< No reply */
-       CONNECTION_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
-       CONNECTION_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED      /**< Not Supported */
+       /**
+        * Successful
+        */
+       CONNECTION_ERROR_NONE = TIZEN_ERROR_NONE,
+
+       /**
+        *Invalid parameter
+        */
+       CONNECTION_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,
+
+       /**
+        *   Out of memory error
+        */
+       CONNECTION_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,
+
+       /**
+        * Invalid operation
+        */
+       CONNECTION_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION,
+
+       /**
+        * Address family         Not supported
+        */
+       CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED = TIZEN_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED,
+
+       /**
+        *      Operation failed
+        */
+       CONNECTION_ERROR_OPERATION_FAILED = TIZEN_ERROR_CONNECTION|0x0401,
+
+       /**
+        * End of iteration
+        */
+       CONNECTION_ERROR_ITERATOR_END = TIZEN_ERROR_CONNECTION|0x0402,
+
+       /**
+        * There is no connection
+        */
+       CONNECTION_ERROR_NO_CONNECTION = TIZEN_ERROR_CONNECTION|0x0403,
+
+       /**
+        * Now inprogress
+        */
+       CONNECTION_ERROR_NOW_IN_PROGRESS = TIZEN_ERROR_NOW_IN_PROGRESS,
+
+       /**
+        * Already exists
+        */
+       CONNECTION_ERROR_ALREADY_EXISTS = TIZEN_ERROR_CONNECTION|0x0404,
+
+       /**
+        * Operation is aborted
+        */
+       CONNECTION_ERROR_OPERATION_ABORTED = TIZEN_ERROR_CONNECTION|0x0405,
+
+       /**
+        * DHCP failed
+        */
+       CONNECTION_ERROR_DHCP_FAILED = TIZEN_ERROR_CONNECTION|0x0406,
+
+       /**
+        * Invalid key
+        */
+       CONNECTION_ERROR_INVALID_KEY = TIZEN_ERROR_CONNECTION|0x0407,
+
+       /**
+        * No reply
+        */
+       CONNECTION_ERROR_NO_REPLY = TIZEN_ERROR_CONNECTION|0x0408,
+
+       /**
+        *     Permission denied
+        */
+       CONNECTION_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED,
+
+       /**
+        *         Not supported
+        */
+       CONNECTION_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED
+
 } connection_error_e;
 
 /**
@@ -183,10 +247,10 @@ typedef enum {
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  */
 typedef enum {
-       CONNECTION_STATISTICS_TYPE_LAST_RECEIVED_DATA = 0, /**< Last received data */
-       CONNECTION_STATISTICS_TYPE_LAST_SENT_DATA = 1, /**< Last sent data */
+       CONNECTION_STATISTICS_TYPE_LAST_RECEIVED_DATA = 0,  /**< Last received data */
+       CONNECTION_STATISTICS_TYPE_LAST_SENT_DATA = 1,      /**< Last sent data */
        CONNECTION_STATISTICS_TYPE_TOTAL_RECEIVED_DATA = 2, /**< Total received data */
-       CONNECTION_STATISTICS_TYPE_TOTAL_SENT_DATA = 3, /**< Total sent data */
+       CONNECTION_STATISTICS_TYPE_TOTAL_SENT_DATA = 3,     /**< Total sent data */
 } connection_statistics_type_e;
 
 
@@ -207,12 +271,12 @@ typedef enum {
  * @privlevel public
  * @privilege %http://tizen.org/privilege/network.get
  * @remarks You must release @a handle using connection_destroy().
- * @param[out] connection The connection handle
+ * @param[out] connection       The connection handle
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OUT_OF_MEMORY         Out of memory
  * @see connection_destroy()
  */
 int connection_create(connection_h* connection);
@@ -221,11 +285,11 @@ int connection_create(connection_h* connection);
 /**
  * @brief Destroys the connection handle.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] connection The connection handle
+ * @param[in] connection        The connection handle
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
  * @see connection_create()
  */
 int connection_destroy(connection_h connection);
@@ -234,7 +298,7 @@ int connection_destroy(connection_h connection);
 /**
  * @brief Called when the type of a connection is changed.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] type The type of the current network connection
+ * @param[in] type              The type of the current network connection
  * @param[in] user_data The user data passed from the callback registration function
  * @see connection_set_type_changed_cb()
  * @see connection_unset_type_changed_cb()
@@ -245,22 +309,23 @@ typedef void(*connection_type_changed_cb)(connection_type_e type, void* user_dat
 /**
  * @brief Called when the address is changed.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] ipv4_address The IP address for IPv4
- * @param[in] ipv6_address The IP address for IPv6
+ * @param[in] ipv4_address      The IP address for IPv4
+ * @param[in] ipv6_address      The IP address for IPv6
  * @param[in] user_data The user data passed from the callback registration function
  * @see connection_set_ip_address_changed_cb()
  * @see connection_unset_ip_address_changed_cb()
  * @see connection_set_proxy_address_changed_cb()
  * @see connection_unset_proxy_address_changed_cb()
  */
-typedef void(*connection_address_changed_cb)(const char* ipv4_address, const char* ipv6_address, void* user_data);
+typedef void(*connection_address_changed_cb)(const char* ipv4_address,
+               const char* ipv6_address, void* user_data);
 
 
 /**
  * @brief Called when connection_set_default_cellular_service_profile_async() finishes.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] result The result
- * @param[in] user_data The user data passed from connection_open_profile()
+ * @param[in] result            The result
+ * @param[in] user_data         The user data passed from connection_open_profile()
  * @pre connection_set_default_cellular_service_profile_async() will invoke this callback function.
  * @see connection_set_default_cellular_service_profile_async()
 */
@@ -270,8 +335,8 @@ typedef void(*connection_set_default_cb)(connection_error_e result, void* user_d
  * @since_tizen 4.0
  * @remarks   If @a ipv6_address is needed outside the callback, a copy should be made. \n
  *            @a ipv6_address will be freed automatically after the execution of this callback.
- * @param[in]  ipv6_address  The IPv6 address
- * @param[in]  user_data     The user data passed from the foreach function
+ * @param[in]  ipv6_address     The IPv6 address
+ * @param[in]  user_data        The user data passed from the foreach function
  * @return  @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
  * @pre  connection_foreach_ipv6_addresses() will invoke this callback.
  * @see  connection_foreach_ipv6_addresses()
@@ -281,13 +346,13 @@ typedef bool(*connection_ipv6_address_cb)(char *ipv6_address, void *user_data);
 /**
  * @brief Gets the type of the current profile for data connection.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] connection The connection handle
- * @param[out] type The type of the network
+ * @param[in] connection        The connection handle
+ * @param[out] type             The type of the network
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
  */
 int connection_get_type(connection_h connection, connection_type_e* type);
 
@@ -296,67 +361,70 @@ int connection_get_type(connection_h connection, connection_type_e* type);
  * @brief Gets the IP address of the current connection.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @remarks You must release @a ip_address using free().
- * @param[in] connection The connection handle
- * @param[in] address_family The address family
+ * @param[in] connection        The connection handle
+ * @param[in] address_family    The address family
  * @param[out] ip_address The pointer to the IP address string
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
+ * @retval #CONNECTION_ERROR_NONE                           Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
+ * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
  */
-int connection_get_ip_address(connection_h connection, connection_address_family_e address_family, char** ip_address);
+int connection_get_ip_address(connection_h connection,
+               connection_address_family_e address_family, char** ip_address);
 
 
 /**
  * @brief Gets the proxy address of the current connection.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @remarks You must release @a proxy using free().
- * @param[in] connection The connection handle
- * @param[in] address_family The address family
+ * @param[in] connection        The connection handle
+ * @param[in] address_family    The address family
  * @param[out] proxy The proxy address
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
+ * @retval #CONNECTION_ERROR_NONE                           Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
+ * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
  */
-int connection_get_proxy(connection_h connection, connection_address_family_e address_family, char** proxy);
+int connection_get_proxy(connection_h connection,
+               connection_address_family_e address_family, char** proxy);
 
 
 /**
  * @brief Gets the MAC address of the Wi-Fi or ethernet.
  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
  * @remarks @a mac_addr must be released with free() by you.
- * @param[in] connection The handle of the connection
- * @param[in] type The type of current network connection
- * @param[out] mac_addr The MAC address
+ * @param[in] connection        The handle of the connection
+ * @param[in] type              The type of current network connection
+ * @param[out] mac_addr         The MAC address
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_INVALID_OPERATION Invalid operation
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
- * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_INVALID_OPERATION     Invalid operation
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
+ * @retval #CONNECTION_ERROR_OUT_OF_MEMORY         Out of memory
  */
-int connection_get_mac_address(connection_h connection, connection_type_e type, char** mac_addr);
+int connection_get_mac_address(connection_h connection,
+               connection_type_e type, char** mac_addr);
 
 
 /**
  * @brief Gets the state of cellular connection.
  * @details The returned state is for the cellular connection state.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] connection The connection handle
- * @param[out] state The state of the cellular connection
+ * @param[in] connection        The connection handle
+ * @param[out] state            The state of the cellular connection
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
  */
 int connection_get_cellular_state(connection_h connection, connection_cellular_state_e* state);
 
@@ -367,15 +435,15 @@ int connection_get_cellular_state(connection_h connection, connection_cellular_s
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @privlevel public
  * @privilege %http://tizen.org/privilege/network.get
- * @param[in] connection The connection handle
- * @param[out] state The state of Wi-Fi connection
+ * @param[in] connection        The connection handle
+ * @param[out] state            The state of Wi-Fi connection
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
- * @retval #CONNECTION_ERROR_NOT_SUPPORTED     Not supported
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED            Not supported
  */
 int connection_get_wifi_state(connection_h connection, connection_wifi_state_e* state);
 
@@ -386,15 +454,15 @@ int connection_get_wifi_state(connection_h connection, connection_wifi_state_e*
  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
  * @privlevel public
  * @privilege %http://tizen.org/privilege/network.get
- * @param[in] connection The connection handle
- * @param[out] state The state of Ethernet connection
+ * @param[in] connection        The connection handle
+ * @param[out] state            The state of Ethernet connection
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
- * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
  */
 int connection_get_ethernet_state(connection_h connection, connection_ethernet_state_e* state);
 
@@ -405,95 +473,100 @@ int connection_get_ethernet_state(connection_h connection, connection_ethernet_s
  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
  * @privlevel public
  * @privilege %http://tizen.org/privilege/network.get
- * @param[in] connection The handle of the connection
- * @param[in] state - Enum connection_ethernet_cable_state_e
+ * @param[in] connection        The handle of the connection
+ * @param[in] state             The state of ethernet cable
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
- * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
+ * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
  */
-int connection_get_ethernet_cable_state(connection_h connection, connection_ethernet_cable_state_e *state);
+int connection_get_ethernet_cable_state(connection_h connection,
+               connection_ethernet_cable_state_e *state);
 
 
 /**
- * @deprecated Deprecated since 4.0. Use connection_ethernet_cable_state_changed_cb instead.
+ * @deprecated Deprecated since 4.0. Use connection_ethernet_cable_state_changed_cb() instead.
  * @brief Called when ethernet cable is plugged [in/out].
  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @param[in] state The ethernet cable state (connection_ethernet_cable_state_e)
- * @param[in] user_data The user data passed to callback registration function
+ * @param[in] state             The state of ethernet cable
+ * @param[in] user_data         The user data passed to callback registration function
  */
-typedef void(*connection_ethernet_cable_state_chaged_cb)(connection_ethernet_cable_state_e state, void* user_data);
+typedef void(*connection_ethernet_cable_state_chaged_cb)
+               (connection_ethernet_cable_state_e state, void* user_data);
 
 
 /**
  * @deprecated Deprecated since 4.0. Use connection_set_ethernet_cable_state_changed_cb() instead.
  * @brief Registers callback for ethernet cable is plugged [in/out] event.
  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @param[in] connection  The handle of connection
- * @param[in] callback  The callback function to be called
- * @param[in] user_data The user data passed to the callback function
+ * @param[in] connection        The handle of connection
+ * @param[in] callback          The callback function to be called
+ * @param[in] user_data         The user data passed to the callback function
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
  */
-int connection_set_ethernet_cable_state_chaged_cb(connection_h connection, connection_ethernet_cable_state_chaged_cb callback, void *user_data) TIZEN_DEPRECATED_API;
+int connection_set_ethernet_cable_state_chaged_cb(connection_h connection,
+               connection_ethernet_cable_state_chaged_cb callback, void *user_data) TIZEN_DEPRECATED_API;
 
 
 /**
  * @deprecated Deprecated since 4.0. Use connection_unset_ethernet_cable_state_changed_cb() instead.
  * @brief Unregisters callback for ethernet cable is plugged [in/out] event.
  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @param[in] connection The handle of connection
+ * @param[in] connection        The handle of connection
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
  */
 int connection_unset_ethernet_cable_state_chaged_cb(connection_h connection) TIZEN_DEPRECATED_API;
 
 /**
  * @brief Called when ethernet cable is plugged [in/out].
  * @since_tizen 4.0
- * @param[in] state The ethernet cable state (connection_ethernet_cable_state_e)
- * @param[in] user_data The user data passed to callback registration function
+ * @param[in] state             The state of ethernet cable
+ * @param[in] user_data         The user data passed to callback registration function
  */
-typedef void(*connection_ethernet_cable_state_changed_cb)(connection_ethernet_cable_state_e state, void* user_data);
+typedef void(*connection_ethernet_cable_state_changed_cb)(
+               connection_ethernet_cable_state_e state, void* user_data);
 
 
 /**
  * @brief Registers callback for ethernet cable is plugged [in/out] event.
  * @since_tizen 4.0
- * @param[in] connection  The handle of connection
- * @param[in] callback  The callback function to be called
- * @param[in] user_data The user data passed to the callback function
+ * @param[in] connection        The handle of connection
+ * @param[in] callback          The callback function to be called
+ * @param[in] user_data         The user data passed to the callback function
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
  */
-int connection_set_ethernet_cable_state_changed_cb(connection_h connection, connection_ethernet_cable_state_changed_cb callback, void *user_data);
+int connection_set_ethernet_cable_state_changed_cb(connection_h connection,
+               connection_ethernet_cable_state_changed_cb callback, void *user_data);
 
 
 /**
  * @brief Unregisters callback for ethernet cable is plugged [in/out] event.
  * @since_tizen 4.0
- * @param[in] connection The handle of connection
+ * @param[in] connection        The handle of connection
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
  */
 int connection_unset_ethernet_cable_state_changed_cb(connection_h connection);
 
@@ -504,15 +577,15 @@ int connection_unset_ethernet_cable_state_changed_cb(connection_h connection);
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @privlevel public
  * @privilege %http://tizen.org/privilege/network.get
- * @param[in] connection The connection handle
- * @param[out] state The state of the Bluetooth connection
+ * @param[in] connection        The connection handle
+ * @param[out] state            The state of the Bluetooth connection
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
- * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
  */
 int connection_get_bt_state(connection_h connection, connection_bt_state_e* state);
 
@@ -520,27 +593,28 @@ int connection_get_bt_state(connection_h connection, connection_bt_state_e* stat
 /**
  * @brief Registers the callback that is called when the type of the current connection is changed.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] connection The connection handle
- * @param[in] callback The callback function to be called
- * @param[in] user_data The user data passed to the callback function
+ * @param[in] connection        The connection handle
+ * @param[in] callback          The callback function to be called
+ * @param[in] user_data         The user data passed to the callback function
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
  */
-int connection_set_type_changed_cb(connection_h connection, connection_type_changed_cb callback, void* user_data);
+int connection_set_type_changed_cb(connection_h connection,
+               connection_type_changed_cb callback, void* user_data);
 
 
 /**
  * @brief Unregisters the callback that is called when the type of current connection is changed.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] connection The connection handle
+ * @param[in] connection        The connection handle
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
  */
 int connection_unset_type_changed_cb(connection_h connection);
 
@@ -548,27 +622,28 @@ int connection_unset_type_changed_cb(connection_h connection);
 /**
  * @brief Registers the callback that is called when the IP address is changed.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] connection The connection handle
- * @param[in] callback The callback function to be called
- * @param[in] user_data The user data passed to the callback function
+ * @param[in] connection        The connection handle
+ * @param[in] callback          The callback function to be called
+ * @param[in] user_data         The user data passed to the callback function
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
  */
-int connection_set_ip_address_changed_cb(connection_h connection, connection_address_changed_cb callback, void* user_data);
+int connection_set_ip_address_changed_cb(connection_h connection,
+               connection_address_changed_cb callback, void* user_data);
 
 
 /**
  * @brief Unregisters the callback that is called when the IP address is changed.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] connection The connection handle
+ * @param[in] connection        The connection handle
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
  */
 int connection_unset_ip_address_changed_cb(connection_h connection);
 
@@ -576,27 +651,28 @@ int connection_unset_ip_address_changed_cb(connection_h connection);
 /**
  * @brief Registers the callback that is called when the proxy address is changed.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] connection The connection handle
+ * @param[in] connection        The connection handle
  * @param[in] callback The callback function to be called
  * @param[in] user_data The user data passed to the callback function
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
  */
-int connection_set_proxy_address_changed_cb(connection_h connection, connection_address_changed_cb callback, void* user_data);
+int connection_set_proxy_address_changed_cb(connection_h connection,
+               connection_address_changed_cb callback, void* user_data);
 
 
 /**
  * @brief Unregisters the callback that is called when the proxy address is changed.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] connection The connection handle
+ * @param[in] connection        The connection handle
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
  */
 int connection_unset_proxy_address_changed_cb(connection_h connection);
 
@@ -607,15 +683,15 @@ int connection_unset_proxy_address_changed_cb(connection_h connection);
  * @privlevel public
  * @privilege %http://tizen.org/privilege/network.profile
  * @remarks You can only add a profile of the cellular type.
- * @param[in] connection The connection handle
- * @param[in] profile The profile handle
+ * @param[in] connection        The connection handle
+ * @param[in] profile           The profile handle
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
- * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not Supported
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
  */
 int connection_add_profile(connection_h connection, connection_profile_h profile);
 
@@ -627,15 +703,15 @@ int connection_add_profile(connection_h connection, connection_profile_h profile
  * @privilege %http://tizen.org/privilege/network.profile \n
  *            %http://tizen.org/privilege/network.get
  * @remarks This API needs both privileges.
- * @param[in] connection The connection handle
- * @param[in] profile The profile handle
+ * @param[in] connection        The connection handle
+ * @param[in] profile           The profile handle
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
- * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not Supported
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
  */
 int connection_remove_profile(connection_h connection, connection_profile_h profile);
 
@@ -650,15 +726,15 @@ int connection_remove_profile(connection_h connection, connection_profile_h prof
  * @privilege %http://tizen.org/privilege/network.profile \n
  *            %http://tizen.org/privilege/network.get
  * @remarks This API needs both privileges.
- * @param[in] connection The connection handle
- * @param[in] profile The profile handle
+ * @param[in] connection        The connection handle
+ * @param[in] profile           The profile handle
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
- * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not Supported
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
  * @see connection_open_profile()
  */
 int connection_update_profile(connection_h connection, connection_profile_h profile);
@@ -670,39 +746,41 @@ int connection_update_profile(connection_h connection, connection_profile_h prof
  * @privlevel public
  * @privilege %http://tizen.org/privilege/network.get
  * @remarks You must release @a profile_iterator using connection_destroy().
- * @param[in] connection The connection handle
- * @param[in] type The type of the connection iterator
+ * @param[in] connection        The connection handle
+ * @param[in] type              The type of the connection iterator
  * @param[out] profile_iterator The iterator of profile
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OUT_OF_MEMORY         Out of memory
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
  */
-int connection_get_profile_iterator(connection_h connection, connection_iterator_type_e type, connection_profile_iterator_h* profile_iterator);
+int connection_get_profile_iterator(connection_h connection,
+               connection_iterator_type_e type, connection_profile_iterator_h* profile_iterator);
 
 
 /**
  * @brief Moves the profile iterator to the next position and gets a profile handle.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] profile_iterator The iterator of profile
- * @param[out] profile The profile handle
+ * @param[in] profile_iterator  The iterator of profile
+ * @param[out] profile          The profile handle
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_ITERATOR_END End of iteration
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_ITERATOR_END          End of iteration
  */
-int connection_profile_iterator_next(connection_profile_iterator_h profile_iterator, connection_profile_h* profile);
+int connection_profile_iterator_next(connection_profile_iterator_h profile_iterator,
+               connection_profile_h* profile);
 
 
 /**
  * @brief Checks whether the next element of a profile iterator exists or not.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
- * @param[in] profile_iterator The iterator of profile
+ * @param[in] profile_iterator  The iterator of profile
  * @return @c true if next element exists,
  *         otherwise @c false if next element doesn't exist
  */
@@ -712,11 +790,11 @@ bool connection_profile_iterator_has_next(connection_profile_iterator_h profile_
 /**
  * @brief Destroys a profiles iterator.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] profile_iterator The iterator of the profile
+ * @param[in] profile_iterator  The iterator of the profile
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
  */
 int connection_destroy_profile_iterator(connection_profile_iterator_h profile_iterator);
 
@@ -727,16 +805,16 @@ int connection_destroy_profile_iterator(connection_profile_iterator_h profile_it
  * @privlevel public
  * @privilege %http://tizen.org/privilege/network.get
  * @remarks You must release @a profile using connection_profile_destroy().
- * @param[in] connection The connection handle
- * @param[out] profile The profile handle
+ * @param[in] connection        The connection handle
+ * @param[out] profile          The profile handle
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_NO_CONNECTION There is no connection
- * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OUT_OF_MEMORY         Out of memory
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_NO_CONNECTION         There is no connection
+ * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
  */
 int connection_get_current_profile(connection_h connection, connection_profile_h* profile);
 
@@ -747,20 +825,21 @@ int connection_get_current_profile(connection_h connection, connection_profile_h
  * @privlevel public
  * @privilege %http://tizen.org/privilege/network.get
  * @remarks You must release @a profile using connection_profile_destroy().
- * @param[in] connection The connection handle
- * @param[in] type The type of cellular service \n
- *                        #CONNECTION_CELLULAR_SERVICE_TYPE_APPLICATION is not permitted
- * @param[out] profile The profile handle
+ * @param[in] connection        The connection handle
+ * @param[in] type              The type of cellular service \n
+ *                           #CONNECTION_CELLULAR_SERVICE_TYPE_APPLICATION is not permitted
+ * @param[out] profile          The profile handle
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
- * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not Supported
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OUT_OF_MEMORY         Out of memory
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
  */
-int connection_get_default_cellular_service_profile(connection_h connection, connection_cellular_service_type_e type, connection_profile_h* profile);
+int connection_get_default_cellular_service_profile(connection_h connection,
+               connection_cellular_service_type_e type, connection_profile_h* profile);
 
 
 /**
@@ -770,19 +849,21 @@ int connection_get_default_cellular_service_profile(connection_h connection, con
  * @privilege %http://tizen.org/privilege/network.profile \n
  *               %http://tizen.org/privilege/network.get
  * @remarks This API needs both privileges.
- * @param[in] connection The connection handle
- * @param[in] type The type of cellular service \n
- *                        only #CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET and #CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_INTERNET are permitted
- * @param[in] profile The profile handle
+ * @param[in] connection        The connection handle
+ * @param[in] type              The type of cellular service \n
+ *                        only #CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET and \n
+ *                 #CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_INTERNET are permitted
+ * @param[in] profile           The profile handle
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
- * @retval #CONNECTION_ERROR_NOT_SUPPORTED     Not Supported
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED            Not supported
  */
-int connection_set_default_cellular_service_profile(connection_h connection, connection_cellular_service_type_e type, connection_profile_h profile);
+int connection_set_default_cellular_service_profile(connection_h connection,
+               connection_cellular_service_type_e type, connection_profile_h profile);
 
 
 /**
@@ -792,28 +873,30 @@ int connection_set_default_cellular_service_profile(connection_h connection, con
  * @privilege %http://tizen.org/privilege/network.profile \n
  *               %http://tizen.org/privilege/network.get
  * @remarks This API needs both privileges.
- * @param[in] connection The connection handle
- * @param[in] type The type of cellular service (only #CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET and #CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_INTERNET are permitted)
+ * @param[in] connection        The connection handle
+ * @param[in] type              The type of cellular service (only #CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET \n
+ *            and #CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_INTERNET are permitted)
  * @param[in] profile The profile handle
  * @param[in] callback The callback function to be called
  * @param[in] user_data The user data passed to the callback function
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
- * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not Supported
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
  */
 int connection_set_default_cellular_service_profile_async(connection_h connection,
-               connection_cellular_service_type_e type, connection_profile_h profile, connection_set_default_cb callback, void* user_data);
+               connection_cellular_service_type_e type, connection_profile_h profile,
+               connection_set_default_cb callback, void* user_data);
 
 
 /**
  * @brief Called after connection_open_profile() is finished.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] result The result
- * @param[in] user_data The user data passed from connection_open_profile()
+ * @param[in] result            The result
+ * @param[in] user_data         The user data passed from connection_open_profile()
  * @pre connection_open_profile() will invoke this callback function.
  * @see connection_open_profile()
 */
@@ -823,8 +906,8 @@ typedef void(*connection_opened_cb)(connection_error_e result, void* user_data);
 /**
  * @brief Called after connection_close_profile() is finished.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] result The result
- * @param[in] user_data The user data passed from connection_close_profile()
+ * @param[in] result            The result
+ * @param[in] user_data         The user data passed from connection_close_profile()
  * @pre connection_close_profile() will invoke this callback function.
  * @see connection_close_profile()
 */
@@ -834,8 +917,8 @@ typedef void(*connection_closed_cb)(connection_error_e result, void* user_data);
 /**
  * @brief Called after connection_reset_profile() is finished.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] result The result
- * @param[in] user_data The user data passed from connection_reset_profile()
+ * @param[in] result            The result
+ * @param[in] user_data         The user data passed from connection_reset_profile()
  * @pre connection_reset_profile() will invoke this callback function.
  * @see connection_reset_profile()
 */
@@ -849,16 +932,16 @@ typedef void(*connection_reset_cb)(connection_error_e result, void* user_data);
  * @privilege %http://tizen.org/privilege/network.set \n
  *               %http://tizen.org/privilege/network.get
  * @remarks This API needs both privileges.
- * @param[in] connection The connection handle
- * @param[in] profile The profile handle
- * @param[in] callback The callback function to be called
- * @param[in] user_data The user data passed to the callback function
+ * @param[in] connection        The connection handle
+ * @param[in] profile           The profile handle
+ * @param[in] callback          The callback function to be called
+ * @param[in] user_data         The user data passed to the callback function
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
  * @post connection_opened_cb() will be invoked.
  * @see connection_opened_cb()
  * @see connection_close_profile()
@@ -866,7 +949,8 @@ typedef void(*connection_reset_cb)(connection_error_e result, void* user_data);
  * @see connection_profile_unset_state_changed_cb()
  * @see connection_profile_state_changed_cb()
  */
-int connection_open_profile(connection_h connection, connection_profile_h profile, connection_opened_cb callback, void* user_data);
+int connection_open_profile(connection_h connection, connection_profile_h profile,
+               connection_opened_cb callback, void* user_data);
 
 
 /**
@@ -874,16 +958,16 @@ int connection_open_profile(connection_h connection, connection_profile_h profil
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @privlevel public
  * @privilege %http://tizen.org/privilege/network.set
- * @param[in] connection The connection handle
- * @param[in] profile The profile handle
- * @param[in] callback The callback function to be called
- * @param[in] user_data The user data passed to the callback function
+ * @param[in] connection        The connection handle
+ * @param[in] profile           The profile handle
+ * @param[in] callback          The callback function to be called
+ * @param[in] user_data         The user data passed to the callback function
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
  * @post connection_closed_cb() will be invoked.
  * @see connection_closed_cb()
  * @see connection_open_profile()
@@ -891,7 +975,8 @@ int connection_open_profile(connection_h connection, connection_profile_h profil
  * @see connection_profile_unset_state_changed_cb()
  * @see connection_profile_state_changed_cb()
  */
-int connection_close_profile(connection_h connection, connection_profile_h profile, connection_closed_cb callback, void* user_data);
+int connection_close_profile(connection_h connection, connection_profile_h profile,
+               connection_closed_cb callback, void* user_data);
 
 
 /**
@@ -901,118 +986,180 @@ int connection_close_profile(connection_h connection, connection_profile_h profi
  * @privilege %http://tizen.org/privilege/network.profile \n
  *               %http://tizen.org/privilege/network.get
  * @remarks This API needs both privileges.
- * @param[in] connection The connection handle
- * @param[in] type The type of reset
- * @param[in] id The subscriber identity module ID to reset (The sim index starts from 0.)
- * @param[in] callback The callback function to be called
- * @param[in] user_data The user data passed to the callback function
+ * @param[in] connection        The connection handle
+ * @param[in] type              The type of reset
+ * @param[in] id                The subscriber identity module ID to reset (The sim index starts from 0.)
+ * @param[in] callback          The callback function to be called
+ * @param[in] user_data         The user data passed to the callback function
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
- * @retval #CONNECTION_ERROR_NOT_SUPPORTED     Not Supported
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED            Not supported
  * @post connection_reset_cb() will be invoked.
 */
-int connection_reset_profile(connection_h connection, connection_reset_option_e type, int id, connection_reset_cb callback, void *user_data);
+int connection_reset_profile(connection_h connection, connection_reset_option_e type,
+               int id, connection_reset_cb callback, void *user_data);
 
 
 /**
+ * @deprecated Deprecated since 4.0. Use connection_add_route_entry() instead.
  * @brief Adds a IPv4 route to the routing table.
  * @details You can get the @a interface_name from connection_profile_get_network_interface_name() of opened profile.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @privlevel public
  * @privilege %http://tizen.org/privilege/network.set
- * @param[in] connection The connection handle
- * @param[in] interface_name The name of network interface
- * @param[in] host_address The IP address of the host
+ * @param[in] connection        The connection handle
+ * @param[in] interface_name    The name of network interface
+ * @param[in] host_address      The IP address of the host
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_ALREADY_EXISTS Already exists
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_ALREADY_EXISTS        Already exists
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
  * @see connection_profile_get_network_interface_name()
  */
-int connection_add_route(connection_h connection, const char* interface_name, const char* host_address);
+int connection_add_route(connection_h connection, const char* interface_name,
+               const char* host_address) TIZEN_DEPRECATED_API;
 
 
 /**
+ * @deprecated Deprecated since 4.0. Use connection_remove_route_entry() instead.
  * @brief Removes a IPv4 route from the routing table.
  * @details You can get the @a interface_name from connection_profile_get_network_interface_name() of opened profile.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @privlevel public
  * @privilege %http://tizen.org/privilege/network.set
- * @param[in] connection The connection handle
- * @param[in] interface_name The name of network interface
- * @param[in] host_address The IP address of the host
+ * @param[in] connection        The connection handle
+ * @param[in] interface_name    The name of network interface
+ * @param[in] host_address      The IP address of the host
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
  * @see connection_profile_get_network_interface_name()
  */
-int connection_remove_route(connection_h connection, const char* interface_name, const char* host_address);
+int connection_remove_route(connection_h connection, const char* interface_name,
+               const char* host_address) TIZEN_DEPRECATED_API;
 
 
 /**
+ * @deprecated Deprecated since 4.0. Use connection_add_route_entry() instead.
  * @brief Adds a IPv6 route to the routing table.
  * @details You can get the @a interface_name from connection_profile_get_network_interface_name() of opened profile.
  * @since_tizen 2.3.1
  * @privlevel public
  * @privilege %http://tizen.org/privilege/network.set
- * @param[in] connection The connection handle
- * @param[in] interface_name The name of network interface
- * @param[in] host_address The IP address of the host
- * @param[in] gateway The gateway address
+ * @param[in] connection        The connection handle
+ * @param[in] interface_name    The name of network interface
+ * @param[in] host_address      The IP address of the host
+ * @param[in] gateway           The gateway address
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_ALREADY_EXISTS Already exists
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_ALREADY_EXISTS        Already exists
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
  * @see connection_profile_get_network_interface_name()
  */
-int connection_add_route_ipv6(connection_h connection, const char *interface_name, const char *host_address, const char * gateway);
+int connection_add_route_ipv6(connection_h connection, const char *interface_name,
+               const char *host_address, const char * gateway) TIZEN_DEPRECATED_API;
 
 
 /**
+ * @deprecated Deprecated since 4.0. Use connection_remove_route_entry() instead.
  * @brief Removes a IPV6 route from the routing table.
  * @details You can get the @a interface_name from connection_profile_get_network_interface_name() of opened profile.
  * @since_tizen 2.3.1
  * @privlevel public
  * @privilege %http://tizen.org/privilege/network.set
- * @param[in] connection The connection handle
- * @param[in] interface_name The name of network interface
- * @param[in] host_address The IP address of the host
- * @param[in] gateway The gateway address
+ * @param[in] connection        The connection handle
+ * @param[in] interface_name    The name of network interface
+ * @param[in] host_address      The IP address of the host
+ * @param[in] gateway           The gateway address
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
+ * @see connection_profile_get_network_interface_name()
+ */
+int connection_remove_route_ipv6(connection_h connection, const char *interface_name,
+               const char *host_address, const char * gateway) TIZEN_DEPRECATED_API;
+
+/**
+ * @brief Adds a route to the routing table.
+ * @details You can get the @a interface_name from \n
+ *          connection_profile_get_network_interface_name() of opened profile.
+ * @since_tizen 4.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/network.set
+ * @param[in] connection        The connection handle
+ * @param[in] address_family    The address family
+ * @param[in] interface_name    The name of network interface
+ * @param[in] host_address      The IP address of the host (e.g., single IP address such as
+ *            163.152.10.2,192.168.1.2), group's IP address (e.g., 163.152.10.0, 192.168.0.0)
+ *            is not allowed
+ * @param[in] gateway           The gateway address
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_ALREADY_EXISTS        Already exists
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
  * @see connection_profile_get_network_interface_name()
  */
-int connection_remove_route_ipv6(connection_h connection, const char *interface_name, const char *host_address, const char * gateway);
+int connection_add_route_entry(connection_h connection,
+               connection_address_family_e address_family, const char *interface_name,
+               const char *host_address, const char *gateway);
+
+/**
+ * @brief Removes a route from the routing table.
+ * @details You can get the @a interface_name from \n
+ *          connection_profile_get_network_interface_name() of opened profile.
+ * @since_tizen 4.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/network.set
+ * @param[in] connection        The connection handle
+ * @param[in] address_family    The address family
+ * @param[in] interface_name    The name of network interface
+ * @param[in] host_address      The IP address of the host (e.g., single IP address such as
+ *            163.152.10.2,192.168.1.2), group's IP address (e.g., 163.152.10.0, 192.168.0.0)
+ *            is not allowed
+ * @param[in] gateway           The gateway address
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
+ * @see connection_profile_get_network_interface_name()
+ */
+int connection_remove_route_entry(connection_h connection,
+               connection_address_family_e address_family, const char *interface_name,
+               const char *host_address, const char *gateway);
 
 /*
  * @brief Gets all IPv6 addresses assigned to the network interface.
  * @since_tizen 4.0
- * @param[in] connection       The connection handle
- * @param[in] connection_type  The connection type
- * @param[in] callback         The callback to be called for each IPv6 address
- * @param[in] user_data        The user data passed to the callback function
+ * @param[in] connection        The connection handle
+ * @param[in] connection_type   The connection type
+ * @param[in] callback          The callback to be called for each IPv6 address
+ * @param[in] user_data         The user data passed to the callback function
  * @return 0 on success, otherwise negative error value.
- * @retval #CONNECTION_ERROR_NONE               Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
- * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
  */
 int connection_foreach_ipv6_address(connection_h connection, connection_type_e connection_type,
                connection_ipv6_address_cb callback, void *user_data);
@@ -1034,17 +1181,18 @@ int connection_foreach_ipv6_address(connection_h connection, connection_type_e c
  * @privlevel public
  * @privilege %http://tizen.org/privilege/network.get
  * @param[in] connection The connection handle
- * @param[in] connection_type The type of connection (only CONNECTION_TYPE_WIFI and CONNECTION_TYPE_CELLULAR are supported)
- * @param[in] statistics_type The type of statistics
- * @param[out] size The received data size of the last cellular packet data connection (bytes)
+ * @param[in] connection_type   The type of connection (only CONNECTION_TYPE_WIFI and CONNECTION_TYPE_CELLULAR are supported)
+ * @param[in] statistics_type   The type of statistics
+ * @param[out] size             The received data size of the last cellular packet data connection (bytes)
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not Supported
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
  */
-int connection_get_statistics(connection_h connection, connection_type_e connection_type, connection_statistics_type_e statistics_type, long long* size);
+int connection_get_statistics(connection_h connection, connection_type_e connection_type,
+               connection_statistics_type_e statistics_type, long long* size);
 
 
 /**
@@ -1053,19 +1201,19 @@ int connection_get_statistics(connection_h connection, connection_type_e connect
  * @privlevel public
  * @privilege %http://tizen.org/privilege/network.set
  * @remarks This API needs both privileges.
- * @param[in] connection The connection handle
- * @param[in] connection_type The type of connection (only CONNECTION_TYPE_WIFI and CONNECTION_TYPE_CELLULAR are supported)
- * @param[in] statistics_type The type of statistics
+ * @param[in] connection        The connection handle
+ * @param[in] connection_type   The type of connection (only CONNECTION_TYPE_WIFI and CONNECTION_TYPE_CELLULAR are supported)
+ * @param[in] statistics_type   The type of statistics
  * @return @c 0 on success,
  *         otherwise a negative error value
- * @retval #CONNECTION_ERROR_NONE Successful
- * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
- * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not Supported
+ * @retval #CONNECTION_ERROR_NONE                  Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
  */
-int connection_reset_statistics(connection_h connection, connection_type_e connection_type, connection_statistics_type_e statistics_type);
-
+int connection_reset_statistics(connection_h connection, connection_type_e connection_type,
+               connection_statistics_type_e statistics_type);
 /**
  * @}
 */
index 5e41cf5..19f132d 100755 (executable)
@@ -143,6 +143,8 @@ int _connection_libnet_add_route(const char *interface_name, const char *host_ad
 int _connection_libnet_remove_route(const char *interface_name, const char *host_address);
 int _connection_libnet_add_route_ipv6(const char *interface_name, const char *host_address, const char * gateway);
 int _connection_libnet_remove_route_ipv6(const char *interface_name, const char *host_address, const char * gateway);
+int _connection_libnet_add_route_entry(connection_address_family_e address_family, const char *interface_name, const char *host_address, const char * gateway);
+int _connection_libnet_remove_route_entry(connection_address_family_e address_family, const char *interface_name, const char *host_address, const char * gateway);
 void _connection_libnet_add_to_profile_list(connection_profile_h profile);
 void _connection_libnet_remove_from_profile_list(connection_profile_h profile);
 bool _connection_libnet_add_to_profile_cb_list(connection_profile_h profile,
index 348a3a2..32c4033 100755 (executable)
@@ -1208,6 +1208,54 @@ EXPORT_API int connection_remove_route_ipv6(connection_h connection, const char
        return _connection_libnet_remove_route_ipv6(interface_name, host_address, gateway);
 }
 
+EXPORT_API int connection_add_route_entry(connection_h connection,
+               connection_address_family_e address_family,     const char *interface_name,
+               const char *host_address, const char *gateway)
+{
+       CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE, ETHERNET_FEATURE);
+
+       if (!(__connection_check_handle_validity(connection)) ||
+               (address_family != CONNECTION_ADDRESS_FAMILY_IPV4 &&
+            address_family != CONNECTION_ADDRESS_FAMILY_IPV6) ||
+           interface_name == NULL || host_address == NULL) {
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+               return CONNECTION_ERROR_INVALID_PARAMETER;
+       }
+
+       if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4)
+               return _connection_libnet_add_route_entry(CONNECTION_ADDRESS_FAMILY_IPV4,
+                                                               interface_name, host_address, gateway);
+       else
+               return _connection_libnet_add_route_entry(CONNECTION_ADDRESS_FAMILY_IPV6,
+                                                               interface_name, host_address, gateway);
+
+       return CONNECTION_ERROR_NONE;
+}
+
+EXPORT_API int connection_remove_route_entry(connection_h connection,
+               connection_address_family_e address_family,     const char *interface_name,
+               const char *host_address, const char *gateway)
+{
+       CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE, ETHERNET_FEATURE);
+
+       if (!(__connection_check_handle_validity(connection)) ||
+               (address_family != CONNECTION_ADDRESS_FAMILY_IPV4 &&
+            address_family != CONNECTION_ADDRESS_FAMILY_IPV6) ||
+           interface_name == NULL || host_address == NULL) {
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+               return CONNECTION_ERROR_INVALID_PARAMETER;
+       }
+
+       if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4)
+               return _connection_libnet_remove_route_entry(CONNECTION_ADDRESS_FAMILY_IPV4,
+                                                               interface_name, host_address, gateway);
+       else
+               return _connection_libnet_remove_route_entry(CONNECTION_ADDRESS_FAMILY_IPV6,
+                                                               interface_name, host_address, gateway);
+
+       return CONNECTION_ERROR_NONE;
+}
+
 static int __get_cellular_statistic(connection_statistics_type_e statistics_type, long long *llsize)
 {
        int rv = VCONF_OK, rv1 = VCONF_OK;
index 9925292..86c94d7 100755 (executable)
@@ -1290,6 +1290,105 @@ int _connection_libnet_remove_route_ipv6(const char *interface_name, const char
        return CONNECTION_ERROR_NONE;
 }
 
+int _connection_libnet_add_route_entry(connection_address_family_e address_family,
+               const char *interface_name, const char *host_address, const char *gateway)
+{
+       int rv;
+       char *endstr = NULL;
+       int address_family_type = 0;
+
+       if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4)
+               address_family_type = AF_INET;
+       else
+               address_family_type = AF_INET6;
+
+       if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4) {
+
+               endstr = strrchr(host_address, '.');
+               if (endstr == NULL ||
+                               strcmp(endstr, ".0") == 0 ||
+                               strncmp(host_address, "0.", 2) == 0 ||
+                               strstr(host_address, "255") != NULL) {
+                       CONNECTION_LOG(CONNECTION_ERROR, "Invalid IP address Passed\n"); //LCOV_EXCL_LINE
+                       return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
+               }
+
+               rv = net_add_route_entry(host_address, interface_name, address_family_type, gateway);
+               if (rv == NET_ERR_ACCESS_DENIED) {
+                       CONNECTION_LOG(CONNECTION_ERROR, "Access denied"); //LCOV_EXCL_LINE
+                       return CONNECTION_ERROR_PERMISSION_DENIED; //LCOV_EXCL_LINE
+               } else if (rv != NET_ERR_NONE)
+                       return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
+
+       } else {
+
+               if (strncmp(host_address, "fe80:", 5) == 0 ||
+                       strncmp(host_address, "ff00:", 5) == 0 ||
+                       strncmp(host_address, "::", 2) == 0) {
+                       CONNECTION_LOG(CONNECTION_ERROR, "Invalid IP address Passed\n"); //LCOV_EXCL_LINE
+                       return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
+               }
+
+               rv = net_add_route_ipv6(host_address, interface_name, address_family_type, gateway);
+               if (rv == NET_ERR_ACCESS_DENIED) {
+                       CONNECTION_LOG(CONNECTION_ERROR, "Access denied"); //LCOV_EXCL_LINE
+                       return CONNECTION_ERROR_PERMISSION_DENIED; //LCOV_EXCL_LINE
+               } else if (rv != NET_ERR_NONE)
+                       return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
+       }
+
+       return CONNECTION_ERROR_NONE;
+}
+
+int _connection_libnet_remove_route_entry(connection_address_family_e address_family,
+               const char *interface_name, const char *host_address, const char *gateway)
+{
+       int rv;
+       char *endstr = strrchr(host_address, '.');
+       int address_family_type = 0;
+
+       if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4)
+               address_family_type = AF_INET;
+       else
+               address_family_type = AF_INET6;
+
+       if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4) {
+               endstr = strrchr(host_address, '.');
+               if (endstr == NULL ||
+                       strcmp(endstr, ".0") == 0 ||
+                       strncmp(host_address, "0.", 2) == 0 ||
+                       strstr(host_address, ".0.") != NULL || strstr(host_address, "255") != NULL) {
+                       CONNECTION_LOG(CONNECTION_ERROR, "Invalid IP address Passed"); //LCOV_EXCL_LINE
+                       return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
+               }
+
+               rv = net_remove_route_entry(host_address, interface_name, address_family_type, gateway);
+               if (rv == NET_ERR_ACCESS_DENIED) {
+                       CONNECTION_LOG(CONNECTION_ERROR, "Access denied"); //LCOV_EXCL_LINE
+                       return CONNECTION_ERROR_PERMISSION_DENIED; //LCOV_EXCL_LINE
+               } else if (rv != NET_ERR_NONE)
+                       return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
+
+       } else {
+
+               if (strncmp(host_address, "fe80:", 5) == 0 ||
+                       strncmp(host_address, "ff00:", 5) == 0 ||
+                       strncmp(host_address, "::", 2) == 0) {
+                       CONNECTION_LOG(CONNECTION_ERROR, "Invalid IP address Passed\n"); //LCOV_EXCL_LINE
+                       return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
+               }
+
+               rv = net_remove_route_ipv6(host_address, interface_name, address_family_type, gateway);
+               if (rv == NET_ERR_ACCESS_DENIED) {
+                       CONNECTION_LOG(CONNECTION_ERROR, "Access denied"); //LCOV_EXCL_LINE
+                       return CONNECTION_ERROR_PERMISSION_DENIED; //LCOV_EXCL_LINE
+               } else if (rv != NET_ERR_NONE)
+                       return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
+       }
+
+       return CONNECTION_ERROR_NONE;
+}
+
 void _connection_libnet_add_to_profile_list(connection_profile_h profile)
 {
        prof_handle_list = g_slist_append(prof_handle_list, profile);
index 7181144..581f28f 100755 (executable)
@@ -1804,6 +1804,147 @@ int test_remove_route_ipv6(void)
        return 1;
 }
 
+int test_add_route_entry(void)
+{
+       char ip_addr[100] = {0};
+       char gateway[100] = {0};
+       char if_name[40] = {0};
+       int input;
+       bool input_rv;
+       int rv = 0;
+
+       input_rv = test_get_user_int("Input Address type to get"
+               "(1:IPV4, 2:IPV6):", &input);
+
+       if (input_rv == false) {
+               printf("Invalid input!!\n");
+               return -1;
+       }
+
+       switch (input) {
+       case 1:
+               if (test_get_user_string("Input Interface name - (Enter for skip) :", if_name, 40) == false)
+                       return -1;
+
+               if (test_get_user_string("Input IP - (Enter for skip) :", ip_addr, 100) == false)
+                       return -1;
+
+               if (test_get_user_string("Input Gateway - (Enter for skip) :", gateway, 100) == false)
+                       return -1;
+
+               g_strstrip(ip_addr);
+               g_strstrip(gateway);
+               g_strstrip(if_name);
+               rv = connection_add_route_entry(connection, CONNECTION_ADDRESS_FAMILY_IPV4, if_name, ip_addr, gateway);
+               if (rv != CONNECTION_ERROR_NONE) {
+                       printf("Fail to get add new route [%d]\n", rv);
+                       return -1;
+               }
+               printf("Add Route successfully\n");
+               break;
+
+       case 2:
+               if (test_get_user_string("Input Interface name - (Enter for skip) :", if_name, 40) == false)
+                       return -1;
+
+               if (test_get_user_string("Input IP - (Enter for skip) :", ip_addr, 100) == false)
+                       return -1;
+
+               if (test_get_user_string("Input Gateway - (Enter for skip) :", gateway, 100) == false)
+                       return -1;
+
+               g_strstrip(ip_addr);
+               g_strstrip(gateway);
+               g_strstrip(if_name);
+               rv = connection_add_route_entry(connection, CONNECTION_ADDRESS_FAMILY_IPV6, if_name, ip_addr, gateway);
+               if (rv != CONNECTION_ERROR_NONE) {
+                       printf("Fail to get add new route [%d]\n", rv);
+                       return -1;
+               }
+               printf("Add Route successfully\n");
+               break;
+
+       default:
+               printf("Wrong IP address family!!\n");
+               return -1;
+
+       }
+
+       return 1;
+
+}
+
+int test_remove_route_entry(void)
+{
+       char ip_addr[100] = {0};
+       char gateway[100] = {0};
+       char if_name[40] = {0};
+       int input;
+       bool input_rv;
+       int rv = 0;
+
+       input_rv = test_get_user_int("Input Address type to get"
+               "(1:IPV4, 2:IPV6):", &input);
+
+       if (input_rv == false) {
+               printf("Invalid input!!\n");
+               return -1;
+       }
+
+       switch (input) {
+       case 1:
+               if (test_get_user_string("Input Interface name - (Enter for skip) :", if_name, 40) == false)
+                       return -1;
+
+               if (test_get_user_string("Input IP - (Enter for skip) :", ip_addr, 100) == false)
+                       return -1;
+
+               if (test_get_user_string("Input Gateway - (Enter for skip) :", gateway, 100) == false)
+                       return -1;
+
+               g_strstrip(ip_addr);
+               g_strstrip(gateway);
+               g_strstrip(if_name);
+               rv = connection_remove_route_entry(connection, CONNECTION_ADDRESS_FAMILY_IPV4, if_name, ip_addr, gateway);
+               if (rv != CONNECTION_ERROR_NONE) {
+                       printf("Fail to remove the route [%s]\n", test_print_error(rv));
+                       return -1;
+               }
+               printf("Remove Route successfully\n");
+
+               break;
+
+       case 2:
+               if (test_get_user_string("Input Interface name - (Enter for skip) :", if_name, 40) == false)
+                       return -1;
+
+               if (test_get_user_string("Input IP - (Enter for skip) :", ip_addr, 100) == false)
+                       return -1;
+
+               if (test_get_user_string("Input Gateway - (Enter for skip) :", gateway, 100) == false)
+                       return -1;
+
+               g_strstrip(ip_addr);
+               g_strstrip(gateway);
+               g_strstrip(if_name);
+               rv = connection_remove_route_entry(connection, CONNECTION_ADDRESS_FAMILY_IPV6, if_name, ip_addr, gateway);
+               if (rv != CONNECTION_ERROR_NONE) {
+                       printf("Fail to remove the route [%d]\n", rv);
+                       return -1;
+               }
+               printf("Remove Route successfully\n");
+               break;
+
+       default:
+               printf("Wrong IP address family!!\n");
+               return -1;
+
+       }
+
+       return 1;
+
+}
+
 int test_get_bt_state(void)
 {
        int rv = 0;
@@ -2134,6 +2275,12 @@ gboolean test_thread(GIOChannel *source, GIOCondition condition, gpointer data)
                rv = test_remove_route_ipv6();
                break;
        case 'D':
+               rv = test_add_route_entry();
+               break;
+       case 'E':
+               rv = test_remove_route_entry();
+               break;
+       case 'F':
                rv = test_foreach_ipv6_address();
                break;
        }