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