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 __TIZEN_NETWORK_NET_CONNECTION_H__
19 #define __TIZEN_NETWORK_NET_CONNECTION_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.
45 typedef void* connection_h;
49 * @brief The profiles iterator handle.
52 typedef void* connection_profile_iterator_h;
56 * @brief Enumeration for connection type.
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.
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.
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.
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.
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.
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.
133 * Initialized with the default profile defined by csc
135 CONNECTION_RESET_DEFAULT_PROFILE = 0,
138 * Remove all profiles
140 CONNECTION_RESET_CLEAR_PROFILE = 1,
142 } connection_reset_option_e;
146 * @brief Enumeration for the attached or detached state of ethernet cable.
150 CONNECTION_ETHERNET_CABLE_DETACHED = 0, /**< Ethernet cable is detached */
151 CONNECTION_ETHERNET_CABLE_ATTACHED = 1, /**< Ethernet cable is attached */
152 } connection_ethernet_cable_state_e;
155 * @brief Enumeration for the DHCP state.
159 CONNECTION_DHCP_STATE_UNKNOWN = 0, /**< Unknown state */
160 CONNECTION_DHCP_STATE_STARTED = 1, /**< DHCP is running */
161 CONNECTION_DHCP_STATE_FINISHED = 2, /**< DHCP is finished */
162 } connection_dhcp_state_e;
165 * @brief Enumeration for connection errors.
172 CONNECTION_ERROR_NONE = TIZEN_ERROR_NONE,
177 CONNECTION_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,
180 * Out of memory error
182 CONNECTION_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,
187 CONNECTION_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION,
190 * Address family not supported
192 CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED = TIZEN_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED,
197 CONNECTION_ERROR_NOW_IN_PROGRESS = TIZEN_ERROR_NOW_IN_PROGRESS,
202 CONNECTION_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED,
207 CONNECTION_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED,
212 CONNECTION_ERROR_OPERATION_FAILED = TIZEN_ERROR_CONNECTION|0x0401,
217 CONNECTION_ERROR_ITERATOR_END = TIZEN_ERROR_CONNECTION|0x0402,
220 * There is no connection
222 CONNECTION_ERROR_NO_CONNECTION = TIZEN_ERROR_CONNECTION|0x0403,
227 CONNECTION_ERROR_ALREADY_EXISTS = TIZEN_ERROR_CONNECTION|0x0404,
230 * Operation is aborted
232 CONNECTION_ERROR_OPERATION_ABORTED = TIZEN_ERROR_CONNECTION|0x0405,
237 CONNECTION_ERROR_DHCP_FAILED = TIZEN_ERROR_CONNECTION|0x0406,
242 CONNECTION_ERROR_INVALID_KEY = TIZEN_ERROR_CONNECTION|0x0407,
247 CONNECTION_ERROR_NO_REPLY = TIZEN_ERROR_CONNECTION|0x0408,
250 * Already initialized (Since 5.0)
252 CONNECTION_ERROR_ALREADY_INITIALIZED = TIZEN_ERROR_CONNECTION|0x0409,
255 * Not initialized (Since 5.0)
257 CONNECTION_ERROR_NOT_INITIALIZED = TIZEN_ERROR_CONNECTION|0x040A,
259 } connection_error_e;
267 * @addtogroup CAPI_NETWORK_CONNECTION_STATISTICS_MODULE
273 * @brief Enumeration for statistics type.
277 CONNECTION_STATISTICS_TYPE_LAST_RECEIVED_DATA = 0, /**< Last received data */
278 CONNECTION_STATISTICS_TYPE_LAST_SENT_DATA = 1, /**< Last sent data */
279 CONNECTION_STATISTICS_TYPE_TOTAL_RECEIVED_DATA = 2, /**< Total received data */
280 CONNECTION_STATISTICS_TYPE_TOTAL_SENT_DATA = 3, /**< Total sent data */
281 } connection_statistics_type_e;
290 * @addtogroup CAPI_NETWORK_CONNECTION_MANAGER_MODULE
296 * @brief Creates a handle for managing data connections.
297 * @details If you do not use this function and use other functions,
298 * you will get the #CONNECTION_ERROR_NOT_INITIALIZED error.
299 * If you put an invalid handle, you will get the #CONNECTION_ERROR_INVALID_PARAMETER error.
302 * @privilege %http://tizen.org/privilege/network.get
303 * @remarks You must release @a connection using connection_destroy().
304 * @param[out] connection The connection handle
305 * @return @c 0 on success,
306 * otherwise a negative error value
307 * @retval #CONNECTION_ERROR_NONE Successful
308 * @retval #CONNECTION_ERROR_ALREADY_INITIALIZED Already initialized
309 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
310 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
311 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
312 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
313 * @see connection_destroy()
315 int connection_create(connection_h* connection);
319 * @brief Destroys the connection handle.
321 * @param[in] connection The connection handle
322 * @return @c 0 on success,
323 * otherwise a negative error value
324 * @retval #CONNECTION_ERROR_NONE Successful
325 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
326 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
327 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
328 * @see connection_create()
330 int connection_destroy(connection_h connection);
334 * @brief Called when the type of a connection is changed.
336 * @param[in] type The type of the current network connection
337 * @param[in] user_data The user data passed from the callback registration function
338 * @see connection_set_type_changed_cb()
339 * @see connection_unset_type_changed_cb()
341 typedef void(*connection_type_changed_cb)(connection_type_e type, void* user_data);
345 * @brief Called when the address is changed.
347 * @remarks @a ipv4_address @a ipv6_address should not be freed.
348 * @a ipv4_address @a ipv6_address is available only in the callback.
349 * To use outside the callback, make a copy.
350 * @param[in] ipv4_address The IP address for IPv4
351 * @param[in] ipv6_address The IP address for IPv6
352 * @param[in] user_data The user data passed from the callback registration function
353 * @see connection_set_ip_address_changed_cb()
354 * @see connection_unset_ip_address_changed_cb()
355 * @see connection_set_proxy_address_changed_cb()
356 * @see connection_unset_proxy_address_changed_cb()
358 typedef void(*connection_address_changed_cb)(const char* ipv4_address,
359 const char* ipv6_address, void* user_data);
363 * @brief Called when connection_set_default_cellular_service_profile_async() finishes.
365 * @param[in] result The result
366 * @param[in] user_data The user data passed from connection_open_profile()
367 * @pre connection_set_default_cellular_service_profile_async() will invoke this callback function.
368 * @see connection_set_default_cellular_service_profile_async()
370 typedef void(*connection_set_default_cb)(connection_error_e result, void* user_data);
373 * @brief Called with an IPv6 address.
375 * @remarks If @a ipv6_address is needed outside the callback, a copy should be made. \n
376 * @a ipv6_address will be freed automatically after the execution of this callback.
377 * @param[in] ipv6_address The IPv6 address
378 * @param[in] user_data The user data passed from the foreach function
379 * @return @c true to continue with the next iteration of the loop, \n
380 * @c false to break out of the loop
381 * @pre connection_foreach_ipv6_address() will invoke this callback.
382 * @see connection_foreach_ipv6_address()
384 typedef bool(*connection_ipv6_address_cb)(char *ipv6_address, void *user_data);
387 * @brief Called when the DHCP state is changed.
389 * @param[in] state The DHCP state
390 * @param[in] interface_name The interface name with DHCP state change
391 * @param[in] result The result of DHCP operation
392 * @param[in] user_data The user data passed from the callback registration function
393 * @see connection_set_dhcp_state_changed_cb()
394 * @see connection_unset_dhcp_state_changed_cb()
396 typedef void(*connection_dhcp_state_changed_cb)(connection_dhcp_state_e state,
397 const char *interface_name, connection_error_e result, void *user_data);
400 * @brief Gets the type of the current profile for data connection.
402 * @param[in] connection The connection handle
403 * @param[out] type The type of the network
404 * @return @c 0 on success,
405 * otherwise a negative error value
406 * @retval #CONNECTION_ERROR_NONE Successful
407 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
408 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
409 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
410 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
412 int connection_get_type(connection_h connection, connection_type_e* type);
416 * @brief Gets the IP address of the current connection.
418 * @remarks You must release @a ip_address using free().
419 * @param[in] connection The connection handle
420 * @param[in] address_family The address family
421 * @param[out] ip_address The pointer to the IP address string
422 * @return @c 0 on success,
423 * otherwise a negative error value
424 * @retval #CONNECTION_ERROR_NONE Successful
425 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
426 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
427 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
428 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
429 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
431 int connection_get_ip_address(connection_h connection,
432 connection_address_family_e address_family, char** ip_address);
436 * @brief Gets the proxy address of the current connection.
438 * @remarks You must release @a proxy using free().
439 * @param[in] connection The connection handle
440 * @param[in] address_family The address family
441 * @param[out] proxy The proxy address
442 * @return @c 0 on success,
443 * otherwise a negative error value
444 * @retval #CONNECTION_ERROR_NONE Successful
445 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
446 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
447 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
448 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
449 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
451 int connection_get_proxy(connection_h connection,
452 connection_address_family_e address_family, char** proxy);
456 * @brief Gets the MAC address of the Wi-Fi or ethernet.
458 * @remarks @a mac_addr must be released with free() by you.
459 * @param[in] connection The handle of the connection
460 * @param[in] type The type of current network connection
461 * @param[out] mac_addr The MAC address
462 * @return @c 0 on success,
463 * otherwise a negative error value
464 * @retval #CONNECTION_ERROR_NONE Successful
465 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
466 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
467 * @retval #CONNECTION_ERROR_INVALID_OPERATION Invalid operation
468 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
469 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
470 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
472 int connection_get_mac_address(connection_h connection,
473 connection_type_e type, char** mac_addr);
477 * @brief Gets if the current connection is metered.
480 * @privilege %http://tizen.org/privilege/network.get
481 * @param[in] connection The connection handle
482 * @param[out] is_metered The value indicating whether it is metered
483 * @return @c 0 on success,
484 * otherwise a negative error value
485 * @retval #CONNECTION_ERROR_NONE Successful
486 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
487 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
488 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
489 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
490 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
492 int connection_is_metered_network(connection_h connection, bool* is_metered);
496 * @brief Gets the state of cellular connection.
497 * @details The returned state is for the cellular connection state.
499 * @param[in] connection The connection handle
500 * @param[out] state The state of the cellular connection
501 * @return @c 0 on success,
502 * otherwise a negative error value
503 * @retval #CONNECTION_ERROR_NONE Successful
504 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
505 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
506 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
507 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
509 int connection_get_cellular_state(connection_h connection, connection_cellular_state_e* state);
513 * @brief Gets the state of the Wi-Fi.
514 * @details The returned state is for the Wi-Fi connection state.
517 * @privilege %http://tizen.org/privilege/network.get
518 * @param[in] connection The connection handle
519 * @param[out] state The state of Wi-Fi connection
520 * @return @c 0 on success,
521 * otherwise a negative error value
522 * @retval #CONNECTION_ERROR_NONE Successful
523 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
524 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
525 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
526 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
527 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
529 int connection_get_wifi_state(connection_h connection, connection_wifi_state_e* state);
533 * @brief Gets the state of the Ethernet.
534 * @details The returned state is for the Ethernet connection state.
537 * @privilege %http://tizen.org/privilege/network.get
538 * @param[in] connection The connection handle
539 * @param[out] state The state of Ethernet connection
540 * @return @c 0 on success,
541 * otherwise a negative error value
542 * @retval #CONNECTION_ERROR_NONE Successful
543 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
544 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
545 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
546 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
547 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
549 int connection_get_ethernet_state(connection_h connection, connection_ethernet_state_e* state);
553 * @brief Called when the Internet state of the current connection is changed.
555 * @param[in] state The Internet state of current connection
556 * @param[in] user_data The user data passed to callback registration function
558 typedef void(*connection_internet_state_changed_cb)(
559 connection_internet_state_e state, void* user_data);
562 * @brief Sets the callback that is called when the Internet availability over the current connection is changed.
564 * @param[in] connection The connection handle
565 * @param[in] callback The callback function to be called
566 * @param[in] user_data The user data passed to the callback function
567 * @return @c 0 on success,
568 * otherwise a negative error value
569 * @retval #CONNECTION_ERROR_NONE Successful
570 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
571 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
572 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
573 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
575 int connection_set_internet_state_changed_cb(connection_h connection,
576 connection_internet_state_changed_cb callback, void *user_data);
580 * @brief Unsets the callback that is called when the Internet state of the current connection is changed.
582 * @param[in] connection The connection handle
583 * @return @c 0 on success,
584 * otherwise a negative error value
585 * @retval #CONNECTION_ERROR_NONE Successful
586 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
587 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
588 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
589 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
591 int connection_unset_internet_state_changed_cb(connection_h connection);
594 * @brief Checks for ethernet cable is attached or not.
595 * @details The returned state is for the ethernet cable state.
598 * @privilege %http://tizen.org/privilege/network.get
599 * @param[in] connection The handle of the connection
600 * @param[in] state The state of ethernet cable
601 * @return @c 0 on success,
602 * otherwise a negative error value
603 * @retval #CONNECTION_ERROR_NONE Successful
604 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
605 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
606 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
607 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
608 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
610 int connection_get_ethernet_cable_state(connection_h connection,
611 connection_ethernet_cable_state_e *state);
615 * @brief Gets the DHCP state of the interface.
618 * @privilege %http://tizen.org/privilege/network.get
619 * @param[in] connection The connection handle
620 * @param[in] interface_name The interface name
621 * @param[out] state The DHCP state of the interface
622 * @return @c 0 on success,
623 * otherwise a negative error value
624 * @retval #CONNECTION_ERROR_NONE Successful
625 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
626 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
627 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
628 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
630 int connection_get_dhcp_state(connection_h connection,
631 const char *interface_name, connection_dhcp_state_e *state);
635 * @deprecated Deprecated since 4.0. Use connection_ethernet_cable_state_changed_cb() instead.
636 * @brief Called when ethernet cable is plugged [in/out].
638 * @param[in] state The state of ethernet cable
639 * @param[in] user_data The user data passed to callback registration function
641 typedef void(*connection_ethernet_cable_state_chaged_cb)
642 (connection_ethernet_cable_state_e state, void* user_data);
646 * @deprecated Deprecated since 4.0. Use connection_set_ethernet_cable_state_changed_cb() instead.
647 * @brief Sets callback for ethernet cable is plugged [in/out] event.
649 * @param[in] connection The connection handle
650 * @param[in] callback The callback function to be called
651 * @param[in] user_data The user data passed to the callback function
652 * @return @c 0 on success,
653 * otherwise a negative error value
654 * @retval #CONNECTION_ERROR_NONE Successful
655 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
656 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
657 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
658 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
660 int connection_set_ethernet_cable_state_chaged_cb(connection_h connection,
661 connection_ethernet_cable_state_chaged_cb callback, void *user_data) TIZEN_DEPRECATED_API;
665 * @deprecated Deprecated since 4.0. Use connection_unset_ethernet_cable_state_changed_cb() instead.
666 * @brief Unsets callback for ethernet cable is plugged [in/out] event.
668 * @param[in] connection The connection handle
669 * @return @c 0 on success,
670 * otherwise a negative error value
671 * @retval #CONNECTION_ERROR_NONE Successful
672 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
673 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
674 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
675 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
677 int connection_unset_ethernet_cable_state_chaged_cb(connection_h connection) TIZEN_DEPRECATED_API;
680 * @brief Called when ethernet cable is plugged [in/out].
682 * @param[in] state The state of ethernet cable
683 * @param[in] user_data The user data passed to callback registration function
685 typedef void(*connection_ethernet_cable_state_changed_cb)(
686 connection_ethernet_cable_state_e state, void* user_data);
690 * @brief Sets callback for ethernet cable is plugged [in/out] event.
692 * @param[in] connection The connection handle
693 * @param[in] callback The callback function to be called
694 * @param[in] user_data The user data passed to the callback function
695 * @return @c 0 on success,
696 * otherwise a negative error value
697 * @retval #CONNECTION_ERROR_NONE Successful
698 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
699 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
700 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
701 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
703 int connection_set_ethernet_cable_state_changed_cb(connection_h connection,
704 connection_ethernet_cable_state_changed_cb callback, void *user_data);
708 * @brief Unsets callback for ethernet cable is plugged [in/out] event.
710 * @param[in] connection The connection handle
711 * @return @c 0 on success,
712 * otherwise a negative error value
713 * @retval #CONNECTION_ERROR_NONE Successful
714 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
715 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
716 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
717 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
719 int connection_unset_ethernet_cable_state_changed_cb(connection_h connection);
723 * @brief Gets the state of the Bluetooth.
724 * @details The returned state is for the Bluetooth connection state.
727 * @privilege %http://tizen.org/privilege/network.get
728 * @param[in] connection The connection handle
729 * @param[out] state The state of the Bluetooth connection
730 * @return @c 0 on success,
731 * otherwise a negative error value
732 * @retval #CONNECTION_ERROR_NONE Successful
733 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
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
739 int connection_get_bt_state(connection_h connection, connection_bt_state_e* state);
743 * @brief Sets the callback that is called when the type of the current connection is changed.
745 * @param[in] connection The connection handle
746 * @param[in] callback The callback function to be called
747 * @param[in] user_data The user data passed to the callback function
748 * @return @c 0 on success,
749 * otherwise a negative error value
750 * @retval #CONNECTION_ERROR_NONE Successful
751 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
752 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
753 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
754 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
756 int connection_set_type_changed_cb(connection_h connection,
757 connection_type_changed_cb callback, void* user_data);
761 * @brief Unsets the callback that is called when the type of current connection is changed.
763 * @param[in] connection The connection handle
764 * @return @c 0 on success,
765 * otherwise a negative error value
766 * @retval #CONNECTION_ERROR_NONE Successful
767 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
768 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
769 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
770 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
772 int connection_unset_type_changed_cb(connection_h connection);
776 * @brief Sets the callback that is called when the IP address is changed.
778 * @param[in] connection The connection handle
779 * @param[in] callback The callback function to be called
780 * @param[in] user_data The user data passed to the callback function
781 * @return @c 0 on success,
782 * otherwise a negative error value
783 * @retval #CONNECTION_ERROR_NONE Successful
784 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
785 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
786 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
787 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
789 int connection_set_ip_address_changed_cb(connection_h connection,
790 connection_address_changed_cb callback, void* user_data);
794 * @brief Unsets the callback that is called when the IP address is changed.
796 * @param[in] connection The connection handle
797 * @return @c 0 on success,
798 * otherwise a negative error value
799 * @retval #CONNECTION_ERROR_NONE Successful
800 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
801 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
802 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
803 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
805 int connection_unset_ip_address_changed_cb(connection_h connection);
809 * @brief Sets the callback that is called when the proxy address is changed.
811 * @param[in] connection The connection handle
812 * @param[in] callback The callback function to be called
813 * @param[in] user_data The user data passed to the callback function
814 * @return @c 0 on success,
815 * otherwise a negative error value
816 * @retval #CONNECTION_ERROR_NONE Successful
817 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
818 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
819 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
820 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
822 int connection_set_proxy_address_changed_cb(connection_h connection,
823 connection_address_changed_cb callback, void* user_data);
827 * @brief Unsets the callback that is called when the proxy address is changed.
829 * @param[in] connection The connection handle
830 * @return @c 0 on success,
831 * otherwise a negative error value
832 * @retval #CONNECTION_ERROR_NONE Successful
833 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
834 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
835 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
836 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
838 int connection_unset_proxy_address_changed_cb(connection_h connection);
842 * @brief Sets the callback that is called when the DHCP state is changed.
844 * @param[in] connection The connection handle
845 * @param[in] callback The callback function to be called
846 * @param[in] user_data The user data passed to the callback function
847 * @return @c 0 on success,
848 * otherwise a negative error value
849 * @retval #CONNECTION_ERROR_NONE Successful
850 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
851 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
852 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
853 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
855 int connection_set_dhcp_state_changed_cb(connection_h connection,
856 connection_dhcp_state_changed_cb callback, void *user_data);
860 * @brief Unsets the callback that is called when the DHCP state is changed.
862 * @param[in] connection The connection handle
863 * @return @c 0 on success,
864 * otherwise a negative error value
865 * @retval #CONNECTION_ERROR_NONE Successful
866 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
867 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
868 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
869 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
871 int connection_unset_dhcp_state_changed_cb(connection_h connection);
875 * @brief Adds a new profile which is created by connection_profile_create().
878 * @privilege %http://tizen.org/privilege/network.profile
879 * @remarks You can only add a profile of the cellular type.
880 * @param[in] connection The connection handle
881 * @param[in] profile The profile handle
882 * @return @c 0 on success,
883 * otherwise a negative error value
884 * @retval #CONNECTION_ERROR_NONE Successful
885 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
886 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
887 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
888 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
889 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
891 int connection_add_profile(connection_h connection, connection_profile_h profile);
895 * @brief Removes an existing profile.
898 * @privilege %http://tizen.org/privilege/network.profile \n
899 * %http://tizen.org/privilege/network.get
900 * @remarks This function needs both privileges.
901 * @param[in] connection The connection handle
902 * @param[in] profile The profile handle
903 * @return @c 0 on success,
904 * otherwise a negative error value
905 * @retval #CONNECTION_ERROR_NONE Successful
906 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
907 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
908 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
909 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
910 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
912 int connection_remove_profile(connection_h connection, connection_profile_h profile);
916 * @brief Updates an existing profile.
917 * @details When a profile is changed, these changes will be not applied to the
918 * Connection Manager immediately.
919 * When you call this function, your changes affect the Connection Manager
920 * and the existing profile is updated.
921 * In addition, the existing profile will be updated if you call connection_open_profile().
924 * @privilege %http://tizen.org/privilege/network.profile \n
925 * %http://tizen.org/privilege/network.get
926 * @remarks This function needs both privileges.
927 * @param[in] connection The connection handle
928 * @param[in] profile The profile handle
929 * @return @c 0 on success,
930 * otherwise a negative error value
931 * @retval #CONNECTION_ERROR_NONE Successful
932 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
933 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
934 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
935 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
936 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
937 * @see connection_open_profile()
939 int connection_update_profile(connection_h connection, connection_profile_h profile);
943 * @brief Gets a profiles iterator.
946 * @privilege %http://tizen.org/privilege/network.get
947 * @remarks You must release @a profile_iterator using connection_destroy().
948 * @param[in] connection The connection handle
949 * @param[in] type The type of the connection iterator
950 * @param[out] profile_iterator The iterator of profile
951 * @return @c 0 on success,
952 * otherwise a negative error value
953 * @retval #CONNECTION_ERROR_NONE Successful
954 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
955 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
956 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
957 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
958 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
959 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
961 int connection_get_profile_iterator(connection_h connection,
962 connection_iterator_type_e type, connection_profile_iterator_h* profile_iterator);
966 * @brief Moves the profile iterator to the next position and gets a profile handle.
968 * @param[in] profile_iterator The iterator of profile
969 * @param[out] profile The profile handle
970 * @return @c 0 on success,
971 * otherwise a negative error value
972 * @retval #CONNECTION_ERROR_NONE Successful
973 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
974 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
975 * @retval #CONNECTION_ERROR_ITERATOR_END End of iteration
976 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
978 int connection_profile_iterator_next(connection_profile_iterator_h profile_iterator,
979 connection_profile_h* profile);
983 * @brief Checks whether the next element of a profile iterator exists or not.
985 * @remarks The specific error code can be obtained using the get_last_result() method.
986 * Error codes are described in Exception section.
987 * @param[in] profile_iterator The iterator of profile
988 * @return @c true if next element exists,
989 * otherwise @c false if next element doesn't exist
990 * @exception #CONNECTION_ERROR_NONE Successful
991 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
992 * @exception #CONNECTION_ERROR_NOT_SUPPORTED Not supported
993 * @see get_last_result()
995 bool connection_profile_iterator_has_next(connection_profile_iterator_h profile_iterator);
999 * @brief Destroys a profiles iterator.
1001 * @param[in] profile_iterator The iterator of the profile
1002 * @return @c 0 on success,
1003 * otherwise a negative error value
1004 * @retval #CONNECTION_ERROR_NONE Successful
1005 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
1006 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1007 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1009 int connection_destroy_profile_iterator(connection_profile_iterator_h profile_iterator);
1013 * @brief Gets the name of the default profile.
1016 * @privilege %http://tizen.org/privilege/network.get
1017 * @remarks You must release @a profile using connection_profile_destroy().
1018 * @param[in] connection The connection handle
1019 * @param[out] profile The profile handle
1020 * @return @c 0 on success,
1021 * otherwise a negative error value
1022 * @retval #CONNECTION_ERROR_NONE Successful
1023 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
1024 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1025 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
1026 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1027 * @retval #CONNECTION_ERROR_NO_CONNECTION There is no connection
1028 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1029 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1031 int connection_get_current_profile(connection_h connection, connection_profile_h* profile);
1035 * @brief Gets the default profile which provides the given cellular service.
1038 * @privilege %http://tizen.org/privilege/network.get
1039 * @remarks You must release @a profile using connection_profile_destroy().
1040 * @param[in] connection The connection handle
1041 * @param[in] type The type of cellular service \n
1042 * #CONNECTION_CELLULAR_SERVICE_TYPE_APPLICATION is not permitted
1043 * @param[out] profile The profile handle
1044 * @return @c 0 on success,
1045 * otherwise a negative error value
1046 * @retval #CONNECTION_ERROR_NONE Successful
1047 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
1048 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1049 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
1050 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1051 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1052 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1054 int connection_get_default_cellular_service_profile(connection_h connection,
1055 connection_cellular_service_type_e type, connection_profile_h* profile);
1059 * @brief Sets the default profile which provides the given cellular service.
1062 * @privilege %http://tizen.org/privilege/network.profile \n
1063 * %http://tizen.org/privilege/network.get
1064 * @remarks This function needs both privileges.
1065 * @param[in] connection The connection handle
1066 * @param[in] type The type of cellular service \n
1067 * Only #CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET and
1068 * #CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_INTERNET are permitted
1069 * @param[in] profile The profile handle
1070 * @return @c 0 on success,
1071 * otherwise a negative error value
1072 * @retval #CONNECTION_ERROR_NONE Successful
1073 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
1074 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1075 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1076 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1077 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1079 int connection_set_default_cellular_service_profile(connection_h connection,
1080 connection_cellular_service_type_e type, connection_profile_h profile);
1084 * @brief Sets the default profile which provides the given cellular service, asynchronously.
1087 * @privilege %http://tizen.org/privilege/network.profile \n
1088 * %http://tizen.org/privilege/network.get
1089 * @remarks This function needs both privileges.
1090 * @param[in] connection The connection handle
1091 * @param[in] type The type of cellular service \n
1092 * Only #CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET and
1093 * #CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_INTERNET are permitted
1094 * @param[in] profile The profile handle
1095 * @param[in] callback The callback function to be called
1096 * @param[in] user_data The user data passed to the callback function
1097 * @return @c 0 on success,
1098 * otherwise a negative error value
1099 * @retval #CONNECTION_ERROR_NONE Successful
1100 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
1101 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1102 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1103 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1104 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1106 int connection_set_default_cellular_service_profile_async(connection_h connection,
1107 connection_cellular_service_type_e type, connection_profile_h profile,
1108 connection_set_default_cb callback, void* user_data);
1112 * @brief Called after connection_open_profile() is finished.
1114 * @param[in] result The result
1115 * @param[in] user_data The user data passed from connection_open_profile()
1116 * @pre connection_open_profile() will invoke this callback function.
1117 * @see connection_open_profile()
1119 typedef void(*connection_opened_cb)(connection_error_e result, void* user_data);
1123 * @brief Called after connection_close_profile() is finished.
1125 * @param[in] result The result
1126 * @param[in] user_data The user data passed from connection_close_profile()
1127 * @pre connection_close_profile() will invoke this callback function.
1128 * @see connection_close_profile()
1130 typedef void(*connection_closed_cb)(connection_error_e result, void* user_data);
1134 * @brief Called after connection_reset_profile() is finished.
1136 * @param[in] result The result
1137 * @param[in] user_data The user data passed from connection_reset_profile()
1138 * @pre connection_reset_profile() will invoke this callback function.
1139 * @see connection_reset_profile()
1141 typedef void(*connection_reset_cb)(connection_error_e result, void* user_data);
1145 * @brief Opens a connection of profile, asynchronously.
1148 * @privilege %http://tizen.org/privilege/network.set \n
1149 * %http://tizen.org/privilege/network.get
1150 * @remarks This function needs both privileges.
1151 * @param[in] connection The connection handle
1152 * @param[in] profile The profile handle
1153 * @param[in] callback The callback function to be called
1154 * @param[in] user_data The user data passed to the callback function
1155 * @return @c 0 on success,
1156 * otherwise a negative error value
1157 * @retval #CONNECTION_ERROR_NONE Successful
1158 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
1159 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1160 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1161 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1162 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1163 * @post connection_opened_cb() will be invoked.
1164 * @see connection_opened_cb()
1165 * @see connection_close_profile()
1166 * @see connection_profile_set_state_changed_cb()
1167 * @see connection_profile_unset_state_changed_cb()
1168 * @see connection_profile_state_changed_cb()
1170 int connection_open_profile(connection_h connection, connection_profile_h profile,
1171 connection_opened_cb callback, void* user_data);
1175 * @brief Closes a connection of profile.
1178 * @privilege %http://tizen.org/privilege/network.set
1179 * @param[in] connection The connection handle
1180 * @param[in] profile The profile handle
1181 * @param[in] callback The callback function to be called
1182 * @param[in] user_data The user data passed to the callback function
1183 * @return @c 0 on success,
1184 * otherwise a negative error value
1185 * @retval #CONNECTION_ERROR_NONE Successful
1186 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
1187 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1188 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1189 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1190 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1191 * @post connection_closed_cb() will be invoked.
1192 * @see connection_closed_cb()
1193 * @see connection_open_profile()
1194 * @see connection_profile_set_state_changed_cb()
1195 * @see connection_profile_unset_state_changed_cb()
1196 * @see connection_profile_state_changed_cb()
1198 int connection_close_profile(connection_h connection, connection_profile_h profile,
1199 connection_closed_cb callback, void* user_data);
1203 * @brief Resets the cellular profile.
1206 * @privilege %http://tizen.org/privilege/network.profile \n
1207 * %http://tizen.org/privilege/network.get
1208 * @remarks This function needs both privileges.
1209 * @param[in] connection The connection handle
1210 * @param[in] type The type of reset
1211 * @param[in] id The subscriber identity module ID to reset
1212 * (The sim index starts from 0.)
1213 * @param[in] callback The callback function to be called
1214 * @param[in] user_data The user data passed to the callback function
1215 * @return @c 0 on success,
1216 * otherwise a negative error value
1217 * @retval #CONNECTION_ERROR_NONE Successful
1218 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
1219 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1220 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1221 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1222 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1223 * @post connection_reset_cb() will be invoked.
1225 int connection_reset_profile(connection_h connection, connection_reset_option_e type,
1226 int id, connection_reset_cb callback, void *user_data);
1231 * @deprecated Deprecated since 4.0. Use connection_add_route_entry() instead.
1232 * @brief Adds a IPv4 route to the routing table.
1233 * @details You can get the @a interface_name from
1234 * connection_profile_get_network_interface_name() of opened profile.
1236 * @privlevel partner
1237 * @privilege %http://tizen.org/privilege/network.route
1238 * @remarks Since 6.0, the required privilege and level of this function has changed.
1239 * @param[in] connection The connection handle
1240 * @param[in] interface_name The name of network interface
1241 * @param[in] host_address The IP address of the host
1242 * @return @c 0 on success,
1243 * otherwise a negative error value
1244 * @retval #CONNECTION_ERROR_NONE Successful
1245 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
1246 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1247 * @retval #CONNECTION_ERROR_ALREADY_EXISTS Already exists
1248 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1249 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1250 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1251 * @see connection_profile_get_network_interface_name()
1253 int connection_add_route(connection_h connection, const char* interface_name,
1254 const char* host_address) TIZEN_DEPRECATED_API;
1259 * @deprecated Deprecated since 4.0. Use connection_remove_route_entry() instead.
1260 * @brief Removes a IPv4 route from the routing table.
1261 * @details You can get the @a interface_name from
1262 * connection_profile_get_network_interface_name() of opened profile.
1264 * @privlevel partner
1265 * @privilege %http://tizen.org/privilege/network.route
1266 * @remarks Since 6.0, the required privilege and level of this function has changed.
1267 * @param[in] connection The connection handle
1268 * @param[in] interface_name The name of network interface
1269 * @param[in] host_address The IP address of the host
1270 * @return @c 0 on success,
1271 * otherwise a negative error value
1272 * @retval #CONNECTION_ERROR_NONE Successful
1273 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
1274 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1275 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1276 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1277 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1278 * @see connection_profile_get_network_interface_name()
1280 int connection_remove_route(connection_h connection, const char* interface_name,
1281 const char* host_address) TIZEN_DEPRECATED_API;
1286 * @deprecated Deprecated since 4.0. Use connection_add_route_entry() instead.
1287 * @brief Adds a IPv6 route to the routing table.
1288 * @details You can get the @a interface_name from
1289 * connection_profile_get_network_interface_name() of opened profile.
1290 * @since_tizen 2.3.1
1291 * @privlevel partner
1292 * @privilege %http://tizen.org/privilege/network.route
1293 * @remarks Since 6.0, the required privilege and level of this function has changed.
1294 * @param[in] connection The connection handle
1295 * @param[in] interface_name The name of network interface
1296 * @param[in] host_address The IP address of the host
1297 * @param[in] gateway The gateway address
1298 * @return @c 0 on success,
1299 * otherwise a negative error value
1300 * @retval #CONNECTION_ERROR_NONE Successful
1301 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
1302 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1303 * @retval #CONNECTION_ERROR_ALREADY_EXISTS Already exists
1304 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1305 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1306 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1307 * @see connection_profile_get_network_interface_name()
1309 int connection_add_route_ipv6(connection_h connection, const char *interface_name,
1310 const char *host_address, const char * gateway) TIZEN_DEPRECATED_API;
1315 * @deprecated Deprecated since 4.0. Use connection_remove_route_entry() instead.
1316 * @brief Removes a IPV6 route from the routing table.
1317 * @details You can get the @a interface_name from
1318 * connection_profile_get_network_interface_name() of opened profile.
1319 * @since_tizen 2.3.1
1320 * @privlevel partner
1321 * @privilege %http://tizen.org/privilege/network.route
1322 * @remarks Since 6.0, the required privilege and level of this function has changed.
1323 * @param[in] connection The connection handle
1324 * @param[in] interface_name The name of network interface
1325 * @param[in] host_address The IP address of the host
1326 * @param[in] gateway The gateway address
1327 * @return @c 0 on success,
1328 * otherwise a negative error value
1329 * @retval #CONNECTION_ERROR_NONE Successful
1330 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
1331 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1332 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1333 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1334 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1335 * @see connection_profile_get_network_interface_name()
1337 int connection_remove_route_ipv6(connection_h connection, const char *interface_name,
1338 const char *host_address, const char * gateway) TIZEN_DEPRECATED_API;
1342 * @brief Adds a route to the routing table.
1343 * @details You can get the @a interface_name from \n
1344 * connection_profile_get_network_interface_name() of opened profile.
1346 * @privlevel partner
1347 * @privilege %http://tizen.org/privilege/network.route
1348 * @remarks Since 6.0, the required privilege and level of this function has changed.
1349 * @param[in] connection The connection handle
1350 * @param[in] address_family The address family
1351 * @param[in] interface_name The name of network interface
1352 * @param[in] host_address The IP address of the host (e.g., single IP address such as
1353 * 163.152.10.2,192.168.1.2), group's IP address (e.g., 163.152.10.0, 192.168.0.0)
1355 * @param[in] gateway The gateway address
1356 * @return @c 0 on success,
1357 * otherwise a negative error value
1358 * @retval #CONNECTION_ERROR_NONE Successful
1359 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
1360 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1361 * @retval #CONNECTION_ERROR_ALREADY_EXISTS Already exists
1362 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1363 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1364 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1365 * @see connection_profile_get_network_interface_name()
1367 int connection_add_route_entry(connection_h connection,
1368 connection_address_family_e address_family, const char *interface_name,
1369 const char *host_address, const char *gateway);
1373 * @brief Removes a route from the routing table.
1374 * @details You can get the @a interface_name from \n
1375 * connection_profile_get_network_interface_name() of opened profile.
1377 * @privlevel partner
1378 * @privilege %http://tizen.org/privilege/network.route
1379 * @remarks Since 6.0, the required privilege and level of this function has changed.
1380 * @param[in] connection The connection handle
1381 * @param[in] address_family The address family
1382 * @param[in] interface_name The name of network interface
1383 * @param[in] host_address The IP address of the host (e.g., single IP address such as
1384 * 163.152.10.2,192.168.1.2), group's IP address (e.g., 163.152.10.0, 192.168.0.0)
1386 * @param[in] gateway The gateway address
1387 * @return @c 0 on success,
1388 * otherwise a negative error value
1389 * @retval #CONNECTION_ERROR_NONE Successful
1390 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
1391 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1392 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1393 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1394 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1395 * @see connection_profile_get_network_interface_name()
1397 int connection_remove_route_entry(connection_h connection,
1398 connection_address_family_e address_family, const char *interface_name,
1399 const char *host_address, const char *gateway);
1402 * @brief Gets all IPv6 addresses assigned to the network interface.
1404 * @param[in] connection The connection handle
1405 * @param[in] connection_type The connection type
1406 * @param[in] callback The callback to be called for each IPv6 address
1407 * @param[in] user_data The user data passed to the callback function
1408 * @return 0 on success, otherwise negative error value.
1409 * @retval #CONNECTION_ERROR_NONE Successful
1410 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
1411 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1412 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1413 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1415 int connection_foreach_ipv6_address(connection_h connection, connection_type_e connection_type,
1416 connection_ipv6_address_cb callback, void *user_data);
1424 * @addtogroup CAPI_NETWORK_CONNECTION_STATISTICS_MODULE
1430 * @brief Gets the statistics information.
1433 * @privilege %http://tizen.org/privilege/network.get
1434 * @param[in] connection The connection handle
1435 * @param[in] connection_type The type of connection \n
1436 * Only #CONNECTION_TYPE_WIFI and #CONNECTION_TYPE_CELLULAR are supported
1437 * @param[in] statistics_type The type of statistics
1438 * @param[out] size The received data size of the last cellular packet data connection (bytes)
1439 * @return @c 0 on success,
1440 * otherwise a negative error value
1441 * @retval #CONNECTION_ERROR_NONE Successful
1442 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
1443 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1444 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1445 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1446 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1448 int connection_get_statistics(connection_h connection, connection_type_e connection_type,
1449 connection_statistics_type_e statistics_type, long long* size);
1453 * @brief Resets the statistics information.
1456 * @privilege %http://tizen.org/privilege/network.set
1457 * @param[in] connection The connection handle
1458 * @param[in] connection_type The type of connection \n
1459 * Only #CONNECTION_TYPE_WIFI and #CONNECTION_TYPE_CELLULAR are supported
1460 * @param[in] statistics_type The type of statistics
1461 * @return @c 0 on success,
1462 * otherwise a negative error value
1463 * @retval #CONNECTION_ERROR_NONE Successful
1464 * @retval #CONNECTION_ERROR_NOT_INITIALIZED Not initialized
1465 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1466 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1467 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
1468 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1470 int connection_reset_statistics(connection_h connection, connection_type_e connection_type,
1471 connection_statistics_type_e statistics_type);
1479 #endif /* __cplusplus */
1482 #endif /* __TIZEN_NETWORK_NET_CONNECTION_H__ */