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