2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __TIZEN_NETWORK_TETHERING_H__
18 #define __TIZEN_NETWORK_TETHERING_H__
32 * @addtogroup CAPI_NETWORK_TETHERING_MANAGER_MODULE
37 * @brief The tethering handle.
40 typedef void * tethering_h;
43 * @brief Enumeration for the tethering.
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 */
60 * @brief Enumeration for the type of tethering.
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 */
71 * @brief Enumeration for the cause of disabling the tethering.
75 TETHERING_DISABLED_BY_USB_DISCONNECTION = 0, /**< Disabled due to usb disconnection */
76 TETHERING_DISABLED_BY_FLIGHT_MODE, /**< Disabled due to flight mode */
77 TETHERING_DISABLED_BY_LOW_BATTERY, /**< Disabled due to low battery */
78 TETHERING_DISABLED_BY_NETWORK_CLOSE, /**< Disabled due to pdp network close */
79 TETHERING_DISABLED_BY_TIMEOUT, /**< Disabled due to timeout */
80 TETHERING_DISABLED_BY_OTHERS, /**< Disabled by other apps */
81 TETHERING_DISABLED_BY_REQUEST, /**< Disabled by your request */
82 TETHERING_DISABLED_BY_WIFI_ON, /**< Disabled due to Wi-Fi on */
83 TETHERING_DISABLED_BY_BT_OFF, /**< Disabled due to Bluetooth off */
84 } tethering_disabled_cause_e;
92 * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
97 * @brief Enumeration for the Wi-Fi security.
101 TETHERING_WIFI_SECURITY_TYPE_NONE = 0, /**< No Security type */
102 TETHERING_WIFI_SECURITY_TYPE_WPA2_PSK, /**< WPA2_PSK */
103 TETHERING_WIFI_SECURITY_TYPE_WPS, /**< WPA2_PSK */
104 } tethering_wifi_security_type_e;
107 * @brief Enumeration for the Wi-Fi mode
111 TETHERING_WIFI_MODE_TYPE_B = 0, /**< mode b */
112 TETHERING_WIFI_MODE_TYPE_G, /**< mode g */
113 TETHERING_WIFI_MODE_TYPE_A, /**< mode a */
114 TETHERING_WIFI_MODE_TYPE_AD, /**< mode ad */
115 } tethering_wifi_mode_type_e;
118 TETHERING_TYPE_IPSEC_PASSTHROUGH = 0, /**< IPSEC */
119 TETHERING_TYPE_PPTP_PASSTHROUGH, /**< PPTP type */
120 TETHERING_TYPE_L2TP_PASSTHROUGH, /**< L2TP type */
121 } tethering_vpn_passthrough_type_e;
129 * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
134 * @brief The tethering client handle.
137 typedef void * tethering_client_h;
140 * @brief Enumeration for address family.
144 TETHERING_ADDRESS_FAMILY_IPV4 = 0, /**< IPV4 Address type */
145 TETHERING_ADDRESS_FAMILY_IPV6 = 1, /**< IPV6 Address type (Since 4.0) */
146 } tethering_address_family_e;
154 * @addtogroup CAPI_NETWORK_TETHERING_MANAGER_MODULE
159 * @brief Called when the tethering is enabled.
161 * @param[in] result The result of enabling the tethering
162 * @param[in] type The tethering type
163 * @param[in] is_requested Indicates whether this change is requested
164 * @param[in] user_data The user data passed from tethering_set_enabled_cb()
165 * @pre If you register callback function using tethering_set_enabled_cb(), this will be invoked when the tethering is enabled.
166 * @see tethering_enable()
167 * @see tethering_unset_enabled_cb()
169 typedef void (*tethering_enabled_cb)(tethering_error_e result, tethering_type_e type, bool is_requested, void *user_data);
172 * @brief Called when the tethering is disabled.
174 * @param[in] result The result of disabling the tethering
175 * @param[in] type The tethering type
176 * @param[in] cause The cause of disabling
177 * @param[in] user_data The user data passed from tethering_set_disabled_cb()
178 * @pre If you register callback function using tethering_set_disabled_cb(), this will be invoked when the tethering is disabled.
179 * @see tethering_set_disabled_cb()
180 * @see tethering_unset_disabled_cb()
182 typedef void (*tethering_disabled_cb)(tethering_error_e result, tethering_type_e type, tethering_disabled_cause_e cause, void *user_data);
185 * @brief Called when the connection state is changed.
187 * @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().
188 * @param[in] client The client of which connection state is changed
189 * @param[in] opened @c true when connection is opened, otherwise false
190 * @param[in] user_data The user data passed from tethering_set_connection_state_changed_cb()
191 * @pre If you register callback function using tethering_set_connection_state_changed_cb(), this will be invoked when the connection state is changed.
192 * @see tethering_set_connection_state_changed_cb()
193 * @see tethering_unset_connection_state_changed_cb()
195 typedef void (*tethering_connection_state_changed_cb)(tethering_client_h client, bool opened, void *user_data);
198 * @brief Called when you get the connected client repeatedly.
200 * @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().
201 * @param[in] client The connected client
202 * @param[in] user_data The user data passed from the request function
203 * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
204 * @pre tethering_foreach_connected_clients() will invoke this callback.
205 * @see tethering_foreach_connected_clients()
207 typedef bool(*tethering_connected_client_cb)(tethering_client_h client, void *user_data);
210 * @brief Called when you get the data usage.
212 * @param[in] result The result of getting the data usage
213 * @param[in] received_data The usage of received data
214 * @param[in] sent_data The usage of sent data
215 * @param[in] user_data The user data passed from the request function
216 * @pre tethering_get_data_usage() will invoked this callback.
218 typedef void (*tethering_data_usage_cb)(tethering_error_e result, unsigned long long received_data, unsigned long long sent_data, void *user_data);
221 * @brief Called when the security type of Wi-Fi tethering is changed.
223 * @param[in] changed_type The changed security type of Wi-Fi tethering
224 * @param[in] user_data The user data passed from the register function
225 * @see tethering_wifi_set_security_type_changed_cb()
226 * @see tethering_wifi_unset_security_type_changed_cb()
228 typedef void (*tethering_wifi_security_type_changed_cb)(tethering_wifi_security_type_e changed_type, void *user_data);
231 * @brief Called when the visibility of SSID is changed.
233 * @param[in] changed_visible The changed visibility of SSID
234 * @param[in] user_data The user data passed from the register function
235 * @see tethering_wifi_set_ssid_visibility_changed_cb()
236 * @see tethering_wifi_unset_ssid_visibility_changed_cb()
238 typedef void (*tethering_wifi_ssid_visibility_changed_cb)(bool changed_visible, void *user_data);
241 * @brief Called when the passphrase of Wi-Fi tethering is changed.
243 * @param[in] user_data The user data passed from the register function
244 * @see tethering_wifi_set_passphrase_changed_cb()
245 * @see tethering_wifi_unset_passphrase_changed_cb()
247 typedef void (*tethering_wifi_passphrase_changed_cb)(void *user_data);
250 * @brief Called when the settings are reloaded.
252 * @param[in] result The result of reloading the settings
253 * @param[in] user_data The user data passed from the request function
254 * @pre tethering_wifi_reload_settings() will invoke this callback.
256 typedef void (*tethering_wifi_settings_reloaded_cb)(tethering_error_e result, void *user_data);
259 * @brief Creates the handle for tethering.
261 * @privlevel platform
262 * @privilege %http://tizen.org/privilege/tethering.admin
263 * @remarks The @a tethering must be released using tethering_destroy().
264 * @param[out] tethering A handle of a new mobile ap handle on success
265 * @return 0 on success, otherwise a negative error value
266 * @retval #TETHERING_ERROR_NONE Successful
267 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
268 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
269 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API is not supported
270 * @see tethering_destroy()
272 int tethering_create(tethering_h *tethering);
275 * @brief Destroys the handle for tethering.
277 * @privlevel platform
278 * @privilege %http://tizen.org/privilege/tethering.admin
279 * @param[in] tethering The tethering handle
280 * @return 0 on success, otherwise a negative error value
281 * @retval #TETHERING_ERROR_NONE Successful
282 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
283 * @see tethering_create()
285 int tethering_destroy(tethering_h tethering);
288 * @brief Enables the tethering, asynchronously.
290 * @privlevel platform
291 * @privilege %http://tizen.org/privilege/tethering.admin
292 * @param[in] tethering The tethering handle
293 * @param[in] type The tethering type
294 * @return 0 on success, otherwise negative error value
295 * @retval #TETHERING_ERROR_NONE Successful
296 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
297 * @post tethering_enabled_cb() will be invoked.
298 * @see tethering_is_enabled()
299 * @see tethering_disable()
301 int tethering_enable(tethering_h tethering, tethering_type_e type);
304 * @brief Disables the tethering, asynchronously.
306 * @privlevel platform
307 * @privilege %http://tizen.org/privilege/tethering.admin
308 * @param[in] tethering The tethering handle
309 * @param[in] type The tethering type
310 * @return 0 on success, otherwise negative error value
311 * @retval #TETHERING_ERROR_NONE Successful
312 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
313 * @post tethering_disabled_cb() will be invoked.
314 * @see tethering_is_enabled()
315 * @see tethering_enable()
317 int tethering_disable(tethering_h tethering, tethering_type_e type);
320 * @brief Enables the IPv6 tethering, asynchronously.
322 * @privlevel platform
323 * @privilege %http://tizen.org/privilege/tethering.admin
324 * @remarks It supports Wi-Fi tethering and BT tethering only.
325 * @param[in] tethering The tethering handle
326 * @param[in] type The tethering type
327 * @return 0 on success, otherwise negative error value
328 * @retval #TETHERING_ERROR_NONE Successful
329 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
330 * @post tethering_enabled_cb() will be invoked.
331 * @see tethering_is_enabled()
332 * @see tethering_ipv6_disable()
334 int tethering_ipv6_enable(tethering_h tethering, tethering_type_e type);
337 * @brief Disables the IPv6 tethering, asynchronously.
339 * @privlevel platform
340 * @privilege %http://tizen.org/privilege/tethering.admin
341 * @remarks It supports Wi-Fi tethering and BT tethering only.
342 * @param[in] tethering The tethering handle
343 * @param[in] type The tethering type
344 * @return 0 on success, otherwise negative error value
345 * @retval #TETHERING_ERROR_NONE Successful
346 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
347 * @post tethering_disabled_cb() will be invoked.
348 * @see tethering_is_enabled()
349 * @see tethering_ipv6_enable()
351 int tethering_ipv6_disable(tethering_h tethering, tethering_type_e type);
354 * @brief Checks whether the tethering is enabled or not.
356 * @privlevel platform
357 * @privilege %http://tizen.org/privilege/tethering.admin
358 * @param[in] tethering The tethering handle
359 * @param[in] type The tethering type
360 * @return @c true if tethering is enabled, \n @c false if tethering is disabled
362 bool tethering_is_enabled(tethering_h tethering, tethering_type_e type);
365 * @brief Gets the MAC address of local device as "FC:A1:3E:D6:B1:B1".
367 * @privlevel platform
368 * @privilege %http://tizen.org/privilege/tethering.admin
369 * @remarks @a mac_address must be released using free().
370 * @param[in] tethering The tethering handle
371 * @param[in] type The tethering type
372 * @param[out] mac_address The MAC address
373 * @return 0 on success, otherwise a negative error value
374 * @retval #TETHERING_ERROR_NONE Successful
375 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
376 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
377 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
378 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
379 * @pre The tethering must be enabled.
380 * @see tethering_is_enabled()
381 * @see tethering_enable()
383 int tethering_get_mac_address(tethering_h tethering, tethering_type_e type, char **mac_address);
386 * @brief Gets the name of network interface (e.g. usb0).
388 * @privlevel platform
389 * @privilege %http://tizen.org/privilege/tethering.admin
390 * @remarks @a interface_name must be released using free().
391 * @param[in] tethering The tethering handle
392 * @param[in] type The tethering type
393 * @param[out] interface_name The name of the network interface
394 * @return 0 on success, otherwise negative error value
395 * @retval #TETHERING_ERROR_NONE Successful
396 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
397 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
398 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
399 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
400 * @pre The tethering must be enabled.
401 * @see tethering_is_enabled()
402 * @see tethering_enable()
404 int tethering_get_network_interface_name(tethering_h tethering, tethering_type_e type, char **interface_name);
407 * @brief Gets the local IP address.
409 * @privlevel platform
410 * @privilege %http://tizen.org/privilege/tethering.admin
411 * @remarks @a ip_address must be released using free().
412 * @param[in] tethering The tethering handle
413 * @param[in] type The tethering type
414 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
415 * @param[out] ip_address The local IP address
416 * @return 0 on success, otherwise negative error value
417 * @retval #TETHERING_ERROR_NONE Successful
418 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
419 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
420 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
421 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
422 * @pre The tethering must be enabled.
423 * @see tethering_is_enabled()
424 * @see tethering_enable()
426 int tethering_get_ip_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **ip_address);
429 * @brief Gets the Gateway address.
431 * @privlevel platform
432 * @privilege %http://tizen.org/privilege/tethering.admin
433 * @remarks @a gateway_address must be released using free().
434 * @param[in] tethering The tethering handle
435 * @param[in] type The tethering type
436 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
437 * @param[out] gateway_address The local IP address
438 * @return 0 on success, otherwise negative error value
439 * @retval #TETHERING_ERROR_NONE Successful
440 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
441 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
442 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
443 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
444 * @pre The tethering must be enabled.
445 * @see tethering_is_enabled()
446 * @see tethering_enable()
448 int tethering_get_gateway_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **gateway_address);
451 * @brief Gets the Subnet Mask.
453 * @privlevel platform
454 * @privilege %http://tizen.org/privilege/tethering.admin
455 * @remarks @a subnet_mask must be released using free().
456 * @param[in] tethering The tethering handle
457 * @param[in] type The tethering type
458 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
459 * @param[out] subnet_mask The local IP address
460 * @return 0 on success, otherwise negative error value
461 * @retval #TETHERING_ERROR_NONE Successful
462 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
463 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
464 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
465 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
466 * @pre The tethering must be enabled.
467 * @see tethering_is_enabled()
468 * @see tethering_enable()
470 int tethering_get_subnet_mask(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **subnet_mask);
473 * @brief Gets the data usage.
475 * @privlevel platform
476 * @privilege %http://tizen.org/privilege/tethering.admin
477 * @param[in] tethering The tethering handle
478 * @param[out] usage The data usage
479 * @return 0 on success, otherwise negative error value
480 * @retval #TETHERING_ERROR_NONE Successful
481 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
482 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
483 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
484 * @pre The tethering must be enabled.
485 * @see tethering_is_enabled()
486 * @see tethering_enable()
488 int tethering_get_data_usage(tethering_h tethering, tethering_data_usage_cb callback, void *user_data);
491 * @brief Gets the clients which are connected.
493 * @privlevel platform
494 * @privilege %http://tizen.org/privilege/tethering.admin
495 * @param[in] tethering The tethering handle
496 * @param[in] type The tethering type
497 * @param[in] callback The callback function to invoke
498 * @param[in] user_data The user data to be passed to the callback function
499 * @retval #TETHERING_ERROR_NONE Successful
500 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
501 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
502 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
503 * @pre The tethering must be enabled.
504 * @see tethering_is_enabled()
505 * @see tethering_enable()
507 int tethering_foreach_connected_clients(tethering_h tethering, tethering_type_e type, tethering_connected_client_cb callback, void *user_data);
510 * @brief Registers the callback function, which is called when tethering is enabled.
512 * @privlevel platform
513 * @privilege %http://tizen.org/privilege/tethering.admin
514 * @param[in] tethering The tethering handle
515 * @param[in] type The tethering type
516 * @param[in] callback The callback function to invoke
517 * @param[in] user_data The user data to be passed to the callback function
518 * @retval #TETHERING_ERROR_NONE Successful
519 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
520 * @see tethering_unset_enabled_cb()
522 int tethering_set_enabled_cb(tethering_h tethering, tethering_type_e type, tethering_enabled_cb callback, void *user_data);
525 * @brief Unregisters the callback function, which is called when tethering is enabled.
527 * @privlevel platform
528 * @privilege %http://tizen.org/privilege/tethering.admin
529 * @param[in] tethering The tethering handle
530 * @param[in] type The tethering type
531 * @retval #TETHERING_ERROR_NONE Successful
532 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
533 * @see tethering_set_enabled_cb()
535 int tethering_unset_enabled_cb(tethering_h tethering, tethering_type_e type);
538 * @brief Registers the callback function called when tethering is disabled.
540 * @privlevel platform
541 * @privilege %http://tizen.org/privilege/tethering.admin
542 * @param[in] tethering The tethering handle
543 * @param[in] type The tethering type
544 * @param[in] callback The callback function to invoke
545 * @param[in] user_data The user data to be passed to the callback function
546 * @retval #TETHERING_ERROR_NONE Successful
547 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
548 * @see tethering_unset_disabled_cb()
550 int tethering_set_disabled_cb(tethering_h tethering, tethering_type_e type, tethering_disabled_cb callback, void *user_data);
553 * @brief Unregisters the callback function, which is called when tethering is disabled.
555 * @privlevel platform
556 * @privilege %http://tizen.org/privilege/tethering.admin
557 * @param[in] tethering The tethering handle
558 * @param[in] type The tethering type
559 * @retval #TETHERING_ERROR_NONE Successful
560 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
561 * @see tethering_set_disabled_cb()
563 int tethering_unset_disabled_cb(tethering_h tethering, tethering_type_e type);
566 * @brief Registers the callback function, which is called when the state of connection is changed.
568 * @privlevel platform
569 * @privilege %http://tizen.org/privilege/tethering.admin
570 * @param[in] tethering The tethering handle
571 * @param[in] type The tethering type
572 * @param[in] callback The callback function to invoke
573 * @param[in] user_data The user data to be passed to the callback function
574 * @retval #TETHERING_ERROR_NONE Successful
575 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
576 * @see tethering_unset_connection_state_changed_cb_cb()
578 int tethering_set_connection_state_changed_cb(tethering_h tethering, tethering_type_e type, tethering_connection_state_changed_cb callback, void *user_data);
581 * @brief Unregisters the callback function, which is called when the state of connection is changed.
583 * @privlevel platform
584 * @privilege %http://tizen.org/privilege/tethering.admin
585 * @param[in] tethering The tethering handle
586 * @param[in] type The tethering type
587 * @retval #TETHERING_ERROR_NONE Successful
588 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
589 * @see tethering_set_connection_state_changed_cb()
591 int tethering_unset_connection_state_changed_cb(tethering_h tethering, tethering_type_e type);
594 * @brief Registers the callback function, which is called when the security type of Wi-Fi tethering is changed.
596 * @privlevel platform
597 * @privilege %http://tizen.org/privilege/tethering.admin
598 * @param[in] tethering The tethering handle
599 * @param[in] callback The callback function to invoke
600 * @param[in] user_data The user data to be passed to the callback function
601 * @retval #TETHERING_ERROR_NONE Successful
602 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
603 * @see tethering_wifi_unset_security_type_changed_cb()
605 int tethering_wifi_set_security_type_changed_cb(tethering_h tethering, tethering_wifi_security_type_changed_cb callback, void *user_data);
608 * @brief Unregisters the callback function, which is called when the security type of Wi-Fi tethering is changed.
610 * @privlevel platform
611 * @privilege %http://tizen.org/privilege/tethering.admin
612 * @param[in] tethering The tethering handle
613 * @param[in] type The tethering type
614 * @retval #TETHERING_ERROR_NONE Successful
615 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
616 * @see tethering_wifi_set_security_type_changed_cb()
618 int tethering_wifi_unset_security_type_changed_cb(tethering_h tethering);
621 * @brief Registers the callback function , which iscalled when the visibility of SSID is changed.
623 * @privlevel platform
624 * @privilege %http://tizen.org/privilege/tethering.admin
625 * @param[in] tethering The tethering handle
626 * @param[in] callback The callback function to invoke
627 * @param[in] user_data The user data to be passed to the callback function
628 * @retval #TETHERING_ERROR_NONE Successful
629 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
630 * @see tethering_wifi_unset_ssid_visibility_changed_cb_cb()
632 int tethering_wifi_set_ssid_visibility_changed_cb(tethering_h tethering, tethering_wifi_ssid_visibility_changed_cb callback, void *user_data);
635 * @brief Unregisters the callback function, which is called when the visibility of SSID is changed.
637 * @privlevel platform
638 * @privilege %http://tizen.org/privilege/tethering.admin
639 * @param[in] tethering The tethering handle
640 * @retval #TETHERING_ERROR_NONE Successful
641 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
642 * @see tethering_wifi_set_ssid_visibility_changed_cb()
644 int tethering_wifi_unset_ssid_visibility_changed_cb(tethering_h tethering);
647 * @brief Registers the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
649 * @privlevel platform
650 * @privilege %http://tizen.org/privilege/tethering.admin
651 * @param[in] tethering The tethering handle
652 * @param[in] callback The callback function to invoke
653 * @param[in] user_data The user data to be passed to the callback function
654 * @retval #TETHERING_ERROR_NONE Successful
655 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
656 * @see tethering_wifi_unset_passphrase_changed_cb()
658 int tethering_wifi_set_passphrase_changed_cb(tethering_h tethering, tethering_wifi_passphrase_changed_cb callback, void *user_data);
661 * @brief Unregisters the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
663 * @privlevel platform
664 * @privilege %http://tizen.org/privilege/tethering.admin
665 * @param[in] tethering The tethering handle
666 * @retval #TETHERING_ERROR_NONE Successful
667 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
668 * @see tethering_wifi_set_passphrase_changed_cb()
670 int tethering_wifi_unset_passphrase_changed_cb(tethering_h tethering);
678 * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
683 * @brief Sets the security type of Wi-Fi tethering.
685 * @privlevel platform
686 * @privilege %http://tizen.org/privilege/tethering.admin
687 * @remarks This change is applied next time Wi-Fi tethering is enabled.
688 * @param[in] tethering The tethering handle
689 * @param[in] type The security type
690 * @return 0 on success, otherwise negative error value
691 * @retval #TETHERING_ERROR_NONE Successful
692 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
693 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
694 * @see tethering_wifi_get_security_type()
696 int tethering_wifi_set_security_type(tethering_h tethering, tethering_wifi_security_type_e type);
699 * @brief Gets the security type of Wi-Fi tethering.
701 * @privlevel platform
702 * @privilege %http://tizen.org/privilege/tethering.admin
703 * @param[in] tethering The tethering handle
704 * @param[out] type The security type
705 * @return 0 on success, otherwise negative error value
706 * @retval #TETHERING_ERROR_NONE Successful
707 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
708 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
709 * @see tethering_wifi_set_security_type()
711 int tethering_wifi_get_security_type(tethering_h tethering, tethering_wifi_security_type_e *type);
714 * @brief Sets the SSID (service set identifier).
715 * @details The SSID cannot exceed 32 bytes. If SSID is not set, device name is used as SSID.
717 * @privlevel platform
718 * @privilege %http://tizen.org/privilege/tethering.admin
719 * @remarks This change is applied next time Wi-Fi tethering is enabled with same @a tethering handle.
720 * @param[in] tethering The tethering handle
721 * @param[in] ssid The SSID
722 * @return 0 on success, otherwise negative error value
723 * @retval #TETHERING_ERROR_NONE Successful
724 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
725 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
727 int tethering_wifi_set_ssid(tethering_h tethering, const char *ssid);
730 * @brief Gets the SSID (service set identifier).
732 * @privlevel platform
733 * @privilege %http://tizen.org/privilege/tethering.admin
734 * @remarks @a ssid must be released using free().
735 * @param[in] tethering The tethering handle
736 * @param[out] ssid The SSID
737 * @return 0 on success, otherwise negative error value
738 * @retval #TETHERING_ERROR_NONE Successful
739 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
740 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
741 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
743 int tethering_wifi_get_ssid(tethering_h tethering, char **ssid);
746 * @brief Sets the visibility of SSID (service set identifier).
747 * @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.
749 * @privlevel platform
750 * @privilege %http://tizen.org/privilege/tethering.admin
751 * @remarks This change is applied next time Wi-Fi tethering is enabled.
752 * @param[in] tethering The tethering handle
753 * @param[in] visible The visibility of SSID: (@c true = visible, @c false = invisible)
754 * @return 0 on success, otherwise negative error value
755 * @retval #TETHERING_ERROR_NONE Successful
756 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
757 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
758 * @see tethering_wifi_get_ssid_visibility()
760 int tethering_wifi_set_ssid_visibility(tethering_h tethering, bool visible);
763 * @brief Gets the visibility of SSID (service set identifier).
764 * @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.
766 * @privlevel platform
767 * @privilege %http://tizen.org/privilege/tethering.admin
768 * @param[in] tethering The tethering handle
769 * @param[out] visible The visibility of SSID: (@c true = visible, @c false = invisible)
770 * @return 0 on success, otherwise negative error value
771 * @retval #TETHERING_ERROR_NONE Successful
772 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
773 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
774 * @see tethering_wifi_set_ssid_visibility()
776 int tethering_wifi_get_ssid_visibility(tethering_h tethering, bool *visible);
779 * @brief Sets the passphrase.
781 * @privlevel platform
782 * @privilege %http://tizen.org/privilege/tethering.admin
783 * @remarks This change is applied next time Wi-Fi tethering is enabled.
784 * @param[in] tethering The tethering handle
785 * @param[in] passphrase The passphrase
786 * @return 0 on success, otherwise negative error value
787 * @retval #TETHERING_ERROR_NONE Successful
788 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
789 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
790 * @see tethering_wifi_get_passphrase()
792 int tethering_wifi_set_passphrase(tethering_h tethering, const char *passphrase);
795 * @brief Gets the passphrase.
797 * @privlevel platform
798 * @privilege %http://tizen.org/privilege/tethering.admin
799 * @remarks @a passphrase must be released using free().
800 * @param[in] tethering The tethering handle
801 * @param[out] passphrase The passphrase
802 * @return 0 on success, otherwise negative error value
803 * @retval #TETHERING_ERROR_NONE Successful
804 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
805 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
806 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
807 * @see tethering_wifi_set_passphrase()
809 int tethering_wifi_get_passphrase(tethering_h tethering, char **passphrase);
812 * @brief Reloads the settings (SSID / Passphrase / Security type / SSID visibility).
814 * @privlevel platform
815 * @privilege %http://tizen.org/privilege/tethering.admin
816 * @remarks Connected devices via Wi-Fi tethering or MobileAP will be disconnected when the settings are reloaded.
817 * @param[in] tethering The tethering handle
818 * @param[in] callback The callback function to invoke
819 * @param[in] user_data The user data to be passed to the callback function
820 * @return 0 on success, otherwise negative error value
821 * @retval #TETHERING_ERROR_NONE Successful
822 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
823 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
825 int tethering_wifi_reload_settings(tethering_h tethering, tethering_wifi_settings_reloaded_cb callback, void *user_data);
828 * @brief Gets the mac_filter for Wi-Fi Tethering.
829 * @details If you set the mac_filter to enable, then the device can be allowed/blocked based on mac-address.
830 * By default mac_filter is set to false.
832 * @privlevel platform
833 * @privilege %http://tizen.org/privilege/tethering.admin
834 * @param[in] tethering The handle of tethering
835 * @param[out] mac_filter The mac filter: (@c true = enable, @c false = disable)
836 * @return 0 on success, otherwise negative error value.
837 * @retval #TETHERING_ERROR_NONE Successful
838 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
839 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
840 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
841 * @see tethering_mobileap_set_mac_filter()
843 int tethering_wifi_get_mac_filter(tethering_h tethering, bool *mac_filter);
846 * @brief Sets the mac-filter for Wi-Fi Tethering.
847 * @details If you set the mac_filter to enable, then the device can be allowed/blocked based on mac-address.
848 * By default mac_filter is set to @c false.
850 * @privlevel platform
851 * @privilege %http://tizen.org/privilege/tethering.admin
852 * @remarks This change is applied next time Wi-Fi tethering is enabled.
853 * @param[in] tethering The tethering handle
854 * @param[in] mac_filter The mac filter: (@c true = enable, @c false = disable)
855 * @return 0 on success, otherwise negative error value
856 * @retval #TETHERING_ERROR_NONE Successful
857 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
858 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
859 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
860 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
861 * @see tethering_mobileap_get_mac_filter()
863 int tethering_wifi_set_mac_filter(tethering_h tethering, bool mac_filter);
866 * @brief Adds the mac-address to the allowed client list.
867 * @details AP can allow the client by adding clients mac-address to the allowed list.
869 * @privlevel platform
870 * @privilege %http://tizen.org/privilege/tethering.admin
871 * @param[in] tethering The handle of tethering
872 * @param[in] mac The mac address
873 * @return 0 on success, otherwise negative error value.
874 * @retval #TETHERING_ERROR_NONE Successful
875 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
876 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
877 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
878 * @see tethering_mobileap_set_mac_filter()
880 int tethering_wifi_add_allowed_mac_list(tethering_h tethering, const char *mac);
883 * @brief Removes the mac-address from the allowed client list.
884 * @details Removes the mac-address from the allowed client list.
886 * @privlevel platform
887 * @privilege %http://tizen.org/privilege/tethering.admin
888 * @param[in] tethering The handle of tethering
889 * @param[in] mac The mac address
890 * @return 0 on success, otherwise negative error value.
891 * @retval #TETHERING_ERROR_NONE Successful
892 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
893 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
894 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
895 * @see tethering_mobileap_set_mac_filter()
897 int tethering_wifi_remove_allowed_mac_list(tethering_h tethering, const char *mac);
899 * @brief Gets the mac-addresses from the allowed client list.
900 * @details Gets the mac-addresses from the allowed client list.
902 * @privlevel platform
903 * @privilege %http://tizen.org/privilege/tethering.admin
904 * @param[in] tethering The handle of tethering
905 * @param[out] allowed_mac_list list of allowed mac addresses list
906 * @return 0 on success, otherwise negative error value.
907 * @retval #TETHERING_ERROR_NONE Successful
908 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
909 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
910 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
911 * @see tethering_mobileap_set_mac_filter()
913 int tethering_wifi_get_allowed_mac_list(tethering_h tethering, void **allowed_mac_list);
916 * @brief Adds the mac-address to the blocked(black list) client list.
917 * @details AP can disallow the client by adding clients mac-address to the blocked list.
919 * @privlevel platform
920 * @privilege %http://tizen.org/privilege/tethering.admin
921 * @param[in] tethering The handle of tethering
922 * @param[in] mac The mac address
923 * @return 0 on success, otherwise negative error value.
924 * @retval #TETHERING_ERROR_NONE Successful
925 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
926 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
927 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
928 * @see tethering_mobileap_set_mac_filter()
930 int tethering_wifi_add_blocked_mac_list(tethering_h tethering, const char *mac);
933 * @brief Removes the mac-address from the blocked(black list) client list.
934 * @details Removes the mac-address from the blocked client list.
936 * @privlevel platform
937 * @privilege %http://tizen.org/privilege/tethering.admin
938 * @param[in] tethering The handle of tethering
939 * @param[in] mac The mac address
940 * @return 0 on success, otherwise negative error value.
941 * @retval #TETHERING_ERROR_NONE Successful
942 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
943 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
944 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
945 * @see tethering_mobileap_set_mac_filter()
947 int tethering_wifi_remove_blocked_mac_list(tethering_h tethering, const char *mac);
950 * @brief Gets the mac-addresses from the blocked client list.
951 * @details Get the mac-addresses from the blocked client list.
953 * @privlevel platform
954 * @privilege %http://tizen.org/privilege/tethering.admin
955 * @param[in] tethering The handle of tethering
956 * @param[out] blocked_mac_list list of blocked mac addresses list
957 * @return 0 on success, otherwise negative error value.
958 * @retval #TETHERING_ERROR_NONE Successful
959 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
960 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
961 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
962 * @see tethering_mobileap_set_mac_filter()
964 int tethering_wifi_get_blocked_mac_list(tethering_h tethering, void **blocked_mac_list);
967 * @brief Enables/disables the dhcp server.
969 * @privlevel platform
970 * @privilege %http://tizen.org/privilege/tethering.admin
971 * @details Enable/disable the dhcp server.
972 * @param[in] tethering The handle of tethering
973 * @param[in] enable Enable/disable the dhcp server
974 * @return 0 on success, otherwise negative error value.
975 * @retval #TETHERING_ERROR_NONE Successful
976 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
978 int tethering_wifi_enable_dhcp(tethering_h tethering, bool enable);
981 * @brief Enables the dhcp server with the address range.
983 * @privlevel platform
984 * @privilege %http://tizen.org/privilege/tethering.admin
985 * @details Enable the dhcp server with the address range.
986 * @param[in] tethering The handle of tethering
987 * @param[in] rangestart Start address range
988 * @param[in] rangestop End address range
989 * @return 0 on success, otherwise negative error value.
990 * @retval #TETHERING_ERROR_NONE Successful
991 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
993 int tethering_wifi_set_dhcp_range(tethering_h tethering, char *rangestart, char *rangestop);
996 * @brief Checks whether the dhcp is enabled or not.
998 * @privlevel platform
999 * @privilege %http://tizen.org/privilege/tethering.admin
1000 * @param[in] tethering The tethering handle
1001 * @param[out] dhcp_enabled @c true if dhcp is enabled, \n @c false if dhcp is disabled
1002 * @return 0 on success, otherwise a negative error value
1003 * @retval #TETHERING_ERROR_NONE Successful
1004 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1006 int tethering_wifi_is_dhcp_enabled(tethering_h tethering, bool *dhcp_enabled);
1009 * @brief Sets the Channel for Wi-Fi.
1010 * @details The Channel should be in between 1-14. If channel is not set, Wi-Fi sets default channel.
1012 * @privlevel platform
1013 * @privilege %http://tizen.org/privilege/tethering.admin
1014 * @param[in] tethering The tethering handle
1015 * @param[in] channel The channel number
1016 * @return 0 on success, otherwise negative error value
1017 * @retval #TETHERING_ERROR_NONE Successful
1018 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1020 int tethering_wifi_set_channel(tethering_h tethering, int channel);
1023 * @brief Gets the channel for Wi-Fi.
1024 * @details If channel is not set, Wi-Fi gets default channel.
1026 * @privlevel platform
1027 * @privilege %http://tizen.org/privilege/tethering.admin
1028 * @param[in] tethering The tethering handle
1029 * @param[out] channel The channel number
1030 * @return 0 on success, otherwise negative error value
1031 * @retval #TETHERING_ERROR_NONE Successful
1032 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1033 * @see tethering_wifi_set_channel()
1035 int tethering_wifi_get_channel(tethering_h tethering, int *channel);
1038 * @brief Sets the mode for Wi-Fi.
1039 * @details The mobile AP mode (ex: b only, g only, ad, a). If mode is not set, Wi-Fi sets default mode.
1041 * @privlevel platform
1042 * @privilege %http://tizen.org/privilege/tethering.admin
1043 * @param[in] tethering The tethering handle
1044 * @param[in] type The mobile AP mode
1045 * @return 0 on success, otherwise negative error value
1046 * @retval #TETHERING_ERROR_NONE Successful
1047 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1049 int tethering_wifi_set_mode(tethering_h tethering, tethering_wifi_mode_type_e type);
1052 * @brief Gets the mode for Wi-Fi.
1053 * @details If the mode is not set, Wi-Fi gets default mode.
1055 * @privlevel platform
1056 * @privilege %http://tizen.org/privilege/tethering.admin
1057 * @remarks @a mode must be released using free().
1058 * @param[in] tethering The tethering handle
1059 * @param[out] type The mode of Wi-Fi tethering
1060 * @return 0 on success, otherwise negative error value
1061 * @retval #TETHERING_ERROR_NONE Successful
1062 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1063 * @see tethering_wifi_set_mode()
1065 int tethering_wifi_get_mode(tethering_h tethering, tethering_wifi_mode_type_e *type);
1068 * @brief Sets txpower for Wi-Fi tethering.
1070 * @privlevel platform
1071 * @privilege http://tizen.org/privilege/tethering.admin
1072 * @param[in] tethering The tethering handle
1073 * @param[in] txpower value of txpower to be set
1074 * @return 0 on success, otherwise a negative error value
1075 * @retval #TETHERING_ERROR_NONE Successful
1076 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1077 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1078 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1079 * @see tethering_wifi_get_txpower()
1081 int tethering_wifi_set_txpower(tethering_h tethering, unsigned int txpower);
1084 * @brief Gets txpower for Wi-Fi tethering.
1086 * @privlevel platform
1087 * @privilege http://tizen.org/privilege/tethering.admin
1088 * @param[in] tethering The tethering handle
1089 * @param[out] txpower value of txpower
1090 * @return 0 on success, otherwise a negative error value
1091 * @retval #TETHERING_ERROR_NONE Successful
1092 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1093 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1094 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1095 * @see tethering_wifi_set_txpower()
1097 int tethering_wifi_get_txpower(tethering_h tethering, unsigned int *txpower);
1100 * @brief Sets mtu for Wi-Fi tethering.
1102 * @privlevel platform
1103 * @privilege %http://tizen.org/privilege/tethering.admin
1104 * @param[in] tethering The tethering handle
1105 * @param[in] mtu value of mtu to be set
1106 * @return 0 on success, otherwise a negative error value
1107 * @retval #TETHERING_ERROR_NONE Successful
1108 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1109 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1110 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1112 int tethering_wifi_set_mtu(tethering_h tethering, unsigned int mtu);
1115 * @brief Changes mac address for Wi-Fi tethering.
1117 * @privlevel platform
1118 * @privilege %http://tizen.org/privilege/tethering.admin
1119 * @param[in] tethering The client handle
1120 * @param[in] mac The mac address
1121 * @return 0 on success, otherwise a negative error value
1122 * @retval #TETHERING_ERROR_NONE Successful
1123 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1124 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1125 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1127 int tethering_wifi_change_mac(tethering_h tethering, char *mac);
1130 * @brief Sets max connected devices for Wi-Fi tethering.
1132 * @privlevel platform
1133 * @privilege %http://tizen.org/privilege/tethering.admin
1134 * @param[in] tethering The client handle
1135 * @param[in] max_device value of max_device to be set
1136 * @return 0 on success, otherwise a negative error value
1137 * @retval #TETHERING_ERROR_NONE Successful
1138 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1139 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1140 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1141 * @see tethering_wifi_get_max_connected_device()
1143 int tethering_wifi_set_max_connected_device(tethering_h tethering, int max_device);
1146 * @brief Gets max connected devices for Wi-Fi tethering.
1148 * @privlevel platform
1149 * @privilege %http://tizen.org/privilege/tethering.admin
1150 * @param[in] tethering The client handle
1151 * @param[out] max_device value of max_device
1152 * @return 0 on success, otherwise a negative error value
1153 * @retval #TETHERING_ERROR_NONE Successful
1154 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1155 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1156 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1157 * @see tethering_wifi_set_max_connected_device()
1159 int tethering_wifi_get_max_connected_device(tethering_h tethering, int *max_device);
1162 * @brief Enables port forwarding feature.
1164 * @privlevel platform
1165 * @privilege %http://tizen.org/privilege/tethering.admin
1166 * @details enable/disable port forwarding feature.
1167 * @param[in] tethering The handle of tethering
1168 * @param[in] enable Enable/Disable port forwarding
1169 * @return 0 on success, otherwise negative error value.
1170 * @retval #TETHERING_ERROR_NONE Successful
1171 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1172 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1173 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1175 int tethering_wifi_enable_port_forwarding(tethering_h tethering, bool enable);
1178 * @brief Sets port forwarding rule.
1180 * @privlevel platform
1181 * @privilege %http://tizen.org/privilege/tethering.admin
1182 * @details Set port forwarding rule.
1183 * @param[in] tethering The handle of tethering
1184 * @param[in] ifname interface name
1185 * @param[in] protocol protocol (tcp/udp)
1186 * @param[in] org_ip original destination ip where packet was meant to sent
1187 * @param[in] org_port original destination port where packet was meant to sent
1188 * @param[in] final_ip new destination ip where packet will be forwarded
1189 * @param[in] final_port new destination port where packet will be forwarded
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
1196 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 * @brief Resets port forwarding rule.
1201 * @privlevel platform
1202 * @privilege %http://tizen.org/privilege/tethering.admin
1203 * @details Reset port forwarding rule.
1204 * @param[in] tethering The handle of tethering
1205 * @return 0 on success, otherwise negative error value.
1206 * @retval #TETHERING_ERROR_NONE Successful
1207 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1208 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1209 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1211 int tethering_wifi_reset_port_forwarding_rule(tethering_h tethering);
1214 * @brief Checks whether the port forwarding is enabled or not.
1216 * @privlevel platform
1217 * @privilege %http://tizen.org/privilege/tethering.admin
1218 * @param[in] tethering The tethering handle
1219 * @param[out] forwarding_enabled @c true if port forwarding is enabled, \n @c false if port forwarding is disabled
1220 * @return 0 on success, otherwise a negative error value
1221 * @retval #TETHERING_ERROR_NONE Successful
1222 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1223 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1224 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1226 int tethering_wifi_is_port_forwarding_enabled(tethering_h tethering, bool* forwarding_enabled);
1229 * @brief Gets the port forwarding rule for Wi-Fi tethering.
1231 * @privlevel platform
1232 * @privilege %http://tizen.org/privilege/tethering.admin
1233 * @param[in] tethering The client handle
1234 * @param[out] port_forwarding_list list of port forwarding rules
1235 * @return 0 on success, otherwise a negative error value
1236 * @retval #TETHERING_ERROR_NONE Successful
1237 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1238 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1239 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1241 int tethering_wifi_get_port_forwarding_rule(tethering_h tethering, void **port_forwarding_list);
1244 * @brief Enables port filtering feature.
1246 * @privlevel platform
1247 * @privilege %http://tizen.org/privilege/tethering.admin
1248 * @details enable/disable port filtering feature.
1249 * @param[in] tethering The handle of tethering
1250 * @param[in] enable Enable/Disable port filtering
1251 * @return 0 on success, otherwise negative error value.
1252 * @retval #TETHERING_ERROR_NONE Successful
1253 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1254 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1255 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1257 int tethering_wifi_enable_port_filtering(tethering_h tethering, bool enable);
1260 * @brief Sets port filtering rule.
1262 * @privlevel platform
1263 * @privilege %http://tizen.org/privilege/tethering.admin
1264 * @details Set port filtering rule.
1265 * @param[in] tethering The handle of tethering
1266 * @param[in] port to be filtered
1267 * @param[in] protocol protocol (tcp/udp)
1268 * @param[in] allow allow/disallow port filtering
1269 * @return 0 on success, otherwise negative error value.
1270 * @retval #TETHERING_ERROR_NONE Successful
1271 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1272 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1273 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1275 int tethering_wifi_add_port_filtering_rule(tethering_h tethering, int port, char *protocol, bool allow);
1278 * @brief Sets custom port filtering rule.
1280 * @privlevel platform
1281 * @privilege %http://tizen.org/privilege/tethering.admin
1282 * @details Set custom port filtering rule.
1283 * @param[in] tethering The handle of tethering
1284 * @param[in] port1 to be filtered
1285 * @param[in] port2 to be filtered
1286 * @param[in] protocol protocol (tcp/udp)
1287 * @param[in] allow allow/disallow port filtering
1288 * @return 0 on success, otherwise negative error value.
1289 * @retval #TETHERING_ERROR_NONE Successful
1290 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1291 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1292 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1294 int tethering_wifi_add_custom_port_filtering_rule(tethering_h tethering, int port1, int port2, char *protocol, bool allow);
1297 * @brief Gets the port filtering rule for Wi-Fi tethering.
1299 * @privlevel platform
1300 * @privilege %http://tizen.org/privilege/tethering.admin
1301 * @param[in] tethering The client handle
1302 * @param[out] port_filtering_list list of port filtering rules
1303 * @return 0 on success, otherwise a negative error value
1304 * @retval #TETHERING_ERROR_NONE Successful
1305 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1306 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1307 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1309 int tethering_wifi_get_port_filtering_rule(tethering_h tethering, void **port_filtering_list);
1312 * @brief Gets the custom port filtering rule for Wi-Fi tethering.
1314 * @privlevel platform
1315 * @privilege %http://tizen.org/privilege/tethering.admin
1316 * @param[in] tethering The client handle
1317 * @param[out] custom_port_filtering_list list of custom port filtering rules
1318 * @return 0 on success, otherwise a negative error value
1319 * @retval #TETHERING_ERROR_NONE Successful
1320 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1321 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1322 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1324 int tethering_wifi_get_custom_port_filtering_rule(tethering_h tethering, void **custom_port_filtering_list);
1327 * @brief Checks whether the port filtering is enabled or not.
1329 * @privlevel platform
1330 * @privilege %http://tizen.org/privilege/tethering.admin
1331 * @param[in] tethering The tethering handle
1332 * @param[out] filtering_enabled @c true if port filtering is enabled, \n @c false if port filtering is disabled
1333 * @return 0 on success, otherwise a negative error value
1334 * @retval #TETHERING_ERROR_NONE Successful
1335 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1336 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1337 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1339 int tethering_wifi_is_port_filtering_enabled(tethering_h tethering, bool* filtering_enabled);
1342 * @brief Sets vpn passthrough rule.
1344 * @privlevel platform
1345 * @privilege %http://tizen.org/privilege/tethering.admin
1346 * @details Set vpn passthrough rule.
1347 * @param[in] tethering The handle of tethering
1348 * @param[in] type vpn passthrough type
1349 * @param[in] enable @c true if vpn passthrough is enabled, \n @c false if vpn passthrough is disabled
1350 * @return 0 on success, otherwise negative error value.
1351 * @retval #TETHERING_ERROR_NONE Successful
1352 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1353 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1354 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1356 int tethering_wifi_set_vpn_passthrough_rule(tethering_h tethering, tethering_vpn_passthrough_type_e type, bool enable);
1359 * @brief Pushes the WPS button to connect with Wi-Fi Tethering client. (WPS PBC)
1361 * @remarks The WPS button should be pushed when client tries to connect with Soft AP by using WPS PBC.
1362 * @param[in] tethering The tethering handle
1363 * @return 0 on success, otherwise negative error value
1364 * @retval #TETHERING_ERROR_NONE Successful
1365 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1366 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
1367 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission denied
1368 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
1370 int tethering_wifi_push_wps_button(tethering_h tethering);
1373 * @brief Sets the WPS PIN to connect with Wi-Fi Tethering client. (WPS PIN)
1375 * @remarks The WPS PIN should be inserted when client tries to connect with Soft AP by using WPS PIN.
1376 * @param[in] tethering The tethering handle
1377 * @param[in] wps_pin The WPS PIN
1378 * @return 0 on success, otherwise negative error value
1379 * @retval #TETHERING_ERROR_NONE Successful
1380 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1381 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
1382 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission denied
1383 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
1385 int tethering_wifi_set_wps_pin(tethering_h tethering, const char *wps_pin);
1394 * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
1399 * @brief Clones the handle of a client.
1401 * @privlevel platform
1402 * @privilege %http://tizen.org/privilege/tethering.admin
1403 * @remarks @a dest must be release using tethering_client_destroy().
1404 * @param[out] dest The cloned client handle
1405 * @param[in] origin The origin client handle
1406 * @return 0 on success, otherwise a negative error value
1407 * @retval #TETHERING_ERROR_NONE Successful
1408 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1409 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1410 * @see tethering_client_destroy()
1412 int tethering_client_clone(tethering_client_h *dest, tethering_client_h origin);
1415 * @brief Destroys the handle of a client.
1417 * @privlevel platform
1418 * @privilege %http://tizen.org/privilege/tethering.admin
1419 * @param[in] client The client handle
1420 * @return 0 on success, otherwise a negative error value
1421 * @retval #TETHERING_ERROR_NONE Successful
1422 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1423 * @see tethering_client_clone()
1425 int tethering_client_destroy(tethering_client_h client);
1428 * @brief Gets the tethering type of client.
1430 * @privlevel platform
1431 * @privilege %http://tizen.org/privilege/tethering.admin
1432 * @param[in] client The handle of client
1433 * @param[out] type The type of tethering
1434 * @return 0 on success, otherwise a negative error value.
1435 * @retval #TETHERING_ERROR_NONE Successful
1436 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1437 * @see tethering_usb_get_connected_client()
1438 * @see tethering_connection_state_changed_cb()
1440 int tethering_client_get_tethering_type(tethering_client_h client, tethering_type_e *type);
1443 * @brief Gets the name of a client.
1445 * @privlevel platform
1446 * @privilege %http://tizen.org/privilege/tethering.admin
1447 * @remarks @a name must be released using free().
1448 * @param[in] client The client handle
1449 * @param[out] name The name of the client
1450 * @return 0 on success, otherwise a negative error value
1451 * @retval #TETHERING_ERROR_NONE Successful
1452 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1453 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1454 * @see tethering_usb_get_connected_client()
1455 * @see tethering_connection_state_changed_cb()
1457 int tethering_client_get_name(tethering_client_h client, char **name);
1460 * @brief Gets the IP address of a client.
1462 * @privlevel platform
1463 * @privilege %http://tizen.org/privilege/tethering.admin
1464 * @remarks @a ip_address must be released using free().
1465 * @param[in] client The client handle
1466 * @param[in] address_family The address family of IP address. Currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported
1467 * @param[out] ip_address The IP address
1468 * @return 0 on success, otherwise a negative error value
1469 * @retval #TETHERING_ERROR_NONE Successful
1470 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1471 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1472 * @see tethering_usb_get_connected_client()
1473 * @see tethering_connection_state_changed_cb()
1475 int tethering_client_get_ip_address(tethering_client_h client, tethering_address_family_e address_family, char **ip_address);
1478 * @brief Gets the MAC address of a client such as "FC:A1:3E:D6:B1:B1".
1480 * @privlevel platform
1481 * @privilege %http://tizen.org/privilege/tethering.admin
1482 * @remarks @a mac_address must be released using free().
1483 * @param[in] client The client handle
1484 * @param[out] mac_address The MAC address
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 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1489 * @see tethering_usb_get_connected_client()
1490 * @see tethering_connection_state_changed_cb()
1492 int tethering_client_get_mac_address(tethering_client_h client, char **mac_address);
1495 * @brief Gets the connection time of a client.
1497 * @privlevel platform
1498 * @privilege %http://tizen.org/privilege/tethering.admin
1499 * @param[in] client The client handle
1500 * @param[out] time The connected time of the client
1501 * @return 0 on success, otherwise a negative error value
1502 * @retval #TETHERING_ERROR_NONE Successful
1503 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1504 * @see tethering_usb_get_connected_client()
1505 * @see tethering_connection_state_changed_cb()
1507 int tethering_client_get_time(tethering_client_h client, time_t *timestamp);
1518 #endif /* __TIZEN_NETWORK_TETHERING_H__ */