380cc4e526d337a04dca2cef392ab4256e0e249e
[platform/core/api/connection.git] / include / net_connection.h
1 /*
2  * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef __NET_CONNECTION_INTF_H__
18 #define __NET_CONNECTION_INTF_H__
19
20 #include "connection_profile.h"
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif /* __cplusplus */
25
26 /**
27  * @file net_connection.h
28  */
29
30 /**
31  * @addtogroup CAPI_NETWORK_CONNECTION_MANAGER_MODULE
32  * @{
33  */
34
35 /**
36  * @brief The connection handle.
37  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
38 */
39 typedef void* connection_h;
40
41 /**
42  * @brief The profiles iterator handle.
43  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
44 */
45 typedef void* connection_profile_iterator_h;
46
47 /**
48  * @brief Enumeration for connection type.
49  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
50  */
51 typedef enum
52 {
53     CONNECTION_TYPE_DISCONNECTED = 0,  /**< Disconnected */
54     CONNECTION_TYPE_WIFI = 1,  /**< Wi-Fi type */
55     CONNECTION_TYPE_CELLULAR = 2,  /**< Cellular type */
56     CONNECTION_TYPE_ETHERNET = 3,  /**< Ethernet type */
57     CONNECTION_TYPE_BT = 4,  /**< Bluetooth type */
58     CONNECTION_TYPE_NET_PROXY, /**< Proxy type for internet connection (Since 3.0) */
59 } connection_type_e;
60
61 /**
62  * @brief Enumeration for cellular network state.
63  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
64  */
65 typedef enum
66 {
67     CONNECTION_CELLULAR_STATE_OUT_OF_SERVICE = 0,  /**< Out of service */
68     CONNECTION_CELLULAR_STATE_FLIGHT_MODE = 1,  /**< Flight mode */
69     CONNECTION_CELLULAR_STATE_ROAMING_OFF = 2,  /**< Roaming is turned off */
70     CONNECTION_CELLULAR_STATE_CALL_ONLY_AVAILABLE = 3,  /**< Call is only available */
71     CONNECTION_CELLULAR_STATE_AVAILABLE = 4,  /**< Available but not connected yet */
72     CONNECTION_CELLULAR_STATE_CONNECTED = 5,  /**< Connected */
73 } connection_cellular_state_e;
74
75 /**
76  * @brief Enumeration for Wi-Fi state.
77  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
78  */
79 typedef enum
80 {
81     CONNECTION_WIFI_STATE_DEACTIVATED = 0,  /**< Wi-Fi is deactivated */
82     CONNECTION_WIFI_STATE_DISCONNECTED = 1,  /**< Disconnected */
83     CONNECTION_WIFI_STATE_CONNECTED = 2,  /**< Connected */
84 } connection_wifi_state_e;
85
86 /**
87  * @brief Enumeration for ethernet state.
88  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
89  */
90 typedef enum
91 {
92     CONNECTION_ETHERNET_STATE_DEACTIVATED = 0,  /**< There is no Ethernet profile to open */
93     CONNECTION_ETHERNET_STATE_DISCONNECTED = 1,  /**< Disconnected */
94     CONNECTION_ETHERNET_STATE_CONNECTED = 2,  /**< Connected */
95 } connection_ethernet_state_e;
96
97 /**
98  * @brief Enumeration for Bluetooth state.
99  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
100  */
101 typedef enum
102 {
103     CONNECTION_BT_STATE_DEACTIVATED = 0,  /**< There is no Bluetooth profile to open */
104     CONNECTION_BT_STATE_DISCONNECTED = 1,  /**< Disconnected */
105     CONNECTION_BT_STATE_CONNECTED = 2,  /**< Connected */
106 } connection_bt_state_e;
107
108 /**
109  * @brief Enumeration for connection iterator type.
110  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
111  */
112 typedef enum
113 {
114     CONNECTION_ITERATOR_TYPE_REGISTERED = 0,  /**< The iterator of the registered profile  */
115     CONNECTION_ITERATOR_TYPE_CONNECTED = 1,  /**< The iterator of the connected profile  */
116         CONNECTION_ITERATOR_TYPE_DEFAULT = 2,   /**< The iterator of the default profile  */
117 } connection_iterator_type_e;
118
119 /**
120  * @brief Enumeration for reset profile type.
121  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
122 */
123 typedef enum
124 {
125     CONNECTION_RESET_DEFAULT_PROFILE = 0,  /**< Initialized with the default profile defined by csc */
126     CONNECTION_RESET_CLEAR_PROFILE = 1,  /**< Remove all profiles */
127 } connection_reset_option_e;
128
129 /**
130  * @brief This enumeration defines the attached or detached state of ethernet cable.
131  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
132  */
133 typedef enum
134 {
135     CONNECTION_ETHERNET_CABLE_DETACHED = 0,  /**< Ethernet cable is detached */
136     CONNECTION_ETHERNET_CABLE_ATTACHED = 1,  /**< Ethernet cable is attached */
137 } connection_ethernet_cable_state_e;
138
139 /**
140  * @brief Enumeration for connection errors.
141  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
142  */
143 typedef enum
144 {
145     CONNECTION_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
146     CONNECTION_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
147     CONNECTION_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory error */
148     CONNECTION_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid Operation */
149     CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED = TIZEN_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED, /**< Address family not supported */
150     CONNECTION_ERROR_OPERATION_FAILED = TIZEN_ERROR_CONNECTION|0x0401, /**< Operation failed */
151     CONNECTION_ERROR_ITERATOR_END = TIZEN_ERROR_CONNECTION|0x0402, /**< End of iteration */
152     CONNECTION_ERROR_NO_CONNECTION = TIZEN_ERROR_CONNECTION|0x0403, /**< There is no connection */
153     CONNECTION_ERROR_NOW_IN_PROGRESS = TIZEN_ERROR_NOW_IN_PROGRESS, /** Now in progress */
154     CONNECTION_ERROR_ALREADY_EXISTS = TIZEN_ERROR_CONNECTION|0x0404, /**< Already exists */
155     CONNECTION_ERROR_OPERATION_ABORTED = TIZEN_ERROR_CONNECTION|0x0405, /**< Operation is aborted */
156     CONNECTION_ERROR_DHCP_FAILED = TIZEN_ERROR_CONNECTION|0x0406, /**< DHCP failed  */
157     CONNECTION_ERROR_INVALID_KEY = TIZEN_ERROR_CONNECTION|0x0407, /**< Invalid key  */
158     CONNECTION_ERROR_NO_REPLY = TIZEN_ERROR_CONNECTION|0x0408, /**< No reply */
159     CONNECTION_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
160     CONNECTION_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED  /**< Not Supported */
161 } connection_error_e;
162
163 /**
164  * @}
165 */
166
167 /**
168  * @addtogroup CAPI_NETWORK_CONNECTION_STATISTICS_MODULE
169  * @{
170 */
171
172 /**
173  * @brief Enumeration for statistics type.
174  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
175  */
176 typedef enum
177 {
178     CONNECTION_STATISTICS_TYPE_LAST_RECEIVED_DATA = 0,  /**< Last received data */
179     CONNECTION_STATISTICS_TYPE_LAST_SENT_DATA = 1,  /**< Last sent data */
180     CONNECTION_STATISTICS_TYPE_TOTAL_RECEIVED_DATA = 2,  /**< Total received data */
181     CONNECTION_STATISTICS_TYPE_TOTAL_SENT_DATA = 3,  /**< Total sent data */
182 } connection_statistics_type_e;
183
184 /**
185  * @}
186 */
187
188 /**
189  * @addtogroup CAPI_NETWORK_CONNECTION_MANAGER_MODULE
190  * @{
191 */
192
193
194 /**
195  * @brief Creates a handle for managing data connections.
196  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
197  * @privlevel public
198  * @privilege %http://tizen.org/privilege/network.get
199  * @remarks You must release @a handle using connection_destroy().
200  * @param[out] connection  The connection handle
201  * @return @c 0 on success, otherwise a negative error value
202  * @retval #CONNECTION_ERROR_NONE  Successful
203  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
204  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY  Out of memory
205  * @see connection_destroy()
206  */
207 int connection_create(connection_h* connection);
208
209 /**
210  * @brief Destroys the connection handle.
211  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
212  * @param[in] connection  The connection handle
213  * @return @c 0 on success, otherwise negative error value
214  * @retval #CONNECTION_ERROR_NONE  Successful
215  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
216  * @see connection_create()
217  */
218 int connection_destroy(connection_h connection);
219
220 /**
221  * @brief Called when the type of a connection is changed.
222  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
223  * @param[in] type  The type of the current network connection
224  * @param[in] user_data The user data passed from the callback registration function
225  * @see connection_set_type_changed_cb()
226  * @see connection_unset_type_changed_cb()
227  */
228 typedef void(*connection_type_changed_cb)(connection_type_e type, void* user_data);
229
230 /**
231  * @brief Called when the address is changed.
232  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
233  * @param[in] ipv4_address  The IP address for IPv4
234  * @param[in] ipv6_address  The IP address for IPv6
235  * @param[in] user_data The user data passed from the callback registration function
236  * @see connection_set_ip_address_changed_cb()
237  * @see connection_unset_ip_address_changed_cb()
238  * @see connection_set_proxy_address_changed_cb()
239  * @see connection_unset_proxy_address_changed_cb()
240  */
241 typedef void(*connection_address_changed_cb)(const char* ipv4_address, const char* ipv6_address, void* user_data);
242
243 /**
244  * @brief Called when connection_set_default_cellular_service_profile_async() finishes.
245  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
246  * @param[in] result  The result
247  * @param[in] user_data The user data passed from connection_open_profile()
248  * @pre connection_set_default_cellular_service_profile_async() will invoke this callback function.
249  * @see connection_set_default_cellular_service_profile_async()
250 */
251 typedef void(*connection_set_default_cb)(connection_error_e result, void* user_data);
252
253 /**
254  * @brief Gets the type of the current profile for data connection.
255  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
256  * @param[in] connection  The connection handle
257  * @param[out] type  The type of the network
258  * @return @c 0 on success, otherwise negative error value
259  * @retval #CONNECTION_ERROR_NONE  Successful
260  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
261  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
262  */
263 int connection_get_type(connection_h connection, connection_type_e* type);
264
265 /**
266  * @brief Gets the IP address of the current connection.
267  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
268  * @remarks You must release @a ip_address using free().
269  * @param[in] connection  The connection handle
270  * @param[in] address_family  The address family
271  * @param[out] ip_address  The pointer to the IP address string
272  * @return @c 0 on success, otherwise a negative error value
273  * @retval #CONNECTION_ERROR_NONE  Successful
274  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
275  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
276  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED  Not supported address family
277  */
278 int connection_get_ip_address(connection_h connection, connection_address_family_e address_family, char** ip_address);
279
280 /**
281  * @brief Gets the proxy address of the current connection.
282  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
283  * @remarks You must release @a proxy using free().
284  * @param[in] connection  The connection handle
285  * @param[in] address_family  The address family
286  * @param[out] proxy  The proxy address
287  * @return @c 0 on success, otherwise a negative error value
288  * @retval #CONNECTION_ERROR_NONE  Successful
289  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
290  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
291  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED  Not supported address family
292  */
293 int connection_get_proxy(connection_h connection, connection_address_family_e address_family, char** proxy);
294
295 /**
296  * @brief Gets the MAC address of the Wi-Fi or ethernet.
297  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
298  * @remarks @a mac_addr must be released with free() by you.
299  * @param[in] connection  The handle of the connection
300  * @param[in] type  The type of current network connection
301  * @param[out] mac_addr  The MAC address
302  * @return 0 on success, otherwise negative error value.
303  * @retval #CONNECTION_ERROR_NONE  Successful
304  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
305  * @retval #CONNECTION_ERROR_INVALID_OPERATION   Invalid operation
306  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
307  * @retval #CONNECTION_ERROR_NOT_SUPPORTED  Not supported
308  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY  Out of memory
309  */
310 int connection_get_mac_address(connection_h connection, connection_type_e type, char** mac_addr);
311
312 /**
313  * @brief Gets the state of cellular connection.
314  * @details The returned state is for the cellular connection state.
315  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
316  * @param[in] connection  The connection handle
317  * @param[out] state  The state of the cellular connection
318  * @return @c 0 on success, otherwise a negative error value
319  * @retval #CONNECTION_ERROR_NONE  Successful
320  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
321  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
322  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
323  */
324 int connection_get_cellular_state(connection_h connection, connection_cellular_state_e* state);
325
326 /**
327  * @brief Gets the state of the Wi-Fi.
328  * @details The returned state is for the Wi-Fi connection state.
329  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
330  * @privlevel public
331  * @privilege %http://tizen.org/privilege/network.get
332  * @param[in] connection  The connection handle
333  * @param[out] state  The state of Wi-Fi connection
334  * @return @c 0 on success, otherwise a negative error value
335  * @retval #CONNECTION_ERROR_NONE  Successful
336  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
337  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
338  * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
339  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
340  */
341 int connection_get_wifi_state(connection_h connection, connection_wifi_state_e* state);
342
343 /**
344  * @brief Gets the state of the Ethernet.
345  * @details The returned state is for the Ethernet connection state.
346  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
347  * @privlevel public
348  * @privilege %http://tizen.org/privilege/network.get
349  * @param[in] connection  The connection handle
350  * @param[out] state  The state of Ethernet connection
351  * @return @c 0 on success, otherwise a negative error value
352  * @retval #CONNECTION_ERROR_NONE  Successful
353  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
354  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
355  * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
356  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
357  */
358 int connection_get_ethernet_state(connection_h connection, connection_ethernet_state_e* state);
359
360 /**
361 * @brief Checks for ethernet cable is attached or not.
362 * @details The returned state is for the ethernet cable state.
363 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
364 * @privlevel public
365 * @privilege %http://tizen.org/privilege/network.get
366 * @param[in] connection  The handle of the connection
367 * @param[in] state - Enum connection_ethernet_cable_state_e
368 * @return 0 on success, otherwise 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_NOT_SUPPORTED  Not supported
373 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
374 */
375 int connection_get_ethernet_cable_state(connection_h connection, connection_ethernet_cable_state_e *state);
376
377 /**
378  * @brief Called when ethernet cable is plugged [in/out].
379  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
380  * @param[in] state The ethernet cable state (connection_ethernet_cable_state_e)
381  * @param[in] user_data The user data passed to callback registration function
382  */
383 typedef void(*connection_ethernet_cable_state_chaged_cb)(
384                         connection_ethernet_cable_state_e state, void* user_data);
385
386 /**
387  * @brief Registers callback for ethernet cable is plugged [in/out] event.
388  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
389  * @param[in] callback  The callback function to be called
390  * @param[in] user_data The user data passed to the callback function
391  * @return 0 on success, otherwise negative error value
392  * @retval #CONNECTION_ERROR_NONE   Successful
393  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
394  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
395  * @retval #CONNECTION_ERROR_NOT_SUPPORTED  Not supported
396  */
397 int connection_set_ethernet_cable_state_chaged_cb( connection_h connection,
398                 connection_ethernet_cable_state_chaged_cb callback, void *user_data);
399
400 /**
401  * @brief Unregisters callback for ethernet cable is plugged [in/out] event.
402  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
403  * @param[in] connection  The handle of connection
404  * @return 0 on success, otherwise negative error value
405  * @retval #CONNECTION_ERROR_NONE  Successful
406  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
407  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
408  * @retval #CONNECTION_ERROR_NOT_SUPPORTED  Not supported
409  */
410 int connection_unset_ethernet_cable_state_chaged_cb(connection_h connection);
411
412 /**
413  * @brief Gets the state of the Bluetooth.
414  * @details The returned state is for the Bluetooth connection state.
415  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
416  * @privlevel public
417  * @privilege %http://tizen.org/privilege/network.get
418  * @param[in] connection  The connection handle
419  * @param[out] state  The state of the Bluetooth connection
420  * @return @c 0 on success, otherwise a negative error value
421  * @retval #CONNECTION_ERROR_NONE  Successful
422  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
423  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
424  * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
425  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
426  */
427 int connection_get_bt_state(connection_h connection, connection_bt_state_e* state);
428
429 /**
430  * @brief Registers the callback that is called when the type of the current connection is changed.
431  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
432  * @param[in] connection  The connection handle
433  * @param[in] callback  The callback function to be called
434  * @param[in] user_data The user data passed to the callback function
435  * @return @c 0 on success, otherwise a negative error value
436  * @retval #CONNECTION_ERROR_NONE  Successful
437  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
438  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
439  */
440 int connection_set_type_changed_cb(connection_h connection, connection_type_changed_cb callback, void* user_data);
441
442 /**
443  * @brief Unregisters the callback that is called when the type of current connection is changed.
444  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
445  * @param[in] connection  The connection handle
446  * @return @c 0 on success, otherwise a negative error value
447  * @retval #CONNECTION_ERROR_NONE  Successful
448  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
449  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
450  */
451 int connection_unset_type_changed_cb(connection_h connection);
452
453 /**
454  * @brief Registers the callback that is called when the IP address is changed.
455  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
456  * @param[in] connection  The connection handle
457  * @param[in] callback  The callback function to be called
458  * @param[in] user_data The user data passed to the callback function
459  * @return @c 0 on success, otherwise a negative error value
460  * @retval #CONNECTION_ERROR_NONE  Successful
461  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
462  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
463  */
464 int connection_set_ip_address_changed_cb(connection_h connection, connection_address_changed_cb callback, void* user_data);
465
466 /**
467  * @brief Unregisters the callback that is called when the IP address is changed.
468  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
469  * @param[in] connection  The connection handle
470  * @return @c 0 on success, otherwise a negative error value
471  * @retval #CONNECTION_ERROR_NONE  Successful
472  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
473  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
474  */
475 int connection_unset_ip_address_changed_cb(connection_h connection);
476
477 /**
478  * @brief Registers the callback that is called when the proxy address is changed.
479  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
480  * @param[in] connection  The connection handle
481  * @param[in] callback  The callback function to be called
482  * @param[in] user_data The user data passed to the callback function
483  * @return @c 0 on success, otherwise a negative error value
484  * @retval #CONNECTION_ERROR_NONE  Successful
485  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
486  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
487  */
488 int connection_set_proxy_address_changed_cb(connection_h connection, connection_address_changed_cb callback, void* user_data);
489
490 /**
491  * @brief Unregisters the callback that is called when the proxy address is changed.
492  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
493  * @param[in] connection  The connection handle
494  * @return @c 0 on success, otherwise a negative error value
495  * @retval #CONNECTION_ERROR_NONE  Successful
496  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
497  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
498  */
499 int connection_unset_proxy_address_changed_cb(connection_h connection);
500
501 /**
502  * @brief Adds a new profile which is created by connection_profile_create().
503  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
504  * @privlevel public
505  * @privilege %http://tizen.org/privilege/network.profile
506  * @remarks You can only add a profile of the cellular type.
507  * @param[in] connection  The connection handle
508  * @param[in] profile  The profile handle
509  * @return @c 0 on success, 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_PERMISSION_DENIED Permission Denied
514  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not Supported
515  */
516 int connection_add_profile(connection_h connection, connection_profile_h profile);
517
518 /**
519  * @brief Removes an existing profile.
520  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
521  * @privlevel public
522  * @privilege %http://tizen.org/privilege/network.profile \n
523  *            %http://tizen.org/privilege/network.get
524  * @remarks This API needs both privileges.
525  * @param[in] connection  The connection handle
526  * @param[in] profile  The profile handle
527  * @return @c 0 on success, otherwise a negative error value
528  * @retval #CONNECTION_ERROR_NONE  Successful
529  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
530  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
531  * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
532  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not Supported
533  */
534 int connection_remove_profile(connection_h connection, connection_profile_h profile);
535
536 /**
537  * @brief Updates an existing profile.
538  * @details When a profile is changed, these changes will be not applied to the Connection Manager immediately.
539  * When you call this function, your changes affect the Connection Manager and the existing profile is updated.
540  * In addition, the existing profile will be updated if you call connection_open_profile().
541  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
542  * @privlevel public
543  * @privilege %http://tizen.org/privilege/network.profile \n
544  *            %http://tizen.org/privilege/network.get
545  * @remarks This API needs both privileges.
546  * @param[in] connection  The connection handle
547  * @param[in] profile  The profile handle
548  * @return @c 0 on success, otherwise a negative error value
549  * @retval #CONNECTION_ERROR_NONE  Successful
550  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
551  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
552  * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
553  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not Supported
554  * @see connection_open_profile()
555  */
556 int connection_update_profile(connection_h connection, connection_profile_h profile);
557
558 /**
559  * @brief Gets a profiles iterator.
560  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
561  * @privlevel public
562  * @privilege %http://tizen.org/privilege/network.get
563  * @remarks You must release @a profile_iterator using connection_destroy().
564  * @param[in] connection  The connection handle
565  * @param[in] type  The type of the connetion iterator
566  * @param[out] profile_iterator  The iterator of profile
567  * @return @c 0 on success, otherwise a negative error value
568  * @retval #CONNECTION_ERROR_NONE  Successful
569  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
570  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY  Out of memory
571  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
572  * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
573  */
574 int connection_get_profile_iterator(connection_h connection, connection_iterator_type_e type, connection_profile_iterator_h* profile_iterator);
575
576 /**
577  * @brief Moves the profile iterator to the next position and gets a profile handle.
578  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
579  * @param[in] profile_iterator  The iterator of profile
580  * @param[out] profile  The profile handle
581  * @return @c 0 on success, otherwise a negative error value
582  * @retval #CONNECTION_ERROR_NONE  Successful
583  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
584  * @retval #CONNECTION_ERROR_ITERATOR_END  End of iteration
585  */
586 int connection_profile_iterator_next(connection_profile_iterator_h profile_iterator, connection_profile_h* profile);
587
588 /**
589  * @brief Checks whether the next element of a profile iterator exists or not.
590  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
591  * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
592  * @param[in] profile_iterator  The iterator of profile
593  * @return @c true if next element exists, otherwise @c false if next element doesn't exist
594  */
595 bool connection_profile_iterator_has_next(connection_profile_iterator_h profile_iterator);
596
597 /**
598  * @brief Destroys a profiles iterator.
599  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
600  * @param[in] profile_iterator  The iterator of the profile
601  * @return @c 0 on success, otherwise a negative error value
602  * @retval #CONNECTION_ERROR_NONE  Successful
603  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
604  */
605 int connection_destroy_profile_iterator(connection_profile_iterator_h profile_iterator);
606
607 /**
608  * @brief Gets the name of the default profile.
609  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
610  * @privlevel public
611  * @privilege %http://tizen.org/privilege/network.get
612  * @remarks You must release @a profile using connection_profile_destroy().
613  * @param[in] connection  The connection handle
614  * @param[out] profile  The profile handle
615  * @return @c 0 on success, otherwise a negative error value
616  * @retval #CONNECTION_ERROR_NONE  Successful
617  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
618  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY  Out of memory
619  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
620  * @retval #CONNECTION_ERROR_NO_CONNECTION  There is no connection
621  * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
622  */
623 int connection_get_current_profile(connection_h connection, connection_profile_h* profile);
624
625 /**
626  * @brief Gets the default profile which provides the given cellular service.
627  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
628  * @privlevel public
629  * @privilege %http://tizen.org/privilege/network.get
630  * @remarks You must release @a profile using connection_profile_destroy().
631  * @param[in] connection  The connection handle
632  * @param[in] type  The type of cellular service \n
633  *                 #CONNECTION_CELLULAR_SERVICE_TYPE_APPLICATION is not permitted.
634  * @param[out] profile  The profile handle
635  * @return @c 0 on success, otherwise a negative error value
636  * @retval #CONNECTION_ERROR_NONE  Successful
637  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
638  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY  Out of memory
639  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
640  * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denieda
641  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not Supported
642  */
643 int connection_get_default_cellular_service_profile(connection_h connection, connection_cellular_service_type_e type, connection_profile_h* profile);
644
645 /**
646  * @brief Sets the default profile which provides the given cellular service.
647  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
648  * @privlevel public
649  * @privilege %http://tizen.org/privilege/network.profile \n
650  *            %http://tizen.org/privilege/network.get
651  * @remarks This API needs both privileges.
652  * @param[in] connection  The connection handle
653  * @param[in] type  The type of cellular service \n
654  *                 only #CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET and #CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_INTERNET are permitted.
655  * @param[in] profile  The profile handle
656  * @return @c 0 on success, otherwise a negative error value
657  * @retval #CONNECTION_ERROR_NONE  Successful
658  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
659  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
660  * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
661  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not Supported
662  */
663 int connection_set_default_cellular_service_profile(connection_h connection, connection_cellular_service_type_e type, connection_profile_h profile);
664
665 /**
666  * @brief Sets the default profile which provides the given cellular service, asynchronously.
667  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
668  * @privlevel public
669  * @privilege %http://tizen.org/privilege/network.profile \n
670  *            %http://tizen.org/privilege/network.get
671  * @remarks This API needs both privileges.
672  * @param[in] connection  The connection handle
673  * @param[in] type  The type of cellular service (only #CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET and #CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_INTERNET are permitted)
674  * @param[in] profile  The profile handle
675  * @param[in] callback  The callback function to be called
676  * @param[in] user_data The user data passed to the callback function
677  * @return @c 0 on success, otherwise negative error value
678  * @retval #CONNECTION_ERROR_NONE  Successful
679  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
680  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
681  * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
682  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not Supported
683  */
684 int connection_set_default_cellular_service_profile_async(connection_h connection,
685                 connection_cellular_service_type_e type, connection_profile_h profile, connection_set_default_cb callback, void* user_data);
686
687 /**
688  * @brief Called after connection_open_profile() is finished.
689  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
690  * @param[in] result  The result
691  * @param[in] user_data The user data passed from connection_open_profile()
692  * @pre connection_open_profile() will invoke this callback function.
693  * @see connection_open_profile()
694 */
695 typedef void(*connection_opened_cb)(connection_error_e result, void* user_data);
696
697 /**
698  * @brief Called after connection_close_profile() is finished.
699  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
700  * @param[in] result  The result
701  * @param[in] user_data The user data passed from connection_close_profile()
702  * @pre connection_close_profile() will invoke this callback function.
703  * @see connection_close_profile()
704 */
705 typedef void(*connection_closed_cb)(connection_error_e result, void* user_data);
706
707 /**
708  * @brief Called after connection_reset_profile() is finished.
709  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
710  * @param[in] result  The result
711  * @param[in] user_data The user data passed from connection_reset_profile()
712  * @pre connection_reset_profile() will invoke this callback function.
713  * @see connection_reset_profile()
714 */
715 typedef void(*connection_reset_cb)(connection_error_e result, void* user_data);
716
717 /**
718  * @brief Opens a connection of profile, asynchronously.
719  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
720  * @privlevel public
721  * @privilege %http://tizen.org/privilege/network.set \n
722  *            %http://tizen.org/privilege/network.get
723  * @remarks This API needs both privileges.
724  * @param[in] connection  The connection handle
725  * @param[in] profile  The profile handle
726  * @param[in] callback  The callback function to be called
727  * @param[in] user_data The user data passed to the callback function
728  * @return @c 0 on success, otherwise negative error value
729  * @retval #CONNECTION_ERROR_NONE  Successful
730  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
731  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
732  * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
733  * @post connection_opened_cb() will be invoked.
734  * @see connection_opened_cb()
735  * @see connection_close_profile()
736  * @see connection_profile_set_state_changed_cb()
737  * @see connection_profile_unset_state_changed_cb()
738  * @see connection_profile_state_changed_cb()
739  */
740 int connection_open_profile(connection_h connection, connection_profile_h profile, connection_opened_cb callback, void* user_data);
741
742 /**
743  * @brief Closes a connection of profile.
744  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
745  * @privlevel public
746  * @privilege %http://tizen.org/privilege/network.set
747  * @param[in] connection  The connection handle
748  * @param[in] profile  The profile handle
749  * @param[in] callback  The callback function to be called
750  * @param[in] user_data The user data passed to the callback function
751  * @return @c 0 on success, otherwise negative error value
752  * @retval #CONNECTION_ERROR_NONE  Successful
753  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
754  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
755  * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
756  * @post connection_closed_cb() will be invoked.
757  * @see connection_closed_cb()
758  * @see connection_open_profile()
759  * @see connection_profile_set_state_changed_cb()
760  * @see connection_profile_unset_state_changed_cb()
761  * @see connection_profile_state_changed_cb()
762  */
763 int connection_close_profile(connection_h connection, connection_profile_h profile, connection_closed_cb callback, void* user_data);
764
765 /**
766  * @brief Resets the cellular profile.
767  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
768  * @privlevel public
769  * @privilege %http://tizen.org/privilege/network.profile \n
770  *            %http://tizen.org/privilege/network.get
771  * @remarks This API needs both privileges.
772  * @param[in] connection  The connection handle
773  * @param[in] type  The type of reset
774  * @param[in] id  The subscriber identity module id to reset (The sim index starts from 0.)
775  * @param[in] callback  The callback function to be called
776  * @param[in] user_data The user data passed to the callback function
777  * @return 0 on success, otherwise negative error value
778  * @retval #CONNECTION_ERROR_NONE Successful
779  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
780  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
781  * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
782  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not Supported
783  * @post connection_reset_cb() will be invoked.
784 */
785 int connection_reset_profile(connection_h connection, connection_reset_option_e type, int id, connection_reset_cb callback, void *user_data);
786
787 /**
788  * @brief Adds a IPv4 route to the routing table.
789  * @details You can get the @a interface_name from connection_profile_get_network_interface_name() of opened profile.
790  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
791  * @privlevel public
792  * @privilege %http://tizen.org/privilege/network.set
793  * @param[in] connection  The connection handle
794  * @param[in] interface_name  The name of network interface
795  * @param[in] host_address  The IP address of the host
796  * @return @c 0 on success, otherwise negative error value
797  * @retval #CONNECTION_ERROR_NONE  Successful
798  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
799  * @retval #CONNECTION_ERROR_ALREADY_EXISTS  Already exists
800  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
801  * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
802  * @see connection_profile_get_network_interface_name()
803  */
804 int connection_add_route(connection_h connection, const char* interface_name, const char* host_address);
805
806 /**
807  * @brief Removes a IPv4 route from the routing table.
808  * @details You can get the @a interface_name from connection_profile_get_network_interface_name() of opened profile.
809  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
810  * @privlevel public
811  * @privilege %http://tizen.org/privilege/network.set
812  * @param[in] connection  The connection handle
813  * @param[in] interface_name  The name of network interface
814  * @param[in] host_address  The IP address of the host
815  * @return @c 0 on success, otherwise negative error value
816  * @retval #CONNECTION_ERROR_NONE  Successful
817  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
818  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
819  * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
820  * @see connection_profile_get_network_interface_name()
821  */
822 int connection_remove_route(connection_h connection, const char* interface_name, const char* host_address);
823
824 /**
825  * @brief Adds a IPv6 route to the routing table.
826  * @details You can get the @a interface_name from connection_profile_get_network_interface_name() of opened profile.
827  * @since_tizen 2.3.1
828  * @privlevel public
829  * @privilege %http://tizen.org/privilege/network.set
830  * @param[in] connection  The connection handle
831  * @param[in] interface_name  The name of network interface
832  * @param[in] host_address  The IP address of the host
833  * @param[in] gateway  The gateway address
834  * @return @c 0 on success, otherwise negative error value
835  * @retval #CONNECTION_ERROR_NONE  Successful
836  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
837  * @retval #CONNECTION_ERROR_ALREADY_EXISTS  Already exists
838  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
839  * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
840  * @see connection_profile_get_network_interface_name()
841  */
842 int connection_add_route_ipv6(connection_h connection, const char *interface_name, const char *host_address, const char * gateway);
843
844 /**
845  * @brief Removes a IPV6 route from the routing table.
846  * @details You can get the @a interface_name from connection_profile_get_network_interface_name() of opened profile.
847  * @since_tizen 2.3.1
848  * @privlevel public
849  * @privilege %http://tizen.org/privilege/network.set
850  * @param[in] connection  The connection handle
851  * @param[in] interface_name  The name of network interface
852  * @param[in] host_address  The IP address of the host
853  * @param[in] gateway  The gateway address
854  * @return @c 0 on success, otherwise negative error value
855  * @retval #CONNECTION_ERROR_NONE  Successful
856  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
857  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
858  * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
859  * @see connection_profile_get_network_interface_name()
860  */
861 int connection_remove_route_ipv6(connection_h connection, const char *interface_name, const char *host_address, const char * gateway);
862
863 /**
864  * @}
865 */
866
867 /**
868  * @addtogroup CAPI_NETWORK_CONNECTION_STATISTICS_MODULE
869  * @{
870 */
871
872 /**
873  * @brief Gets the statistics information.
874  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
875  * @privlevel public
876  * @privilege %http://tizen.org/privilege/network.get
877  * @param[in] connection  The connection handle
878  * @param[in] connection_type  The type of connection (only CONNECTION_TYPE_WIFI and CONNECTION_TYPE_CELLULAR are supported)
879  * @param[in] statistics_type  The type of statistics
880  * @param[out] size  The received data size of the last cellular packet data connection (bytes)
881  * @return @c 0 on success, otherwise negative error value
882  * @retval #CONNECTION_ERROR_NONE  Successful
883  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
884  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
885  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not Supported
886  */
887 int connection_get_statistics(connection_h connection, connection_type_e connection_type, connection_statistics_type_e statistics_type, long long* size);
888
889 /**
890  * @brief Resets the statistics information.
891  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
892  * @privlevel public
893  * @privilege %http://tizen.org/privilege/network.set
894  * @remarks This API needs both privileges.
895  * @param[in] connection  The connection handle
896  * @param[in] connection_type  The type of connection (only CONNECTION_TYPE_WIFI and CONNECTION_TYPE_CELLULAR are supported)
897  * @param[in] statistics_type  The type of statistics
898  * @return @c 0 on success, otherwise negative error value
899  * @retval #CONNECTION_ERROR_NONE Successful
900  * @retval #CONNECTION_ERROR_INVALID_PARAMETER   Invalid parameter
901  * @retval #CONNECTION_ERROR_OPERATION_FAILED  Operation failed
902  * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
903  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not Supported
904  */
905 int connection_reset_statistics(connection_h connection, connection_type_e connection_type, connection_statistics_type_e statistics_type);
906
907 /**
908  * @}
909 */
910
911 #ifdef __cplusplus
912 }
913 #endif /* __cplusplus */
914
915 #endif