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 */
68 TETHERING_TYPE_P2P, /**< P2P type */
69 TETHERING_TYPE_WIFI_SHARING, /**< Wi-Fi Sharing */
73 * @brief Enumeration for the cause of disabling the tethering.
77 TETHERING_DISABLED_BY_USB_DISCONNECTION = 0, /**< Disabled due to usb disconnection */
78 TETHERING_DISABLED_BY_FLIGHT_MODE, /**< Disabled due to flight mode */
79 TETHERING_DISABLED_BY_LOW_BATTERY, /**< Disabled due to low battery */
80 TETHERING_DISABLED_BY_NETWORK_CLOSE, /**< Disabled due to pdp network close */
81 TETHERING_DISABLED_BY_TIMEOUT, /**< Disabled due to timeout */
82 TETHERING_DISABLED_BY_OTHERS, /**< Disabled by other apps */
83 TETHERING_DISABLED_BY_REQUEST, /**< Disabled by your request */
84 TETHERING_DISABLED_BY_WIFI_ON, /**< Disabled due to Wi-Fi on */
85 TETHERING_DISABLED_BY_BT_OFF, /**< Disabled due to Bluetooth off */
86 } tethering_disabled_cause_e;
94 * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
99 * @brief Enumeration for the Wi-Fi security.
103 TETHERING_WIFI_SECURITY_TYPE_NONE = 0, /**< No Security type */
104 TETHERING_WIFI_SECURITY_TYPE_WPA2_PSK, /**< WPA2_PSK */
105 TETHERING_WIFI_SECURITY_TYPE_WPS, /**< WPA2_PSK */
106 TETHERING_WIFI_SECURITY_TYPE_SAE, /**< SAE */
107 } tethering_wifi_security_type_e;
110 * @brief Enumeration for the Wi-Fi mode
114 TETHERING_WIFI_MODE_TYPE_B = 0, /**< mode b */
115 TETHERING_WIFI_MODE_TYPE_G, /**< mode g */
116 TETHERING_WIFI_MODE_TYPE_A, /**< mode a */
117 TETHERING_WIFI_MODE_TYPE_AD, /**< mode ad */
118 } tethering_wifi_mode_type_e;
121 TETHERING_TYPE_IPSEC_PASSTHROUGH = 0, /**< IPSEC */
122 TETHERING_TYPE_PPTP_PASSTHROUGH, /**< PPTP type */
123 TETHERING_TYPE_L2TP_PASSTHROUGH, /**< L2TP type */
124 } tethering_vpn_passthrough_type_e;
132 * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
137 * @brief The tethering client handle.
140 typedef void * tethering_client_h;
143 * @brief Enumeration for address family.
147 TETHERING_ADDRESS_FAMILY_IPV4 = 0, /**< IPV4 Address type */
148 TETHERING_ADDRESS_FAMILY_IPV6 = 1, /**< IPV6 Address type (Since 4.0) */
149 } tethering_address_family_e;
157 * @addtogroup CAPI_NETWORK_TETHERING_MANAGER_MODULE
162 * @brief Called when the tethering is enabled.
164 * @param[in] result The result of enabling the tethering
165 * @param[in] type The tethering type
166 * @param[in] is_requested Indicates whether this change is requested
167 * @param[in] user_data The user data passed from tethering_set_enabled_cb()
168 * @pre If you register callback function using tethering_set_enabled_cb(), this will be invoked when the tethering is enabled.
169 * @see tethering_enable()
170 * @see tethering_unset_enabled_cb()
172 typedef void (*tethering_enabled_cb)(tethering_error_e result, tethering_type_e type, bool is_requested, void *user_data);
175 * @brief Called when the tethering is disabled.
177 * @param[in] result The result of disabling the tethering
178 * @param[in] type The tethering type
179 * @param[in] cause The cause of disabling
180 * @param[in] user_data The user data passed from tethering_set_disabled_cb()
181 * @pre If you register callback function using tethering_set_disabled_cb(), this will be invoked when the tethering is disabled.
182 * @see tethering_set_disabled_cb()
183 * @see tethering_unset_disabled_cb()
185 typedef void (*tethering_disabled_cb)(tethering_error_e result, tethering_type_e type, tethering_disabled_cause_e cause, void *user_data);
188 * @brief Called when the connection state is changed.
190 * @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().
191 * @param[in] client The client of which connection state is changed
192 * @param[in] opened @c true when connection is opened, otherwise false
193 * @param[in] user_data The user data passed from tethering_set_connection_state_changed_cb()
194 * @pre If you register callback function using tethering_set_connection_state_changed_cb(), this will be invoked when the connection state is changed.
195 * @see tethering_set_connection_state_changed_cb()
196 * @see tethering_unset_connection_state_changed_cb()
198 typedef void (*tethering_connection_state_changed_cb)(tethering_client_h client, bool opened, void *user_data);
201 * @brief Called when you get the connected client repeatedly.
203 * @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().
204 * @param[in] client The connected client
205 * @param[in] user_data The user data passed from the request function
206 * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
207 * @pre tethering_foreach_connected_clients() will invoke this callback.
208 * @see tethering_foreach_connected_clients()
210 typedef bool(*tethering_connected_client_cb)(tethering_client_h client, void *user_data);
213 * @brief Called when you get the data usage.
215 * @param[in] result The result of getting the data usage
216 * @param[in] received_data The usage of received data
217 * @param[in] sent_data The usage of sent data
218 * @param[in] user_data The user data passed from the request function
219 * @pre tethering_get_data_usage() will invoked this callback.
221 typedef void (*tethering_data_usage_cb)(tethering_error_e result, unsigned long long received_data, unsigned long long sent_data, void *user_data);
224 * @brief Called when the security type of Wi-Fi tethering is changed.
226 * @param[in] changed_type The changed security type of Wi-Fi tethering
227 * @param[in] user_data The user data passed from the register function
228 * @see tethering_wifi_set_security_type_changed_cb()
229 * @see tethering_wifi_unset_security_type_changed_cb()
231 typedef void (*tethering_wifi_security_type_changed_cb)(tethering_wifi_security_type_e changed_type, void *user_data);
234 * @brief Called when the visibility of SSID is changed.
236 * @param[in] changed_visible The changed visibility of SSID
237 * @param[in] user_data The user data passed from the register function
238 * @see tethering_wifi_set_ssid_visibility_changed_cb()
239 * @see tethering_wifi_unset_ssid_visibility_changed_cb()
241 typedef void (*tethering_wifi_ssid_visibility_changed_cb)(bool changed_visible, void *user_data);
244 * @brief Called when the passphrase of Wi-Fi tethering is changed.
246 * @param[in] user_data The user data passed from the register function
247 * @see tethering_wifi_set_passphrase_changed_cb()
248 * @see tethering_wifi_unset_passphrase_changed_cb()
250 typedef void (*tethering_wifi_passphrase_changed_cb)(void *user_data);
253 * @brief Called when the settings are reloaded.
255 * @param[in] result The result of reloading the settings
256 * @param[in] user_data The user data passed from the request function
257 * @pre tethering_wifi_reload_settings() will invoke this callback.
259 typedef void (*tethering_wifi_settings_reloaded_cb)(tethering_error_e result, void *user_data);
262 * @brief Creates the handle for tethering.
264 * @privlevel platform
265 * @privilege %http://tizen.org/privilege/tethering.admin
266 * @remarks The @a tethering must be released using tethering_destroy().
267 * @param[out] tethering A handle of a new mobile ap handle on success
268 * @return 0 on success, otherwise a negative error value
269 * @retval #TETHERING_ERROR_NONE Successful
270 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
271 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
272 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API is not supported
273 * @see tethering_destroy()
275 int tethering_create(tethering_h *tethering);
278 * @brief Destroys the handle for tethering.
280 * @privlevel platform
281 * @privilege %http://tizen.org/privilege/tethering.admin
282 * @param[in] tethering The tethering handle
283 * @return 0 on success, otherwise a negative error value
284 * @retval #TETHERING_ERROR_NONE Successful
285 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
286 * @see tethering_create()
288 int tethering_destroy(tethering_h tethering);
291 * @brief Enables the tethering, asynchronously.
293 * @privlevel platform
294 * @privilege %http://tizen.org/privilege/tethering.admin
295 * @param[in] tethering The tethering handle
296 * @param[in] type The tethering type
297 * @return 0 on success, otherwise negative error value
298 * @retval #TETHERING_ERROR_NONE Successful
299 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
300 * @post tethering_enabled_cb() will be invoked.
301 * @see tethering_is_enabled()
302 * @see tethering_disable()
304 int tethering_enable(tethering_h tethering, tethering_type_e type);
307 * @brief Disables the tethering, asynchronously.
309 * @privlevel platform
310 * @privilege %http://tizen.org/privilege/tethering.admin
311 * @param[in] tethering The tethering handle
312 * @param[in] type The tethering type
313 * @return 0 on success, otherwise negative error value
314 * @retval #TETHERING_ERROR_NONE Successful
315 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
316 * @post tethering_disabled_cb() will be invoked.
317 * @see tethering_is_enabled()
318 * @see tethering_enable()
320 int tethering_disable(tethering_h tethering, tethering_type_e type);
323 * @brief Enables the IPv6 tethering, asynchronously.
325 * @privlevel platform
326 * @privilege %http://tizen.org/privilege/tethering.admin
327 * @remarks It supports Wi-Fi tethering and BT tethering only.
328 * @param[in] tethering The tethering handle
329 * @param[in] type The tethering type
330 * @return 0 on success, otherwise negative error value
331 * @retval #TETHERING_ERROR_NONE Successful
332 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
333 * @post tethering_enabled_cb() will be invoked.
334 * @see tethering_is_enabled()
335 * @see tethering_ipv6_disable()
337 int tethering_ipv6_enable(tethering_h tethering, tethering_type_e type);
340 * @brief Disables the IPv6 tethering, asynchronously.
342 * @privlevel platform
343 * @privilege %http://tizen.org/privilege/tethering.admin
344 * @remarks It supports Wi-Fi tethering and BT tethering only.
345 * @param[in] tethering The tethering handle
346 * @param[in] type The tethering type
347 * @return 0 on success, otherwise negative error value
348 * @retval #TETHERING_ERROR_NONE Successful
349 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
350 * @post tethering_disabled_cb() will be invoked.
351 * @see tethering_is_enabled()
352 * @see tethering_ipv6_enable()
354 int tethering_ipv6_disable(tethering_h tethering, tethering_type_e type);
357 * @brief Checks whether the tethering is enabled or not.
359 * @privlevel platform
360 * @privilege %http://tizen.org/privilege/tethering.admin
361 * @param[in] tethering The tethering handle
362 * @param[in] type The tethering type
363 * @return @c true if tethering is enabled, \n @c false if tethering is disabled
365 bool tethering_is_enabled(tethering_h tethering, tethering_type_e type);
368 * @brief Gets the MAC address of local device as "FC:A1:3E:D6:B1:B1".
370 * @privlevel platform
371 * @privilege %http://tizen.org/privilege/tethering.admin
372 * @remarks @a mac_address must be released using free().
373 * @param[in] tethering The tethering handle
374 * @param[in] type The tethering type
375 * @param[out] mac_address The MAC address
376 * @return 0 on success, otherwise a negative error value
377 * @retval #TETHERING_ERROR_NONE Successful
378 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
379 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
380 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
381 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
382 * @pre The tethering must be enabled.
383 * @see tethering_is_enabled()
384 * @see tethering_enable()
386 int tethering_get_mac_address(tethering_h tethering, tethering_type_e type, char **mac_address);
389 * @brief Gets the name of network interface (e.g. usb0).
391 * @privlevel platform
392 * @privilege %http://tizen.org/privilege/tethering.admin
393 * @remarks @a interface_name must be released using free().
394 * @param[in] tethering The tethering handle
395 * @param[in] type The tethering type
396 * @param[out] interface_name The name of the network interface
397 * @return 0 on success, otherwise negative error value
398 * @retval #TETHERING_ERROR_NONE Successful
399 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
400 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
401 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
402 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
403 * @pre The tethering must be enabled.
404 * @see tethering_is_enabled()
405 * @see tethering_enable()
407 int tethering_get_network_interface_name(tethering_h tethering, tethering_type_e type, char **interface_name);
410 * @brief Gets the local IP address.
412 * @privlevel platform
413 * @privilege %http://tizen.org/privilege/tethering.admin
414 * @remarks @a ip_address must be released using free().
415 * @param[in] tethering The tethering handle
416 * @param[in] type The tethering type
417 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
418 * @param[out] ip_address The local IP address
419 * @return 0 on success, otherwise negative error value
420 * @retval #TETHERING_ERROR_NONE Successful
421 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
422 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
423 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
424 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
425 * @pre The tethering must be enabled.
426 * @see tethering_is_enabled()
427 * @see tethering_enable()
429 int tethering_get_ip_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **ip_address);
432 * @brief Gets the Gateway address.
434 * @privlevel platform
435 * @privilege %http://tizen.org/privilege/tethering.admin
436 * @remarks @a gateway_address must be released using free().
437 * @param[in] tethering The tethering handle
438 * @param[in] type The tethering type
439 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
440 * @param[out] gateway_address The local IP address
441 * @return 0 on success, otherwise negative error value
442 * @retval #TETHERING_ERROR_NONE Successful
443 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
444 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
445 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
446 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
447 * @pre The tethering must be enabled.
448 * @see tethering_is_enabled()
449 * @see tethering_enable()
451 int tethering_get_gateway_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **gateway_address);
454 * @brief Gets the Subnet Mask.
456 * @privlevel platform
457 * @privilege %http://tizen.org/privilege/tethering.admin
458 * @remarks @a subnet_mask must be released using free().
459 * @param[in] tethering The tethering handle
460 * @param[in] type The tethering type
461 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
462 * @param[out] subnet_mask The local IP address
463 * @return 0 on success, otherwise negative error value
464 * @retval #TETHERING_ERROR_NONE Successful
465 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
466 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
467 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
468 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
469 * @pre The tethering must be enabled.
470 * @see tethering_is_enabled()
471 * @see tethering_enable()
473 int tethering_get_subnet_mask(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **subnet_mask);
476 * @brief Gets the data usage.
478 * @privlevel platform
479 * @privilege %http://tizen.org/privilege/tethering.admin
480 * @param[in] tethering The tethering handle
481 * @param[out] usage The data usage
482 * @return 0 on success, otherwise negative error value
483 * @retval #TETHERING_ERROR_NONE Successful
484 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
485 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
486 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
487 * @pre The tethering must be enabled.
488 * @see tethering_is_enabled()
489 * @see tethering_enable()
491 int tethering_get_data_usage(tethering_h tethering, tethering_data_usage_cb callback, void *user_data);
494 * @brief Gets the clients which are connected.
496 * @privlevel platform
497 * @privilege %http://tizen.org/privilege/tethering.admin
498 * @param[in] tethering The tethering handle
499 * @param[in] type The tethering type
500 * @param[in] callback The callback function to invoke
501 * @param[in] user_data The user data to be passed to the callback function
502 * @retval #TETHERING_ERROR_NONE Successful
503 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
504 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
505 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
506 * @pre The tethering must be enabled.
507 * @see tethering_is_enabled()
508 * @see tethering_enable()
510 int tethering_foreach_connected_clients(tethering_h tethering, tethering_type_e type, tethering_connected_client_cb callback, void *user_data);
513 * @brief Registers the callback function, which is called when tethering is enabled.
515 * @privlevel platform
516 * @privilege %http://tizen.org/privilege/tethering.admin
517 * @param[in] tethering The tethering handle
518 * @param[in] type The tethering type
519 * @param[in] callback The callback function to invoke
520 * @param[in] user_data The user data to be passed to the callback function
521 * @retval #TETHERING_ERROR_NONE Successful
522 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
523 * @see tethering_unset_enabled_cb()
525 int tethering_set_enabled_cb(tethering_h tethering, tethering_type_e type, tethering_enabled_cb callback, void *user_data);
528 * @brief Unregisters the callback function, which is called when tethering is enabled.
530 * @privlevel platform
531 * @privilege %http://tizen.org/privilege/tethering.admin
532 * @param[in] tethering The tethering handle
533 * @param[in] type The tethering type
534 * @retval #TETHERING_ERROR_NONE Successful
535 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
536 * @see tethering_set_enabled_cb()
538 int tethering_unset_enabled_cb(tethering_h tethering, tethering_type_e type);
541 * @brief Registers the callback function called when tethering is disabled.
543 * @privlevel platform
544 * @privilege %http://tizen.org/privilege/tethering.admin
545 * @param[in] tethering The tethering handle
546 * @param[in] type The tethering type
547 * @param[in] callback The callback function to invoke
548 * @param[in] user_data The user data to be passed to the callback function
549 * @retval #TETHERING_ERROR_NONE Successful
550 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
551 * @see tethering_unset_disabled_cb()
553 int tethering_set_disabled_cb(tethering_h tethering, tethering_type_e type, tethering_disabled_cb callback, void *user_data);
556 * @brief Unregisters the callback function, which is called when tethering is disabled.
558 * @privlevel platform
559 * @privilege %http://tizen.org/privilege/tethering.admin
560 * @param[in] tethering The tethering handle
561 * @param[in] type The tethering type
562 * @retval #TETHERING_ERROR_NONE Successful
563 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
564 * @see tethering_set_disabled_cb()
566 int tethering_unset_disabled_cb(tethering_h tethering, tethering_type_e type);
569 * @brief Registers the callback function, which is called when the state of connection is changed.
571 * @privlevel platform
572 * @privilege %http://tizen.org/privilege/tethering.admin
573 * @param[in] tethering The tethering handle
574 * @param[in] type The tethering type
575 * @param[in] callback The callback function to invoke
576 * @param[in] user_data The user data to be passed to the callback function
577 * @retval #TETHERING_ERROR_NONE Successful
578 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
579 * @see tethering_unset_connection_state_changed_cb_cb()
581 int tethering_set_connection_state_changed_cb(tethering_h tethering, tethering_type_e type, tethering_connection_state_changed_cb callback, void *user_data);
584 * @brief Unregisters the callback function, which is called when the state of connection is changed.
586 * @privlevel platform
587 * @privilege %http://tizen.org/privilege/tethering.admin
588 * @param[in] tethering The tethering handle
589 * @param[in] type The tethering type
590 * @retval #TETHERING_ERROR_NONE Successful
591 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
592 * @see tethering_set_connection_state_changed_cb()
594 int tethering_unset_connection_state_changed_cb(tethering_h tethering, tethering_type_e type);
597 * @brief Registers the callback function, which is called when the security type of Wi-Fi tethering is changed.
599 * @privlevel platform
600 * @privilege %http://tizen.org/privilege/tethering.admin
601 * @param[in] tethering The tethering handle
602 * @param[in] callback The callback function to invoke
603 * @param[in] user_data The user data to be passed to the callback function
604 * @retval #TETHERING_ERROR_NONE Successful
605 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
606 * @see tethering_wifi_unset_security_type_changed_cb()
608 int tethering_wifi_set_security_type_changed_cb(tethering_h tethering, tethering_wifi_security_type_changed_cb callback, void *user_data);
611 * @brief Unregisters the callback function, which is called when the security type of Wi-Fi tethering is changed.
613 * @privlevel platform
614 * @privilege %http://tizen.org/privilege/tethering.admin
615 * @param[in] tethering The tethering handle
616 * @param[in] type The tethering type
617 * @retval #TETHERING_ERROR_NONE Successful
618 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
619 * @see tethering_wifi_set_security_type_changed_cb()
621 int tethering_wifi_unset_security_type_changed_cb(tethering_h tethering);
624 * @brief Registers the callback function , which iscalled when the visibility of SSID is changed.
626 * @privlevel platform
627 * @privilege %http://tizen.org/privilege/tethering.admin
628 * @param[in] tethering The tethering handle
629 * @param[in] callback The callback function to invoke
630 * @param[in] user_data The user data to be passed to the callback function
631 * @retval #TETHERING_ERROR_NONE Successful
632 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
633 * @see tethering_wifi_unset_ssid_visibility_changed_cb_cb()
635 int tethering_wifi_set_ssid_visibility_changed_cb(tethering_h tethering, tethering_wifi_ssid_visibility_changed_cb callback, void *user_data);
638 * @brief Unregisters the callback function, which is called when the visibility of SSID is changed.
640 * @privlevel platform
641 * @privilege %http://tizen.org/privilege/tethering.admin
642 * @param[in] tethering The tethering handle
643 * @retval #TETHERING_ERROR_NONE Successful
644 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
645 * @see tethering_wifi_set_ssid_visibility_changed_cb()
647 int tethering_wifi_unset_ssid_visibility_changed_cb(tethering_h tethering);
650 * @brief Registers the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
652 * @privlevel platform
653 * @privilege %http://tizen.org/privilege/tethering.admin
654 * @param[in] tethering The tethering handle
655 * @param[in] callback The callback function to invoke
656 * @param[in] user_data The user data to be passed to the callback function
657 * @retval #TETHERING_ERROR_NONE Successful
658 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
659 * @see tethering_wifi_unset_passphrase_changed_cb()
661 int tethering_wifi_set_passphrase_changed_cb(tethering_h tethering, tethering_wifi_passphrase_changed_cb callback, void *user_data);
664 * @brief Unregisters the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
666 * @privlevel platform
667 * @privilege %http://tizen.org/privilege/tethering.admin
668 * @param[in] tethering The tethering handle
669 * @retval #TETHERING_ERROR_NONE Successful
670 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
671 * @see tethering_wifi_set_passphrase_changed_cb()
673 int tethering_wifi_unset_passphrase_changed_cb(tethering_h tethering);
681 * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
686 * @brief Sets the security type of Wi-Fi tethering.
688 * @privlevel platform
689 * @privilege %http://tizen.org/privilege/tethering.admin
690 * @remarks This change is applied next time Wi-Fi tethering is enabled.
691 * @param[in] tethering The tethering handle
692 * @param[in] type The security type
693 * @return 0 on success, otherwise negative error value
694 * @retval #TETHERING_ERROR_NONE Successful
695 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
696 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
697 * @see tethering_wifi_get_security_type()
699 int tethering_wifi_set_security_type(tethering_h tethering, tethering_wifi_security_type_e type);
702 * @brief Gets the security type of Wi-Fi tethering.
704 * @privlevel platform
705 * @privilege %http://tizen.org/privilege/tethering.admin
706 * @param[in] tethering The tethering handle
707 * @param[out] type The security type
708 * @return 0 on success, otherwise negative error value
709 * @retval #TETHERING_ERROR_NONE Successful
710 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
711 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
712 * @see tethering_wifi_set_security_type()
714 int tethering_wifi_get_security_type(tethering_h tethering, tethering_wifi_security_type_e *type);
717 * @brief Sets the SSID (service set identifier).
718 * @details The SSID cannot exceed 32 bytes. If SSID is not set, device name is used as SSID.
720 * @privlevel platform
721 * @privilege %http://tizen.org/privilege/tethering.admin
722 * @remarks This change is applied next time Wi-Fi tethering is enabled with same @a tethering handle.
723 * @param[in] tethering The tethering handle
724 * @param[in] ssid The SSID
725 * @return 0 on success, otherwise negative error value
726 * @retval #TETHERING_ERROR_NONE Successful
727 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
728 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
730 int tethering_wifi_set_ssid(tethering_h tethering, const char *ssid);
733 * @brief Gets the SSID (service set identifier).
735 * @privlevel platform
736 * @privilege %http://tizen.org/privilege/tethering.admin
737 * @remarks @a ssid must be released using free().
738 * @param[in] tethering The tethering handle
739 * @param[out] ssid The SSID
740 * @return 0 on success, otherwise negative error value
741 * @retval #TETHERING_ERROR_NONE Successful
742 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
743 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
744 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
746 int tethering_wifi_get_ssid(tethering_h tethering, char **ssid);
749 * @brief Sets the visibility of SSID (service set identifier).
750 * @details If the visibility is set to invisible, then the SSID of this device is hidden and Wi-Fi scan will not find the device.
752 * @privlevel platform
753 * @privilege %http://tizen.org/privilege/tethering.admin
754 * @remarks This change is applied next time Wi-Fi tethering is enabled.
755 * @param[in] tethering The tethering handle
756 * @param[in] visible The visibility of SSID: (@c true = visible, @c false = invisible)
757 * @return 0 on success, otherwise negative error value
758 * @retval #TETHERING_ERROR_NONE Successful
759 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
760 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
761 * @see tethering_wifi_get_ssid_visibility()
763 int tethering_wifi_set_ssid_visibility(tethering_h tethering, bool visible);
766 * @brief Gets the visibility of SSID (service set identifier).
767 * @details If the visibility is set to invisible, then the SSID of this device is hidden and Wi-Fi scan will not find the device.
769 * @privlevel platform
770 * @privilege %http://tizen.org/privilege/tethering.admin
771 * @param[in] tethering The tethering handle
772 * @param[out] visible The visibility of SSID: (@c true = visible, @c false = invisible)
773 * @return 0 on success, otherwise negative error value
774 * @retval #TETHERING_ERROR_NONE Successful
775 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
776 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
777 * @see tethering_wifi_set_ssid_visibility()
779 int tethering_wifi_get_ssid_visibility(tethering_h tethering, bool *visible);
782 * @brief Sets the passphrase.
784 * @privlevel platform
785 * @privilege %http://tizen.org/privilege/tethering.admin
786 * @remarks This change is applied next time Wi-Fi tethering is enabled.
787 * @param[in] tethering The tethering handle
788 * @param[in] passphrase The passphrase
789 * @return 0 on success, otherwise negative error value
790 * @retval #TETHERING_ERROR_NONE Successful
791 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
792 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
793 * @see tethering_wifi_get_passphrase()
795 int tethering_wifi_set_passphrase(tethering_h tethering, const char *passphrase);
798 * @brief Gets the passphrase.
800 * @privlevel platform
801 * @privilege %http://tizen.org/privilege/tethering.admin
802 * @remarks @a passphrase must be released using free().
803 * @param[in] tethering The tethering handle
804 * @param[out] passphrase The passphrase
805 * @return 0 on success, otherwise negative error value
806 * @retval #TETHERING_ERROR_NONE Successful
807 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
808 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
809 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
810 * @see tethering_wifi_set_passphrase()
812 int tethering_wifi_get_passphrase(tethering_h tethering, char **passphrase);
815 * @brief Reloads the settings (SSID / Passphrase / Security type / SSID visibility).
817 * @privlevel platform
818 * @privilege %http://tizen.org/privilege/tethering.admin
819 * @remarks Connected devices via Wi-Fi tethering or MobileAP will be disconnected when the settings are reloaded.
820 * @param[in] tethering The tethering handle
821 * @param[in] callback The callback function to invoke
822 * @param[in] user_data The user data to be passed to the callback function
823 * @return 0 on success, otherwise negative error value
824 * @retval #TETHERING_ERROR_NONE Successful
825 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
826 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
828 int tethering_wifi_reload_settings(tethering_h tethering, tethering_wifi_settings_reloaded_cb callback, void *user_data);
831 * @brief Gets the mac_filter for Wi-Fi Tethering.
832 * @details If you set the mac_filter to enable, then the device can be allowed/blocked based on mac-address.
833 * By default mac_filter is set to false.
835 * @privlevel platform
836 * @privilege %http://tizen.org/privilege/tethering.admin
837 * @param[in] tethering The handle of tethering
838 * @param[out] mac_filter The mac filter: (@c true = enable, @c false = disable)
839 * @return 0 on success, otherwise negative error value.
840 * @retval #TETHERING_ERROR_NONE Successful
841 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
842 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
843 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
844 * @see tethering_mobileap_set_mac_filter()
846 int tethering_wifi_get_mac_filter(tethering_h tethering, bool *mac_filter);
849 * @brief Sets the mac-filter for Wi-Fi Tethering.
850 * @details If you set the mac_filter to enable, then the device can be allowed/blocked based on mac-address.
851 * By default mac_filter is set to @c false.
853 * @privlevel platform
854 * @privilege %http://tizen.org/privilege/tethering.admin
855 * @remarks This change is applied next time Wi-Fi tethering is enabled.
856 * @param[in] tethering The tethering handle
857 * @param[in] mac_filter The mac filter: (@c true = enable, @c false = disable)
858 * @return 0 on success, otherwise negative error value
859 * @retval #TETHERING_ERROR_NONE Successful
860 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
861 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
862 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
863 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
864 * @see tethering_mobileap_get_mac_filter()
866 int tethering_wifi_set_mac_filter(tethering_h tethering, bool mac_filter);
869 * @brief Adds the mac-address to the allowed client list.
870 * @details AP can allow the client by adding clients mac-address to the allowed list.
872 * @privlevel platform
873 * @privilege %http://tizen.org/privilege/tethering.admin
874 * @param[in] tethering The handle of tethering
875 * @param[in] mac The mac address
876 * @return 0 on success, otherwise negative error value.
877 * @retval #TETHERING_ERROR_NONE Successful
878 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
879 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
880 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
881 * @see tethering_mobileap_set_mac_filter()
883 int tethering_wifi_add_allowed_mac_list(tethering_h tethering, const char *mac);
886 * @brief Removes the mac-address from the allowed client list.
887 * @details Removes the mac-address from the allowed client list.
889 * @privlevel platform
890 * @privilege %http://tizen.org/privilege/tethering.admin
891 * @param[in] tethering The handle of tethering
892 * @param[in] mac The mac address
893 * @return 0 on success, otherwise negative error value.
894 * @retval #TETHERING_ERROR_NONE Successful
895 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
896 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
897 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
898 * @see tethering_mobileap_set_mac_filter()
900 int tethering_wifi_remove_allowed_mac_list(tethering_h tethering, const char *mac);
902 * @brief Gets the mac-addresses from the allowed client list.
903 * @details Gets the mac-addresses from the allowed client list.
905 * @privlevel platform
906 * @privilege %http://tizen.org/privilege/tethering.admin
907 * @param[in] tethering The handle of tethering
908 * @param[out] allowed_mac_list list of allowed mac addresses list
909 * @return 0 on success, otherwise negative error value.
910 * @retval #TETHERING_ERROR_NONE Successful
911 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
912 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
913 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
914 * @see tethering_mobileap_set_mac_filter()
916 int tethering_wifi_get_allowed_mac_list(tethering_h tethering, void **allowed_mac_list);
919 * @brief Adds the mac-address to the blocked client list.
920 * @details AP can disallow the client by adding clients mac-address to the blocked list.
922 * @privlevel platform
923 * @privilege %http://tizen.org/privilege/tethering.admin
924 * @param[in] tethering The handle of tethering
925 * @param[in] mac The mac address
926 * @return 0 on success, otherwise negative error value.
927 * @retval #TETHERING_ERROR_NONE Successful
928 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
929 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
930 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
931 * @see tethering_mobileap_set_mac_filter()
933 int tethering_wifi_add_blocked_mac_list(tethering_h tethering, const char *mac);
936 * @brief Removes the mac-address from the blocked client list.
937 * @details Removes the mac-address from the blocked client list.
939 * @privlevel platform
940 * @privilege %http://tizen.org/privilege/tethering.admin
941 * @param[in] tethering The handle of tethering
942 * @param[in] mac The mac address
943 * @return 0 on success, otherwise negative error value.
944 * @retval #TETHERING_ERROR_NONE Successful
945 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
946 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
947 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
948 * @see tethering_mobileap_set_mac_filter()
950 int tethering_wifi_remove_blocked_mac_list(tethering_h tethering, const char *mac);
953 * @brief Gets the mac-addresses from the blocked client list.
954 * @details Get the mac-addresses from the blocked client list.
956 * @privlevel platform
957 * @privilege %http://tizen.org/privilege/tethering.admin
958 * @param[in] tethering The handle of tethering
959 * @param[out] blocked_mac_list list of blocked mac addresses list
960 * @return 0 on success, otherwise negative error value.
961 * @retval #TETHERING_ERROR_NONE Successful
962 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
963 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
964 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
965 * @see tethering_mobileap_set_mac_filter()
967 int tethering_wifi_get_blocked_mac_list(tethering_h tethering, void **blocked_mac_list);
970 * @brief Enables/disables the dhcp server.
972 * @privlevel platform
973 * @privilege %http://tizen.org/privilege/tethering.admin
974 * @details Enable/disable the dhcp server.
975 * @param[in] tethering The handle of tethering
976 * @param[in] enable Enable/disable the dhcp server
977 * @return 0 on success, otherwise negative error value.
978 * @retval #TETHERING_ERROR_NONE Successful
979 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
981 int tethering_wifi_enable_dhcp(tethering_h tethering, bool enable);
984 * @brief Enables the dhcp server with the address range.
986 * @privlevel platform
987 * @privilege %http://tizen.org/privilege/tethering.admin
988 * @details Enable the dhcp server with the address range.
989 * @param[in] tethering The handle of tethering
990 * @param[in] rangestart Start address range
991 * @param[in] rangestop End address range
992 * @return 0 on success, otherwise negative error value.
993 * @retval #TETHERING_ERROR_NONE Successful
994 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
996 int tethering_wifi_set_dhcp_range(tethering_h tethering, char *rangestart, char *rangestop);
999 * @brief Checks whether the dhcp is enabled or not.
1001 * @privlevel platform
1002 * @privilege %http://tizen.org/privilege/tethering.admin
1003 * @param[in] tethering The tethering handle
1004 * @param[out] dhcp_enabled @c true if dhcp is enabled, \n @c false if dhcp is disabled
1005 * @return 0 on success, otherwise a negative error value
1006 * @retval #TETHERING_ERROR_NONE Successful
1007 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1009 int tethering_wifi_is_dhcp_enabled(tethering_h tethering, bool *dhcp_enabled);
1012 * @brief Sets the Channel for Wi-Fi.
1013 * @details The Channel should be in between 1-14. If channel is not set, Wi-Fi sets default channel.
1015 * @privlevel platform
1016 * @privilege %http://tizen.org/privilege/tethering.admin
1017 * @param[in] tethering The tethering handle
1018 * @param[in] channel The channel number
1019 * @return 0 on success, otherwise negative error value
1020 * @retval #TETHERING_ERROR_NONE Successful
1021 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1023 int tethering_wifi_set_channel(tethering_h tethering, int channel);
1026 * @brief Gets the channel for Wi-Fi.
1027 * @details If channel is not set, Wi-Fi gets default channel.
1029 * @privlevel platform
1030 * @privilege %http://tizen.org/privilege/tethering.admin
1031 * @param[in] tethering The tethering handle
1032 * @param[out] channel The channel number
1033 * @return 0 on success, otherwise negative error value
1034 * @retval #TETHERING_ERROR_NONE Successful
1035 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1036 * @see tethering_wifi_set_channel()
1038 int tethering_wifi_get_channel(tethering_h tethering, int *channel);
1041 * @brief Sets the mode for Wi-Fi.
1042 * @details The mobile AP mode (ex: b only, g only, ad, a). If mode is not set, Wi-Fi sets default mode.
1044 * @privlevel platform
1045 * @privilege %http://tizen.org/privilege/tethering.admin
1046 * @param[in] tethering The tethering handle
1047 * @param[in] type The mobile AP mode
1048 * @return 0 on success, otherwise negative error value
1049 * @retval #TETHERING_ERROR_NONE Successful
1050 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1052 int tethering_wifi_set_mode(tethering_h tethering, tethering_wifi_mode_type_e type);
1055 * @brief Gets the mode for Wi-Fi.
1056 * @details If the mode is not set, Wi-Fi gets default mode.
1058 * @privlevel platform
1059 * @privilege %http://tizen.org/privilege/tethering.admin
1060 * @remarks @a mode must be released using free().
1061 * @param[in] tethering The tethering handle
1062 * @param[out] type The mode of Wi-Fi tethering
1063 * @return 0 on success, otherwise negative error value
1064 * @retval #TETHERING_ERROR_NONE Successful
1065 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1066 * @see tethering_wifi_set_mode()
1068 int tethering_wifi_get_mode(tethering_h tethering, tethering_wifi_mode_type_e *type);
1071 * @brief Sets txpower for Wi-Fi tethering.
1073 * @privlevel platform
1074 * @privilege http://tizen.org/privilege/tethering.admin
1075 * @param[in] tethering The tethering handle
1076 * @param[in] txpower value of txpower to be set
1077 * @return 0 on success, otherwise a negative error value
1078 * @retval #TETHERING_ERROR_NONE Successful
1079 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1080 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1081 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1082 * @see tethering_wifi_get_txpower()
1084 int tethering_wifi_set_txpower(tethering_h tethering, unsigned int txpower);
1087 * @brief Gets txpower for Wi-Fi tethering.
1089 * @privlevel platform
1090 * @privilege http://tizen.org/privilege/tethering.admin
1091 * @param[in] tethering The tethering handle
1092 * @param[out] txpower value of txpower
1093 * @return 0 on success, otherwise a negative error value
1094 * @retval #TETHERING_ERROR_NONE Successful
1095 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1096 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1097 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1098 * @see tethering_wifi_set_txpower()
1100 int tethering_wifi_get_txpower(tethering_h tethering, unsigned int *txpower);
1103 * @brief Sets mtu for Wi-Fi tethering.
1105 * @privlevel platform
1106 * @privilege %http://tizen.org/privilege/tethering.admin
1107 * @param[in] tethering The tethering handle
1108 * @param[in] mtu value of mtu to be set
1109 * @return 0 on success, otherwise a negative error value
1110 * @retval #TETHERING_ERROR_NONE Successful
1111 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1112 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1113 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1115 int tethering_wifi_set_mtu(tethering_h tethering, unsigned int mtu);
1118 * @brief Changes mac address for Wi-Fi tethering.
1120 * @privlevel platform
1121 * @privilege %http://tizen.org/privilege/tethering.admin
1122 * @param[in] tethering The client handle
1123 * @param[in] mac The mac address
1124 * @return 0 on success, otherwise a negative error value
1125 * @retval #TETHERING_ERROR_NONE Successful
1126 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1127 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1128 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1130 int tethering_wifi_change_mac(tethering_h tethering, char *mac);
1133 * @brief Sets max connected devices for Wi-Fi tethering.
1135 * @privlevel platform
1136 * @privilege %http://tizen.org/privilege/tethering.admin
1137 * @param[in] tethering The client handle
1138 * @param[in] max_device value of max_device to be set
1139 * @return 0 on success, otherwise a negative error value
1140 * @retval #TETHERING_ERROR_NONE Successful
1141 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1142 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1143 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1144 * @see tethering_wifi_get_max_connected_device()
1146 int tethering_wifi_set_max_connected_device(tethering_h tethering, int max_device);
1149 * @brief Gets max connected devices for Wi-Fi tethering.
1151 * @privlevel platform
1152 * @privilege %http://tizen.org/privilege/tethering.admin
1153 * @param[in] tethering The client handle
1154 * @param[out] max_device value of max_device
1155 * @return 0 on success, otherwise a negative error value
1156 * @retval #TETHERING_ERROR_NONE Successful
1157 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1158 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1159 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1160 * @see tethering_wifi_set_max_connected_device()
1162 int tethering_wifi_get_max_connected_device(tethering_h tethering, int *max_device);
1165 * @brief Enables port forwarding feature.
1167 * @privlevel platform
1168 * @privilege %http://tizen.org/privilege/tethering.admin
1169 * @details enable/disable port forwarding feature.
1170 * @param[in] tethering The handle of tethering
1171 * @param[in] enable Enable/Disable port forwarding
1172 * @return 0 on success, otherwise negative error value.
1173 * @retval #TETHERING_ERROR_NONE Successful
1174 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1175 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1176 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1178 int tethering_wifi_enable_port_forwarding(tethering_h tethering, bool enable);
1181 * @brief Sets port forwarding rule.
1183 * @privlevel platform
1184 * @privilege %http://tizen.org/privilege/tethering.admin
1185 * @details Set port forwarding rule.
1186 * @param[in] tethering The handle of tethering
1187 * @param[in] ifname interface name
1188 * @param[in] protocol protocol (tcp/udp)
1189 * @param[in] org_ip original destination ip where packet was meant to sent
1190 * @param[in] org_port original destination port where packet was meant to sent
1191 * @param[in] final_ip new destination ip where packet will be forwarded
1192 * @param[in] final_port new destination port where packet will be forwarded
1193 * @return 0 on success, otherwise negative error value.
1194 * @retval #TETHERING_ERROR_NONE Successful
1195 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1196 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1197 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1199 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);
1202 * @brief Resets port forwarding rule.
1204 * @privlevel platform
1205 * @privilege %http://tizen.org/privilege/tethering.admin
1206 * @details Reset port forwarding rule.
1207 * @param[in] tethering The handle of tethering
1208 * @return 0 on success, otherwise negative error value.
1209 * @retval #TETHERING_ERROR_NONE Successful
1210 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1211 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1212 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1214 int tethering_wifi_reset_port_forwarding_rule(tethering_h tethering);
1217 * @brief Checks whether the port forwarding is enabled or not.
1219 * @privlevel platform
1220 * @privilege %http://tizen.org/privilege/tethering.admin
1221 * @param[in] tethering The tethering handle
1222 * @param[out] forwarding_enabled @c true if port forwarding is enabled, \n @c false if port forwarding is disabled
1223 * @return 0 on success, otherwise a negative error value
1224 * @retval #TETHERING_ERROR_NONE Successful
1225 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1226 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1227 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1229 int tethering_wifi_is_port_forwarding_enabled(tethering_h tethering, bool* forwarding_enabled);
1232 * @brief Gets the port forwarding rule for Wi-Fi tethering.
1234 * @privlevel platform
1235 * @privilege %http://tizen.org/privilege/tethering.admin
1236 * @param[in] tethering The client handle
1237 * @param[out] port_forwarding_list list of port forwarding rules
1238 * @return 0 on success, otherwise a negative error value
1239 * @retval #TETHERING_ERROR_NONE Successful
1240 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1241 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1242 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1244 int tethering_wifi_get_port_forwarding_rule(tethering_h tethering, void **port_forwarding_list);
1247 * @brief Enables port filtering feature.
1249 * @privlevel platform
1250 * @privilege %http://tizen.org/privilege/tethering.admin
1251 * @details enable/disable port filtering feature.
1252 * @param[in] tethering The handle of tethering
1253 * @param[in] enable Enable/Disable port filtering
1254 * @return 0 on success, otherwise negative error value.
1255 * @retval #TETHERING_ERROR_NONE Successful
1256 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1257 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1258 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1260 int tethering_wifi_enable_port_filtering(tethering_h tethering, bool enable);
1263 * @brief Sets port filtering rule.
1265 * @privlevel platform
1266 * @privilege %http://tizen.org/privilege/tethering.admin
1267 * @details Set port filtering rule.
1268 * @param[in] tethering The handle of tethering
1269 * @param[in] port to be filtered
1270 * @param[in] protocol protocol (tcp/udp)
1271 * @param[in] allow allow/disallow port filtering
1272 * @return 0 on success, otherwise negative error value.
1273 * @retval #TETHERING_ERROR_NONE Successful
1274 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1275 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1276 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1278 int tethering_wifi_add_port_filtering_rule(tethering_h tethering, int port, char *protocol, bool allow);
1281 * @brief Sets custom port filtering rule.
1283 * @privlevel platform
1284 * @privilege %http://tizen.org/privilege/tethering.admin
1285 * @details Set custom port filtering rule.
1286 * @param[in] tethering The handle of tethering
1287 * @param[in] port1 to be filtered
1288 * @param[in] port2 to be filtered
1289 * @param[in] protocol protocol (tcp/udp)
1290 * @param[in] allow allow/disallow port filtering
1291 * @return 0 on success, otherwise negative error value.
1292 * @retval #TETHERING_ERROR_NONE Successful
1293 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1294 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1295 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1297 int tethering_wifi_add_custom_port_filtering_rule(tethering_h tethering, int port1, int port2, char *protocol, bool allow);
1300 * @brief Gets the port filtering rule for Wi-Fi tethering.
1302 * @privlevel platform
1303 * @privilege %http://tizen.org/privilege/tethering.admin
1304 * @param[in] tethering The client handle
1305 * @param[out] port_filtering_list list of port filtering rules
1306 * @return 0 on success, otherwise a negative error value
1307 * @retval #TETHERING_ERROR_NONE Successful
1308 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1309 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1310 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1312 int tethering_wifi_get_port_filtering_rule(tethering_h tethering, void **port_filtering_list);
1315 * @brief Gets the custom port filtering rule for Wi-Fi tethering.
1317 * @privlevel platform
1318 * @privilege %http://tizen.org/privilege/tethering.admin
1319 * @param[in] tethering The client handle
1320 * @param[out] custom_port_filtering_list list of custom port filtering rules
1321 * @return 0 on success, otherwise a negative error value
1322 * @retval #TETHERING_ERROR_NONE Successful
1323 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1324 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1325 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1327 int tethering_wifi_get_custom_port_filtering_rule(tethering_h tethering, void **custom_port_filtering_list);
1330 * @brief Checks whether the port filtering is enabled or not.
1332 * @privlevel platform
1333 * @privilege %http://tizen.org/privilege/tethering.admin
1334 * @param[in] tethering The tethering handle
1335 * @param[out] filtering_enabled @c true if port filtering is enabled, \n @c false if port filtering is disabled
1336 * @return 0 on success, otherwise a negative error value
1337 * @retval #TETHERING_ERROR_NONE Successful
1338 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1339 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1340 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1342 int tethering_wifi_is_port_filtering_enabled(tethering_h tethering, bool* filtering_enabled);
1345 * @brief Sets vpn passthrough rule.
1347 * @privlevel platform
1348 * @privilege %http://tizen.org/privilege/tethering.admin
1349 * @details Set vpn passthrough rule.
1350 * @param[in] tethering The handle of tethering
1351 * @param[in] type vpn passthrough type
1352 * @param[in] enable @c true if vpn passthrough is enabled, \n @c false if vpn passthrough is disabled
1353 * @return 0 on success, otherwise negative error value.
1354 * @retval #TETHERING_ERROR_NONE Successful
1355 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1356 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1357 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1359 int tethering_wifi_set_vpn_passthrough_rule(tethering_h tethering, tethering_vpn_passthrough_type_e type, bool enable);
1362 * @brief Pushes the WPS button to connect with Wi-Fi Tethering client. (WPS PBC)
1364 * @remarks The WPS button should be pushed when client tries to connect with Soft AP by using WPS PBC.
1365 * @param[in] tethering The tethering handle
1366 * @return 0 on success, otherwise negative error value
1367 * @retval #TETHERING_ERROR_NONE Successful
1368 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1369 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
1370 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission denied
1371 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
1373 int tethering_wifi_push_wps_button(tethering_h tethering);
1376 * @brief Sets the WPS PIN to connect with Wi-Fi Tethering client. (WPS PIN)
1378 * @remarks The WPS PIN should be inserted when client tries to connect with Soft AP by using WPS PIN.
1379 * @param[in] tethering The tethering handle
1380 * @param[in] wps_pin The WPS PIN
1381 * @return 0 on success, otherwise negative error value
1382 * @retval #TETHERING_ERROR_NONE Successful
1383 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1384 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
1385 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission denied
1386 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
1388 int tethering_wifi_set_wps_pin(tethering_h tethering, const char *wps_pin);
1391 * @brief Checks whether wifi-sharing is supported or not.
1393 * @privlevel platform
1394 * @privilege %http://tizen.org/privilege/tethering.admin
1395 * @param[in] tethering The tethering handle
1396 * @param[out] supported @c true if wifi-sharing is supported, \n @c false if wifi-sharing is unsupported
1397 * @return 0 on success, otherwise a negative error value
1398 * @retval #TETHERING_ERROR_NONE Successful
1399 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1400 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission denied
1401 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
1403 int tethering_wifi_is_sharing_supported(tethering_h tethering, bool *supported);
1412 * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
1417 * @brief Clones the handle of a client.
1419 * @privlevel platform
1420 * @privilege %http://tizen.org/privilege/tethering.admin
1421 * @remarks @a dest must be release using tethering_client_destroy().
1422 * @param[out] dest The cloned client handle
1423 * @param[in] origin The origin client handle
1424 * @return 0 on success, otherwise a negative error value
1425 * @retval #TETHERING_ERROR_NONE Successful
1426 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1427 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1428 * @see tethering_client_destroy()
1430 int tethering_client_clone(tethering_client_h *dest, tethering_client_h origin);
1433 * @brief Destroys the handle of a client.
1435 * @privlevel platform
1436 * @privilege %http://tizen.org/privilege/tethering.admin
1437 * @param[in] client The client handle
1438 * @return 0 on success, otherwise a negative error value
1439 * @retval #TETHERING_ERROR_NONE Successful
1440 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1441 * @see tethering_client_clone()
1443 int tethering_client_destroy(tethering_client_h client);
1446 * @brief Gets the tethering type of client.
1448 * @privlevel platform
1449 * @privilege %http://tizen.org/privilege/tethering.admin
1450 * @param[in] client The handle of client
1451 * @param[out] type The type of tethering
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 * @see tethering_usb_get_connected_client()
1456 * @see tethering_connection_state_changed_cb()
1458 int tethering_client_get_tethering_type(tethering_client_h client, tethering_type_e *type);
1461 * @brief Gets the name of a client.
1463 * @privlevel platform
1464 * @privilege %http://tizen.org/privilege/tethering.admin
1465 * @remarks @a name must be released using free().
1466 * @param[in] client The client handle
1467 * @param[out] name The name of the client
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_name(tethering_client_h client, char **name);
1478 * @brief Gets the IP address of a client.
1480 * @privlevel platform
1481 * @privilege %http://tizen.org/privilege/tethering.admin
1482 * @remarks @a ip_address must be released using free().
1483 * @param[in] client The client handle
1484 * @param[in] address_family The address family of IP address. Currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported
1485 * @param[out] ip_address The IP address
1486 * @return 0 on success, otherwise a negative error value
1487 * @retval #TETHERING_ERROR_NONE Successful
1488 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1489 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1490 * @see tethering_usb_get_connected_client()
1491 * @see tethering_connection_state_changed_cb()
1493 int tethering_client_get_ip_address(tethering_client_h client, tethering_address_family_e address_family, char **ip_address);
1496 * @brief Gets the MAC address of a client such as "FC:A1:3E:D6:B1:B1".
1498 * @privlevel platform
1499 * @privilege %http://tizen.org/privilege/tethering.admin
1500 * @remarks @a mac_address must be released using free().
1501 * @param[in] client The client handle
1502 * @param[out] mac_address The MAC address
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 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1507 * @see tethering_usb_get_connected_client()
1508 * @see tethering_connection_state_changed_cb()
1510 int tethering_client_get_mac_address(tethering_client_h client, char **mac_address);
1513 * @brief Gets the connection time of a client.
1515 * @privlevel platform
1516 * @privilege %http://tizen.org/privilege/tethering.admin
1517 * @param[in] client The client handle
1518 * @param[out] time The connected time of the client
1519 * @return 0 on success, otherwise a negative error value
1520 * @retval #TETHERING_ERROR_NONE Successful
1521 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1522 * @see tethering_usb_get_connected_client()
1523 * @see tethering_connection_state_changed_cb()
1525 int tethering_client_get_time(tethering_client_h client, time_t *timestamp);
1536 #endif /* __TIZEN_NETWORK_TETHERING_H__ */