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_MAX, /**< Maximum */
73 TETHERING_WIFI_BAND_2G = 0,
74 TETHERING_WIFI_BAND_5G,
77 * @brief Enumeration for the cause of disabling the tethering.
81 TETHERING_DISABLED_BY_USB_DISCONNECTION = 0, /**< Disabled due to usb disconnection */
82 TETHERING_DISABLED_BY_FLIGHT_MODE, /**< Disabled due to flight mode */
83 TETHERING_DISABLED_BY_LOW_BATTERY, /**< Disabled due to low battery */
84 TETHERING_DISABLED_BY_NETWORK_CLOSE, /**< Disabled due to pdp network close */
85 TETHERING_DISABLED_BY_TIMEOUT, /**< Disabled due to timeout */
86 TETHERING_DISABLED_BY_OTHERS, /**< Disabled by other apps */
87 TETHERING_DISABLED_BY_REQUEST, /**< Disabled by your request */
88 TETHERING_DISABLED_BY_WIFI_ON, /**< Disabled due to Wi-Fi on */
89 TETHERING_DISABLED_BY_BT_OFF, /**< Disabled due to Bluetooth off */
90 } tethering_disabled_cause_e;
98 * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
103 * @brief Enumeration for the Wi-Fi security.
107 TETHERING_WIFI_SECURITY_TYPE_NONE = 0, /**< No Security type */
108 TETHERING_WIFI_SECURITY_TYPE_WPA2_PSK, /**< WPA2_PSK */
109 TETHERING_WIFI_SECURITY_TYPE_WPS, /**< WPA2_PSK */
110 TETHERING_WIFI_SECURITY_TYPE_SAE, /**< SAE */
111 } tethering_wifi_security_type_e;
114 * @brief Enumeration for the Wi-Fi mode
118 TETHERING_WIFI_MODE_TYPE_B = 0, /**< mode b */
119 TETHERING_WIFI_MODE_TYPE_G, /**< mode g */
120 TETHERING_WIFI_MODE_TYPE_A, /**< mode a */
121 TETHERING_WIFI_MODE_TYPE_AD, /**< mode ad */
122 } tethering_wifi_mode_type_e;
125 TETHERING_TYPE_IPSEC_PASSTHROUGH = 0, /**< IPSEC */
126 TETHERING_TYPE_PPTP_PASSTHROUGH, /**< PPTP type */
127 TETHERING_TYPE_L2TP_PASSTHROUGH, /**< L2TP type */
128 } tethering_vpn_passthrough_type_e;
136 * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
141 * @brief The tethering client handle.
144 typedef void * tethering_client_h;
147 * @brief Enumeration for address family.
151 TETHERING_ADDRESS_FAMILY_IPV4 = 0, /**< IPV4 Address type */
152 TETHERING_ADDRESS_FAMILY_IPV6 = 1, /**< IPV6 Address type (Since 4.0) */
153 } tethering_address_family_e;
161 * @addtogroup CAPI_NETWORK_TETHERING_MANAGER_MODULE
166 * @brief Called when the tethering is enabled.
168 * @param[in] result The result of enabling the tethering
169 * @param[in] type The tethering type
170 * @param[in] is_requested Indicates whether this change is requested
171 * @param[in] user_data The user data passed from tethering_set_enabled_cb()
172 * @pre If you register callback function using tethering_set_enabled_cb(), this will be invoked when the tethering is enabled.
173 * @see tethering_enable()
174 * @see tethering_unset_enabled_cb()
176 typedef void (*tethering_enabled_cb)(tethering_error_e result, tethering_type_e type, bool is_requested, void *user_data);
179 * @brief Called when the tethering is disabled.
181 * @param[in] result The result of disabling the tethering
182 * @param[in] type The tethering type
183 * @param[in] cause The cause of disabling
184 * @param[in] user_data The user data passed from tethering_set_disabled_cb()
185 * @pre If you register callback function using tethering_set_disabled_cb(), this will be invoked when the tethering is disabled.
186 * @see tethering_set_disabled_cb()
187 * @see tethering_unset_disabled_cb()
189 typedef void (*tethering_disabled_cb)(tethering_error_e result, tethering_type_e type, tethering_disabled_cause_e cause, void *user_data);
192 * @brief Called when the connection state is changed.
194 * @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().
195 * @param[in] client The client of which connection state is changed
196 * @param[in] opened @c true when connection is opened, otherwise false
197 * @param[in] user_data The user data passed from tethering_set_connection_state_changed_cb()
198 * @pre If you register callback function using tethering_set_connection_state_changed_cb(), this will be invoked when the connection state is changed.
199 * @see tethering_set_connection_state_changed_cb()
200 * @see tethering_unset_connection_state_changed_cb()
202 typedef void (*tethering_connection_state_changed_cb)(tethering_client_h client, bool opened, void *user_data);
205 * @brief Called when you get the connected client repeatedly.
207 * @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().
208 * @param[in] client The connected client
209 * @param[in] user_data The user data passed from the request function
210 * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
211 * @pre tethering_foreach_connected_clients() will invoke this callback.
212 * @see tethering_foreach_connected_clients()
214 typedef bool(*tethering_connected_client_cb)(tethering_client_h client, void *user_data);
217 * @brief Called when you get the data usage.
219 * @param[in] result The result of getting the data usage
220 * @param[in] received_data The usage of received data
221 * @param[in] sent_data The usage of sent data
222 * @param[in] user_data The user data passed from the request function
223 * @pre tethering_get_data_usage() will invoked this callback.
225 typedef void (*tethering_data_usage_cb)(tethering_error_e result, unsigned long long received_data, unsigned long long sent_data, void *user_data);
228 * @brief Called when the security type of Wi-Fi tethering is changed.
230 * @param[in] changed_type The changed security type of Wi-Fi tethering
231 * @param[in] user_data The user data passed from the register function
232 * @see tethering_wifi_set_security_type_changed_cb()
233 * @see tethering_wifi_unset_security_type_changed_cb()
235 typedef void (*tethering_wifi_security_type_changed_cb)(tethering_wifi_security_type_e changed_type, void *user_data);
238 * @brief Called when the visibility of SSID is changed.
240 * @param[in] changed_visible The changed visibility of SSID
241 * @param[in] user_data The user data passed from the register function
242 * @see tethering_wifi_set_ssid_visibility_changed_cb()
243 * @see tethering_wifi_unset_ssid_visibility_changed_cb()
245 typedef void (*tethering_wifi_ssid_visibility_changed_cb)(bool changed_visible, void *user_data);
248 * @brief Called when the passphrase of Wi-Fi tethering is changed.
250 * @param[in] user_data The user data passed from the register function
251 * @see tethering_wifi_set_passphrase_changed_cb()
252 * @see tethering_wifi_unset_passphrase_changed_cb()
254 typedef void (*tethering_wifi_passphrase_changed_cb)(void *user_data);
257 * @brief Called when the settings are reloaded.
259 * @param[in] result The result of reloading the settings
260 * @param[in] user_data The user data passed from the request function
261 * @pre tethering_wifi_reload_settings() will invoke this callback.
263 typedef void (*tethering_wifi_settings_reloaded_cb)(tethering_error_e result, void *user_data);
266 * @brief Creates the handle for tethering.
268 * @privlevel platform
269 * @privilege %http://tizen.org/privilege/tethering.admin
270 * @remarks The @a tethering must be released using tethering_destroy().
271 * @param[out] tethering A handle of a new mobile ap handle on success
272 * @return 0 on success, otherwise a negative error value
273 * @retval #TETHERING_ERROR_NONE Successful
274 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
275 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
276 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API is not supported
277 * @see tethering_destroy()
279 int tethering_create(tethering_h *tethering);
282 * @brief Destroys the handle for tethering.
284 * @privlevel platform
285 * @privilege %http://tizen.org/privilege/tethering.admin
286 * @param[in] tethering The tethering handle
287 * @return 0 on success, otherwise a negative error value
288 * @retval #TETHERING_ERROR_NONE Successful
289 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
290 * @see tethering_create()
292 int tethering_destroy(tethering_h tethering);
295 * @brief Enables the tethering, asynchronously.
297 * @privlevel platform
298 * @privilege %http://tizen.org/privilege/tethering.admin
299 * @param[in] tethering The tethering handle
300 * @param[in] type The tethering type
301 * @return 0 on success, otherwise negative error value
302 * @retval #TETHERING_ERROR_NONE Successful
303 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
304 * @post tethering_enabled_cb() will be invoked.
305 * @see tethering_is_enabled()
306 * @see tethering_disable()
308 int tethering_enable(tethering_h tethering, tethering_type_e type);
311 * @brief Disables the tethering, asynchronously.
313 * @privlevel platform
314 * @privilege %http://tizen.org/privilege/tethering.admin
315 * @param[in] tethering The tethering handle
316 * @param[in] type The tethering type
317 * @return 0 on success, otherwise negative error value
318 * @retval #TETHERING_ERROR_NONE Successful
319 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
320 * @post tethering_disabled_cb() will be invoked.
321 * @see tethering_is_enabled()
322 * @see tethering_enable()
324 int tethering_disable(tethering_h tethering, tethering_type_e type);
327 * @brief Enables the IPv6 tethering, asynchronously.
329 * @privlevel platform
330 * @privilege %http://tizen.org/privilege/tethering.admin
331 * @remarks It supports Wi-Fi tethering and BT tethering only.
332 * @param[in] tethering The tethering handle
333 * @param[in] type The tethering type
334 * @return 0 on success, otherwise negative error value
335 * @retval #TETHERING_ERROR_NONE Successful
336 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
337 * @post tethering_enabled_cb() will be invoked.
338 * @see tethering_is_enabled()
339 * @see tethering_ipv6_disable()
341 int tethering_ipv6_enable(tethering_h tethering, tethering_type_e type);
344 * @brief Disables the IPv6 tethering, asynchronously.
346 * @privlevel platform
347 * @privilege %http://tizen.org/privilege/tethering.admin
348 * @remarks It supports Wi-Fi tethering and BT tethering only.
349 * @param[in] tethering The tethering handle
350 * @param[in] type The tethering type
351 * @return 0 on success, otherwise negative error value
352 * @retval #TETHERING_ERROR_NONE Successful
353 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
354 * @post tethering_disabled_cb() will be invoked.
355 * @see tethering_is_enabled()
356 * @see tethering_ipv6_enable()
358 int tethering_ipv6_disable(tethering_h tethering, tethering_type_e type);
361 * @brief Checks whether the tethering is enabled or not.
363 * @privlevel platform
364 * @privilege %http://tizen.org/privilege/tethering.admin
365 * @param[in] tethering The tethering handle
366 * @param[in] type The tethering type
367 * @return @c true if tethering is enabled, \n @c false if tethering is disabled
369 bool tethering_is_enabled(tethering_h tethering, tethering_type_e type);
372 * @brief Gets the MAC address of local device as "FC:A1:3E:D6:B1:B1".
374 * @privlevel platform
375 * @privilege %http://tizen.org/privilege/tethering.admin
376 * @remarks @a mac_address must be released using free().
377 * @param[in] tethering The tethering handle
378 * @param[in] type The tethering type
379 * @param[out] mac_address The MAC address
380 * @return 0 on success, otherwise a negative error value
381 * @retval #TETHERING_ERROR_NONE Successful
382 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
383 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
384 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
385 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
386 * @pre The tethering must be enabled.
387 * @see tethering_is_enabled()
388 * @see tethering_enable()
390 int tethering_get_mac_address(tethering_h tethering, tethering_type_e type, char **mac_address);
393 * @brief Gets the name of network interface (e.g. usb0).
395 * @privlevel platform
396 * @privilege %http://tizen.org/privilege/tethering.admin
397 * @remarks @a interface_name must be released using free().
398 * @param[in] tethering The tethering handle
399 * @param[in] type The tethering type
400 * @param[out] interface_name The name of the network interface
401 * @return 0 on success, otherwise negative error value
402 * @retval #TETHERING_ERROR_NONE Successful
403 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
404 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
405 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
406 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
407 * @pre The tethering must be enabled.
408 * @see tethering_is_enabled()
409 * @see tethering_enable()
411 int tethering_get_network_interface_name(tethering_h tethering, tethering_type_e type, char **interface_name);
414 * @brief Gets the local IP address.
416 * @privlevel platform
417 * @privilege %http://tizen.org/privilege/tethering.admin
418 * @remarks @a ip_address must be released using free().
419 * @param[in] tethering The tethering handle
420 * @param[in] type The tethering type
421 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
422 * @param[out] ip_address The local IP address
423 * @return 0 on success, otherwise negative error value
424 * @retval #TETHERING_ERROR_NONE Successful
425 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
426 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
427 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
428 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
429 * @pre The tethering must be enabled.
430 * @see tethering_is_enabled()
431 * @see tethering_enable()
433 int tethering_get_ip_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **ip_address);
436 * @brief Sets the local IP address.
438 * @privlevel platform
439 * @privilege %http://tizen.org/privilege/tethering.admin
440 * @param[in] tethering The tethering handle
441 * @param[in] type The tethering type
442 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
443 * @param[out] ip_address The local IP address
444 * @return 0 on success, otherwise negative error value
445 * @retval #TETHERING_ERROR_NONE Successful
446 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
447 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
448 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
449 * @see tethering_enable()
451 int tethering_set_ip_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, const char *ip_address);
454 * @brief Gets the Gateway address.
456 * @privlevel platform
457 * @privilege %http://tizen.org/privilege/tethering.admin
458 * @remarks @a gateway_address 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] gateway_address 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_gateway_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **gateway_address);
476 * @brief Gets the Subnet Mask.
478 * @privlevel platform
479 * @privilege %http://tizen.org/privilege/tethering.admin
480 * @remarks @a subnet_mask must be released using free().
481 * @param[in] tethering The tethering handle
482 * @param[in] type The tethering type
483 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
484 * @param[out] subnet_mask The local IP address
485 * @return 0 on success, otherwise negative error value
486 * @retval #TETHERING_ERROR_NONE Successful
487 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
488 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
489 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
490 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
491 * @pre The tethering must be enabled.
492 * @see tethering_is_enabled()
493 * @see tethering_enable()
495 int tethering_get_subnet_mask(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **subnet_mask);
498 * @brief Gets the data usage.
500 * @privlevel platform
501 * @privilege %http://tizen.org/privilege/tethering.admin
502 * @param[in] tethering The tethering handle
503 * @param[out] usage The data usage
504 * @return 0 on success, otherwise negative error value
505 * @retval #TETHERING_ERROR_NONE Successful
506 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
507 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
508 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
509 * @pre The tethering must be enabled.
510 * @see tethering_is_enabled()
511 * @see tethering_enable()
513 int tethering_get_data_usage(tethering_h tethering, tethering_data_usage_cb callback, void *user_data);
516 * @brief Gets the clients which are connected.
518 * @privlevel platform
519 * @privilege %http://tizen.org/privilege/tethering.admin
520 * @param[in] tethering The tethering handle
521 * @param[in] type The tethering type
522 * @param[in] callback The callback function to invoke
523 * @param[in] user_data The user data to be passed to the callback function
524 * @retval #TETHERING_ERROR_NONE Successful
525 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
526 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
527 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
528 * @pre The tethering must be enabled.
529 * @see tethering_is_enabled()
530 * @see tethering_enable()
532 int tethering_foreach_connected_clients(tethering_h tethering, tethering_type_e type, tethering_connected_client_cb callback, void *user_data);
535 * @brief Gets the clients which are connected.
537 * @privlevel platform
538 * @privilege %http://tizen.org/privilege/tethering.admin
539 * @param[in] tethering The tethering handle
540 * @param[in] type The tethering type
541 * @retval #TETHERING_ERROR_NONE Successful
542 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
543 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
545 int tethering_is_dualband_supported(tethering_h tethering, tethering_type_e type, bool *supported);
548 * @brief Registers the callback function, which is called when tethering is enabled.
550 * @privlevel platform
551 * @privilege %http://tizen.org/privilege/tethering.admin
552 * @param[in] tethering The tethering handle
553 * @param[in] type The tethering type
554 * @param[in] callback The callback function to invoke
555 * @param[in] user_data The user data to be passed to the callback function
556 * @retval #TETHERING_ERROR_NONE Successful
557 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
558 * @see tethering_unset_enabled_cb()
560 int tethering_set_enabled_cb(tethering_h tethering, tethering_type_e type, tethering_enabled_cb callback, void *user_data);
563 * @brief Unregisters the callback function, which is called when tethering is enabled.
565 * @privlevel platform
566 * @privilege %http://tizen.org/privilege/tethering.admin
567 * @param[in] tethering The tethering handle
568 * @param[in] type The tethering type
569 * @retval #TETHERING_ERROR_NONE Successful
570 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
571 * @see tethering_set_enabled_cb()
573 int tethering_unset_enabled_cb(tethering_h tethering, tethering_type_e type);
576 * @brief Registers the callback function called when tethering is disabled.
578 * @privlevel platform
579 * @privilege %http://tizen.org/privilege/tethering.admin
580 * @param[in] tethering The tethering handle
581 * @param[in] type The tethering type
582 * @param[in] callback The callback function to invoke
583 * @param[in] user_data The user data to be passed to the callback function
584 * @retval #TETHERING_ERROR_NONE Successful
585 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
586 * @see tethering_unset_disabled_cb()
588 int tethering_set_disabled_cb(tethering_h tethering, tethering_type_e type, tethering_disabled_cb callback, void *user_data);
591 * @brief Unregisters the callback function, which is called when tethering is disabled.
593 * @privlevel platform
594 * @privilege %http://tizen.org/privilege/tethering.admin
595 * @param[in] tethering The tethering handle
596 * @param[in] type The tethering type
597 * @retval #TETHERING_ERROR_NONE Successful
598 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
599 * @see tethering_set_disabled_cb()
601 int tethering_unset_disabled_cb(tethering_h tethering, tethering_type_e type);
604 * @brief Registers the callback function, which is called when the state of connection is changed.
606 * @privlevel platform
607 * @privilege %http://tizen.org/privilege/tethering.admin
608 * @param[in] tethering The tethering handle
609 * @param[in] type The tethering type
610 * @param[in] callback The callback function to invoke
611 * @param[in] user_data The user data to be passed to the callback function
612 * @retval #TETHERING_ERROR_NONE Successful
613 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
614 * @see tethering_unset_connection_state_changed_cb_cb()
616 int tethering_set_connection_state_changed_cb(tethering_h tethering, tethering_type_e type, tethering_connection_state_changed_cb callback, void *user_data);
619 * @brief Unregisters the callback function, which is called when the state of connection is changed.
621 * @privlevel platform
622 * @privilege %http://tizen.org/privilege/tethering.admin
623 * @param[in] tethering The tethering handle
624 * @param[in] type The tethering type
625 * @retval #TETHERING_ERROR_NONE Successful
626 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
627 * @see tethering_set_connection_state_changed_cb()
629 int tethering_unset_connection_state_changed_cb(tethering_h tethering, tethering_type_e type);
632 * @brief Registers the callback function, which is called when the security type of Wi-Fi tethering is changed.
634 * @privlevel platform
635 * @privilege %http://tizen.org/privilege/tethering.admin
636 * @param[in] tethering The tethering handle
637 * @param[in] callback The callback function to invoke
638 * @param[in] user_data The user data to be passed to the callback function
639 * @retval #TETHERING_ERROR_NONE Successful
640 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
641 * @see tethering_wifi_unset_security_type_changed_cb()
643 int tethering_wifi_set_security_type_changed_cb(tethering_h tethering, tethering_wifi_security_type_changed_cb callback, void *user_data);
646 * @brief Unregisters the callback function, which is called when the security type of Wi-Fi tethering is changed.
648 * @privlevel platform
649 * @privilege %http://tizen.org/privilege/tethering.admin
650 * @param[in] tethering The tethering handle
651 * @param[in] type The tethering type
652 * @retval #TETHERING_ERROR_NONE Successful
653 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
654 * @see tethering_wifi_set_security_type_changed_cb()
656 int tethering_wifi_unset_security_type_changed_cb(tethering_h tethering);
659 * @brief Registers the callback function , which iscalled when the visibility of SSID is changed.
661 * @privlevel platform
662 * @privilege %http://tizen.org/privilege/tethering.admin
663 * @param[in] tethering The tethering handle
664 * @param[in] callback The callback function to invoke
665 * @param[in] user_data The user data to be passed to the callback function
666 * @retval #TETHERING_ERROR_NONE Successful
667 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
668 * @see tethering_wifi_unset_ssid_visibility_changed_cb_cb()
670 int tethering_wifi_set_ssid_visibility_changed_cb(tethering_h tethering, tethering_wifi_ssid_visibility_changed_cb callback, void *user_data);
673 * @brief Unregisters the callback function, which is called when the visibility of SSID is changed.
675 * @privlevel platform
676 * @privilege %http://tizen.org/privilege/tethering.admin
677 * @param[in] tethering The tethering handle
678 * @retval #TETHERING_ERROR_NONE Successful
679 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
680 * @see tethering_wifi_set_ssid_visibility_changed_cb()
682 int tethering_wifi_unset_ssid_visibility_changed_cb(tethering_h tethering);
685 * @brief Registers the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
687 * @privlevel platform
688 * @privilege %http://tizen.org/privilege/tethering.admin
689 * @param[in] tethering The tethering handle
690 * @param[in] callback The callback function to invoke
691 * @param[in] user_data The user data to be passed to the callback function
692 * @retval #TETHERING_ERROR_NONE Successful
693 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
694 * @see tethering_wifi_unset_passphrase_changed_cb()
696 int tethering_wifi_set_passphrase_changed_cb(tethering_h tethering, tethering_wifi_passphrase_changed_cb callback, void *user_data);
699 * @brief Unregisters the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
701 * @privlevel platform
702 * @privilege %http://tizen.org/privilege/tethering.admin
703 * @param[in] tethering The tethering handle
704 * @retval #TETHERING_ERROR_NONE Successful
705 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
706 * @see tethering_wifi_set_passphrase_changed_cb()
708 int tethering_wifi_unset_passphrase_changed_cb(tethering_h tethering);
716 * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
721 * @brief Sets the security type of Wi-Fi tethering.
723 * @privlevel platform
724 * @privilege %http://tizen.org/privilege/tethering.admin
725 * @remarks This change is applied next time Wi-Fi tethering is enabled.
726 * @param[in] tethering The tethering handle
727 * @param[in] type The security type
728 * @return 0 on success, otherwise negative error value
729 * @retval #TETHERING_ERROR_NONE Successful
730 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
731 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
732 * @see tethering_wifi_get_security_type()
734 int tethering_wifi_set_security_type(tethering_h tethering, tethering_wifi_security_type_e type);
737 * @brief Gets the security type of Wi-Fi tethering.
739 * @privlevel platform
740 * @privilege %http://tizen.org/privilege/tethering.admin
741 * @param[in] tethering The tethering handle
742 * @param[out] type The security type
743 * @return 0 on success, otherwise negative error value
744 * @retval #TETHERING_ERROR_NONE Successful
745 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
746 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
747 * @see tethering_wifi_set_security_type()
749 int tethering_wifi_get_security_type(tethering_h tethering, tethering_wifi_security_type_e *type);
752 * @brief Sets the SSID (service set identifier).
753 * @details The SSID cannot exceed 32 bytes. If SSID is not set, device name is used as SSID.
755 * @privlevel platform
756 * @privilege %http://tizen.org/privilege/tethering.admin
757 * @remarks This change is applied next time Wi-Fi tethering is enabled with same @a tethering handle.
758 * @param[in] tethering The tethering handle
759 * @param[in] ssid The SSID
760 * @return 0 on success, otherwise negative error value
761 * @retval #TETHERING_ERROR_NONE Successful
762 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
763 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
765 int tethering_wifi_set_ssid(tethering_h tethering, const char *ssid);
768 * @brief Gets the SSID (service set identifier).
770 * @privlevel platform
771 * @privilege %http://tizen.org/privilege/tethering.admin
772 * @remarks @a ssid must be released using free().
773 * @param[in] tethering The tethering handle
774 * @param[out] ssid The SSID
775 * @return 0 on success, otherwise negative error value
776 * @retval #TETHERING_ERROR_NONE Successful
777 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
778 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
779 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
781 int tethering_wifi_get_ssid(tethering_h tethering, char **ssid);
784 * @brief Sets the visibility of SSID (service set identifier).
785 * @details If the visibility is set to invisible, then the SSID of this device is hidden and Wi-Fi scan will not find the device.
787 * @privlevel platform
788 * @privilege %http://tizen.org/privilege/tethering.admin
789 * @remarks This change is applied next time Wi-Fi tethering is enabled.
790 * @param[in] tethering The tethering handle
791 * @param[in] visible The visibility of SSID: (@c true = visible, @c false = invisible)
792 * @return 0 on success, otherwise negative error value
793 * @retval #TETHERING_ERROR_NONE Successful
794 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
795 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
796 * @see tethering_wifi_get_ssid_visibility()
798 int tethering_wifi_set_ssid_visibility(tethering_h tethering, bool visible);
801 * @brief Gets the visibility of SSID (service set identifier).
802 * @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.
804 * @privlevel platform
805 * @privilege %http://tizen.org/privilege/tethering.admin
806 * @param[in] tethering The tethering handle
807 * @param[out] visible The visibility of SSID: (@c true = visible, @c false = invisible)
808 * @return 0 on success, otherwise negative error value
809 * @retval #TETHERING_ERROR_NONE Successful
810 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
811 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
812 * @see tethering_wifi_set_ssid_visibility()
814 int tethering_wifi_get_ssid_visibility(tethering_h tethering, bool *visible);
817 * @brief Sets the passphrase.
819 * @privlevel platform
820 * @privilege %http://tizen.org/privilege/tethering.admin
821 * @remarks This change is applied next time Wi-Fi tethering is enabled.
822 * @param[in] tethering The tethering handle
823 * @param[in] passphrase The passphrase
824 * @return 0 on success, otherwise negative error value
825 * @retval #TETHERING_ERROR_NONE Successful
826 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
827 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
828 * @see tethering_wifi_get_passphrase()
830 int tethering_wifi_set_passphrase(tethering_h tethering, const char *passphrase);
833 * @brief Gets the passphrase.
835 * @privlevel platform
836 * @privilege %http://tizen.org/privilege/tethering.admin
837 * @remarks @a passphrase must be released using free().
838 * @param[in] tethering The tethering handle
839 * @param[out] passphrase The passphrase
840 * @return 0 on success, otherwise negative error value
841 * @retval #TETHERING_ERROR_NONE Successful
842 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
843 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
844 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
845 * @see tethering_wifi_set_passphrase()
847 int tethering_wifi_get_passphrase(tethering_h tethering, char **passphrase);
850 * @brief Reloads the settings (SSID / Passphrase / Security type / SSID visibility).
852 * @privlevel platform
853 * @privilege %http://tizen.org/privilege/tethering.admin
854 * @remarks Connected devices via Wi-Fi tethering or MobileAP will be disconnected when the settings are reloaded.
855 * @param[in] tethering The tethering handle
856 * @param[in] callback The callback function to invoke
857 * @param[in] user_data The user data to be passed to the callback function
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
863 int tethering_wifi_reload_settings(tethering_h tethering, tethering_wifi_settings_reloaded_cb callback, void *user_data);
866 * @brief Gets the mac_filter for Wi-Fi Tethering.
867 * @details If you set the mac_filter to enable, then the device can be allowed/blocked based on mac-address.
868 * By default mac_filter is set to false.
870 * @privlevel platform
871 * @privilege %http://tizen.org/privilege/tethering.admin
872 * @param[in] tethering The handle of tethering
873 * @param[out] mac_filter The mac filter: (@c true = enable, @c false = disable)
874 * @return 0 on success, otherwise negative error value.
875 * @retval #TETHERING_ERROR_NONE Successful
876 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
877 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
878 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
879 * @see tethering_mobileap_set_mac_filter()
881 int tethering_wifi_get_mac_filter(tethering_h tethering, bool *mac_filter);
884 * @brief Sets the mac-filter for Wi-Fi Tethering.
885 * @details If you set the mac_filter to enable, then the device can be allowed/blocked based on mac-address.
886 * By default mac_filter is set to @c false.
888 * @privlevel platform
889 * @privilege %http://tizen.org/privilege/tethering.admin
890 * @remarks This change is applied next time Wi-Fi tethering is enabled.
891 * @param[in] tethering The tethering handle
892 * @param[in] mac_filter The mac filter: (@c true = enable, @c false = disable)
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_OPERATION_FAILED Operation failed
897 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
898 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
899 * @see tethering_mobileap_get_mac_filter()
901 int tethering_wifi_set_mac_filter(tethering_h tethering, bool mac_filter);
904 * @brief Adds the mac-address to the allowed client list.
905 * @details AP can allow the client by adding clients mac-address to the allowed list.
907 * @privlevel platform
908 * @privilege %http://tizen.org/privilege/tethering.admin
909 * @param[in] tethering The handle of tethering
910 * @param[in] mac The mac address
911 * @return 0 on success, otherwise negative error value.
912 * @retval #TETHERING_ERROR_NONE Successful
913 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
914 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
915 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
916 * @see tethering_mobileap_set_mac_filter()
918 int tethering_wifi_add_allowed_mac_list(tethering_h tethering, const char *mac);
921 * @brief Removes the mac-address from the allowed client list.
922 * @details Removes the mac-address from the allowed client list.
924 * @privlevel platform
925 * @privilege %http://tizen.org/privilege/tethering.admin
926 * @param[in] tethering The handle of tethering
927 * @param[in] mac The mac address
928 * @return 0 on success, otherwise negative error value.
929 * @retval #TETHERING_ERROR_NONE Successful
930 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
931 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
932 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
933 * @see tethering_mobileap_set_mac_filter()
935 int tethering_wifi_remove_allowed_mac_list(tethering_h tethering, const char *mac);
937 * @brief Gets the mac-addresses from the allowed client list.
938 * @details Gets the mac-addresses from the allowed client list.
940 * @privlevel platform
941 * @privilege %http://tizen.org/privilege/tethering.admin
942 * @param[in] tethering The handle of tethering
943 * @param[out] allowed_mac_list list of allowed mac addresses list
944 * @return 0 on success, otherwise negative error value.
945 * @retval #TETHERING_ERROR_NONE Successful
946 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
947 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
948 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
949 * @see tethering_mobileap_set_mac_filter()
951 int tethering_wifi_get_allowed_mac_list(tethering_h tethering, void **allowed_mac_list);
954 * @brief Adds the mac-address to the blocked client list.
955 * @details AP can disallow the client by adding clients mac-address to the blocked list.
957 * @privlevel platform
958 * @privilege %http://tizen.org/privilege/tethering.admin
959 * @param[in] tethering The handle of tethering
960 * @param[in] mac The mac address
961 * @return 0 on success, otherwise negative error value.
962 * @retval #TETHERING_ERROR_NONE Successful
963 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
964 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
965 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
966 * @see tethering_mobileap_set_mac_filter()
968 int tethering_wifi_add_blocked_mac_list(tethering_h tethering, const char *mac);
971 * @brief Removes the mac-address from the blocked client list.
972 * @details Removes the mac-address from the blocked client list.
974 * @privlevel platform
975 * @privilege %http://tizen.org/privilege/tethering.admin
976 * @param[in] tethering The handle of tethering
977 * @param[in] mac The mac address
978 * @return 0 on success, otherwise negative error value.
979 * @retval #TETHERING_ERROR_NONE Successful
980 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
981 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
982 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
983 * @see tethering_mobileap_set_mac_filter()
985 int tethering_wifi_remove_blocked_mac_list(tethering_h tethering, const char *mac);
988 * @brief Gets the mac-addresses from the blocked client list.
989 * @details Get the mac-addresses from the blocked client list.
991 * @privlevel platform
992 * @privilege %http://tizen.org/privilege/tethering.admin
993 * @param[in] tethering The handle of tethering
994 * @param[out] blocked_mac_list list of blocked mac addresses list
995 * @return 0 on success, otherwise negative error value.
996 * @retval #TETHERING_ERROR_NONE Successful
997 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
998 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
999 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1000 * @see tethering_mobileap_set_mac_filter()
1002 int tethering_wifi_get_blocked_mac_list(tethering_h tethering, void **blocked_mac_list);
1005 * @brief Enables/disables the dhcp server.
1007 * @privlevel platform
1008 * @privilege %http://tizen.org/privilege/tethering.admin
1009 * @details Enable/disable the dhcp server.
1010 * @param[in] tethering The handle of tethering
1011 * @param[in] enable Enable/disable the dhcp server
1012 * @return 0 on success, otherwise negative error value.
1013 * @retval #TETHERING_ERROR_NONE Successful
1014 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1016 int tethering_wifi_enable_dhcp(tethering_h tethering, bool enable);
1019 * @brief Enables the dhcp server with the address range.
1021 * @privlevel platform
1022 * @privilege %http://tizen.org/privilege/tethering.admin
1023 * @details Enable the dhcp server with the address range.
1024 * @param[in] tethering The handle of tethering
1025 * @param[in] rangestart Start address range
1026 * @param[in] rangestop End address range
1027 * @return 0 on success, otherwise negative error value.
1028 * @retval #TETHERING_ERROR_NONE Successful
1029 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1031 int tethering_wifi_set_dhcp_range(tethering_h tethering, char *rangestart, char *rangestop);
1034 * @brief Checks whether the dhcp is enabled or not.
1036 * @privlevel platform
1037 * @privilege %http://tizen.org/privilege/tethering.admin
1038 * @param[in] tethering The tethering handle
1039 * @param[out] dhcp_enabled @c true if dhcp is enabled, \n @c false if dhcp is disabled
1040 * @return 0 on success, otherwise a negative error value
1041 * @retval #TETHERING_ERROR_NONE Successful
1042 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1044 int tethering_wifi_is_dhcp_enabled(tethering_h tethering, bool *dhcp_enabled);
1047 * @brief Sets the Channel for Wi-Fi.
1048 * @details The Channel should be in between 1-14. If channel is not set, Wi-Fi sets default channel.
1050 * @privlevel platform
1051 * @privilege %http://tizen.org/privilege/tethering.admin
1052 * @param[in] tethering The tethering handle
1053 * @param[in] channel The channel number
1054 * @return 0 on success, otherwise negative error value
1055 * @retval #TETHERING_ERROR_NONE Successful
1056 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1058 int tethering_wifi_set_channel(tethering_h tethering, int channel);
1061 * @brief Gets the channel for Wi-Fi.
1062 * @details If channel is not set, Wi-Fi gets default channel.
1064 * @privlevel platform
1065 * @privilege %http://tizen.org/privilege/tethering.admin
1066 * @param[in] tethering The tethering handle
1067 * @param[out] channel The channel number
1068 * @return 0 on success, otherwise negative error value
1069 * @retval #TETHERING_ERROR_NONE Successful
1070 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1071 * @see tethering_wifi_set_channel()
1073 int tethering_wifi_get_channel(tethering_h tethering, int *channel);
1076 * @brief Sets the mode for Wi-Fi.
1077 * @details The mobile AP mode (ex: b only, g only, ad, a). If mode is not set, Wi-Fi sets default mode.
1079 * @privlevel platform
1080 * @privilege %http://tizen.org/privilege/tethering.admin
1081 * @param[in] tethering The tethering handle
1082 * @param[in] type The mobile AP mode
1083 * @return 0 on success, otherwise negative error value
1084 * @retval #TETHERING_ERROR_NONE Successful
1085 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1087 int tethering_wifi_set_mode(tethering_h tethering, tethering_wifi_mode_type_e type);
1090 * @brief Gets the mode for Wi-Fi.
1091 * @details If the mode is not set, Wi-Fi gets default mode.
1093 * @privlevel platform
1094 * @privilege %http://tizen.org/privilege/tethering.admin
1095 * @remarks @a mode must be released using free().
1096 * @param[in] tethering The tethering handle
1097 * @param[out] type The mode of Wi-Fi tethering
1098 * @return 0 on success, otherwise negative error value
1099 * @retval #TETHERING_ERROR_NONE Successful
1100 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1101 * @see tethering_wifi_set_mode()
1103 int tethering_wifi_get_mode(tethering_h tethering, tethering_wifi_mode_type_e *type);
1106 * @brief Sets txpower for Wi-Fi tethering.
1108 * @privlevel platform
1109 * @privilege http://tizen.org/privilege/tethering.admin
1110 * @param[in] tethering The tethering handle
1111 * @param[in] txpower value of txpower to be set
1112 * @return 0 on success, otherwise a negative error value
1113 * @retval #TETHERING_ERROR_NONE Successful
1114 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1115 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1116 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1117 * @see tethering_wifi_get_txpower()
1119 int tethering_wifi_set_txpower(tethering_h tethering, unsigned int txpower);
1122 * @brief Gets txpower for Wi-Fi tethering.
1124 * @privlevel platform
1125 * @privilege http://tizen.org/privilege/tethering.admin
1126 * @param[in] tethering The tethering handle
1127 * @param[out] txpower value of txpower
1128 * @return 0 on success, otherwise a negative error value
1129 * @retval #TETHERING_ERROR_NONE Successful
1130 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1131 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1132 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1133 * @see tethering_wifi_set_txpower()
1135 int tethering_wifi_get_txpower(tethering_h tethering, unsigned int *txpower);
1138 * @brief Sets mtu for Wi-Fi tethering.
1140 * @privlevel platform
1141 * @privilege %http://tizen.org/privilege/tethering.admin
1142 * @param[in] tethering The tethering handle
1143 * @param[in] mtu value of mtu to be set
1144 * @return 0 on success, otherwise a negative error value
1145 * @retval #TETHERING_ERROR_NONE Successful
1146 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1147 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1148 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1150 int tethering_wifi_set_mtu(tethering_h tethering, unsigned int mtu);
1153 * @brief Changes mac address for Wi-Fi tethering.
1155 * @privlevel platform
1156 * @privilege %http://tizen.org/privilege/tethering.admin
1157 * @param[in] tethering The client handle
1158 * @param[in] mac The mac address
1159 * @return 0 on success, otherwise a negative error value
1160 * @retval #TETHERING_ERROR_NONE Successful
1161 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1162 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1163 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1165 int tethering_wifi_change_mac(tethering_h tethering, char *mac);
1168 * @brief Sets max connected devices for Wi-Fi tethering.
1170 * @privlevel platform
1171 * @privilege %http://tizen.org/privilege/tethering.admin
1172 * @param[in] tethering The client handle
1173 * @param[in] max_device value of max_device to be set
1174 * @return 0 on success, otherwise a negative error value
1175 * @retval #TETHERING_ERROR_NONE Successful
1176 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1177 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1178 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1179 * @see tethering_wifi_get_max_connected_device()
1181 int tethering_wifi_set_max_connected_device(tethering_h tethering, int max_device);
1184 * @brief Gets max connected devices for Wi-Fi tethering.
1186 * @privlevel platform
1187 * @privilege %http://tizen.org/privilege/tethering.admin
1188 * @param[in] tethering The client handle
1189 * @param[out] max_device value of max_device
1190 * @return 0 on success, otherwise a negative error value
1191 * @retval #TETHERING_ERROR_NONE Successful
1192 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1193 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1194 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1195 * @see tethering_wifi_set_max_connected_device()
1197 int tethering_wifi_get_max_connected_device(tethering_h tethering, int *max_device);
1200 * @brief Enables port forwarding feature.
1202 * @privlevel platform
1203 * @privilege %http://tizen.org/privilege/tethering.admin
1204 * @details enable/disable port forwarding feature.
1205 * @param[in] tethering The handle of tethering
1206 * @param[in] enable Enable/Disable port forwarding
1207 * @return 0 on success, otherwise negative error value.
1208 * @retval #TETHERING_ERROR_NONE Successful
1209 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1210 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1211 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1213 int tethering_wifi_enable_port_forwarding(tethering_h tethering, bool enable);
1216 * @brief Sets port forwarding rule.
1218 * @privlevel platform
1219 * @privilege %http://tizen.org/privilege/tethering.admin
1220 * @details Set port forwarding rule.
1221 * @param[in] tethering The handle of tethering
1222 * @param[in] ifname interface name
1223 * @param[in] protocol protocol (tcp/udp)
1224 * @param[in] org_ip original destination ip where packet was meant to sent
1225 * @param[in] org_port original destination port where packet was meant to sent
1226 * @param[in] final_ip new destination ip where packet will be forwarded
1227 * @param[in] final_port new destination port where packet will be forwarded
1228 * @return 0 on success, otherwise negative error value.
1229 * @retval #TETHERING_ERROR_NONE Successful
1230 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1231 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1232 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1234 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);
1237 * @brief Resets port forwarding rule.
1239 * @privlevel platform
1240 * @privilege %http://tizen.org/privilege/tethering.admin
1241 * @details Reset port forwarding rule.
1242 * @param[in] tethering The handle of tethering
1243 * @return 0 on success, otherwise negative error value.
1244 * @retval #TETHERING_ERROR_NONE Successful
1245 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1246 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1247 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1249 int tethering_wifi_reset_port_forwarding_rule(tethering_h tethering);
1252 * @brief Checks whether the port forwarding is enabled or not.
1254 * @privlevel platform
1255 * @privilege %http://tizen.org/privilege/tethering.admin
1256 * @param[in] tethering The tethering handle
1257 * @param[out] forwarding_enabled @c true if port forwarding is enabled, \n @c false if port forwarding is disabled
1258 * @return 0 on success, otherwise a negative error value
1259 * @retval #TETHERING_ERROR_NONE Successful
1260 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1261 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1262 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1264 int tethering_wifi_is_port_forwarding_enabled(tethering_h tethering, bool* forwarding_enabled);
1267 * @brief Gets the port forwarding rule for Wi-Fi tethering.
1269 * @privlevel platform
1270 * @privilege %http://tizen.org/privilege/tethering.admin
1271 * @param[in] tethering The client handle
1272 * @param[out] port_forwarding_list list of port forwarding rules
1273 * @return 0 on success, otherwise a negative error value
1274 * @retval #TETHERING_ERROR_NONE Successful
1275 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1276 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1277 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1279 int tethering_wifi_get_port_forwarding_rule(tethering_h tethering, void **port_forwarding_list);
1282 * @brief Enables port filtering feature.
1284 * @privlevel platform
1285 * @privilege %http://tizen.org/privilege/tethering.admin
1286 * @details enable/disable port filtering feature.
1287 * @param[in] tethering The handle of tethering
1288 * @param[in] enable Enable/Disable port filtering
1289 * @return 0 on success, otherwise negative error value.
1290 * @retval #TETHERING_ERROR_NONE Successful
1291 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1292 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1293 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1295 int tethering_wifi_enable_port_filtering(tethering_h tethering, bool enable);
1298 * @brief Sets port filtering rule.
1300 * @privlevel platform
1301 * @privilege %http://tizen.org/privilege/tethering.admin
1302 * @details Set port filtering rule.
1303 * @param[in] tethering The handle of tethering
1304 * @param[in] port to be filtered
1305 * @param[in] protocol protocol (tcp/udp)
1306 * @param[in] allow allow/disallow port filtering
1307 * @return 0 on success, otherwise negative error value.
1308 * @retval #TETHERING_ERROR_NONE Successful
1309 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1310 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1311 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1313 int tethering_wifi_add_port_filtering_rule(tethering_h tethering, int port, char *protocol, bool allow);
1316 * @brief Sets custom port filtering rule.
1318 * @privlevel platform
1319 * @privilege %http://tizen.org/privilege/tethering.admin
1320 * @details Set custom port filtering rule.
1321 * @param[in] tethering The handle of tethering
1322 * @param[in] port1 to be filtered
1323 * @param[in] port2 to be filtered
1324 * @param[in] protocol protocol (tcp/udp)
1325 * @param[in] allow allow/disallow port filtering
1326 * @return 0 on success, otherwise negative error value.
1327 * @retval #TETHERING_ERROR_NONE Successful
1328 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1329 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1330 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1332 int tethering_wifi_add_custom_port_filtering_rule(tethering_h tethering, int port1, int port2, char *protocol, bool allow);
1335 * @brief Gets the port filtering rule for Wi-Fi tethering.
1337 * @privlevel platform
1338 * @privilege %http://tizen.org/privilege/tethering.admin
1339 * @param[in] tethering The client handle
1340 * @param[out] port_filtering_list list of port filtering rules
1341 * @return 0 on success, otherwise a negative error value
1342 * @retval #TETHERING_ERROR_NONE Successful
1343 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1344 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1345 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1347 int tethering_wifi_get_port_filtering_rule(tethering_h tethering, void **port_filtering_list);
1350 * @brief Gets the custom port filtering rule for Wi-Fi tethering.
1352 * @privlevel platform
1353 * @privilege %http://tizen.org/privilege/tethering.admin
1354 * @param[in] tethering The client handle
1355 * @param[out] custom_port_filtering_list list of custom port filtering rules
1356 * @return 0 on success, otherwise a negative error value
1357 * @retval #TETHERING_ERROR_NONE Successful
1358 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1359 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1360 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1362 int tethering_wifi_get_custom_port_filtering_rule(tethering_h tethering, void **custom_port_filtering_list);
1365 * @brief Checks whether the port filtering is enabled or not.
1367 * @privlevel platform
1368 * @privilege %http://tizen.org/privilege/tethering.admin
1369 * @param[in] tethering The tethering handle
1370 * @param[out] filtering_enabled @c true if port filtering is enabled, \n @c false if port filtering is disabled
1371 * @return 0 on success, otherwise a negative error value
1372 * @retval #TETHERING_ERROR_NONE Successful
1373 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1374 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1375 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1377 int tethering_wifi_is_port_filtering_enabled(tethering_h tethering, bool* filtering_enabled);
1380 * @brief Sets vpn passthrough rule.
1382 * @privlevel platform
1383 * @privilege %http://tizen.org/privilege/tethering.admin
1384 * @details Set vpn passthrough rule.
1385 * @param[in] tethering The handle of tethering
1386 * @param[in] type vpn passthrough type
1387 * @param[in] enable @c true if vpn passthrough is enabled, \n @c false if vpn passthrough is disabled
1388 * @return 0 on success, otherwise negative error value.
1389 * @retval #TETHERING_ERROR_NONE Successful
1390 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1391 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1392 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1394 int tethering_wifi_set_vpn_passthrough_rule(tethering_h tethering, tethering_vpn_passthrough_type_e type, bool enable);
1397 * @brief Pushes the WPS button to connect with Wi-Fi Tethering client. (WPS PBC)
1399 * @remarks The WPS button should be pushed when client tries to connect with Soft AP by using WPS PBC.
1400 * @param[in] tethering The tethering handle
1401 * @return 0 on success, otherwise negative error value
1402 * @retval #TETHERING_ERROR_NONE Successful
1403 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1404 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
1405 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission denied
1406 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
1408 int tethering_wifi_push_wps_button(tethering_h tethering);
1411 * @brief Sets the WPS PIN to connect with Wi-Fi Tethering client. (WPS PIN)
1413 * @remarks The WPS PIN should be inserted when client tries to connect with Soft AP by using WPS PIN.
1414 * @param[in] tethering The tethering handle
1415 * @param[in] wps_pin The WPS PIN
1416 * @return 0 on success, otherwise negative error value
1417 * @retval #TETHERING_ERROR_NONE Successful
1418 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1419 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
1420 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission denied
1421 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
1423 int tethering_wifi_set_wps_pin(tethering_h tethering, const char *wps_pin);
1426 * @brief Checks whether wifi-sharing is supported or not.
1428 * @privlevel platform
1429 * @privilege %http://tizen.org/privilege/tethering.admin
1430 * @param[in] tethering The tethering handle
1431 * @param[out] supported @c true if wifi-sharing is supported, \n @c false if wifi-sharing is unsupported
1432 * @return 0 on success, otherwise a negative error value
1433 * @retval #TETHERING_ERROR_NONE Successful
1434 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1435 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission denied
1436 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
1438 int tethering_wifi_is_sharing_supported(tethering_h tethering, bool *supported);
1441 * @brief Sets the wifi-sharing flag.
1443 * @privlevel platform
1444 * @param[in] tethering The tethering handle
1445 * @param[in] sharing @c true if wifi-sharing is set, \n @c false if wifi-sharing is unset
1446 * @return 0 on success, otherwise a negative error value
1447 * @retval #TETHERING_ERROR_NONE Successful
1448 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1449 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
1451 int tethering_wifi_set_sharing(tethering_h tethering, bool sharing);
1454 * @brief Gets the wifi-sharing flag.
1456 * @privlevel platform
1457 * @param[in] tethering The tethering handle
1458 * @param[out] sharing @c true if wifi-sharing is set, \n @c otherwise false.
1459 * @return 0 on success, otherwise a negative error value
1460 * @retval #TETHERING_ERROR_NONE Successful
1461 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1462 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
1464 int tethering_wifi_get_sharing(tethering_h tethering, bool *sharing);
1472 * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
1477 * @brief Clones the handle of a client.
1479 * @privlevel platform
1480 * @privilege %http://tizen.org/privilege/tethering.admin
1481 * @remarks @a dest must be release using tethering_client_destroy().
1482 * @param[out] dest The cloned client handle
1483 * @param[in] origin The origin client handle
1484 * @return 0 on success, otherwise a negative error value
1485 * @retval #TETHERING_ERROR_NONE Successful
1486 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1487 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1488 * @see tethering_client_destroy()
1490 int tethering_client_clone(tethering_client_h *dest, tethering_client_h origin);
1493 * @brief Destroys the handle of a client.
1495 * @privlevel platform
1496 * @privilege %http://tizen.org/privilege/tethering.admin
1497 * @param[in] client The client handle
1498 * @return 0 on success, otherwise a negative error value
1499 * @retval #TETHERING_ERROR_NONE Successful
1500 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1501 * @see tethering_client_clone()
1503 int tethering_client_destroy(tethering_client_h client);
1506 * @brief Gets the tethering type of client.
1508 * @privlevel platform
1509 * @privilege %http://tizen.org/privilege/tethering.admin
1510 * @param[in] client The handle of client
1511 * @param[out] type The type of tethering
1512 * @return 0 on success, otherwise a negative error value.
1513 * @retval #TETHERING_ERROR_NONE Successful
1514 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1515 * @see tethering_usb_get_connected_client()
1516 * @see tethering_connection_state_changed_cb()
1518 int tethering_client_get_tethering_type(tethering_client_h client, tethering_type_e *type);
1521 * @brief Gets the tethering band of client.
1523 * @privlevel platform
1524 * @privilege %http://tizen.org/privilege/tethering.admin
1525 * @param[in] client The handle of client
1526 * @param[out] band The band of tethering
1527 * @return 0 on success, otherwise a negative error value.
1528 * @retval #TETHERING_ERROR_NONE Successful
1529 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1530 * @see tethering_usb_get_connected_client()
1531 * @see tethering_connection_state_changed_cb()
1533 int tethering_client_get_tethering_band(tethering_client_h client, tethering_band_e *band);
1537 * @brief Gets the name of a client.
1539 * @privlevel platform
1540 * @privilege %http://tizen.org/privilege/tethering.admin
1541 * @remarks @a name must be released using free().
1542 * @param[in] client The client handle
1543 * @param[out] name The name of the client
1544 * @return 0 on success, otherwise a negative error value
1545 * @retval #TETHERING_ERROR_NONE Successful
1546 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1547 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1548 * @see tethering_usb_get_connected_client()
1549 * @see tethering_connection_state_changed_cb()
1551 int tethering_client_get_name(tethering_client_h client, char **name);
1554 * @brief Gets the IP address of a client.
1556 * @privlevel platform
1557 * @privilege %http://tizen.org/privilege/tethering.admin
1558 * @remarks @a ip_address must be released using free().
1559 * @param[in] client The client handle
1560 * @param[in] address_family The address family of IP address. Currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported
1561 * @param[out] ip_address The IP address
1562 * @return 0 on success, otherwise a negative error value
1563 * @retval #TETHERING_ERROR_NONE Successful
1564 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1565 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1566 * @see tethering_usb_get_connected_client()
1567 * @see tethering_connection_state_changed_cb()
1569 int tethering_client_get_ip_address(tethering_client_h client, tethering_address_family_e address_family, char **ip_address);
1572 * @brief Gets the MAC address of a client such as "FC:A1:3E:D6:B1:B1".
1574 * @privlevel platform
1575 * @privilege %http://tizen.org/privilege/tethering.admin
1576 * @remarks @a mac_address must be released using free().
1577 * @param[in] client The client handle
1578 * @param[out] mac_address The MAC address
1579 * @return 0 on success, otherwise a negative error value
1580 * @retval #TETHERING_ERROR_NONE Successful
1581 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1582 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1583 * @see tethering_usb_get_connected_client()
1584 * @see tethering_connection_state_changed_cb()
1586 int tethering_client_get_mac_address(tethering_client_h client, char **mac_address);
1589 * @brief Gets the connection time of a client.
1591 * @privlevel platform
1592 * @privilege %http://tizen.org/privilege/tethering.admin
1593 * @param[in] client The client handle
1594 * @param[out] time The connected time of the client
1595 * @return 0 on success, otherwise a negative error value
1596 * @retval #TETHERING_ERROR_NONE Successful
1597 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1598 * @see tethering_usb_get_connected_client()
1599 * @see tethering_connection_state_changed_cb()
1601 int tethering_client_get_time(tethering_client_h client, time_t *timestamp);
1613 #endif /* __TIZEN_NETWORK_TETHERING_H__ */