2bd8fe3769e8c45a7f9b28c68dd4ca3e727568f1
[platform/core/api/tethering.git] / include / tethering.h
1 /*
2 * Copyright (c) 2011 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 __TIZEN_NETWORK_TETHERING_H__
18 #define __TIZEN_NETWORK_TETHERING_H__
19
20 #include <tizen.h>
21 #include <time.h>
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /**
28  * @file tethering.h
29  */
30
31 /**
32  * @internal
33  * @addtogroup CAPI_NETWORK_TETHERING_MANAGER_MODULE
34  * @{
35  */
36
37 /**
38  * @internal
39  * @brief The tethering handle.
40  * @since_tizen 2.3
41  */
42 typedef void * tethering_h;
43
44 /**
45  * @internal
46  * @brief Enumeration for the tethering.
47  * @since_tizen 2.3
48  */
49 typedef enum {
50     TETHERING_ERROR_NONE = TIZEN_ERROR_NONE,  /**< Successful */
51     TETHERING_ERROR_NOT_PERMITTED = TIZEN_ERROR_NOT_PERMITTED,  /**< Operation not permitted */
52     TETHERING_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,  /**< Invalid parameter */
53     TETHERING_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,  /**< Out of memory */
54     TETHERING_ERROR_RESOURCE_BUSY = TIZEN_ERROR_RESOURCE_BUSY,  /**< Resource busy */
55     TETHERING_ERROR_NOT_ENABLED = TIZEN_ERROR_TETHERING | 0x0501,  /**< Not enabled */
56     TETHERING_ERROR_OPERATION_FAILED = TIZEN_ERROR_TETHERING | 0x0502,  /**< Operation failed */
57     TETHERING_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid operation */
58     TETHERING_ERROR_NOT_SUPPORT_API = TIZEN_ERROR_NOT_SUPPORTED, /**< API is not supported */
59     TETHERING_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED,  /**< Permission denied */
60 } tethering_error_e;
61
62 /**
63  * @internal
64  * @brief Enumeration for the type of tethering.
65  * @since_tizen 2.3
66  */
67 typedef enum {
68     TETHERING_TYPE_ALL = 0,  /**< All type except for TETHERING_TYPE_RESERVED */
69     TETHERING_TYPE_USB,  /**< USB type */
70     TETHERING_TYPE_WIFI,  /**< Wi-Fi type */
71     TETHERING_TYPE_BT,  /**< BT type */
72     TETHERING_TYPE_RESERVED,  /**< Reserved type */
73 } tethering_type_e;
74
75 /**
76  * @internal
77  * @brief Enumeration for the cause of disabling the tethering.
78  * @since_tizen 2.3
79  */
80 typedef enum
81 {
82     TETHERING_DISABLED_BY_USB_DISCONNECTION = 0,  /**< Disabled due to usb disconnection */
83     TETHERING_DISABLED_BY_FLIGHT_MODE,  /**< Disabled due to flight mode */
84     TETHERING_DISABLED_BY_LOW_BATTERY,  /**< Disabled due to low battery */
85     TETHERING_DISABLED_BY_NETWORK_CLOSE,  /**< Disabled due to pdp network close */
86     TETHERING_DISABLED_BY_TIMEOUT,  /**< Disabled due to timeout */
87     TETHERING_DISABLED_BY_OTHERS,  /**< Disabled by other apps */
88     TETHERING_DISABLED_BY_REQUEST,  /**< Disabled by your request */
89     TETHERING_DISABLED_BY_WIFI_ON,  /**< Disabled due to Wi-Fi on */
90     TETHERING_DISABLED_BY_BT_OFF,  /**< Disabled due to Bluetooth off */
91     TETHERING_DISABLED_BY_POWER_SAVE_MODE,      /**< Disabled due to power save mode */
92 } tethering_disabled_cause_e;
93
94 /**
95  * @}
96  */
97
98
99 /**
100  * @internal
101  * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
102  * @{
103  */
104
105 /**
106  * @internal
107  * @brief Enumeration for the Wi-Fi security.
108  * @since_tizen 2.3
109  */
110 typedef enum {
111     TETHERING_WIFI_SECURITY_TYPE_NONE = 0,  /**< No Security type */
112     TETHERING_WIFI_SECURITY_TYPE_WPA2_PSK,  /**< WPA2_PSK */
113 } tethering_wifi_security_type_e;
114
115 /**
116  * @}
117  */
118
119
120 /**
121  * @internal
122  * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
123  * @{
124  */
125
126 /**
127  * @internal
128  * @brief The tethering client handle.
129  * @since_tizen 2.3
130  */
131 typedef void * tethering_client_h;
132
133 /**
134  * @internal
135  * @brief Enumeration for address family.
136  * @since_tizen 2.3
137  */
138 typedef enum {
139     TETHERING_ADDRESS_FAMILY_IPV4 = 0,  /**< IPV4 Address type */
140 } tethering_address_family_e;
141
142 /**
143  * @}
144  */
145
146
147 /**
148  * @internal
149  * @addtogroup CAPI_NETWORK_TETHERING_MANAGER_MODULE
150  * @{
151  */
152
153 /**
154  * @internal
155  * @brief Called when the tethering is enabled.
156  * @since_tizen 2.3
157  * @param[in]  result  The result of enabling the tethering
158  * @param[in]  type  The tethering type
159  * @param[in]  is_requested  Indicates whether this change is requested
160  * @param[in]  user_data  The user data passed from tethering_set_enabled_cb()
161  * @pre  If you register callback function using tethering_set_enabled_cb(), this will be invoked when the tethering is enabled.
162  * @see tethering_enable()
163  * @see tethering_unset_enabled_cb()
164  */
165 typedef void (*tethering_enabled_cb)(tethering_error_e result, tethering_type_e type, bool is_requested, void *user_data);
166
167 /**
168  * @internal
169  * @brief Called when the tethering is disabled.
170  * @since_tizen 2.3
171  * @param[in]  result  The result of disabling the tethering
172  * @param[in]  type  The tethering type
173  * @param[in]  cause  The cause of disabling
174  * @param[in]  user_data  The user data passed from tethering_set_disabled_cb()
175  * @pre  If you register callback function using tethering_set_disabled_cb(), this will be invoked when the tethering is disabled.
176  * @see tethering_set_disabled_cb()
177  * @see tethering_unset_disabled_cb()
178  */
179 typedef void (*tethering_disabled_cb)(tethering_error_e result, tethering_type_e type, tethering_disabled_cause_e cause, void *user_data);
180
181 /**
182  * @internal
183  * @brief Called when the connection state is changed.
184  * @since_tizen 2.3
185  * @remarks @a client is valid only in this function. In order to use it outside this function, a user must copy the client with tethering_client_clone().
186  * @param[in]  client  The client of which connection state is changed
187  * @param[in]  opened  @c true when connection is opened, otherwise false
188  * @param[in]  user_data  The user data passed from tethering_set_connection_state_changed_cb()
189  * @pre  If you register callback function using tethering_set_connection_state_changed_cb(), this will be invoked when the connection state is changed.
190  * @see tethering_set_connection_state_changed_cb()
191  * @see tethering_unset_connection_state_changed_cb()
192  */
193 typedef void (*tethering_connection_state_changed_cb)(tethering_client_h client, bool opened, void *user_data);
194
195 /**
196  * @internal
197  * @brief Called when you get the connected client repeatedly.
198  * @since_tizen 2.3
199  * @remarks @a client is valid only in this function. In order to use the client outside this function, a user must copy the client with tethering_client_clone().
200  * @param[in]  client  The connected client
201  * @param[in]  user_data  The user data passed from the request function
202  * @return  @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
203  * @pre  tethering_foreach_connected_clients() will invoke this callback.
204  * @see  tethering_foreach_connected_clients()
205  */
206 typedef bool(*tethering_connected_client_cb)(tethering_client_h client, void *user_data);
207
208 /**
209  * @internal
210  * @brief Called when you get the data usage.
211  * @since_tizen 2.3
212  * @param[in]  result  The result of getting the data usage
213  * @param[in]  received_data  The usage of received data
214  * @param[in]  sent_data  The usage of sent data
215  * @param[in]  user_data  The user data passed from the request function
216  * @pre  tethering_get_data_usage() will invoked this callback.
217  */
218 typedef void (*tethering_data_usage_cb)(tethering_error_e result, unsigned long long received_data, unsigned long long sent_data, void *user_data);
219
220 /**
221  * @internal
222  * @brief Called when the security type of Wi-Fi tethering is changed.
223  * @since_tizen 2.3
224  * @param[in]  changed_type  The changed security type of Wi-Fi tethering
225  * @param[in]  user_data  The user data passed from the register function
226  * @see tethering_wifi_set_security_type_changed_cb()
227  * @see tethering_wifi_unset_security_type_changed_cb()
228  */
229 typedef void (*tethering_wifi_security_type_changed_cb)(tethering_wifi_security_type_e changed_type, void *user_data);
230
231 /**
232  * @internal
233  * @brief Called when the visibility of SSID is changed.
234  * @since_tizen 2.3
235  * @param[in]  changed_visible  The changed visibility of SSID
236  * @param[in]  user_data  The user data passed from the register function
237  * @see tethering_wifi_set_ssid_visibility_changed_cb()
238  * @see tethering_wifi_unset_ssid_visibility_changed_cb()
239  */
240 typedef void (*tethering_wifi_ssid_visibility_changed_cb)(bool changed_visible, void *user_data);
241
242 /**
243  * @internal
244  * @brief Called when the passphrase of Wi-Fi tethering is changed.
245  * @since_tizen 2.3
246  * @param[in]  user_data  The user data passed from the register function
247  * @see tethering_wifi_set_passphrase_changed_cb()
248  * @see tethering_wifi_unset_passphrase_changed_cb()
249  */
250 typedef void (*tethering_wifi_passphrase_changed_cb)(void *user_data);
251
252 /**
253  * @internal
254  * @brief Called when the settings are reloaded.
255  * @since_tizen 2.3
256  * @param[in]  result  The result of reloading the settings
257  * @param[in]  user_data  The user data passed from the request function
258  * @pre  tethering_wifi_reload_settings() will invoke this callback.
259  */
260 typedef void (*tethering_wifi_settings_reloaded_cb)(tethering_error_e result, void *user_data);
261
262 /**
263  * @internal
264  * @brief Called when Wi-Fi AP settings are reloaded.
265  * @since_tizen 2.3
266  * @param[in]  result  The result of reloading the settings
267  * @param[in]  user_data  The user data passed from the request function
268  * @pre  tethering_wifi_ap_reload_settings() will invoke this callback.
269  */
270 typedef void (*tethering_wifi_ap_settings_reloaded_cb)(tethering_error_e result, void *user_data);
271
272 /**
273  * @internal
274  * @brief Creates the handle for tethering.
275  * @since_tizen 2.3
276  * @privlevel platform
277  * @privilege http://tizen.org/privilege/tethering.admin
278  * @remarks The @a tethering must be released using tethering_destroy().
279  * @param[out]  tethering  A handle of a new mobile ap handle on success
280  * @return  0 on success, otherwise a negative error value
281  * @retval  #TETHERING_ERROR_NONE  Successful
282  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
283  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
284  * @retval  #TETHERING_ERROR_NOT_SUPPORT_API  API is not supported
285  * @see  tethering_destroy()
286  */
287 int tethering_create(tethering_h *tethering);
288
289 /**
290  * @internal
291  * @brief Destroys the handle for tethering.
292  * @since_tizen 2.3
293  * @privlevel platform
294  * @privilege http://tizen.org/privilege/tethering.admin
295  * @param[in]  tethering  The tethering handle
296  * @return  0 on success, otherwise a negative error value
297  * @retval  #TETHERING_ERROR_NONE  Successful
298  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
299  * @see  tethering_create()
300  */
301 int tethering_destroy(tethering_h tethering);
302
303 /**
304  * @internal
305  * @brief Enables the tethering, asynchronously.
306  * @since_tizen 2.3
307  * @privlevel platform
308  * @privilege http://tizen.org/privilege/tethering.admin
309  * @param[in]  tethering  The tethering handle
310  * @param[in]  type  The tethering type
311  * @return 0 on success, otherwise negative error value
312  * @retval  #TETHERING_ERROR_NONE  Successful
313  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
314  * @post tethering_enabled_cb() will be invoked.
315  * @see  tethering_is_enabled()
316  * @see  tethering_disable()
317  */
318 int tethering_enable(tethering_h tethering, tethering_type_e type);
319
320 /**
321  * @internal
322  * @brief Disables the tethering, asynchronously.
323  * @since_tizen 2.3
324  * @privlevel platform
325  * @privilege http://tizen.org/privilege/tethering.admin
326  * @param[in]  tethering  The tethering handle
327  * @param[in]  type  The tethering type
328  * @return 0 on success, otherwise negative error value
329  * @retval  #TETHERING_ERROR_NONE  Successful
330  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
331  * @post tethering_disabled_cb() will be invoked.
332  * @see  tethering_is_enabled()
333  * @see  tethering_enable()
334  */
335 int tethering_disable(tethering_h tethering, tethering_type_e type);
336
337 /**
338  * @internal
339  * @brief Checks whether the tethering is enabled or not.
340  * @since_tizen 2.3
341  * @privlevel platform
342  * @privilege http://tizen.org/privilege/tethering.admin
343  * @param[in]  tethering  The tethering handle
344  * @param[in]  type  The tethering type
345  * @return  @c true if tethering is enabled, \n @c false if tethering is disabled
346  */
347 bool tethering_is_enabled(tethering_h tethering, tethering_type_e type);
348
349 /**
350  * @internal
351  * @brief Gets the MAC address of local device as "FC:A1:3E:D6:B1:B1".
352  * @since_tizen 2.3
353  * @privlevel platform
354  * @privilege http://tizen.org/privilege/tethering.admin
355  * @remarks @a mac_address must be released using free().
356  * @param[in]  tethering  The tethering handle
357  * @param[in]  type  The tethering type
358  * @param[out]  mac_address  The MAC address
359  * @return  0 on success, otherwise a negative error value
360  * @retval  #TETHERING_ERROR_NONE  Successful
361  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
362  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
363  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
364  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
365  * @pre  The tethering must be enabled.
366  * @see  tethering_is_enabled()
367  * @see  tethering_enable()
368  */
369 int tethering_get_mac_address(tethering_h tethering, tethering_type_e type, char **mac_address);
370
371 /**
372  * @internal
373  * @brief Gets the name of network interface (e.g. usb0).
374  * @since_tizen 2.3
375  * @privlevel platform
376  * @privilege http://tizen.org/privilege/tethering.admin
377  * @remarks @a interface_name must be released using free().
378  * @param[in]  tethering  The tethering handle
379  * @param[in]  type  The tethering type
380  * @param[out]  interface_name  The name of the network interface
381  * @return 0 on success, otherwise negative error value
382  * @retval  #TETHERING_ERROR_NONE  Successful
383  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
384  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
385  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
386  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
387  * @pre  The tethering must be enabled.
388  * @see  tethering_is_enabled()
389  * @see  tethering_enable()
390  */
391 int tethering_get_network_interface_name(tethering_h tethering, tethering_type_e type, char **interface_name);
392
393 /**
394  * @internal
395  * @brief Gets the local IP address.
396  * @since_tizen 2.3
397  * @privlevel platform
398  * @privilege http://tizen.org/privilege/tethering.admin
399  * @remarks @a ip_address must be released using free().
400  * @param[in]  tethering  The tethering handle
401  * @param[in]  type  The tethering type
402  * @param[in]  address_family  The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
403  * @param[out]  ip_address  The local IP address
404  * @return 0 on success, otherwise negative error value
405  * @retval  #TETHERING_ERROR_NONE  Successful
406  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
407  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
408  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
409  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
410  * @pre  The tethering must be enabled.
411  * @see  tethering_is_enabled()
412  * @see  tethering_enable()
413  */
414 int tethering_get_ip_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **ip_address);
415
416 /**
417  * @internal
418  * @brief Gets the Gateway address.
419  * @since_tizen 2.3
420  * @privlevel platform
421  * @privilege http://tizen.org/privilege/tethering.admin
422  * @remarks @a gateway_address must be released using free().
423  * @param[in]  tethering  The tethering handle
424  * @param[in]  type  The tethering type
425  * @param[in]  address_family  The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
426  * @param[out]  gateway_address  The local IP address
427  * @return 0 on success, otherwise negative error value
428  * @retval  #TETHERING_ERROR_NONE  Successful
429  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
430  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
431  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
432  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
433  * @pre  The tethering must be enabled.
434  * @see  tethering_is_enabled()
435  * @see  tethering_enable()
436  */
437 int tethering_get_gateway_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **gateway_address);
438
439 /**
440  * @internal
441  * @brief Gets the Subnet Mask.
442  * @since_tizen 2.3
443  * @privlevel platform
444  * @privilege http://tizen.org/privilege/tethering.admin
445  * @remarks @a subnet_mask must be released using free().
446  * @param[in]  tethering  The tethering handle
447  * @param[in]  type  The tethering type
448  * @param[in]  address_family  The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
449  * @param[out]  subnet_mask  The local IP address
450  * @return 0 on success, otherwise negative error value
451  * @retval  #TETHERING_ERROR_NONE  Successful
452  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
453  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
454  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
455  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
456  * @pre  The tethering must be enabled.
457  * @see  tethering_is_enabled()
458  * @see  tethering_enable()
459  */
460 int tethering_get_subnet_mask(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **subnet_mask);
461
462 /**
463  * @internal
464  * @brief Gets the data usage.
465  * @since_tizen 2.3
466  * @privlevel platform
467  * @privilege http://tizen.org/privilege/tethering.admin
468  * @param[in]  tethering  The tethering handle
469  * @param[out]  usage  The data usage
470  * @return 0 on success, otherwise negative error value
471  * @retval  #TETHERING_ERROR_NONE  Successful
472  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
473  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
474  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
475  * @pre  The tethering must be enabled.
476  * @see  tethering_is_enabled()
477  * @see  tethering_enable()
478  */
479 int tethering_get_data_usage(tethering_h tethering, tethering_data_usage_cb callback, void *user_data);
480
481 /**
482  * @internal
483  * @brief Gets the clients which are connected.
484  * @since_tizen 2.3
485  * @privlevel platform
486  * @privilege http://tizen.org/privilege/tethering.admin
487  * @param[in]  tethering  The tethering handle
488  * @param[in]  type  The tethering type
489  * @param[in]  callback  The callback function to invoke
490  * @param[in]  user_data  The user data to be passed to the callback function
491  * @retval  #TETHERING_ERROR_NONE  Successful
492  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
493  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
494  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
495  * @pre  The tethering must be enabled.
496  * @see  tethering_is_enabled()
497  * @see  tethering_enable()
498  */
499 int tethering_foreach_connected_clients(tethering_h tethering, tethering_type_e type, tethering_connected_client_cb callback, void *user_data);
500
501 /**
502  * @brief Set the ip forward status
503  * @param[in]  tethering  The handle of tethering
504  * @param[in]  status  The ip forward status: (@c true = enable, @c false = disable)
505  * @retval  #TETHERING_ERROR_NONE  Successful
506  * @reztval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
507  * @see  tethering_get_ip_forward_status()
508  */
509 int tethering_set_ip_forward_status(tethering_h tethering, bool status);
510
511 /**
512  * @brief Get the ip forward status
513  * @param[in]  tethering  The handle of tethering
514  * @param[out]  status  The ip forward status: (@c true = enable, @c false = disable)
515  * @retval  #TETHERING_ERROR_NONE  Successful
516  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
517  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
518  * @see  tethering_set_ip_forward_status()
519  */
520 int tethering_get_ip_forward_status(tethering_h tethering, bool *status);
521
522 /**
523  * @internal
524  * @brief Registers the callback function, which is called when tethering is enabled.
525  * @since_tizen 2.3
526  * @privlevel platform
527  * @privilege http://tizen.org/privilege/tethering.admin
528  * @param[in]  tethering  The tethering handle
529  * @param[in]  type  The tethering type
530  * @param[in]  callback  The callback function to invoke
531  * @param[in]  user_data  The user data to be passed to the callback function
532  * @retval  #TETHERING_ERROR_NONE  Successful
533  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
534  * @see  tethering_unset_enabled_cb()
535  */
536 int tethering_set_enabled_cb(tethering_h tethering, tethering_type_e type, tethering_enabled_cb callback, void *user_data);
537
538 /**
539  * @internal
540  * @brief Unregisters the callback function, which is called when tethering is enabled.
541  * @since_tizen 2.3
542  * @privlevel platform
543  * @privilege http://tizen.org/privilege/tethering.admin
544  * @param[in]  tethering  The tethering handle
545  * @param[in]  type  The tethering type
546  * @retval  #TETHERING_ERROR_NONE  Successful
547  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
548  * @see  tethering_set_enabled_cb()
549  */
550 int tethering_unset_enabled_cb(tethering_h tethering, tethering_type_e type);
551
552 /**
553  * @internal
554  * @brief Registers the callback function called when tethering is disabled.
555  * @since_tizen 2.3
556  * @privlevel platform
557  * @privilege http://tizen.org/privilege/tethering.admin
558  * @param[in]  tethering  The tethering handle
559  * @param[in]  type  The tethering type
560  * @param[in]  callback  The callback function to invoke
561  * @param[in]  user_data  The user data to be passed to the callback function
562  * @retval  #TETHERING_ERROR_NONE  Successful
563  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
564  * @see  tethering_unset_disabled_cb()
565  */
566 int tethering_set_disabled_cb(tethering_h tethering, tethering_type_e type, tethering_disabled_cb callback, void *user_data);
567
568 /**
569  * @internal
570  * @brief Unregisters the callback function, which is called when tethering is disabled.
571  * @since_tizen 2.3
572  * @privlevel platform
573  * @privilege http://tizen.org/privilege/tethering.admin
574  * @param[in]  tethering  The tethering handle
575  * @param[in]  type  The tethering type
576  * @retval  #TETHERING_ERROR_NONE  Successful
577  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
578  * @see  tethering_set_disabled_cb()
579  */
580 int tethering_unset_disabled_cb(tethering_h tethering, tethering_type_e type);
581
582 /**
583  * @internal
584  * @brief Registers the callback function, which is called when the state of connection is changed.
585  * @since_tizen 2.3
586  * @privlevel platform
587  * @privilege http://tizen.org/privilege/tethering.admin
588  * @param[in]  tethering  The tethering handle
589  * @param[in]  type  The tethering type
590  * @param[in]  callback  The callback function to invoke
591  * @param[in]  user_data  The user data to be passed to the callback function
592  * @retval  #TETHERING_ERROR_NONE  Successful
593  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
594  * @see  tethering_unset_connection_state_changed_cb_cb()
595  */
596 int tethering_set_connection_state_changed_cb(tethering_h tethering, tethering_type_e type, tethering_connection_state_changed_cb callback, void *user_data);
597
598 /**
599  * @internal
600  * @brief Unregisters the callback function, which is called when the state of connection is changed.
601  * @since_tizen 2.3
602  * @privlevel platform
603  * @privilege http://tizen.org/privilege/tethering.admin
604  * @param[in]  tethering  The tethering handle
605  * @param[in]  type  The tethering type
606  * @retval  #TETHERING_ERROR_NONE  Successful
607  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
608  * @see  tethering_set_connection_state_changed_cb()
609  */
610 int tethering_unset_connection_state_changed_cb(tethering_h tethering, tethering_type_e type);
611
612 /**
613  * @internal
614  * @brief Registers the callback function, which is called when the security type of Wi-Fi tethering is changed.
615  * @since_tizen 2.3
616  * @privlevel platform
617  * @privilege http://tizen.org/privilege/tethering.admin
618  * @param[in]  tethering  The tethering handle
619  * @param[in]  callback  The callback function to invoke
620  * @param[in]  user_data  The user data to be passed to the callback function
621  * @retval  #TETHERING_ERROR_NONE  Successful
622  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
623  * @see  tethering_wifi_unset_security_type_changed_cb()
624  */
625 int tethering_wifi_set_security_type_changed_cb(tethering_h tethering, tethering_wifi_security_type_changed_cb callback, void *user_data);
626
627 /**
628  * @internal
629  * @brief Unregisters the callback function, which is called when the security type of Wi-Fi tethering is changed.
630  * @since_tizen 2.3
631  * @privlevel platform
632  * @privilege http://tizen.org/privilege/tethering.admin
633  * @param[in]  tethering  The tethering handle
634  * @param[in]  type  The tethering type
635  * @retval  #TETHERING_ERROR_NONE  Successful
636  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
637  * @see  tethering_wifi_set_security_type_changed_cb()
638  */
639 int tethering_wifi_unset_security_type_changed_cb(tethering_h tethering);
640
641 /**
642  * @internal
643  * @brief Registers the callback function , which iscalled when the visibility of SSID is changed.
644  * @since_tizen 2.3
645  * @privlevel platform
646  * @privilege http://tizen.org/privilege/tethering.admin
647  * @param[in]  tethering  The tethering handle
648  * @param[in]  callback  The callback function to invoke
649  * @param[in]  user_data  The user data to be passed to the callback function
650  * @retval  #TETHERING_ERROR_NONE  Successful
651  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
652  * @see  tethering_wifi_unset_ssid_visibility_changed_cb_cb()
653  */
654 int tethering_wifi_set_ssid_visibility_changed_cb(tethering_h tethering, tethering_wifi_ssid_visibility_changed_cb callback, void *user_data);
655
656 /**
657  * @internal
658  * @brief Unregisters the callback function, which is called when the visibility of SSID is changed.
659  * @since_tizen 2.3
660  * @privlevel platform
661  * @privilege http://tizen.org/privilege/tethering.admin
662  * @param[in]  tethering  The tethering handle
663  * @retval  #TETHERING_ERROR_NONE  Successful
664  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
665  * @see  tethering_wifi_set_ssid_visibility_changed_cb()
666  */
667 int tethering_wifi_unset_ssid_visibility_changed_cb(tethering_h tethering);
668
669 /**
670  * @internal
671  * @brief Registers the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
672  * @since_tizen 2.3
673  * @privlevel platform
674  * @privilege http://tizen.org/privilege/tethering.admin
675  * @param[in]  tethering  The tethering handle
676  * @param[in]  callback  The callback function to invoke
677  * @param[in]  user_data  The user data to be passed to the callback function
678  * @retval  #TETHERING_ERROR_NONE  Successful
679  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
680  * @see  tethering_wifi_unset_passphrase_changed_cb()
681  */
682 int tethering_wifi_set_passphrase_changed_cb(tethering_h tethering, tethering_wifi_passphrase_changed_cb callback, void *user_data);
683
684 /**
685  * @internal
686  * @brief Unregisters the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
687  * @since_tizen 2.3
688  * @privlevel platform
689  * @privilege http://tizen.org/privilege/tethering.admin
690  * @param[in]  tethering  The tethering handle
691  * @retval  #TETHERING_ERROR_NONE  Successful
692  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
693  * @see  tethering_wifi_set_passphrase_changed_cb()
694  */
695 int tethering_wifi_unset_passphrase_changed_cb(tethering_h tethering);
696
697 /**
698  * @}
699  */
700
701
702 /**
703  * @internal
704  * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
705  * @{
706  */
707
708 /**
709  * @internal
710  * @brief Sets the security type of Wi-Fi tethering.
711  * @since_tizen 2.3
712  * @privlevel platform
713  * @privilege http://tizen.org/privilege/tethering.admin
714  * @remarks This change is applied next time Wi-Fi tethering is enabled.
715  * @param[in]  tethering  The tethering handle
716  * @param[in]  type  The security type
717  * @return 0 on success, otherwise negative error value
718  * @retval  #TETHERING_ERROR_NONE  Successful
719  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
720  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
721  * @see  tethering_wifi_get_security_type()
722  */
723 int tethering_wifi_set_security_type(tethering_h tethering, tethering_wifi_security_type_e type);
724
725 /**
726  * @internal
727  * @brief Gets the security type of Wi-Fi tethering.
728  * @since_tizen 2.3
729  * @privlevel platform
730  * @privilege http://tizen.org/privilege/tethering.admin
731  * @param[in]  tethering  The tethering handle
732  * @param[out]  type  The security type
733  * @return 0 on success, otherwise negative error value
734  * @retval  #TETHERING_ERROR_NONE  Successful
735  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
736  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
737  * @see  tethering_wifi_set_security_type()
738  */
739 int tethering_wifi_get_security_type(tethering_h tethering, tethering_wifi_security_type_e *type);
740
741 /**
742  * @internal
743  * @brief Sets the SSID (service set identifier).
744  * @details The SSID cannot exceed 32 bytes. If SSID is not set, device name is used as SSID.
745  * @since_tizen 2.3
746  * @privlevel platform
747  * @privilege http://tizen.org/privilege/tethering.admin
748  * @remarks This change is applied next time Wi-Fi tethering is enabled with same @a tethering handle.
749  * @param[in]  tethering  The tethering handle
750  * @param[in]  ssid  The SSID
751  * @return 0 on success, otherwise negative error value
752  * @retval  #TETHERING_ERROR_NONE  Successful
753  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
754  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
755  */
756 int tethering_wifi_set_ssid(tethering_h tethering, const char *ssid);
757
758 /**
759  * @internal
760  * @brief Gets the SSID (service set identifier).
761  * @since_tizen 2.3
762  * @privlevel platform
763  * @privilege http://tizen.org/privilege/tethering.admin
764  * @remarks @a ssid must be released using free().
765  * @param[in]  tethering  The tethering handle
766  * @param[out]  ssid  The SSID
767  * @return 0 on success, otherwise negative error value
768  * @retval  #TETHERING_ERROR_NONE  Successful
769  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
770  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
771  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
772  */
773 int tethering_wifi_get_ssid(tethering_h tethering, char **ssid);
774
775 /**
776  * @internal
777  * @brief Sets the visibility of SSID (service set identifier).
778  * @details If the visibility is set to invisible, then the SSID of this device is hidden and Wi-Fi scan will not find the device.
779  * @since_tizen 2.3
780  * @privlevel platform
781  * @privilege http://tizen.org/privilege/tethering.admin
782  * @remarks This change is applied next time Wi-Fi tethering is enabled.
783  * @param[in]  tethering  The tethering handle
784  * @param[in]  visible  The visibility of SSID: (@c true = visible, @c false = invisible)
785  * @return 0 on success, otherwise negative error value
786  * @retval  #TETHERING_ERROR_NONE  Successful
787  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
788  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
789  * @see  tethering_wifi_get_ssid_visibility()
790  */
791 int tethering_wifi_set_ssid_visibility(tethering_h tethering, bool visible);
792
793 /**
794  * @internal
795  * @brief Gets the visibility of SSID (service set identifier).
796  * @details If the visibility is set to invisible, then the SSID of this device is hidden and Wi-Fi scan will not find the device.
797  * @since_tizen 2.3
798  * @privlevel platform
799  * @privilege http://tizen.org/privilege/tethering.admin
800  * @param[in]  tethering  The tethering handle
801  * @param[out]  visible  The visibility of SSID: (@c true = visible, @c false = invisible)
802  * @return 0 on success, otherwise negative error value
803  * @retval  #TETHERING_ERROR_NONE  Successful
804  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
805  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
806  * @see  tethering_wifi_set_ssid_visibility()
807  */
808 int tethering_wifi_get_ssid_visibility(tethering_h tethering, bool *visible);
809
810 /**
811  * @internal
812  * @brief Sets the passphrase.
813  * @since_tizen 2.3
814  * @privlevel platform
815  * @privilege http://tizen.org/privilege/tethering.admin
816  * @remarks This change is applied next time Wi-Fi tethering is enabled.
817  * @param[in]  tethering  The tethering handle
818  * @param[in]  passphrase  The passphrase
819  * @return 0 on success, otherwise negative error value
820  * @retval  #TETHERING_ERROR_NONE  Successful
821  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
822  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
823  * @see  tethering_wifi_get_passphrase()
824  */
825 int tethering_wifi_set_passphrase(tethering_h tethering, const char *passphrase);
826
827 /**
828  * @internal
829  * @brief Gets the passphrase.
830  * @since_tizen 2.3
831  * @privlevel platform
832  * @privilege http://tizen.org/privilege/tethering.admin
833  * @remarks @a passphrase must be released using free().
834  * @param[in]  tethering  The tethering handle
835  * @param[out]  passphrase  The passphrase
836  * @return 0 on success, otherwise negative error value
837  * @retval  #TETHERING_ERROR_NONE  Successful
838  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
839  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
840  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
841  * @see  tethering_wifi_set_passphrase()
842  */
843 int tethering_wifi_get_passphrase(tethering_h tethering, char **passphrase);
844
845 /**
846  * @internal
847  * @brief Reloads the settings (SSID / Passphrase / Security type / SSID visibility).
848  * @since_tizen 2.3
849  * @privlevel platform
850  * @privilege http://tizen.org/privilege/tethering.admin
851  * @remarks Connected devices via Wi-Fi tethering or MobileAP will be disconnected when the settings are reloaded.
852  * @param[in]  tethering  The tethering handle
853  * @param[in]  callback  The callback function to invoke
854  * @param[in]  user_data  The user data to be passed to the callback function
855  * @return 0 on success, otherwise negative error value
856  * @retval  #TETHERING_ERROR_NONE  Successful
857  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
858  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
859  */
860 int tethering_wifi_reload_settings(tethering_h tethering, tethering_wifi_settings_reloaded_cb callback, void *user_data);
861
862 /**
863  * @internal
864  * @brief Sets the security type of Wi-Fi AP.
865  * @details If security type is not set, WPA2_PSK is used.
866  * @since_tizen 2.3
867  * @privlevel platform
868  * @privilege http://tizen.org/privilege/tethering.admin
869  * @param[in]  tethering  The tethering handle
870  * @param[in]  type  The security type
871  * @return 0 on success, otherwise negative error value
872  * @retval  #TETHERING_ERROR_NONE  Successful
873  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
874  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
875  * @see  tethering_wifi_ap_get_security_type()
876  */
877 int tethering_wifi_ap_set_security_type(tethering_h tethering, tethering_wifi_security_type_e type);
878
879 /**
880  * @internal
881  * @brief Gets the security type of Wi-Fi AP.
882  * @details If security type is not set, WPA2_PSK is used.
883  * @since_tizen 2.3
884  * @privlevel platform
885  * @privilege http://tizen.org/privilege/tethering.admin
886  * @param[in]  tethering  The tethering handle
887  * @param[out]  type  The security type
888  * @return 0 on success, otherwise negative error value
889  * @retval  #TETHERING_ERROR_NONE  Successful
890  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
891  * @see  tethering_wifi_ap_set_security_type()
892  */
893 int tethering_wifi_ap_get_security_type(tethering_h tethering, tethering_wifi_security_type_e *type);
894
895 /**
896  * @internal
897  * @brief Sets the SSID (service set identifier) for Wi-Fi AP.
898  * @details The SSID cannot exceed 32 bytes. If SSID is not set, device name is used as SSID.
899  * @since_tizen 2.3
900  * @privlevel platform
901  * @privilege http://tizen.org/privilege/tethering.admin
902  * @param[in]  tethering  The tethering handle
903  * @param[in]  ssid  The SSID
904  * @return 0 on success, otherwise negative error value
905  * @retval  #TETHERING_ERROR_NONE  Successful
906  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
907  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
908  */
909 int tethering_wifi_ap_set_ssid(tethering_h tethering, const char *ssid);
910
911 /**
912  * @internal
913  * @brief Gets the SSID (service set identifier) for Wi-Fi AP.
914  * @details If SSID is not set, Device name is used as SSID.
915  * @since_tizen 2.3
916  * @privlevel platform
917  * @privilege http://tizen.org/privilege/tethering.admin
918  * @remarks @a ssid must be released using free().
919  * @param[in]  tethering  The tethering handle
920  * @param[out]  ssid  The SSID
921  * @return 0 on success, otherwise negative error value
922  * @retval  #TETHERING_ERROR_NONE  Successful
923  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
924  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
925  */
926 int tethering_wifi_ap_get_ssid(tethering_h tethering, char **ssid);
927
928 /**
929  * @internal
930  * @brief Sets the visibility of SSID (service set identifier) for Wi-Fi AP.
931  * @details If you set the visibility to invisible, then the SSID of this device is hidden and Wi-Fi scan won't find your device.
932  * @details By default visibility is set to @c true.
933  * @since_tizen 2.3
934  * @privlevel platform
935  * @privilege http://tizen.org/privilege/tethering.admin
936  * @remarks This change is applied next time Wi-Fi tethering is enabled.
937  * @param[in]  tethering  The tethering handle
938  * @param[in]  visible  The visibility of SSID: (@c true = visible, @c false = invisible)
939  * @return 0 on success, otherwise negative error value
940  * @retval  #TETHERING_ERROR_NONE  Successful
941  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
942  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
943  * @see  tethering_wifi_ap_get_ssid_visibility()
944  */
945 int tethering_wifi_ap_set_ssid_visibility(tethering_h tethering, bool visible);
946
947 /**
948  * @internal
949  * @brief Gets the visibility of SSID (service set identifier) for Wi-Fi AP.
950  * @details If the visibility is set to invisible, then the SSID of this device is hidden and Wi-Fi scan won't find your device.
951  * @details By default visibility is set to @c true.
952  * @since_tizen 2.3
953  * @privlevel platform
954  * @privilege http://tizen.org/privilege/tethering.admin
955  * @param[in]  tethering  The tethering handle
956  * @param[out]  visible  The visibility of SSID: (@c true = visible, @c false = invisible)
957  * @return 0 on success, otherwise negative error value
958  * @retval  #TETHERING_ERROR_NONE  Successful
959  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
960  * @see  tethering_wifi_ap_set_ssid_visibility()
961  */
962 int tethering_wifi_ap_get_ssid_visibility(tethering_h tethering, bool *visible);
963
964 /**
965  * @internal
966  * @brief Sets the passphrase for Wi-Fi AP.
967  * @details If the passphrase is not set, random string of 8 characters will be used.
968  * @since_tizen 2.3
969  * @privlevel platform
970  * @privilege http://tizen.org/privilege/tethering.admin
971  * @param[in]  tethering  The tethering handle
972  * @param[in]  passphrase  The passphrase
973  * @return 0 on success, otherwise negative error value
974  * @retval  #TETHERING_ERROR_NONE  Successful
975  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
976  * @see  tethering_wifi_ap_get_passphrase()
977  */
978 int tethering_wifi_ap_set_passphrase(tethering_h tethering, const char *passphrase);
979
980 /**
981  * @internal
982  * @brief Gets the passphrase for Wi-Fi AP.
983  * @details If the passphrase is not set, random string of 8 characters will be used.
984  * @since_tizen 2.3
985  * @privlevel platform
986  * @privilege http://tizen.org/privilege/tethering.admin
987  * @remarks @a passphrase must be released using free().
988  * @param[in]  tethering  The tethering handle
989  * @param[out]  passphrase  The passphrase
990  * @return 0 on success, otherwise negative error value
991  * @retval  #TETHERING_ERROR_NONE  Successful
992  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
993  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
994  * @see  tethering_wifi_ap_set_passphrase()
995  */
996 int tethering_wifi_ap_get_passphrase(tethering_h tethering, char **passphrase);
997
998 /**
999  * @internal
1000  * @brief Reloads the settings (SSID / Passphrase / Security type / SSID visibility) for Wi-Fi AP.
1001  * @since_tizen 2.3
1002  * @privlevel platform
1003  * @privilege http://tizen.org/privilege/tethering.admin
1004  * @remarks Devices connected via MobileAP will be disconnected when the settings are reloaded.
1005  * @param[in]  tethering  The tethering handle
1006  * @param[in]  callback  The callback function to invoke
1007  * @param[in]  user_data  The user data to be passed to the callback function
1008  * @return 0 on success, otherwise negative error value
1009  * @retval  #TETHERING_ERROR_NONE  Successful
1010  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1011  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
1012  */
1013 int tethering_wifi_ap_reload_settings(tethering_h tethering, tethering_wifi_ap_settings_reloaded_cb callback, void *user_data);
1014
1015 /**
1016  * @}
1017  */
1018
1019
1020 /**
1021  * @internal
1022  * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
1023  * @{
1024  */
1025
1026 /**
1027  * @internal
1028  * @brief Clones the handle of a client.
1029  * @since_tizen 2.3
1030  * @privlevel platform
1031  * @privilege http://tizen.org/privilege/tethering.admin
1032  * @remarks @a dest must be release using tethering_client_destroy().
1033  * @param[out]  dest  The cloned client handle
1034  * @param[in]  origin  The origin client handle
1035  * @return  0 on success, otherwise a negative error value
1036  * @retval  #TETHERING_ERROR_NONE  Successful
1037  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1038  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
1039  * @see  tethering_client_destroy()
1040  */
1041 int tethering_client_clone(tethering_client_h *dest, tethering_client_h origin);
1042
1043 /**
1044  * @internal
1045  * @brief Destroys the handle of a client.
1046  * @since_tizen 2.3
1047  * @privlevel platform
1048  * @privilege http://tizen.org/privilege/tethering.admin
1049  * @param[in]  client  The client handle
1050  * @return  0 on success, otherwise a negative error value
1051  * @retval  #TETHERING_ERROR_NONE  Successful
1052  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1053  * @see  tethering_client_clone()
1054  */
1055 int tethering_client_destroy(tethering_client_h client);
1056
1057 /**
1058  * @internal
1059  * @brief  Gets the tethering type of client.
1060  * @since_tizen 2.3
1061  * @privlevel platform
1062  * @privilege http://tizen.org/privilege/tethering.admin
1063  * @param[in]  client  The handle of client
1064  * @param[out]  type  The type of tethering
1065  * @return  0 on success, otherwise a negative error value.
1066  * @retval  #TETHERING_ERROR_NONE  Successful
1067  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1068  * @see  tethering_usb_get_connected_client()
1069  * @see  tethering_connection_state_changed_cb()
1070  */
1071 int tethering_client_get_tethering_type(tethering_client_h client, tethering_type_e *type);
1072
1073 /**
1074  * @internal
1075  * @brief Gets the name of a client.
1076  * @since_tizen 2.3
1077  * @privlevel platform
1078  * @privilege http://tizen.org/privilege/tethering.admin
1079  * @remarks @a name must be released using free().
1080  * @param[in]  client  The client handle
1081  * @param[out]  name  The name of the client
1082  * @return  0 on success, otherwise a negative error value
1083  * @retval  #TETHERING_ERROR_NONE  Successful
1084  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1085  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
1086  * @see  tethering_usb_get_connected_client()
1087  * @see  tethering_connection_state_changed_cb()
1088  */
1089 int tethering_client_get_name(tethering_client_h client, char **name);
1090
1091 /**
1092  * @internal
1093  * @brief Gets the IP address of a client.
1094  * @since_tizen 2.3
1095  * @privlevel platform
1096  * @privilege http://tizen.org/privilege/tethering.admin
1097  * @remarks @a ip_address must be released using free().
1098  * @param[in]  client  The client handle
1099  * @param[in]  address_family  The address family of IP address. Currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported
1100  * @param[out]  ip_address  The IP address
1101  * @return  0 on success, otherwise a negative error value
1102  * @retval  #TETHERING_ERROR_NONE  Successful
1103  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1104  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
1105  * @see  tethering_usb_get_connected_client()
1106  * @see  tethering_connection_state_changed_cb()
1107  */
1108 int tethering_client_get_ip_address(tethering_client_h client, tethering_address_family_e address_family, char **ip_address);
1109
1110 /**
1111  * @internal
1112  * @brief Gets the MAC address of a client such as "FC:A1:3E:D6:B1:B1".
1113  * @since_tizen 2.3
1114  * @privlevel platform
1115  * @privilege http://tizen.org/privilege/tethering.admin
1116  * @remarks @a mac_address must be released using free().
1117  * @param[in]  client  The client handle
1118  * @param[out]  mac_address  The MAC address
1119  * @return  0 on success, otherwise a negative error value
1120  * @retval  #TETHERING_ERROR_NONE  Successful
1121  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1122  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
1123  * @see  tethering_usb_get_connected_client()
1124  * @see  tethering_connection_state_changed_cb()
1125  */
1126 int tethering_client_get_mac_address(tethering_client_h client, char **mac_address);
1127
1128 /**
1129  * @internal
1130  * @brief Gets the connection time of a client.
1131  * @since_tizen 2.3
1132  * @privlevel platform
1133  * @privilege http://tizen.org/privilege/tethering.admin
1134  * @param[in] client The client handle
1135  * @param[out]  time  The connected time of the client
1136  * @return  0 on success, otherwise a negative error value
1137  * @retval  #TETHERING_ERROR_NONE  Successful
1138  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1139  * @see  tethering_usb_get_connected_client()
1140  * @see  tethering_connection_state_changed_cb()
1141  */
1142 int tethering_client_get_time(tethering_client_h client, time_t *timestamp);
1143
1144 /**
1145  * @}
1146  */
1147
1148
1149 #ifdef __cplusplus
1150  }
1151 #endif
1152
1153 #endif /* __TIZEN_NETWORK_TETHERING_H__ */
1154
1155