Added support to get wifi-sharing client information.
[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  * @addtogroup CAPI_NETWORK_TETHERING_MANAGER_MODULE
33  * @{
34  */
35
36 /**
37  * @brief The tethering handle.
38  * @since_tizen 2.3
39  */
40 typedef void * tethering_h;
41
42 /**
43  * @brief Enumeration for the tethering.
44  * @since_tizen 2.3
45  */
46 typedef enum {
47     TETHERING_ERROR_NONE = TIZEN_ERROR_NONE,  /**< Successful */
48     TETHERING_ERROR_NOT_PERMITTED = TIZEN_ERROR_NOT_PERMITTED,  /**< Operation not permitted */
49     TETHERING_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,  /**< Invalid parameter */
50     TETHERING_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,  /**< Out of memory */
51     TETHERING_ERROR_RESOURCE_BUSY = TIZEN_ERROR_RESOURCE_BUSY,  /**< Resource busy */
52     TETHERING_ERROR_NOT_ENABLED = TIZEN_ERROR_TETHERING | 0x0501,  /**< Not enabled */
53     TETHERING_ERROR_OPERATION_FAILED = TIZEN_ERROR_TETHERING | 0x0502,  /**< Operation failed */
54     TETHERING_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid operation */
55     TETHERING_ERROR_NOT_SUPPORT_API = TIZEN_ERROR_NOT_SUPPORTED, /**< API is not supported */
56     TETHERING_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED,  /**< Permission denied */
57 } tethering_error_e;
58
59 /**
60  * @brief Enumeration for the type of tethering.
61  * @since_tizen 2.3
62  */
63 typedef enum {
64     TETHERING_TYPE_ALL = 0,  /**< All type */
65     TETHERING_TYPE_USB,  /**< USB type */
66     TETHERING_TYPE_WIFI,  /**< Wi-Fi type */
67     TETHERING_TYPE_BT,  /**< BT type */
68     TETHERING_TYPE_P2P,  /**< P2P type */
69     TETHERING_TYPE_WIFI_SHARING,  /**< Wi-Fi Sharing */
70     TETHERING_TYPE_MAX,  /**< Maximum */
71 } tethering_type_e;
72
73 /**
74  * @brief Enumeration for the cause of disabling the tethering.
75  * @since_tizen 2.3
76  */
77 typedef enum {
78     TETHERING_DISABLED_BY_USB_DISCONNECTION = 0,  /**< Disabled due to usb disconnection */
79     TETHERING_DISABLED_BY_FLIGHT_MODE,  /**< Disabled due to flight mode */
80     TETHERING_DISABLED_BY_LOW_BATTERY,  /**< Disabled due to low battery */
81     TETHERING_DISABLED_BY_NETWORK_CLOSE,  /**< Disabled due to pdp network close */
82     TETHERING_DISABLED_BY_TIMEOUT,  /**< Disabled due to timeout */
83     TETHERING_DISABLED_BY_OTHERS,  /**< Disabled by other apps */
84     TETHERING_DISABLED_BY_REQUEST,  /**< Disabled by your request */
85     TETHERING_DISABLED_BY_WIFI_ON,  /**< Disabled due to Wi-Fi on */
86     TETHERING_DISABLED_BY_BT_OFF,  /**< Disabled due to Bluetooth off */
87 } tethering_disabled_cause_e;
88
89 /**
90  * @}
91  */
92
93
94 /**
95  * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
96  * @{
97  */
98
99 /**
100  * @brief Enumeration for the Wi-Fi security.
101  * @since_tizen 2.3
102  */
103 typedef enum {
104     TETHERING_WIFI_SECURITY_TYPE_NONE = 0,  /**< No Security type */
105     TETHERING_WIFI_SECURITY_TYPE_WPA2_PSK,  /**< WPA2_PSK */
106         TETHERING_WIFI_SECURITY_TYPE_WPS,  /**< WPA2_PSK */
107         TETHERING_WIFI_SECURITY_TYPE_SAE,  /**< SAE */
108 } tethering_wifi_security_type_e;
109
110 /**
111   * @brief Enumeration for the Wi-Fi mode
112   * @since_tizen 3.0
113   */
114 typedef enum {
115         TETHERING_WIFI_MODE_TYPE_B = 0,  /**< mode b */
116         TETHERING_WIFI_MODE_TYPE_G,  /**< mode g */
117         TETHERING_WIFI_MODE_TYPE_A,  /**< mode a */
118         TETHERING_WIFI_MODE_TYPE_AD, /**< mode ad */
119 } tethering_wifi_mode_type_e;
120
121 typedef enum {
122         TETHERING_TYPE_IPSEC_PASSTHROUGH = 0,  /**< IPSEC */
123         TETHERING_TYPE_PPTP_PASSTHROUGH,  /**< PPTP type */
124         TETHERING_TYPE_L2TP_PASSTHROUGH,  /**< L2TP type */
125 } tethering_vpn_passthrough_type_e;
126
127 /**
128  * @}
129  */
130
131
132 /**
133  * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
134  * @{
135  */
136
137 /**
138  * @brief The tethering client handle.
139  * @since_tizen 2.3
140  */
141 typedef void * tethering_client_h;
142
143 /**
144  * @brief Enumeration for address family.
145  * @since_tizen 2.3
146  */
147 typedef enum {
148     TETHERING_ADDRESS_FAMILY_IPV4 = 0,  /**< IPV4 Address type */
149     TETHERING_ADDRESS_FAMILY_IPV6 = 1,  /**< IPV6 Address type (Since 4.0) */
150 } tethering_address_family_e;
151
152 /**
153  * @}
154  */
155
156
157 /**
158  * @addtogroup CAPI_NETWORK_TETHERING_MANAGER_MODULE
159  * @{
160  */
161
162 /**
163  * @brief Called when the tethering is enabled.
164  * @since_tizen 2.3
165  * @param[in]  result  The result of enabling the tethering
166  * @param[in]  type  The tethering type
167  * @param[in]  is_requested  Indicates whether this change is requested
168  * @param[in]  user_data  The user data passed from tethering_set_enabled_cb()
169  * @pre  If you register callback function using tethering_set_enabled_cb(), this will be invoked when the tethering is enabled.
170  * @see tethering_enable()
171  * @see tethering_unset_enabled_cb()
172  */
173 typedef void (*tethering_enabled_cb)(tethering_error_e result, tethering_type_e type, bool is_requested, void *user_data);
174
175 /**
176  * @brief Called when the tethering is disabled.
177  * @since_tizen 2.3
178  * @param[in]  result  The result of disabling the tethering
179  * @param[in]  type  The tethering type
180  * @param[in]  cause  The cause of disabling
181  * @param[in]  user_data  The user data passed from tethering_set_disabled_cb()
182  * @pre  If you register callback function using tethering_set_disabled_cb(), this will be invoked when the tethering is disabled.
183  * @see tethering_set_disabled_cb()
184  * @see tethering_unset_disabled_cb()
185  */
186 typedef void (*tethering_disabled_cb)(tethering_error_e result, tethering_type_e type, tethering_disabled_cause_e cause, void *user_data);
187
188 /**
189  * @brief Called when the connection state is changed.
190  * @since_tizen 2.3
191  * @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().
192  * @param[in]  client  The client of which connection state is changed
193  * @param[in]  opened  @c true when connection is opened, otherwise false
194  * @param[in]  user_data  The user data passed from tethering_set_connection_state_changed_cb()
195  * @pre  If you register callback function using tethering_set_connection_state_changed_cb(), this will be invoked when the connection state is changed.
196  * @see tethering_set_connection_state_changed_cb()
197  * @see tethering_unset_connection_state_changed_cb()
198  */
199 typedef void (*tethering_connection_state_changed_cb)(tethering_client_h client, bool opened, void *user_data);
200
201 /**
202  * @brief Called when you get the connected client repeatedly.
203  * @since_tizen 2.3
204  * @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().
205  * @param[in]  client  The connected client
206  * @param[in]  user_data  The user data passed from the request function
207  * @return  @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
208  * @pre  tethering_foreach_connected_clients() will invoke this callback.
209  * @see  tethering_foreach_connected_clients()
210  */
211 typedef bool(*tethering_connected_client_cb)(tethering_client_h client, void *user_data);
212
213 /**
214  * @brief Called when you get the data usage.
215  * @since_tizen 2.3
216  * @param[in]  result  The result of getting the data usage
217  * @param[in]  received_data  The usage of received data
218  * @param[in]  sent_data  The usage of sent data
219  * @param[in]  user_data  The user data passed from the request function
220  * @pre  tethering_get_data_usage() will invoked this callback.
221  */
222 typedef void (*tethering_data_usage_cb)(tethering_error_e result, unsigned long long received_data, unsigned long long sent_data, void *user_data);
223
224 /**
225  * @brief Called when the security type of Wi-Fi tethering is changed.
226  * @since_tizen 2.3
227  * @param[in]  changed_type  The changed security type of Wi-Fi tethering
228  * @param[in]  user_data  The user data passed from the register function
229  * @see tethering_wifi_set_security_type_changed_cb()
230  * @see tethering_wifi_unset_security_type_changed_cb()
231  */
232 typedef void (*tethering_wifi_security_type_changed_cb)(tethering_wifi_security_type_e changed_type, void *user_data);
233
234 /**
235  * @brief Called when the visibility of SSID is changed.
236  * @since_tizen 2.3
237  * @param[in]  changed_visible  The changed visibility of SSID
238  * @param[in]  user_data  The user data passed from the register function
239  * @see tethering_wifi_set_ssid_visibility_changed_cb()
240  * @see tethering_wifi_unset_ssid_visibility_changed_cb()
241  */
242 typedef void (*tethering_wifi_ssid_visibility_changed_cb)(bool changed_visible, void *user_data);
243
244 /**
245  * @brief Called when the passphrase of Wi-Fi tethering is changed.
246  * @since_tizen 2.3
247  * @param[in]  user_data  The user data passed from the register function
248  * @see tethering_wifi_set_passphrase_changed_cb()
249  * @see tethering_wifi_unset_passphrase_changed_cb()
250  */
251 typedef void (*tethering_wifi_passphrase_changed_cb)(void *user_data);
252
253 /**
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  * @brief Creates the handle for tethering.
264  * @since_tizen 2.3
265  * @privlevel platform
266  * @privilege %http://tizen.org/privilege/tethering.admin
267  * @remarks The @a tethering must be released using tethering_destroy().
268  * @param[out]  tethering  A handle of a new mobile ap handle on success
269  * @return  0 on success, otherwise a negative error value
270  * @retval  #TETHERING_ERROR_NONE  Successful
271  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
272  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
273  * @retval  #TETHERING_ERROR_NOT_SUPPORT_API  API is not supported
274  * @see  tethering_destroy()
275  */
276 int tethering_create(tethering_h *tethering);
277
278 /**
279  * @brief Destroys the handle for tethering.
280  * @since_tizen 2.3
281  * @privlevel platform
282  * @privilege %http://tizen.org/privilege/tethering.admin
283  * @param[in]  tethering  The tethering handle
284  * @return  0 on success, otherwise a negative error value
285  * @retval  #TETHERING_ERROR_NONE  Successful
286  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
287  * @see  tethering_create()
288  */
289 int tethering_destroy(tethering_h tethering);
290
291 /**
292  * @brief Enables the tethering, asynchronously.
293  * @since_tizen 2.3
294  * @privlevel platform
295  * @privilege %http://tizen.org/privilege/tethering.admin
296  * @param[in]  tethering  The tethering handle
297  * @param[in]  type  The tethering type
298  * @return 0 on success, otherwise negative error value
299  * @retval  #TETHERING_ERROR_NONE  Successful
300  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
301  * @post tethering_enabled_cb() will be invoked.
302  * @see  tethering_is_enabled()
303  * @see  tethering_disable()
304  */
305 int tethering_enable(tethering_h tethering, tethering_type_e type);
306
307 /**
308  * @brief Disables the tethering, asynchronously.
309  * @since_tizen 2.3
310  * @privlevel platform
311  * @privilege %http://tizen.org/privilege/tethering.admin
312  * @param[in]  tethering  The tethering handle
313  * @param[in]  type  The tethering type
314  * @return 0 on success, otherwise negative error value
315  * @retval  #TETHERING_ERROR_NONE  Successful
316  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
317  * @post tethering_disabled_cb() will be invoked.
318  * @see  tethering_is_enabled()
319  * @see  tethering_enable()
320  */
321 int tethering_disable(tethering_h tethering, tethering_type_e type);
322
323 /**
324  * @brief Enables the IPv6 tethering, asynchronously.
325  * @since_tizen 4.0
326  * @privlevel platform
327  * @privilege %http://tizen.org/privilege/tethering.admin
328  * @remarks It supports Wi-Fi tethering and BT tethering only.
329  * @param[in] tethering  The tethering handle
330  * @param[in] type       The tethering type
331  * @return 0 on success, otherwise negative error value
332  * @retval #TETHERING_ERROR_NONE               Successful
333  * @retval #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
334  * @post tethering_enabled_cb() will be invoked.
335  * @see  tethering_is_enabled()
336  * @see  tethering_ipv6_disable()
337  */
338 int tethering_ipv6_enable(tethering_h tethering, tethering_type_e type);
339
340 /**
341  * @brief Disables the IPv6 tethering, asynchronously.
342  * @since_tizen 4.0
343  * @privlevel platform
344  * @privilege %http://tizen.org/privilege/tethering.admin
345  * @remarks It supports Wi-Fi tethering and BT tethering only.
346  * @param[in] tethering  The tethering handle
347  * @param[in] type       The tethering type
348  * @return 0 on success, otherwise negative error value
349  * @retval #TETHERING_ERROR_NONE               Successful
350  * @retval #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
351  * @post tethering_disabled_cb() will be invoked.
352  * @see  tethering_is_enabled()
353  * @see  tethering_ipv6_enable()
354  */
355 int tethering_ipv6_disable(tethering_h tethering, tethering_type_e type);
356
357 /**
358  * @brief Checks whether the tethering is enabled or not.
359  * @since_tizen 2.3
360  * @privlevel platform
361  * @privilege %http://tizen.org/privilege/tethering.admin
362  * @param[in]  tethering  The tethering handle
363  * @param[in]  type  The tethering type
364  * @return  @c true if tethering is enabled, \n @c false if tethering is disabled
365  */
366 bool tethering_is_enabled(tethering_h tethering, tethering_type_e type);
367
368 /**
369  * @brief Gets the MAC address of local device as "FC:A1:3E:D6:B1:B1".
370  * @since_tizen 2.3
371  * @privlevel platform
372  * @privilege %http://tizen.org/privilege/tethering.admin
373  * @remarks @a mac_address must be released using free().
374  * @param[in]  tethering  The tethering handle
375  * @param[in]  type  The tethering type
376  * @param[out]  mac_address  The MAC address
377  * @return  0 on success, otherwise a negative error value
378  * @retval  #TETHERING_ERROR_NONE  Successful
379  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
380  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
381  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
382  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
383  * @pre  The tethering must be enabled.
384  * @see  tethering_is_enabled()
385  * @see  tethering_enable()
386  */
387 int tethering_get_mac_address(tethering_h tethering, tethering_type_e type, char **mac_address);
388
389 /**
390  * @brief Gets the name of network interface (e.g. usb0).
391  * @since_tizen 2.3
392  * @privlevel platform
393  * @privilege %http://tizen.org/privilege/tethering.admin
394  * @remarks @a interface_name must be released using free().
395  * @param[in]  tethering  The tethering handle
396  * @param[in]  type  The tethering type
397  * @param[out]  interface_name  The name of the network interface
398  * @return 0 on success, otherwise negative error value
399  * @retval  #TETHERING_ERROR_NONE  Successful
400  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
401  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
402  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
403  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
404  * @pre  The tethering must be enabled.
405  * @see  tethering_is_enabled()
406  * @see  tethering_enable()
407  */
408 int tethering_get_network_interface_name(tethering_h tethering, tethering_type_e type, char **interface_name);
409
410 /**
411  * @brief Gets the local IP address.
412  * @since_tizen 2.3
413  * @privlevel platform
414  * @privilege %http://tizen.org/privilege/tethering.admin
415  * @remarks @a ip_address must be released using free().
416  * @param[in]  tethering  The tethering handle
417  * @param[in]  type  The tethering type
418  * @param[in]  address_family  The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
419  * @param[out]  ip_address  The local IP address
420  * @return 0 on success, otherwise negative error value
421  * @retval  #TETHERING_ERROR_NONE  Successful
422  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
423  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
424  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
425  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
426  * @pre  The tethering must be enabled.
427  * @see  tethering_is_enabled()
428  * @see  tethering_enable()
429  */
430 int tethering_get_ip_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **ip_address);
431
432 /**
433  * @brief Gets the Gateway address.
434  * @since_tizen 2.3
435  * @privlevel platform
436  * @privilege %http://tizen.org/privilege/tethering.admin
437  * @remarks @a gateway_address must be released using free().
438  * @param[in]  tethering  The tethering handle
439  * @param[in]  type  The tethering type
440  * @param[in]  address_family  The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
441  * @param[out]  gateway_address  The local IP address
442  * @return 0 on success, otherwise negative error value
443  * @retval  #TETHERING_ERROR_NONE  Successful
444  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
445  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
446  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
447  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
448  * @pre  The tethering must be enabled.
449  * @see  tethering_is_enabled()
450  * @see  tethering_enable()
451  */
452 int tethering_get_gateway_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **gateway_address);
453
454 /**
455  * @brief Gets the Subnet Mask.
456  * @since_tizen 2.3
457  * @privlevel platform
458  * @privilege %http://tizen.org/privilege/tethering.admin
459  * @remarks @a subnet_mask must be released using free().
460  * @param[in]  tethering  The tethering handle
461  * @param[in]  type  The tethering type
462  * @param[in]  address_family  The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
463  * @param[out]  subnet_mask  The local IP address
464  * @return 0 on success, otherwise negative error value
465  * @retval  #TETHERING_ERROR_NONE  Successful
466  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
467  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
468  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
469  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
470  * @pre  The tethering must be enabled.
471  * @see  tethering_is_enabled()
472  * @see  tethering_enable()
473  */
474 int tethering_get_subnet_mask(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **subnet_mask);
475
476 /**
477  * @brief Gets the data usage.
478  * @since_tizen 2.3
479  * @privlevel platform
480  * @privilege %http://tizen.org/privilege/tethering.admin
481  * @param[in]  tethering  The tethering handle
482  * @param[out]  usage  The data usage
483  * @return 0 on success, otherwise negative error value
484  * @retval  #TETHERING_ERROR_NONE  Successful
485  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
486  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
487  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
488  * @pre  The tethering must be enabled.
489  * @see  tethering_is_enabled()
490  * @see  tethering_enable()
491  */
492 int tethering_get_data_usage(tethering_h tethering, tethering_data_usage_cb callback, void *user_data);
493
494 /**
495  * @brief Gets the clients which are connected.
496  * @since_tizen 2.3
497  * @privlevel platform
498  * @privilege %http://tizen.org/privilege/tethering.admin
499  * @param[in]  tethering  The tethering handle
500  * @param[in]  type  The tethering type
501  * @param[in]  callback  The callback function to invoke
502  * @param[in]  user_data  The user data to be passed to the callback function
503  * @retval  #TETHERING_ERROR_NONE  Successful
504  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
505  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
506  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
507  * @pre  The tethering must be enabled.
508  * @see  tethering_is_enabled()
509  * @see  tethering_enable()
510  */
511 int tethering_foreach_connected_clients(tethering_h tethering, tethering_type_e type, tethering_connected_client_cb callback, void *user_data);
512
513 /**
514  * @brief Registers the callback function, which is called when tethering is enabled.
515  * @since_tizen 2.3
516  * @privlevel platform
517  * @privilege %http://tizen.org/privilege/tethering.admin
518  * @param[in]  tethering  The tethering handle
519  * @param[in]  type  The tethering type
520  * @param[in]  callback  The callback function to invoke
521  * @param[in]  user_data  The user data to be passed to the callback function
522  * @retval  #TETHERING_ERROR_NONE  Successful
523  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
524  * @see  tethering_unset_enabled_cb()
525  */
526 int tethering_set_enabled_cb(tethering_h tethering, tethering_type_e type, tethering_enabled_cb callback, void *user_data);
527
528 /**
529  * @brief Unregisters the callback function, which is called when tethering is enabled.
530  * @since_tizen 2.3
531  * @privlevel platform
532  * @privilege %http://tizen.org/privilege/tethering.admin
533  * @param[in]  tethering  The tethering handle
534  * @param[in]  type  The tethering type
535  * @retval  #TETHERING_ERROR_NONE  Successful
536  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
537  * @see  tethering_set_enabled_cb()
538  */
539 int tethering_unset_enabled_cb(tethering_h tethering, tethering_type_e type);
540
541 /**
542  * @brief Registers the callback function called when tethering is disabled.
543  * @since_tizen 2.3
544  * @privlevel platform
545  * @privilege %http://tizen.org/privilege/tethering.admin
546  * @param[in]  tethering  The tethering handle
547  * @param[in]  type  The tethering type
548  * @param[in]  callback  The callback function to invoke
549  * @param[in]  user_data  The user data to be passed to the callback function
550  * @retval  #TETHERING_ERROR_NONE  Successful
551  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
552  * @see  tethering_unset_disabled_cb()
553  */
554 int tethering_set_disabled_cb(tethering_h tethering, tethering_type_e type, tethering_disabled_cb callback, void *user_data);
555
556 /**
557  * @brief Unregisters the callback function, which is called when tethering is disabled.
558  * @since_tizen 2.3
559  * @privlevel platform
560  * @privilege %http://tizen.org/privilege/tethering.admin
561  * @param[in]  tethering  The tethering handle
562  * @param[in]  type  The tethering type
563  * @retval  #TETHERING_ERROR_NONE  Successful
564  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
565  * @see  tethering_set_disabled_cb()
566  */
567 int tethering_unset_disabled_cb(tethering_h tethering, tethering_type_e type);
568
569 /**
570  * @brief Registers the callback function, which is called when the state of connection is changed.
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  * @param[in]  callback  The callback function to invoke
577  * @param[in]  user_data  The user data to be passed to the callback function
578  * @retval  #TETHERING_ERROR_NONE  Successful
579  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
580  * @see  tethering_unset_connection_state_changed_cb_cb()
581  */
582 int tethering_set_connection_state_changed_cb(tethering_h tethering, tethering_type_e type, tethering_connection_state_changed_cb callback, void *user_data);
583
584 /**
585  * @brief Unregisters the callback function, which is called when the state of connection is changed.
586  * @since_tizen 2.3
587  * @privlevel platform
588  * @privilege %http://tizen.org/privilege/tethering.admin
589  * @param[in]  tethering  The tethering handle
590  * @param[in]  type  The tethering type
591  * @retval  #TETHERING_ERROR_NONE  Successful
592  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
593  * @see  tethering_set_connection_state_changed_cb()
594  */
595 int tethering_unset_connection_state_changed_cb(tethering_h tethering, tethering_type_e type);
596
597 /**
598  * @brief Registers the callback function, which is called when the security type of Wi-Fi tethering is changed.
599  * @since_tizen 2.3
600  * @privlevel platform
601  * @privilege %http://tizen.org/privilege/tethering.admin
602  * @param[in]  tethering  The tethering handle
603  * @param[in]  callback  The callback function to invoke
604  * @param[in]  user_data  The user data to be passed to the callback function
605  * @retval  #TETHERING_ERROR_NONE  Successful
606  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
607  * @see  tethering_wifi_unset_security_type_changed_cb()
608  */
609 int tethering_wifi_set_security_type_changed_cb(tethering_h tethering, tethering_wifi_security_type_changed_cb callback, void *user_data);
610
611 /**
612  * @brief Unregisters the callback function, which is called when the security type of Wi-Fi tethering is changed.
613  * @since_tizen 2.3
614  * @privlevel platform
615  * @privilege %http://tizen.org/privilege/tethering.admin
616  * @param[in]  tethering  The tethering handle
617  * @param[in]  type  The tethering type
618  * @retval  #TETHERING_ERROR_NONE  Successful
619  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
620  * @see  tethering_wifi_set_security_type_changed_cb()
621  */
622 int tethering_wifi_unset_security_type_changed_cb(tethering_h tethering);
623
624 /**
625  * @brief Registers the callback function , which iscalled when the visibility of SSID is changed.
626  * @since_tizen 2.3
627  * @privlevel platform
628  * @privilege %http://tizen.org/privilege/tethering.admin
629  * @param[in]  tethering  The tethering handle
630  * @param[in]  callback  The callback function to invoke
631  * @param[in]  user_data  The user data to be passed to the callback function
632  * @retval  #TETHERING_ERROR_NONE  Successful
633  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
634  * @see  tethering_wifi_unset_ssid_visibility_changed_cb_cb()
635  */
636 int tethering_wifi_set_ssid_visibility_changed_cb(tethering_h tethering, tethering_wifi_ssid_visibility_changed_cb callback, void *user_data);
637
638 /**
639  * @brief Unregisters the callback function, which is called when the visibility of SSID is changed.
640  * @since_tizen 2.3
641  * @privlevel platform
642  * @privilege %http://tizen.org/privilege/tethering.admin
643  * @param[in]  tethering  The tethering handle
644  * @retval  #TETHERING_ERROR_NONE  Successful
645  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
646  * @see  tethering_wifi_set_ssid_visibility_changed_cb()
647  */
648 int tethering_wifi_unset_ssid_visibility_changed_cb(tethering_h tethering);
649
650 /**
651  * @brief Registers the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
652  * @since_tizen 2.3
653  * @privlevel platform
654  * @privilege %http://tizen.org/privilege/tethering.admin
655  * @param[in]  tethering  The tethering handle
656  * @param[in]  callback  The callback function to invoke
657  * @param[in]  user_data  The user data to be passed to the callback function
658  * @retval  #TETHERING_ERROR_NONE  Successful
659  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
660  * @see  tethering_wifi_unset_passphrase_changed_cb()
661  */
662 int tethering_wifi_set_passphrase_changed_cb(tethering_h tethering, tethering_wifi_passphrase_changed_cb callback, void *user_data);
663
664 /**
665  * @brief Unregisters the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
666  * @since_tizen 2.3
667  * @privlevel platform
668  * @privilege %http://tizen.org/privilege/tethering.admin
669  * @param[in]  tethering  The tethering handle
670  * @retval  #TETHERING_ERROR_NONE  Successful
671  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
672  * @see  tethering_wifi_set_passphrase_changed_cb()
673  */
674 int tethering_wifi_unset_passphrase_changed_cb(tethering_h tethering);
675
676 /**
677  * @}
678  */
679
680
681 /**
682  * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
683  * @{
684  */
685
686 /**
687  * @brief Sets the security type of Wi-Fi tethering.
688  * @since_tizen 2.3
689  * @privlevel platform
690  * @privilege %http://tizen.org/privilege/tethering.admin
691  * @remarks This change is applied next time Wi-Fi tethering is enabled.
692  * @param[in]  tethering  The tethering handle
693  * @param[in]  type  The security type
694  * @return 0 on success, otherwise negative error value
695  * @retval  #TETHERING_ERROR_NONE  Successful
696  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
697  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
698  * @see  tethering_wifi_get_security_type()
699  */
700 int tethering_wifi_set_security_type(tethering_h tethering, tethering_wifi_security_type_e type);
701
702 /**
703  * @brief Gets the security type of Wi-Fi tethering.
704  * @since_tizen 2.3
705  * @privlevel platform
706  * @privilege %http://tizen.org/privilege/tethering.admin
707  * @param[in]  tethering  The tethering handle
708  * @param[out]  type  The security type
709  * @return 0 on success, otherwise negative error value
710  * @retval  #TETHERING_ERROR_NONE  Successful
711  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
712  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
713  * @see  tethering_wifi_set_security_type()
714  */
715 int tethering_wifi_get_security_type(tethering_h tethering, tethering_wifi_security_type_e *type);
716
717 /**
718  * @brief Sets the SSID (service set identifier).
719  * @details The SSID cannot exceed 32 bytes. If SSID is not set, device name is used as SSID.
720  * @since_tizen 2.3
721  * @privlevel platform
722  * @privilege %http://tizen.org/privilege/tethering.admin
723  * @remarks This change is applied next time Wi-Fi tethering is enabled with same @a tethering handle.
724  * @param[in]  tethering  The tethering handle
725  * @param[in]  ssid  The SSID
726  * @return 0 on success, otherwise negative error value
727  * @retval  #TETHERING_ERROR_NONE  Successful
728  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
729  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
730  */
731 int tethering_wifi_set_ssid(tethering_h tethering, const char *ssid);
732
733 /**
734  * @brief Gets the SSID (service set identifier).
735  * @since_tizen 2.3
736  * @privlevel platform
737  * @privilege %http://tizen.org/privilege/tethering.admin
738  * @remarks @a ssid must be released using free().
739  * @param[in]  tethering  The tethering handle
740  * @param[out]  ssid  The SSID
741  * @return 0 on success, otherwise negative error value
742  * @retval  #TETHERING_ERROR_NONE  Successful
743  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
744  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
745  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
746  */
747 int tethering_wifi_get_ssid(tethering_h tethering, char **ssid);
748
749 /**
750  * @brief Sets the visibility of SSID (service set identifier).
751  * @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.
752  * @since_tizen 2.3
753  * @privlevel platform
754  * @privilege %http://tizen.org/privilege/tethering.admin
755  * @remarks This change is applied next time Wi-Fi tethering is enabled.
756  * @param[in]  tethering  The tethering handle
757  * @param[in]  visible  The visibility of SSID: (@c true = visible, @c false = invisible)
758  * @return 0 on success, otherwise negative error value
759  * @retval  #TETHERING_ERROR_NONE  Successful
760  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
761  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
762  * @see  tethering_wifi_get_ssid_visibility()
763  */
764 int tethering_wifi_set_ssid_visibility(tethering_h tethering, bool visible);
765
766 /**
767  * @brief Gets the visibility of SSID (service set identifier).
768  * @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.
769  * @since_tizen 2.3
770  * @privlevel platform
771  * @privilege %http://tizen.org/privilege/tethering.admin
772  * @param[in]  tethering  The tethering handle
773  * @param[out]  visible  The visibility of SSID: (@c true = visible, @c false = invisible)
774  * @return 0 on success, otherwise negative error value
775  * @retval  #TETHERING_ERROR_NONE  Successful
776  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
777  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
778  * @see  tethering_wifi_set_ssid_visibility()
779  */
780 int tethering_wifi_get_ssid_visibility(tethering_h tethering, bool *visible);
781
782 /**
783  * @brief Sets the passphrase.
784  * @since_tizen 2.3
785  * @privlevel platform
786  * @privilege %http://tizen.org/privilege/tethering.admin
787  * @remarks This change is applied next time Wi-Fi tethering is enabled.
788  * @param[in]  tethering  The tethering handle
789  * @param[in]  passphrase  The passphrase
790  * @return 0 on success, otherwise negative error value
791  * @retval  #TETHERING_ERROR_NONE  Successful
792  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
793  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
794  * @see  tethering_wifi_get_passphrase()
795  */
796 int tethering_wifi_set_passphrase(tethering_h tethering, const char *passphrase);
797
798 /**
799  * @brief Gets the passphrase.
800  * @since_tizen 2.3
801  * @privlevel platform
802  * @privilege %http://tizen.org/privilege/tethering.admin
803  * @remarks @a passphrase must be released using free().
804  * @param[in]  tethering  The tethering handle
805  * @param[out]  passphrase  The passphrase
806  * @return 0 on success, otherwise negative error value
807  * @retval  #TETHERING_ERROR_NONE  Successful
808  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
809  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
810  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
811  * @see  tethering_wifi_set_passphrase()
812  */
813 int tethering_wifi_get_passphrase(tethering_h tethering, char **passphrase);
814
815 /**
816  * @brief Reloads the settings (SSID / Passphrase / Security type / SSID visibility).
817  * @since_tizen 2.3
818  * @privlevel platform
819  * @privilege %http://tizen.org/privilege/tethering.admin
820  * @remarks Connected devices via Wi-Fi tethering or MobileAP will be disconnected when the settings are reloaded.
821  * @param[in]  tethering  The tethering handle
822  * @param[in]  callback  The callback function to invoke
823  * @param[in]  user_data  The user data to be passed to the callback function
824  * @return 0 on success, otherwise negative error value
825  * @retval  #TETHERING_ERROR_NONE  Successful
826  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
827  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
828  */
829 int tethering_wifi_reload_settings(tethering_h tethering, tethering_wifi_settings_reloaded_cb callback, void *user_data);
830
831 /**
832  * @brief Gets the mac_filter for Wi-Fi Tethering.
833  * @details If you set the mac_filter to enable, then the device can be allowed/blocked based on mac-address.
834  * By default mac_filter is set to false.
835  * @since_tizen 3.0
836  * @privlevel platform
837  * @privilege %http://tizen.org/privilege/tethering.admin
838  * @param[in]  tethering  The handle of tethering
839  * @param[out]  mac_filter The mac filter: (@c true = enable, @c false = disable)
840  * @return 0 on success, otherwise negative error value.
841  * @retval  #TETHERING_ERROR_NONE  Successful
842  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
843  * @retval  #TETHERING_ERROR_NOT_SUPPORTED  API is not supported
844  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
845  * @see  tethering_mobileap_set_mac_filter()
846  */
847 int tethering_wifi_get_mac_filter(tethering_h tethering, bool *mac_filter);
848
849 /**
850  * @brief Sets the mac-filter for Wi-Fi Tethering.
851  * @details If you set the mac_filter to enable, then the device can be allowed/blocked based on mac-address.
852  * By default mac_filter is set to @c false.
853  * @since_tizen 3.0
854  * @privlevel platform
855  * @privilege %http://tizen.org/privilege/tethering.admin
856  * @remarks This change is applied next time Wi-Fi tethering is enabled.
857  * @param[in]  tethering  The tethering handle
858  * @param[in]  mac_filter  The mac filter: (@c true = enable, @c false = disable)
859  * @return 0 on success, otherwise negative error value
860  * @retval  #TETHERING_ERROR_NONE  Successful
861  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
862  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
863  * @retval  #TETHERING_ERROR_NOT_SUPPORTED  API is not supported
864  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
865  * @see  tethering_mobileap_get_mac_filter()
866  */
867 int tethering_wifi_set_mac_filter(tethering_h tethering, bool mac_filter);
868
869 /**
870  * @brief Adds the mac-address to the allowed client list.
871  * @details AP can allow the client by adding clients mac-address to the allowed list.
872  * @since_tizen 3.0
873  * @privlevel platform
874  * @privilege %http://tizen.org/privilege/tethering.admin
875  * @param[in]  tethering  The handle of tethering
876  * @param[in]  mac  The mac address
877  * @return 0 on success, otherwise negative error value.
878  * @retval  #TETHERING_ERROR_NONE  Successful
879  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
880  * @retval  #TETHERING_ERROR_NOT_SUPPORTED  API is not supported
881  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
882  * @see  tethering_mobileap_set_mac_filter()
883  */
884 int tethering_wifi_add_allowed_mac_list(tethering_h tethering, const char *mac);
885
886 /**
887  * @brief Removes the mac-address from the allowed client list.
888  * @details Removes the mac-address from the allowed client list.
889  * @since_tizen 3.0
890  * @privlevel platform
891  * @privilege %http://tizen.org/privilege/tethering.admin
892  * @param[in]  tethering  The handle of tethering
893  * @param[in]  mac  The mac address
894  * @return 0 on success, otherwise negative error value.
895  * @retval  #TETHERING_ERROR_NONE  Successful
896  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
897  * @retval  #TETHERING_ERROR_NOT_SUPPORTED  API is not supported
898  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
899  * @see  tethering_mobileap_set_mac_filter()
900  */
901 int tethering_wifi_remove_allowed_mac_list(tethering_h tethering, const char *mac);
902 /**
903  * @brief Gets the mac-addresses from the allowed client list.
904  * @details Gets the mac-addresses from the allowed client list.
905  * @since_tizen 3.0
906  * @privlevel platform
907  * @privilege %http://tizen.org/privilege/tethering.admin
908  * @param[in]  tethering  The handle of tethering
909  * @param[out]  allowed_mac_list  list of allowed mac addresses list
910  * @return 0 on success, otherwise negative error value.
911  * @retval  #TETHERING_ERROR_NONE  Successful
912  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
913  * @retval  #TETHERING_ERROR_NOT_SUPPORTED  API is not supported
914  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
915  * @see  tethering_mobileap_set_mac_filter()
916  */
917 int tethering_wifi_get_allowed_mac_list(tethering_h tethering, void **allowed_mac_list);
918
919 /**
920  * @brief Adds the mac-address to the blocked client list.
921  * @details AP can disallow the client by adding clients mac-address to the blocked list.
922  * @since_tizen 3.0
923  * @privlevel platform
924  * @privilege %http://tizen.org/privilege/tethering.admin
925  * @param[in]  tethering  The handle of tethering
926  * @param[in]  mac  The mac address
927  * @return 0 on success, otherwise negative error value.
928  * @retval  #TETHERING_ERROR_NONE  Successful
929  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
930  * @retval  #TETHERING_ERROR_NOT_SUPPORTED  API is not supported
931  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
932  * @see  tethering_mobileap_set_mac_filter()
933  */
934 int tethering_wifi_add_blocked_mac_list(tethering_h tethering, const char *mac);
935
936 /**
937  * @brief Removes the mac-address from the blocked client list.
938  * @details Removes the mac-address from the blocked client list.
939  * @since_tizen 3.0
940  * @privlevel platform
941  * @privilege %http://tizen.org/privilege/tethering.admin
942  * @param[in]  tethering  The handle of tethering
943  * @param[in]  mac  The mac address
944  * @return 0 on success, otherwise negative error value.
945  * @retval  #TETHERING_ERROR_NONE  Successful
946  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
947  * @retval  #TETHERING_ERROR_NOT_SUPPORTED  API is not supported
948  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
949  * @see  tethering_mobileap_set_mac_filter()
950  */
951 int tethering_wifi_remove_blocked_mac_list(tethering_h tethering, const char *mac);
952
953 /**
954  * @brief Gets the mac-addresses from the blocked client list.
955  * @details Get the mac-addresses from the blocked client list.
956  * @since_tizen 3.0
957  * @privlevel platform
958  * @privilege %http://tizen.org/privilege/tethering.admin
959  * @param[in]  tethering  The handle of tethering
960  * @param[out]  blocked_mac_list  list of blocked mac addresses list
961  * @return 0 on success, otherwise negative error value.
962  * @retval  #TETHERING_ERROR_NONE  Successful
963  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
964  * @retval  #TETHERING_ERROR_NOT_SUPPORTED  API is not supported
965  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
966  * @see  tethering_mobileap_set_mac_filter()
967  */
968 int tethering_wifi_get_blocked_mac_list(tethering_h tethering, void **blocked_mac_list);
969
970 /**
971  * @brief Enables/disables the dhcp server.
972  * @since_tizen 3.0
973  * @privlevel platform
974  * @privilege %http://tizen.org/privilege/tethering.admin
975  * @details Enable/disable the dhcp server.
976  * @param[in]  tethering  The handle of tethering
977  * @param[in]  enable  Enable/disable the dhcp server
978  * @return 0 on success, otherwise negative error value.
979  * @retval  #TETHERING_ERROR_NONE  Successful
980  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
981  */
982 int tethering_wifi_enable_dhcp(tethering_h tethering, bool enable);
983
984 /**
985  * @brief Enables the dhcp server with the address range.
986  * @since_tizen 3.0
987  * @privlevel platform
988  * @privilege %http://tizen.org/privilege/tethering.admin
989  * @details Enable the dhcp server with the address range.
990  * @param[in]  tethering  The handle of tethering
991  * @param[in]  rangestart Start address range
992  * @param[in]  rangestop  End address range
993  * @return 0 on success, otherwise negative error value.
994  * @retval  #TETHERING_ERROR_NONE  Successful
995  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
996  */
997 int tethering_wifi_set_dhcp_range(tethering_h tethering, char *rangestart, char *rangestop);
998
999 /**
1000  * @brief Checks whether the dhcp is enabled or not.
1001  * @since_tizen 3.0
1002  * @privlevel platform
1003  * @privilege %http://tizen.org/privilege/tethering.admin
1004  * @param[in]  tethering  The tethering handle
1005  * @param[out] dhcp_enabled  @c true if dhcp is enabled, \n @c false if dhcp is disabled
1006  * @return  0 on success, otherwise a negative error value
1007  * @retval  #TETHERING_ERROR_NONE  Successful
1008  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1009  */
1010 int tethering_wifi_is_dhcp_enabled(tethering_h tethering, bool *dhcp_enabled);
1011
1012 /**
1013  * @brief Sets the Channel for Wi-Fi.
1014  * @details The Channel should be in between 1-14. If channel is not set, Wi-Fi sets default channel.
1015  * @since_tizen 3.0
1016  * @privlevel platform
1017  * @privilege %http://tizen.org/privilege/tethering.admin
1018  * @param[in]  tethering  The tethering handle
1019  * @param[in]  channel  The channel number
1020  * @return 0 on success, otherwise negative error value
1021  * @retval  #TETHERING_ERROR_NONE  Successful
1022  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1023  */
1024 int tethering_wifi_set_channel(tethering_h tethering, int channel);
1025
1026 /**
1027  * @brief Gets the channel for Wi-Fi.
1028  * @details If channel is not set, Wi-Fi gets default channel.
1029  * @since_tizen 3.0
1030  * @privlevel platform
1031  * @privilege %http://tizen.org/privilege/tethering.admin
1032  * @param[in]  tethering  The tethering handle
1033  * @param[out]  channel  The channel number
1034  * @return 0 on success, otherwise negative error value
1035  * @retval  #TETHERING_ERROR_NONE  Successful
1036  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1037  * @see  tethering_wifi_set_channel()
1038  */
1039 int tethering_wifi_get_channel(tethering_h tethering, int *channel);
1040
1041 /**
1042  * @brief Sets the mode for Wi-Fi.
1043  * @details The mobile AP mode (ex: b only, g only, ad, a). If mode is not set, Wi-Fi sets default mode.
1044  * @since_tizen 3.0
1045  * @privlevel platform
1046  * @privilege %http://tizen.org/privilege/tethering.admin
1047  * @param[in]  tethering  The tethering handle
1048  * @param[in]  type     The mobile AP mode
1049  * @return 0 on success, otherwise negative error value
1050  * @retval  #TETHERING_ERROR_NONE  Successful
1051  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1052  */
1053 int tethering_wifi_set_mode(tethering_h tethering, tethering_wifi_mode_type_e type);
1054
1055 /**
1056  * @brief Gets the mode for Wi-Fi.
1057  * @details If the mode is not set, Wi-Fi gets default mode.
1058  * @since_tizen 3.0
1059  * @privlevel platform
1060  * @privilege %http://tizen.org/privilege/tethering.admin
1061  * @remarks @a mode must be released using free().
1062  * @param[in]  tethering  The tethering handle
1063  * @param[out]  type  The mode of Wi-Fi tethering
1064  * @return 0 on success, otherwise negative error value
1065  * @retval  #TETHERING_ERROR_NONE  Successful
1066  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1067  * @see  tethering_wifi_set_mode()
1068  */
1069 int tethering_wifi_get_mode(tethering_h tethering, tethering_wifi_mode_type_e *type);
1070
1071 /**
1072  * @brief Sets txpower for Wi-Fi tethering.
1073  * @since_tizen 3.0
1074  * @privlevel platform
1075  * @privilege http://tizen.org/privilege/tethering.admin
1076  * @param[in] tethering The tethering handle
1077  * @param[in] txpower  value of txpower to be set
1078  * @return  0 on success, otherwise a negative error value
1079  * @retval  #TETHERING_ERROR_NONE  Successful
1080  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1081  * @retval  #TETHERING_ERROR_NOT_SUPPORT_API  API not supported
1082  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
1083  * @see tethering_wifi_get_txpower()
1084  */
1085 int tethering_wifi_set_txpower(tethering_h tethering, unsigned int txpower);
1086
1087 /**
1088  * @brief Gets txpower for Wi-Fi tethering.
1089  * @since_tizen 3.0
1090  * @privlevel platform
1091  * @privilege http://tizen.org/privilege/tethering.admin
1092  * @param[in] tethering The tethering handle
1093  * @param[out] txpower  value of txpower
1094  * @return  0 on success, otherwise a negative error value
1095  * @retval  #TETHERING_ERROR_NONE  Successful
1096  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1097  * @retval  #TETHERING_ERROR_NOT_SUPPORT_API  API not supported
1098  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
1099  * @see tethering_wifi_set_txpower()
1100  */
1101 int tethering_wifi_get_txpower(tethering_h tethering, unsigned int *txpower);
1102
1103 /**
1104   * @brief Sets mtu for Wi-Fi tethering.
1105   * @since_tizen 3.0
1106   * @privlevel platform
1107   * @privilege %http://tizen.org/privilege/tethering.admin
1108   * @param[in] tethering The tethering handle
1109   * @param[in] mtu value of mtu to be set
1110   * @return  0 on success, otherwise a negative error value
1111   * @retval  #TETHERING_ERROR_NONE  Successful
1112   * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1113   * @retval  #TETHERING_ERROR_NOT_SUPPORT_API  API not supported
1114   * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
1115   */
1116 int tethering_wifi_set_mtu(tethering_h tethering, unsigned int mtu);
1117
1118 /**
1119   * @brief Changes mac address for Wi-Fi tethering.
1120   * @since_tizen 3.0
1121   * @privlevel platform
1122   * @privilege %http://tizen.org/privilege/tethering.admin
1123   * @param[in] tethering The client handle
1124   * @param[in]  mac  The mac address
1125   * @return  0 on success, otherwise a negative error value
1126   * @retval  #TETHERING_ERROR_NONE  Successful
1127   * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1128   * @retval  #TETHERING_ERROR_NOT_SUPPORT_API  API not supported
1129   * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
1130   */
1131 int tethering_wifi_change_mac(tethering_h tethering, char *mac);
1132
1133 /**
1134   * @brief Sets max connected devices for Wi-Fi tethering.
1135   * @since_tizen 3.0
1136   * @privlevel platform
1137   * @privilege %http://tizen.org/privilege/tethering.admin
1138   * @param[in] tethering The client handle
1139   * @param[in] max_device value of max_device to be set
1140   * @return  0 on success, otherwise a negative error value
1141   * @retval  #TETHERING_ERROR_NONE  Successful
1142   * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1143   * @retval  #TETHERING_ERROR_NOT_SUPPORT_API  API not supported
1144   * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
1145   * @see tethering_wifi_get_max_connected_device()
1146   */
1147 int tethering_wifi_set_max_connected_device(tethering_h tethering, int max_device);
1148
1149 /**
1150   * @brief Gets max connected devices for Wi-Fi tethering.
1151   * @since_tizen 3.0
1152   * @privlevel platform
1153   * @privilege %http://tizen.org/privilege/tethering.admin
1154   * @param[in] tethering The client handle
1155   * @param[out] max_device value of max_device
1156   * @return  0 on success, otherwise a negative error value
1157   * @retval  #TETHERING_ERROR_NONE  Successful
1158   * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1159  * @retval  #TETHERING_ERROR_NOT_SUPPORT_API  API not supported
1160  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
1161   * @see tethering_wifi_set_max_connected_device()
1162   */
1163 int tethering_wifi_get_max_connected_device(tethering_h tethering, int *max_device);
1164
1165 /**
1166   * @brief Enables port forwarding feature.
1167   * @since_tizen 3.0
1168   * @privlevel platform
1169   * @privilege %http://tizen.org/privilege/tethering.admin
1170   * @details enable/disable port forwarding feature.
1171   * @param[in]  tethering  The handle of tethering
1172   * @param[in]  enable Enable/Disable port forwarding
1173   * @return 0 on success, otherwise negative error value.
1174   * @retval  #TETHERING_ERROR_NONE  Successful
1175   * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1176   * @retval  #TETHERING_ERROR_NOT_SUPPORT_API  API not supported
1177   * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
1178   */
1179 int tethering_wifi_enable_port_forwarding(tethering_h tethering, bool enable);
1180
1181 /**
1182   * @brief Sets port forwarding rule.
1183   * @since_tizen 3.0
1184   * @privlevel platform
1185   * @privilege %http://tizen.org/privilege/tethering.admin
1186   * @details Set port forwarding rule.
1187   * @param[in]  tethering  The handle of tethering
1188   * @param[in]  ifname interface name
1189   * @param[in]  protocol protocol (tcp/udp)
1190   * @param[in]  org_ip original destination ip where packet was meant to sent
1191   * @param[in]  org_port original destination port where packet was meant to sent
1192   * @param[in]  final_ip new destination ip where packet will be forwarded
1193   * @param[in]  final_port new destination port where packet will be forwarded
1194   * @return 0 on success, otherwise negative error value.
1195   * @retval  #TETHERING_ERROR_NONE  Successful
1196   * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1197   * @retval  #TETHERING_ERROR_NOT_SUPPORT_API  API not supported
1198   * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
1199   */
1200 int tethering_wifi_add_port_forwarding_rule(tethering_h tethering, char *ifname, char *protocol, char *org_ip, int org_port, char *final_ip, int final_port);
1201
1202 /**
1203   * @brief Resets port forwarding rule.
1204   * @since_tizen 3.0
1205   * @privlevel platform
1206   * @privilege %http://tizen.org/privilege/tethering.admin
1207   * @details Reset port forwarding rule.
1208   * @param[in]  tethering  The handle of tethering
1209   * @return 0 on success, otherwise negative error value.
1210   * @retval  #TETHERING_ERROR_NONE  Successful
1211   * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1212   * @retval  #TETHERING_ERROR_NOT_SUPPORT_API  API not supported
1213   * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
1214   */
1215 int tethering_wifi_reset_port_forwarding_rule(tethering_h tethering);
1216
1217 /**
1218  * @brief Checks whether the port forwarding is enabled or not.
1219  * @since_tizen 3.0
1220  * @privlevel platform
1221  * @privilege %http://tizen.org/privilege/tethering.admin
1222  * @param[in]  tethering  The tethering handle
1223  * @param[out] forwarding_enabled  @c true if port forwarding is enabled, \n @c false if port forwarding is disabled
1224  * @return  0 on success, otherwise a negative error value
1225  * @retval  #TETHERING_ERROR_NONE  Successful
1226  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1227  * @retval  #TETHERING_ERROR_NOT_SUPPORT_API  API not supported
1228  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
1229  */
1230 int tethering_wifi_is_port_forwarding_enabled(tethering_h tethering, bool* forwarding_enabled);
1231
1232 /**
1233  * @brief Gets the port forwarding rule for Wi-Fi tethering.
1234  * @since_tizen 3.0
1235  * @privlevel platform
1236  * @privilege %http://tizen.org/privilege/tethering.admin
1237  * @param[in] tethering The client handle
1238  * @param[out] port_forwarding_list list of port forwarding rules
1239  * @return  0 on success, otherwise a negative error value
1240  * @retval  #TETHERING_ERROR_NONE  Successful
1241  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1242  * @retval  #TETHERING_ERROR_NOT_SUPPORT_API  API not supported
1243  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
1244  */
1245 int tethering_wifi_get_port_forwarding_rule(tethering_h tethering, void **port_forwarding_list);
1246
1247 /**
1248  * @brief Enables port filtering feature.
1249  * @since_tizen 3.0
1250  * @privlevel platform
1251  * @privilege %http://tizen.org/privilege/tethering.admin
1252  * @details enable/disable port filtering feature.
1253  * @param[in]  tethering  The handle of tethering
1254  * @param[in]  enable Enable/Disable port filtering
1255  * @return 0 on success, otherwise negative error value.
1256  * @retval  #TETHERING_ERROR_NONE  Successful
1257  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1258  * @retval  #TETHERING_ERROR_NOT_SUPPORT_API  API not supported
1259  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
1260  */
1261 int tethering_wifi_enable_port_filtering(tethering_h tethering, bool enable);
1262
1263 /**
1264  * @brief Sets port filtering rule.
1265  * @since_tizen 3.0
1266  * @privlevel platform
1267  * @privilege %http://tizen.org/privilege/tethering.admin
1268  * @details Set port filtering rule.
1269  * @param[in]  tethering  The handle of tethering
1270  * @param[in]  port to be filtered
1271  * @param[in]  protocol protocol (tcp/udp)
1272  * @param[in]  allow allow/disallow port filtering
1273  * @return 0 on success, otherwise negative error value.
1274  * @retval  #TETHERING_ERROR_NONE  Successful
1275  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1276  * @retval  #TETHERING_ERROR_NOT_SUPPORT_API  API not supported
1277  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
1278  */
1279 int tethering_wifi_add_port_filtering_rule(tethering_h tethering, int port, char *protocol, bool allow);
1280
1281 /**
1282  * @brief Sets custom port filtering rule.
1283  * @since_tizen 3.0
1284  * @privlevel platform
1285  * @privilege %http://tizen.org/privilege/tethering.admin
1286  * @details Set custom port filtering rule.
1287  * @param[in]  tethering  The handle of tethering
1288  * @param[in]  port1 to be filtered
1289  * @param[in]  port2 to be filtered
1290  * @param[in]  protocol protocol (tcp/udp)
1291  * @param[in]  allow allow/disallow port filtering
1292  * @return 0 on success, otherwise negative error value.
1293  * @retval  #TETHERING_ERROR_NONE  Successful
1294  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1295  * @retval  #TETHERING_ERROR_NOT_SUPPORT_API  API not supported
1296  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
1297  */
1298 int tethering_wifi_add_custom_port_filtering_rule(tethering_h tethering, int port1, int port2, char *protocol, bool allow);
1299
1300 /**
1301  * @brief Gets the port filtering rule for Wi-Fi tethering.
1302  * @since_tizen 3.0
1303  * @privlevel platform
1304  * @privilege %http://tizen.org/privilege/tethering.admin
1305  * @param[in] tethering The client handle
1306  * @param[out] port_filtering_list list of port filtering rules
1307  * @return  0 on success, otherwise a negative error value
1308  * @retval  #TETHERING_ERROR_NONE  Successful
1309  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1310  * @retval  #TETHERING_ERROR_NOT_SUPPORT_API  API not supported
1311  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
1312  */
1313 int tethering_wifi_get_port_filtering_rule(tethering_h tethering, void **port_filtering_list);
1314
1315 /**
1316  * @brief Gets the custom port filtering rule for Wi-Fi tethering.
1317  * @since_tizen 3.0
1318  * @privlevel platform
1319  * @privilege %http://tizen.org/privilege/tethering.admin
1320  * @param[in] tethering The client handle
1321  * @param[out] custom_port_filtering_list list of custom port filtering rules
1322  * @return  0 on success, otherwise a negative error value
1323  * @retval  #TETHERING_ERROR_NONE  Successful
1324  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1325  * @retval  #TETHERING_ERROR_NOT_SUPPORT_API  API not supported
1326  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
1327  */
1328 int tethering_wifi_get_custom_port_filtering_rule(tethering_h tethering, void **custom_port_filtering_list);
1329
1330 /**
1331  * @brief Checks whether the port filtering is enabled or not.
1332  * @since_tizen 3.0
1333  * @privlevel platform
1334  * @privilege %http://tizen.org/privilege/tethering.admin
1335  * @param[in]  tethering  The tethering handle
1336  * @param[out] filtering_enabled  @c true if port filtering is enabled, \n @c false if port filtering is disabled
1337  * @return  0 on success, otherwise a negative error value
1338  * @retval  #TETHERING_ERROR_NONE  Successful
1339  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1340  * @retval  #TETHERING_ERROR_NOT_SUPPORT_API  API not supported
1341  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
1342  */
1343 int tethering_wifi_is_port_filtering_enabled(tethering_h tethering, bool* filtering_enabled);
1344
1345 /**
1346  * @brief Sets vpn passthrough rule.
1347  * @since_tizen 3.0
1348  * @privlevel platform
1349  * @privilege %http://tizen.org/privilege/tethering.admin
1350  * @details Set vpn passthrough rule.
1351  * @param[in]  tethering        The handle of tethering
1352  * @param[in]  type                     vpn passthrough type
1353  * @param[in]  enable           @c true if vpn passthrough is enabled, \n @c false if vpn passthrough is disabled
1354  * @return 0 on success, otherwise negative error value.
1355  * @retval  #TETHERING_ERROR_NONE  Successful
1356  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1357  * @retval  #TETHERING_ERROR_NOT_SUPPORT_API  API not supported
1358  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
1359  */
1360 int tethering_wifi_set_vpn_passthrough_rule(tethering_h tethering, tethering_vpn_passthrough_type_e type, bool enable);
1361
1362 /**
1363  * @brief Pushes the WPS button to connect with Wi-Fi Tethering client. (WPS PBC)
1364  * @since_tizen 3.0
1365  * @remarks The WPS button should be pushed when client tries to connect with Soft AP by using WPS PBC.
1366  * @param[in]  tethering  The tethering handle
1367  * @return 0 on success, otherwise negative error value
1368  * @retval  #TETHERING_ERROR_NONE  Successful
1369  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1370  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
1371  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission denied
1372  * @retval  #TETHERING_ERROR_NOT_SUPPORTED  API is not supported
1373  */
1374 int tethering_wifi_push_wps_button(tethering_h tethering);
1375
1376 /**
1377  * @brief Sets the WPS PIN to connect with Wi-Fi Tethering client. (WPS PIN)
1378  * @since_tizen 3.0
1379  * @remarks The WPS PIN should be inserted when client tries to connect with Soft AP by using WPS PIN.
1380  * @param[in]  tethering  The tethering handle
1381  * @param[in]  wps_pin  The WPS PIN
1382  * @return 0 on success, otherwise negative error value
1383  * @retval  #TETHERING_ERROR_NONE  Successful
1384  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1385  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
1386  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission denied
1387  * @retval  #TETHERING_ERROR_NOT_SUPPORTED  API is not supported
1388  */
1389 int tethering_wifi_set_wps_pin(tethering_h tethering, const char *wps_pin);
1390
1391 /**
1392  * @brief Checks whether wifi-sharing is supported or not.
1393  * @since_tizen 6.0
1394  * @privlevel platform
1395  * @privilege %http://tizen.org/privilege/tethering.admin
1396  * @param[in]  tethering  The tethering handle
1397  * @param[out] supported @c true if wifi-sharing is supported, \n @c false if wifi-sharing is unsupported
1398  * @return  0 on success, otherwise a negative error value
1399  * @retval  #TETHERING_ERROR_NONE  Successful
1400  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1401  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission denied
1402  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
1403  */
1404 int tethering_wifi_is_sharing_supported(tethering_h tethering, bool *supported);
1405
1406
1407 /**
1408  * @}
1409  */
1410
1411
1412 /**
1413  * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
1414  * @{
1415  */
1416
1417 /**
1418  * @brief Clones the handle of a client.
1419  * @since_tizen 2.3
1420  * @privlevel platform
1421  * @privilege %http://tizen.org/privilege/tethering.admin
1422  * @remarks @a dest must be release using tethering_client_destroy().
1423  * @param[out]  dest  The cloned client handle
1424  * @param[in]  origin  The origin client handle
1425  * @return  0 on success, otherwise a negative error value
1426  * @retval  #TETHERING_ERROR_NONE  Successful
1427  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1428  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
1429  * @see  tethering_client_destroy()
1430  */
1431 int tethering_client_clone(tethering_client_h *dest, tethering_client_h origin);
1432
1433 /**
1434  * @brief Destroys the handle of a client.
1435  * @since_tizen 2.3
1436  * @privlevel platform
1437  * @privilege %http://tizen.org/privilege/tethering.admin
1438  * @param[in]  client  The client handle
1439  * @return  0 on success, otherwise a negative error value
1440  * @retval  #TETHERING_ERROR_NONE  Successful
1441  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1442  * @see  tethering_client_clone()
1443  */
1444 int tethering_client_destroy(tethering_client_h client);
1445
1446 /**
1447  * @brief  Gets the tethering type of client.
1448  * @since_tizen 2.3
1449  * @privlevel platform
1450  * @privilege %http://tizen.org/privilege/tethering.admin
1451  * @param[in]  client  The handle of client
1452  * @param[out]  type  The type of tethering
1453  * @return  0 on success, otherwise a negative error value.
1454  * @retval  #TETHERING_ERROR_NONE  Successful
1455  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1456  * @see  tethering_usb_get_connected_client()
1457  * @see  tethering_connection_state_changed_cb()
1458  */
1459 int tethering_client_get_tethering_type(tethering_client_h client, tethering_type_e *type);
1460
1461 /**
1462  * @brief Gets the name of a client.
1463  * @since_tizen 2.3
1464  * @privlevel platform
1465  * @privilege %http://tizen.org/privilege/tethering.admin
1466  * @remarks @a name must be released using free().
1467  * @param[in]  client  The client handle
1468  * @param[out]  name  The name of the client
1469  * @return  0 on success, otherwise a negative error value
1470  * @retval  #TETHERING_ERROR_NONE  Successful
1471  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1472  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
1473  * @see  tethering_usb_get_connected_client()
1474  * @see  tethering_connection_state_changed_cb()
1475  */
1476 int tethering_client_get_name(tethering_client_h client, char **name);
1477
1478 /**
1479  * @brief Gets the IP address of a client.
1480  * @since_tizen 2.3
1481  * @privlevel platform
1482  * @privilege %http://tizen.org/privilege/tethering.admin
1483  * @remarks @a ip_address must be released using free().
1484  * @param[in]  client  The client handle
1485  * @param[in]  address_family  The address family of IP address. Currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported
1486  * @param[out]  ip_address  The IP address
1487  * @return  0 on success, otherwise a negative error value
1488  * @retval  #TETHERING_ERROR_NONE  Successful
1489  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1490  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
1491  * @see  tethering_usb_get_connected_client()
1492  * @see  tethering_connection_state_changed_cb()
1493  */
1494 int tethering_client_get_ip_address(tethering_client_h client, tethering_address_family_e address_family, char **ip_address);
1495
1496 /**
1497  * @brief Gets the MAC address of a client such as "FC:A1:3E:D6:B1:B1".
1498  * @since_tizen 2.3
1499  * @privlevel platform
1500  * @privilege %http://tizen.org/privilege/tethering.admin
1501  * @remarks @a mac_address must be released using free().
1502  * @param[in]  client  The client handle
1503  * @param[out]  mac_address  The MAC address
1504  * @return  0 on success, otherwise a negative error value
1505  * @retval  #TETHERING_ERROR_NONE  Successful
1506  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1507  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
1508  * @see  tethering_usb_get_connected_client()
1509  * @see  tethering_connection_state_changed_cb()
1510  */
1511 int tethering_client_get_mac_address(tethering_client_h client, char **mac_address);
1512
1513 /**
1514  * @brief Gets the connection time of a client.
1515  * @since_tizen 2.3
1516  * @privlevel platform
1517  * @privilege %http://tizen.org/privilege/tethering.admin
1518  * @param[in] client The client handle
1519  * @param[out]  time  The connected time of the client
1520  * @return  0 on success, otherwise a negative error value
1521  * @retval  #TETHERING_ERROR_NONE  Successful
1522  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1523  * @see  tethering_usb_get_connected_client()
1524  * @see  tethering_connection_state_changed_cb()
1525  */
1526 int tethering_client_get_time(tethering_client_h client, time_t *timestamp);
1527
1528 /**
1529  * @}
1530  */
1531
1532
1533 #ifdef __cplusplus
1534  }
1535 #endif
1536
1537 #endif /* __TIZEN_NETWORK_TETHERING_H__ */
1538
1539