2 * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #ifndef __NET_CONNECTION_INTF_H__
19 #define __NET_CONNECTION_INTF_H__
22 #include "connection_profile.h"
27 #endif /* __cplusplus */
31 * @file net_connection.h
36 * @addtogroup CAPI_NETWORK_CONNECTION_MANAGER_MODULE
42 * @brief The connection handle.
43 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
45 typedef void* connection_h;
49 * @brief The profiles iterator handle.
50 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
52 typedef void* connection_profile_iterator_h;
56 * @brief Enumeration for connection type.
57 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
60 CONNECTION_TYPE_DISCONNECTED = 0, /**< Disconnected */
61 CONNECTION_TYPE_WIFI = 1, /**< Wi-Fi type */
62 CONNECTION_TYPE_CELLULAR = 2, /**< Cellular type */
63 CONNECTION_TYPE_ETHERNET = 3, /**< Ethernet type */
64 CONNECTION_TYPE_BT = 4, /**< Bluetooth type */
65 CONNECTION_TYPE_NET_PROXY, /**< Proxy type for internet connection (Since 3.0) */
70 * @brief Enumeration for cellular network state.
71 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
74 CONNECTION_CELLULAR_STATE_OUT_OF_SERVICE = 0, /**< Out of service */
75 CONNECTION_CELLULAR_STATE_FLIGHT_MODE = 1, /**< Flight mode */
76 CONNECTION_CELLULAR_STATE_ROAMING_OFF = 2, /**< Roaming is turned off */
77 CONNECTION_CELLULAR_STATE_CALL_ONLY_AVAILABLE = 3, /**< Call is only available */
78 CONNECTION_CELLULAR_STATE_AVAILABLE = 4, /**< Available but not connected yet */
79 CONNECTION_CELLULAR_STATE_CONNECTED = 5, /**< Connected */
80 } connection_cellular_state_e;
84 * @brief Enumeration for Wi-Fi state.
85 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
88 CONNECTION_WIFI_STATE_DEACTIVATED = 0, /**< Wi-Fi is deactivated */
89 CONNECTION_WIFI_STATE_DISCONNECTED = 1, /**< Disconnected */
90 CONNECTION_WIFI_STATE_CONNECTED = 2, /**< Connected */
91 } connection_wifi_state_e;
95 * @brief Enumeration for ethernet state.
96 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
99 CONNECTION_ETHERNET_STATE_DEACTIVATED = 0, /**< There is no Ethernet profile to open */
100 CONNECTION_ETHERNET_STATE_DISCONNECTED = 1, /**< Disconnected */
101 CONNECTION_ETHERNET_STATE_CONNECTED = 2, /**< Connected */
102 } connection_ethernet_state_e;
106 * @brief Enumeration for Bluetooth state.
107 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
110 CONNECTION_BT_STATE_DEACTIVATED = 0, /**< There is no Bluetooth profile to open */
111 CONNECTION_BT_STATE_DISCONNECTED = 1, /**< Disconnected */
112 CONNECTION_BT_STATE_CONNECTED = 2, /**< Connected */
113 } connection_bt_state_e;
117 * @brief Enumeration for connection iterator type.
118 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
121 CONNECTION_ITERATOR_TYPE_REGISTERED = 0, /**< The iterator of the registered profile */
122 CONNECTION_ITERATOR_TYPE_CONNECTED = 1, /**< The iterator of the connected profile */
123 CONNECTION_ITERATOR_TYPE_DEFAULT = 2, /**< The iterator of the default profile */
124 } connection_iterator_type_e;
128 * @brief Enumeration for reset profile type.
129 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
132 CONNECTION_RESET_DEFAULT_PROFILE = 0, /**< Initialized with the default profile defined by csc */
133 CONNECTION_RESET_CLEAR_PROFILE = 1, /**< Remove all profiles */
134 } connection_reset_option_e;
138 * @brief Enumeration for the attached or detached state of ethernet cable.
139 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
142 CONNECTION_ETHERNET_CABLE_DETACHED = 0, /**< Ethernet cable is detached */
143 CONNECTION_ETHERNET_CABLE_ATTACHED = 1, /**< Ethernet cable is attached */
144 } connection_ethernet_cable_state_e;
148 * @brief Enumeration for connection errors.
149 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
155 CONNECTION_ERROR_NONE = TIZEN_ERROR_NONE,
160 CONNECTION_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,
163 * Out of memory error
165 CONNECTION_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,
170 CONNECTION_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION,
173 * Address family Not supported
175 CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED = TIZEN_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED,
180 CONNECTION_ERROR_OPERATION_FAILED = TIZEN_ERROR_CONNECTION|0x0401,
185 CONNECTION_ERROR_ITERATOR_END = TIZEN_ERROR_CONNECTION|0x0402,
188 * There is no connection
190 CONNECTION_ERROR_NO_CONNECTION = TIZEN_ERROR_CONNECTION|0x0403,
195 CONNECTION_ERROR_NOW_IN_PROGRESS = TIZEN_ERROR_NOW_IN_PROGRESS,
200 CONNECTION_ERROR_ALREADY_EXISTS = TIZEN_ERROR_CONNECTION|0x0404,
203 * Operation is aborted
205 CONNECTION_ERROR_OPERATION_ABORTED = TIZEN_ERROR_CONNECTION|0x0405,
210 CONNECTION_ERROR_DHCP_FAILED = TIZEN_ERROR_CONNECTION|0x0406,
215 CONNECTION_ERROR_INVALID_KEY = TIZEN_ERROR_CONNECTION|0x0407,
220 CONNECTION_ERROR_NO_REPLY = TIZEN_ERROR_CONNECTION|0x0408,
225 CONNECTION_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED,
230 CONNECTION_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED
232 } connection_error_e;
240 * @addtogroup CAPI_NETWORK_CONNECTION_STATISTICS_MODULE
246 * @brief Enumeration for statistics type.
247 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
250 CONNECTION_STATISTICS_TYPE_LAST_RECEIVED_DATA = 0, /**< Last received data */
251 CONNECTION_STATISTICS_TYPE_LAST_SENT_DATA = 1, /**< Last sent data */
252 CONNECTION_STATISTICS_TYPE_TOTAL_RECEIVED_DATA = 2, /**< Total received data */
253 CONNECTION_STATISTICS_TYPE_TOTAL_SENT_DATA = 3, /**< Total sent data */
254 } connection_statistics_type_e;
263 * @addtogroup CAPI_NETWORK_CONNECTION_MANAGER_MODULE
269 * @brief Creates a handle for managing data connections.
270 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
272 * @privilege %http://tizen.org/privilege/network.get
273 * @remarks You must release @a handle using connection_destroy().
274 * @param[out] connection The connection handle
275 * @return @c 0 on success,
276 * otherwise a negative error value
277 * @retval #CONNECTION_ERROR_NONE Successful
278 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
279 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
280 * @see connection_destroy()
282 int connection_create(connection_h* connection);
286 * @brief Destroys the connection handle.
287 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
288 * @param[in] connection The connection handle
289 * @return @c 0 on success,
290 * otherwise a negative error value
291 * @retval #CONNECTION_ERROR_NONE Successful
292 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
293 * @see connection_create()
295 int connection_destroy(connection_h connection);
299 * @brief Called when the type of a connection is changed.
300 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
301 * @param[in] type The type of the current network connection
302 * @param[in] user_data The user data passed from the callback registration function
303 * @see connection_set_type_changed_cb()
304 * @see connection_unset_type_changed_cb()
306 typedef void(*connection_type_changed_cb)(connection_type_e type, void* user_data);
310 * @brief Called when the address is changed.
311 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
312 * @param[in] ipv4_address The IP address for IPv4
313 * @param[in] ipv6_address The IP address for IPv6
314 * @param[in] user_data The user data passed from the callback registration function
315 * @see connection_set_ip_address_changed_cb()
316 * @see connection_unset_ip_address_changed_cb()
317 * @see connection_set_proxy_address_changed_cb()
318 * @see connection_unset_proxy_address_changed_cb()
320 typedef void(*connection_address_changed_cb)(const char* ipv4_address,
321 const char* ipv6_address, void* user_data);
325 * @brief Called when connection_set_default_cellular_service_profile_async() finishes.
326 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
327 * @param[in] result The result
328 * @param[in] user_data The user data passed from connection_open_profile()
329 * @pre connection_set_default_cellular_service_profile_async() will invoke this callback function.
330 * @see connection_set_default_cellular_service_profile_async()
332 typedef void(*connection_set_default_cb)(connection_error_e result, void* user_data);
334 /* @brief Called with an IPv6 address.
336 * @remarks If @a ipv6_address is needed outside the callback, a copy should be made. \n
337 * @a ipv6_address will be freed automatically after the execution of this callback.
338 * @param[in] ipv6_address The IPv6 address
339 * @param[in] user_data The user data passed from the foreach function
340 * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
341 * @pre connection_foreach_ipv6_addresses() will invoke this callback.
342 * @see connection_foreach_ipv6_addresses()
344 typedef bool(*connection_ipv6_address_cb)(char *ipv6_address, void *user_data);
347 * @brief Gets the type of the current profile for data connection.
348 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
349 * @param[in] connection The connection handle
350 * @param[out] type The type of the network
351 * @return @c 0 on success,
352 * otherwise a negative error value
353 * @retval #CONNECTION_ERROR_NONE Successful
354 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
355 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
357 int connection_get_type(connection_h connection, connection_type_e* type);
361 * @brief Gets the IP address of the current connection.
362 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
363 * @remarks You must release @a ip_address using free().
364 * @param[in] connection The connection handle
365 * @param[in] address_family The address family
366 * @param[out] ip_address The pointer to the IP address string
367 * @return @c 0 on success,
368 * otherwise a negative error value
369 * @retval #CONNECTION_ERROR_NONE Successful
370 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
371 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
372 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
374 int connection_get_ip_address(connection_h connection,
375 connection_address_family_e address_family, char** ip_address);
379 * @brief Gets the proxy address of the current connection.
380 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
381 * @remarks You must release @a proxy using free().
382 * @param[in] connection The connection handle
383 * @param[in] address_family The address family
384 * @param[out] proxy The proxy address
385 * @return @c 0 on success,
386 * otherwise a negative error value
387 * @retval #CONNECTION_ERROR_NONE Successful
388 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
389 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
390 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
392 int connection_get_proxy(connection_h connection,
393 connection_address_family_e address_family, char** proxy);
397 * @brief Gets the MAC address of the Wi-Fi or ethernet.
398 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
399 * @remarks @a mac_addr must be released with free() by you.
400 * @param[in] connection The handle of the connection
401 * @param[in] type The type of current network connection
402 * @param[out] mac_addr The MAC address
403 * @return @c 0 on success,
404 * otherwise a negative error value
405 * @retval #CONNECTION_ERROR_NONE Successful
406 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
407 * @retval #CONNECTION_ERROR_INVALID_OPERATION Invalid operation
408 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
409 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
410 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
412 int connection_get_mac_address(connection_h connection,
413 connection_type_e type, char** mac_addr);
417 * @brief Gets the state of cellular connection.
418 * @details The returned state is for the cellular connection state.
419 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
420 * @param[in] connection The connection handle
421 * @param[out] state The state of the cellular connection
422 * @return @c 0 on success,
423 * otherwise a negative error value
424 * @retval #CONNECTION_ERROR_NONE Successful
425 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
426 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
427 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
429 int connection_get_cellular_state(connection_h connection, connection_cellular_state_e* state);
433 * @brief Gets the state of the Wi-Fi.
434 * @details The returned state is for the Wi-Fi connection state.
435 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
437 * @privilege %http://tizen.org/privilege/network.get
438 * @param[in] connection The connection handle
439 * @param[out] state The state of Wi-Fi connection
440 * @return @c 0 on success,
441 * otherwise a negative error value
442 * @retval #CONNECTION_ERROR_NONE Successful
443 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
444 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
445 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
446 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
448 int connection_get_wifi_state(connection_h connection, connection_wifi_state_e* state);
452 * @brief Gets the state of the Ethernet.
453 * @details The returned state is for the Ethernet connection state.
454 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
456 * @privilege %http://tizen.org/privilege/network.get
457 * @param[in] connection The connection handle
458 * @param[out] state The state of Ethernet connection
459 * @return @c 0 on success,
460 * otherwise a negative error value
461 * @retval #CONNECTION_ERROR_NONE Successful
462 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
463 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
464 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
465 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
467 int connection_get_ethernet_state(connection_h connection, connection_ethernet_state_e* state);
471 * @brief Checks for ethernet cable is attached or not.
472 * @details The returned state is for the ethernet cable state.
473 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
475 * @privilege %http://tizen.org/privilege/network.get
476 * @param[in] connection The handle of the connection
477 * @param[in] state The state of ethernet cable
478 * @return @c 0 on success,
479 * otherwise a negative error value
480 * @retval #CONNECTION_ERROR_NONE Successful
481 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
482 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
483 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
484 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
486 int connection_get_ethernet_cable_state(connection_h connection,
487 connection_ethernet_cable_state_e *state);
491 * @deprecated Deprecated since 4.0. Use connection_ethernet_cable_state_changed_cb() instead.
492 * @brief Called when ethernet cable is plugged [in/out].
493 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
494 * @param[in] state The state of ethernet cable
495 * @param[in] user_data The user data passed to callback registration function
497 typedef void(*connection_ethernet_cable_state_chaged_cb)
498 (connection_ethernet_cable_state_e state, void* user_data);
502 * @deprecated Deprecated since 4.0. Use connection_set_ethernet_cable_state_changed_cb() instead.
503 * @brief Registers callback for ethernet cable is plugged [in/out] event.
504 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
505 * @param[in] connection The handle of connection
506 * @param[in] callback The callback function to be called
507 * @param[in] user_data The user data passed to the callback function
508 * @return @c 0 on success,
509 * otherwise a negative error value
510 * @retval #CONNECTION_ERROR_NONE Successful
511 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
512 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
513 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
515 int connection_set_ethernet_cable_state_chaged_cb(connection_h connection,
516 connection_ethernet_cable_state_chaged_cb callback, void *user_data) TIZEN_DEPRECATED_API;
520 * @deprecated Deprecated since 4.0. Use connection_unset_ethernet_cable_state_changed_cb() instead.
521 * @brief Unregisters callback for ethernet cable is plugged [in/out] event.
522 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
523 * @param[in] connection The handle of connection
524 * @return @c 0 on success,
525 * otherwise a negative error value
526 * @retval #CONNECTION_ERROR_NONE Successful
527 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
528 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
529 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
531 int connection_unset_ethernet_cable_state_chaged_cb(connection_h connection) TIZEN_DEPRECATED_API;
534 * @brief Called when ethernet cable is plugged [in/out].
536 * @param[in] state The state of ethernet cable
537 * @param[in] user_data The user data passed to callback registration function
539 typedef void(*connection_ethernet_cable_state_changed_cb)(
540 connection_ethernet_cable_state_e state, void* user_data);
544 * @brief Registers callback for ethernet cable is plugged [in/out] event.
546 * @param[in] connection The handle of connection
547 * @param[in] callback The callback function to be called
548 * @param[in] user_data The user data passed to the callback function
549 * @return @c 0 on success,
550 * otherwise a negative error value
551 * @retval #CONNECTION_ERROR_NONE Successful
552 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
553 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
554 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
556 int connection_set_ethernet_cable_state_changed_cb(connection_h connection,
557 connection_ethernet_cable_state_changed_cb callback, void *user_data);
561 * @brief Unregisters callback for ethernet cable is plugged [in/out] event.
563 * @param[in] connection The handle of connection
564 * @return @c 0 on success,
565 * otherwise a negative error value
566 * @retval #CONNECTION_ERROR_NONE Successful
567 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
568 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
569 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
571 int connection_unset_ethernet_cable_state_changed_cb(connection_h connection);
575 * @brief Gets the state of the Bluetooth.
576 * @details The returned state is for the Bluetooth connection state.
577 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
579 * @privilege %http://tizen.org/privilege/network.get
580 * @param[in] connection The connection handle
581 * @param[out] state The state of the Bluetooth connection
582 * @return @c 0 on success,
583 * otherwise a negative error value
584 * @retval #CONNECTION_ERROR_NONE Successful
585 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
586 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
587 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
588 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
590 int connection_get_bt_state(connection_h connection, connection_bt_state_e* state);
594 * @brief Registers the callback that is called when the type of the current connection is changed.
595 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
596 * @param[in] connection The connection handle
597 * @param[in] callback The callback function to be called
598 * @param[in] user_data The user data passed to the callback function
599 * @return @c 0 on success,
600 * otherwise a negative error value
601 * @retval #CONNECTION_ERROR_NONE Successful
602 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
603 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
605 int connection_set_type_changed_cb(connection_h connection,
606 connection_type_changed_cb callback, void* user_data);
610 * @brief Unregisters the callback that is called when the type of current connection is changed.
611 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
612 * @param[in] connection The connection handle
613 * @return @c 0 on success,
614 * otherwise a negative error value
615 * @retval #CONNECTION_ERROR_NONE Successful
616 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
617 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
619 int connection_unset_type_changed_cb(connection_h connection);
623 * @brief Registers the callback that is called when the IP address is changed.
624 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
625 * @param[in] connection The connection handle
626 * @param[in] callback The callback function to be called
627 * @param[in] user_data The user data passed to the callback function
628 * @return @c 0 on success,
629 * otherwise a negative error value
630 * @retval #CONNECTION_ERROR_NONE Successful
631 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
632 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
634 int connection_set_ip_address_changed_cb(connection_h connection,
635 connection_address_changed_cb callback, void* user_data);
639 * @brief Unregisters the callback that is called when the IP address is changed.
640 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
641 * @param[in] connection The connection handle
642 * @return @c 0 on success,
643 * otherwise a negative error value
644 * @retval #CONNECTION_ERROR_NONE Successful
645 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
646 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
648 int connection_unset_ip_address_changed_cb(connection_h connection);
652 * @brief Registers the callback that is called when the proxy address is changed.
653 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
654 * @param[in] connection The connection handle
655 * @param[in] callback The callback function to be called
656 * @param[in] user_data The user data passed to the callback function
657 * @return @c 0 on success,
658 * otherwise a negative error value
659 * @retval #CONNECTION_ERROR_NONE Successful
660 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
661 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
663 int connection_set_proxy_address_changed_cb(connection_h connection,
664 connection_address_changed_cb callback, void* user_data);
668 * @brief Unregisters the callback that is called when the proxy address is changed.
669 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
670 * @param[in] connection The connection handle
671 * @return @c 0 on success,
672 * otherwise a negative error value
673 * @retval #CONNECTION_ERROR_NONE Successful
674 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
675 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
677 int connection_unset_proxy_address_changed_cb(connection_h connection);
681 * @brief Adds a new profile which is created by connection_profile_create().
682 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
684 * @privilege %http://tizen.org/privilege/network.profile
685 * @remarks You can only add a profile of the cellular type.
686 * @param[in] connection The connection handle
687 * @param[in] profile The profile handle
688 * @return @c 0 on success,
689 * otherwise a negative error value
690 * @retval #CONNECTION_ERROR_NONE Successful
691 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
692 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
693 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
694 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
696 int connection_add_profile(connection_h connection, connection_profile_h profile);
700 * @brief Removes an existing profile.
701 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
703 * @privilege %http://tizen.org/privilege/network.profile \n
704 * %http://tizen.org/privilege/network.get
705 * @remarks This API needs both privileges.
706 * @param[in] connection The connection handle
707 * @param[in] profile The profile handle
708 * @return @c 0 on success,
709 * otherwise a negative error value
710 * @retval #CONNECTION_ERROR_NONE Successful
711 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
712 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
713 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
714 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
716 int connection_remove_profile(connection_h connection, connection_profile_h profile);
720 * @brief Updates an existing profile.
721 * @details When a profile is changed, these changes will be not applied to the Connection Manager immediately.
722 * When you call this function, your changes affect the Connection Manager and the existing profile is updated.
723 * In addition, the existing profile will be updated if you call connection_open_profile().
724 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
726 * @privilege %http://tizen.org/privilege/network.profile \n
727 * %http://tizen.org/privilege/network.get
728 * @remarks This API needs both privileges.
729 * @param[in] connection The connection handle
730 * @param[in] profile The profile handle
731 * @return @c 0 on success,
732 * otherwise a negative error value
733 * @retval #CONNECTION_ERROR_NONE Successful
734 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
735 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
736 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
737 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
738 * @see connection_open_profile()
740 int connection_update_profile(connection_h connection, connection_profile_h profile);
744 * @brief Gets a profiles iterator.
745 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
747 * @privilege %http://tizen.org/privilege/network.get
748 * @remarks You must release @a profile_iterator using connection_destroy().
749 * @param[in] connection The connection handle
750 * @param[in] type The type of the connection iterator
751 * @param[out] profile_iterator The iterator of profile
752 * @return @c 0 on success,
753 * otherwise a negative error value
754 * @retval #CONNECTION_ERROR_NONE Successful
755 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
756 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
757 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
758 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
760 int connection_get_profile_iterator(connection_h connection,
761 connection_iterator_type_e type, connection_profile_iterator_h* profile_iterator);
765 * @brief Moves the profile iterator to the next position and gets a profile handle.
766 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
767 * @param[in] profile_iterator The iterator of profile
768 * @param[out] profile The profile handle
769 * @return @c 0 on success,
770 * otherwise a negative error value
771 * @retval #CONNECTION_ERROR_NONE Successful
772 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
773 * @retval #CONNECTION_ERROR_ITERATOR_END End of iteration
775 int connection_profile_iterator_next(connection_profile_iterator_h profile_iterator,
776 connection_profile_h* profile);
780 * @brief Checks whether the next element of a profile iterator exists or not.
781 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
782 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
783 * @param[in] profile_iterator The iterator of profile
784 * @return @c true if next element exists,
785 * otherwise @c false if next element doesn't exist
787 bool connection_profile_iterator_has_next(connection_profile_iterator_h profile_iterator);
791 * @brief Destroys a profiles iterator.
792 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
793 * @param[in] profile_iterator The iterator of the profile
794 * @return @c 0 on success,
795 * otherwise a negative error value
796 * @retval #CONNECTION_ERROR_NONE Successful
797 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
799 int connection_destroy_profile_iterator(connection_profile_iterator_h profile_iterator);
803 * @brief Gets the name of the default profile.
804 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
806 * @privilege %http://tizen.org/privilege/network.get
807 * @remarks You must release @a profile using connection_profile_destroy().
808 * @param[in] connection The connection handle
809 * @param[out] profile The profile handle
810 * @return @c 0 on success,
811 * otherwise a negative error value
812 * @retval #CONNECTION_ERROR_NONE Successful
813 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
814 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
815 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
816 * @retval #CONNECTION_ERROR_NO_CONNECTION There is no connection
817 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
819 int connection_get_current_profile(connection_h connection, connection_profile_h* profile);
823 * @brief Gets the default profile which provides the given cellular service.
824 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
826 * @privilege %http://tizen.org/privilege/network.get
827 * @remarks You must release @a profile using connection_profile_destroy().
828 * @param[in] connection The connection handle
829 * @param[in] type The type of cellular service \n
830 * #CONNECTION_CELLULAR_SERVICE_TYPE_APPLICATION is not permitted
831 * @param[out] profile The profile handle
832 * @return @c 0 on success,
833 * otherwise a negative error value
834 * @retval #CONNECTION_ERROR_NONE Successful
835 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
836 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
837 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
838 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
839 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
841 int connection_get_default_cellular_service_profile(connection_h connection,
842 connection_cellular_service_type_e type, connection_profile_h* profile);
846 * @brief Sets the default profile which provides the given cellular service.
847 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
849 * @privilege %http://tizen.org/privilege/network.profile \n
850 * %http://tizen.org/privilege/network.get
851 * @remarks This API needs both privileges.
852 * @param[in] connection The connection handle
853 * @param[in] type The type of cellular service \n
854 * only #CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET and \n
855 * #CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_INTERNET are permitted
856 * @param[in] profile The profile handle
857 * @return @c 0 on success,
858 * otherwise a negative error value
859 * @retval #CONNECTION_ERROR_NONE Successful
860 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
861 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
862 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
863 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
865 int connection_set_default_cellular_service_profile(connection_h connection,
866 connection_cellular_service_type_e type, connection_profile_h profile);
870 * @brief Sets the default profile which provides the given cellular service, asynchronously.
871 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
873 * @privilege %http://tizen.org/privilege/network.profile \n
874 * %http://tizen.org/privilege/network.get
875 * @remarks This API needs both privileges.
876 * @param[in] connection The connection handle
877 * @param[in] type The type of cellular service (only #CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET \n
878 * and #CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_INTERNET are permitted)
879 * @param[in] profile The profile handle
880 * @param[in] callback The callback function to be called
881 * @param[in] user_data The user data passed to the callback function
882 * @return @c 0 on success,
883 * otherwise a negative error value
884 * @retval #CONNECTION_ERROR_NONE Successful
885 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
886 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
887 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
888 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
890 int connection_set_default_cellular_service_profile_async(connection_h connection,
891 connection_cellular_service_type_e type, connection_profile_h profile,
892 connection_set_default_cb callback, void* user_data);
896 * @brief Called after connection_open_profile() is finished.
897 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
898 * @param[in] result The result
899 * @param[in] user_data The user data passed from connection_open_profile()
900 * @pre connection_open_profile() will invoke this callback function.
901 * @see connection_open_profile()
903 typedef void(*connection_opened_cb)(connection_error_e result, void* user_data);
907 * @brief Called after connection_close_profile() is finished.
908 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
909 * @param[in] result The result
910 * @param[in] user_data The user data passed from connection_close_profile()
911 * @pre connection_close_profile() will invoke this callback function.
912 * @see connection_close_profile()
914 typedef void(*connection_closed_cb)(connection_error_e result, void* user_data);
918 * @brief Called after connection_reset_profile() is finished.
919 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
920 * @param[in] result The result
921 * @param[in] user_data The user data passed from connection_reset_profile()
922 * @pre connection_reset_profile() will invoke this callback function.
923 * @see connection_reset_profile()
925 typedef void(*connection_reset_cb)(connection_error_e result, void* user_data);
929 * @brief Opens a connection of profile, asynchronously.
930 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
932 * @privilege %http://tizen.org/privilege/network.set \n
933 * %http://tizen.org/privilege/network.get
934 * @remarks This API needs both privileges.
935 * @param[in] connection The connection handle
936 * @param[in] profile The profile handle
937 * @param[in] callback The callback function to be called
938 * @param[in] user_data The user data passed to the callback function
939 * @return @c 0 on success,
940 * otherwise a negative error value
941 * @retval #CONNECTION_ERROR_NONE Successful
942 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
943 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
944 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
945 * @post connection_opened_cb() will be invoked.
946 * @see connection_opened_cb()
947 * @see connection_close_profile()
948 * @see connection_profile_set_state_changed_cb()
949 * @see connection_profile_unset_state_changed_cb()
950 * @see connection_profile_state_changed_cb()
952 int connection_open_profile(connection_h connection, connection_profile_h profile,
953 connection_opened_cb callback, void* user_data);
957 * @brief Closes a connection of profile.
958 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
960 * @privilege %http://tizen.org/privilege/network.set
961 * @param[in] connection The connection handle
962 * @param[in] profile The profile handle
963 * @param[in] callback The callback function to be called
964 * @param[in] user_data The user data passed to the callback function
965 * @return @c 0 on success,
966 * otherwise a negative error value
967 * @retval #CONNECTION_ERROR_NONE Successful
968 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
969 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
970 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
971 * @post connection_closed_cb() will be invoked.
972 * @see connection_closed_cb()
973 * @see connection_open_profile()
974 * @see connection_profile_set_state_changed_cb()
975 * @see connection_profile_unset_state_changed_cb()
976 * @see connection_profile_state_changed_cb()
978 int connection_close_profile(connection_h connection, connection_profile_h profile,
979 connection_closed_cb callback, void* user_data);
983 * @brief Resets the cellular profile.
984 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
986 * @privilege %http://tizen.org/privilege/network.profile \n
987 * %http://tizen.org/privilege/network.get
988 * @remarks This API needs both privileges.
989 * @param[in] connection The connection handle
990 * @param[in] type The type of reset
991 * @param[in] id The subscriber identity module ID to reset (The sim index starts from 0.)
992 * @param[in] callback The callback function to be called
993 * @param[in] user_data The user data passed to the callback function
994 * @return @c 0 on success,
995 * otherwise a negative error value
996 * @retval #CONNECTION_ERROR_NONE Successful
997 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
998 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
999 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1000 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1001 * @post connection_reset_cb() will be invoked.
1003 int connection_reset_profile(connection_h connection, connection_reset_option_e type,
1004 int id, connection_reset_cb callback, void *user_data);
1008 * @deprecated Deprecated since 4.0. Use connection_add_route_entry() instead.
1009 * @brief Adds a IPv4 route to the routing table.
1010 * @details You can get the @a interface_name from connection_profile_get_network_interface_name() of opened profile.
1011 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1013 * @privilege %http://tizen.org/privilege/network.set
1014 * @param[in] connection The connection handle
1015 * @param[in] interface_name The name of network interface
1016 * @param[in] host_address The IP address of the host
1017 * @return @c 0 on success,
1018 * otherwise a negative error value
1019 * @retval #CONNECTION_ERROR_NONE Successful
1020 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1021 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1022 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1023 * @see connection_profile_get_network_interface_name()
1025 int connection_add_route(connection_h connection, const char* interface_name,
1026 const char* host_address) TIZEN_DEPRECATED_API;
1030 * @deprecated Deprecated since 4.0. Use connection_remove_route_entry() instead.
1031 * @brief Removes a IPv4 route from the routing table.
1032 * @details You can get the @a interface_name from connection_profile_get_network_interface_name() of opened profile.
1033 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1035 * @privilege %http://tizen.org/privilege/network.set
1036 * @param[in] connection The connection handle
1037 * @param[in] interface_name The name of network interface
1038 * @param[in] host_address The IP address of the host
1039 * @return @c 0 on success,
1040 * otherwise a negative error value
1041 * @retval #CONNECTION_ERROR_NONE Successful
1042 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1043 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1044 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1045 * @see connection_profile_get_network_interface_name()
1047 int connection_remove_route(connection_h connection, const char* interface_name,
1048 const char* host_address) TIZEN_DEPRECATED_API;
1052 * @deprecated Deprecated since 4.0. Use connection_add_route_entry() instead.
1053 * @brief Adds a IPv6 route to the routing table.
1054 * @details You can get the @a interface_name from connection_profile_get_network_interface_name() of opened profile.
1055 * @since_tizen 2.3.1
1057 * @privilege %http://tizen.org/privilege/network.set
1058 * @param[in] connection The connection handle
1059 * @param[in] interface_name The name of network interface
1060 * @param[in] host_address The IP address of the host
1061 * @param[in] gateway The gateway address
1062 * @return @c 0 on success,
1063 * otherwise a negative error value
1064 * @retval #CONNECTION_ERROR_NONE Successful
1065 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1066 * @retval #CONNECTION_ERROR_ALREADY_EXISTS Already exists
1067 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1068 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1069 * @see connection_profile_get_network_interface_name()
1071 int connection_add_route_ipv6(connection_h connection, const char *interface_name,
1072 const char *host_address, const char * gateway) TIZEN_DEPRECATED_API;
1076 * @deprecated Deprecated since 4.0. Use connection_remove_route_entry() instead.
1077 * @brief Removes a IPV6 route from the routing table.
1078 * @details You can get the @a interface_name from connection_profile_get_network_interface_name() of opened profile.
1079 * @since_tizen 2.3.1
1081 * @privilege %http://tizen.org/privilege/network.set
1082 * @param[in] connection The connection handle
1083 * @param[in] interface_name The name of network interface
1084 * @param[in] host_address The IP address of the host
1085 * @param[in] gateway The gateway address
1086 * @return @c 0 on success,
1087 * otherwise a negative error value
1088 * @retval #CONNECTION_ERROR_NONE Successful
1089 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1090 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1091 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1092 * @see connection_profile_get_network_interface_name()
1094 int connection_remove_route_ipv6(connection_h connection, const char *interface_name,
1095 const char *host_address, const char * gateway) TIZEN_DEPRECATED_API;
1098 * @brief Adds a route to the routing table.
1099 * @details You can get the @a interface_name from \n
1100 * connection_profile_get_network_interface_name() of opened profile.
1103 * @privilege %http://tizen.org/privilege/network.set
1104 * @param[in] connection The connection handle
1105 * @param[in] address_family The address family
1106 * @param[in] interface_name The name of network interface
1107 * @param[in] host_address The IP address of the host (e.g., single IP address such as
1108 * 163.152.10.2,192.168.1.2), group's IP address (e.g., 163.152.10.0, 192.168.0.0)
1110 * @param[in] gateway The gateway address
1111 * @return @c 0 on success,
1112 * otherwise a negative error value
1113 * @retval #CONNECTION_ERROR_NONE Successful
1114 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1115 * @retval #CONNECTION_ERROR_ALREADY_EXISTS Already exists
1116 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1117 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1118 * @see connection_profile_get_network_interface_name()
1120 int connection_add_route_entry(connection_h connection,
1121 connection_address_family_e address_family, const char *interface_name,
1122 const char *host_address, const char *gateway);
1125 * @brief Removes a route from the routing table.
1126 * @details You can get the @a interface_name from \n
1127 * connection_profile_get_network_interface_name() of opened profile.
1130 * @privilege %http://tizen.org/privilege/network.set
1131 * @param[in] connection The connection handle
1132 * @param[in] address_family The address family
1133 * @param[in] interface_name The name of network interface
1134 * @param[in] host_address The IP address of the host (e.g., single IP address such as
1135 * 163.152.10.2,192.168.1.2), group's IP address (e.g., 163.152.10.0, 192.168.0.0)
1137 * @param[in] gateway The gateway address
1138 * @return @c 0 on success,
1139 * otherwise a negative error value
1140 * @retval #CONNECTION_ERROR_NONE Successful
1141 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1142 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1143 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1144 * @see connection_profile_get_network_interface_name()
1146 int connection_remove_route_entry(connection_h connection,
1147 connection_address_family_e address_family, const char *interface_name,
1148 const char *host_address, const char *gateway);
1151 * @brief Gets all IPv6 addresses assigned to the network interface.
1153 * @param[in] connection The connection handle
1154 * @param[in] connection_type The connection type
1155 * @param[in] callback The callback to be called for each IPv6 address
1156 * @param[in] user_data The user data passed to the callback function
1157 * @return 0 on success, otherwise negative error value.
1158 * @retval #CONNECTION_ERROR_NONE Successful
1159 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1160 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1161 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1163 int connection_foreach_ipv6_address(connection_h connection, connection_type_e connection_type,
1164 connection_ipv6_address_cb callback, void *user_data);
1172 * @addtogroup CAPI_NETWORK_CONNECTION_STATISTICS_MODULE
1178 * @brief Gets the statistics information.
1179 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1181 * @privilege %http://tizen.org/privilege/network.get
1182 * @param[in] connection The connection handle
1183 * @param[in] connection_type The type of connection (only CONNECTION_TYPE_WIFI and CONNECTION_TYPE_CELLULAR are supported)
1184 * @param[in] statistics_type The type of statistics
1185 * @param[out] size The received data size of the last cellular packet data connection (bytes)
1186 * @return @c 0 on success,
1187 * otherwise a negative error value
1188 * @retval #CONNECTION_ERROR_NONE Successful
1189 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1190 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1191 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1192 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1194 int connection_get_statistics(connection_h connection, connection_type_e connection_type,
1195 connection_statistics_type_e statistics_type, long long* size);
1199 * @brief Resets the statistics information.
1200 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1202 * @privilege %http://tizen.org/privilege/network.set
1203 * @remarks This API needs both privileges.
1204 * @param[in] connection The connection handle
1205 * @param[in] connection_type The type of connection (only CONNECTION_TYPE_WIFI and CONNECTION_TYPE_CELLULAR are supported)
1206 * @param[in] statistics_type The type of statistics
1207 * @return @c 0 on success,
1208 * otherwise a negative error value
1209 * @retval #CONNECTION_ERROR_NONE Successful
1210 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1211 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1212 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1213 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1215 int connection_reset_statistics(connection_h connection, connection_type_e connection_type,
1216 connection_statistics_type_e statistics_type);
1224 #endif /* __cplusplus */