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 */
70 TETHERING_TYPE_MAX, /**< Maximum */
74 * @brief Enumeration for the cause of disabling the tethering.
78 TETHERING_DISABLED_BY_USB_DISCONNECTION = 0, /**< Disabled due to usb disconnection */
79 TETHERING_DISABLED_BY_FLIGHT_MODE, /**< Disabled due to flight mode */
80 TETHERING_DISABLED_BY_LOW_BATTERY, /**< Disabled due to low battery */
81 TETHERING_DISABLED_BY_NETWORK_CLOSE, /**< Disabled due to pdp network close */
82 TETHERING_DISABLED_BY_TIMEOUT, /**< Disabled due to timeout */
83 TETHERING_DISABLED_BY_OTHERS, /**< Disabled by other apps */
84 TETHERING_DISABLED_BY_REQUEST, /**< Disabled by your request */
85 TETHERING_DISABLED_BY_WIFI_ON, /**< Disabled due to Wi-Fi on */
86 TETHERING_DISABLED_BY_BT_OFF, /**< Disabled due to Bluetooth off */
87 } tethering_disabled_cause_e;
95 * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
100 * @brief Enumeration for the Wi-Fi security.
104 TETHERING_WIFI_SECURITY_TYPE_NONE = 0, /**< No Security type */
105 TETHERING_WIFI_SECURITY_TYPE_WPA2_PSK, /**< WPA2_PSK */
106 TETHERING_WIFI_SECURITY_TYPE_WPS, /**< WPA2_PSK */
107 TETHERING_WIFI_SECURITY_TYPE_SAE, /**< SAE */
108 } tethering_wifi_security_type_e;
111 * @brief Enumeration for the Wi-Fi mode
115 TETHERING_WIFI_MODE_TYPE_B = 0, /**< mode b */
116 TETHERING_WIFI_MODE_TYPE_G, /**< mode g */
117 TETHERING_WIFI_MODE_TYPE_A, /**< mode a */
118 TETHERING_WIFI_MODE_TYPE_AD, /**< mode ad */
119 } tethering_wifi_mode_type_e;
122 TETHERING_TYPE_IPSEC_PASSTHROUGH = 0, /**< IPSEC */
123 TETHERING_TYPE_PPTP_PASSTHROUGH, /**< PPTP type */
124 TETHERING_TYPE_L2TP_PASSTHROUGH, /**< L2TP type */
125 } tethering_vpn_passthrough_type_e;
133 * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
138 * @brief The tethering client handle.
141 typedef void * tethering_client_h;
144 * @brief Enumeration for address family.
148 TETHERING_ADDRESS_FAMILY_IPV4 = 0, /**< IPV4 Address type */
149 TETHERING_ADDRESS_FAMILY_IPV6 = 1, /**< IPV6 Address type (Since 4.0) */
150 } tethering_address_family_e;
158 * @addtogroup CAPI_NETWORK_TETHERING_MANAGER_MODULE
163 * @brief Called when the tethering is enabled.
165 * @param[in] result The result of enabling the tethering
166 * @param[in] type The tethering type
167 * @param[in] is_requested Indicates whether this change is requested
168 * @param[in] user_data The user data passed from tethering_set_enabled_cb()
169 * @pre If you register callback function using tethering_set_enabled_cb(), this will be invoked when the tethering is enabled.
170 * @see tethering_enable()
171 * @see tethering_unset_enabled_cb()
173 typedef void (*tethering_enabled_cb)(tethering_error_e result, tethering_type_e type, bool is_requested, void *user_data);
176 * @brief Called when the tethering is disabled.
178 * @param[in] result The result of disabling the tethering
179 * @param[in] type The tethering type
180 * @param[in] cause The cause of disabling
181 * @param[in] user_data The user data passed from tethering_set_disabled_cb()
182 * @pre If you register callback function using tethering_set_disabled_cb(), this will be invoked when the tethering is disabled.
183 * @see tethering_set_disabled_cb()
184 * @see tethering_unset_disabled_cb()
186 typedef void (*tethering_disabled_cb)(tethering_error_e result, tethering_type_e type, tethering_disabled_cause_e cause, void *user_data);
189 * @brief Called when the connection state is changed.
191 * @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().
192 * @param[in] client The client of which connection state is changed
193 * @param[in] opened @c true when connection is opened, otherwise false
194 * @param[in] user_data The user data passed from tethering_set_connection_state_changed_cb()
195 * @pre If you register callback function using tethering_set_connection_state_changed_cb(), this will be invoked when the connection state is changed.
196 * @see tethering_set_connection_state_changed_cb()
197 * @see tethering_unset_connection_state_changed_cb()
199 typedef void (*tethering_connection_state_changed_cb)(tethering_client_h client, bool opened, void *user_data);
202 * @brief Called when you get the connected client repeatedly.
204 * @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().
205 * @param[in] client The connected client
206 * @param[in] user_data The user data passed from the request function
207 * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
208 * @pre tethering_foreach_connected_clients() will invoke this callback.
209 * @see tethering_foreach_connected_clients()
211 typedef bool(*tethering_connected_client_cb)(tethering_client_h client, void *user_data);
214 * @brief Called when you get the data usage.
216 * @param[in] result The result of getting the data usage
217 * @param[in] received_data The usage of received data
218 * @param[in] sent_data The usage of sent data
219 * @param[in] user_data The user data passed from the request function
220 * @pre tethering_get_data_usage() will invoked this callback.
222 typedef void (*tethering_data_usage_cb)(tethering_error_e result, unsigned long long received_data, unsigned long long sent_data, void *user_data);
225 * @brief Called when the security type of Wi-Fi tethering is changed.
227 * @param[in] changed_type The changed security type of Wi-Fi tethering
228 * @param[in] user_data The user data passed from the register function
229 * @see tethering_wifi_set_security_type_changed_cb()
230 * @see tethering_wifi_unset_security_type_changed_cb()
232 typedef void (*tethering_wifi_security_type_changed_cb)(tethering_wifi_security_type_e changed_type, void *user_data);
235 * @brief Called when the visibility of SSID is changed.
237 * @param[in] changed_visible The changed visibility of SSID
238 * @param[in] user_data The user data passed from the register function
239 * @see tethering_wifi_set_ssid_visibility_changed_cb()
240 * @see tethering_wifi_unset_ssid_visibility_changed_cb()
242 typedef void (*tethering_wifi_ssid_visibility_changed_cb)(bool changed_visible, void *user_data);
245 * @brief Called when the passphrase of Wi-Fi tethering is changed.
247 * @param[in] user_data The user data passed from the register function
248 * @see tethering_wifi_set_passphrase_changed_cb()
249 * @see tethering_wifi_unset_passphrase_changed_cb()
251 typedef void (*tethering_wifi_passphrase_changed_cb)(void *user_data);
254 * @brief Called when the settings are reloaded.
256 * @param[in] result The result of reloading the settings
257 * @param[in] user_data The user data passed from the request function
258 * @pre tethering_wifi_reload_settings() will invoke this callback.
260 typedef void (*tethering_wifi_settings_reloaded_cb)(tethering_error_e result, void *user_data);
263 * @brief Creates the handle for tethering.
265 * @privlevel platform
266 * @privilege %http://tizen.org/privilege/tethering.admin
267 * @remarks The @a tethering must be released using tethering_destroy().
268 * @param[out] tethering A handle of a new mobile ap handle on success
269 * @return 0 on success, otherwise a negative error value
270 * @retval #TETHERING_ERROR_NONE Successful
271 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
272 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
273 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API is not supported
274 * @see tethering_destroy()
276 int tethering_create(tethering_h *tethering);
279 * @brief Destroys the handle for tethering.
281 * @privlevel platform
282 * @privilege %http://tizen.org/privilege/tethering.admin
283 * @param[in] tethering The tethering handle
284 * @return 0 on success, otherwise a negative error value
285 * @retval #TETHERING_ERROR_NONE Successful
286 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
287 * @see tethering_create()
289 int tethering_destroy(tethering_h tethering);
292 * @brief Enables the tethering, asynchronously.
294 * @privlevel platform
295 * @privilege %http://tizen.org/privilege/tethering.admin
296 * @param[in] tethering The tethering handle
297 * @param[in] type The tethering type
298 * @return 0 on success, otherwise negative error value
299 * @retval #TETHERING_ERROR_NONE Successful
300 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
301 * @post tethering_enabled_cb() will be invoked.
302 * @see tethering_is_enabled()
303 * @see tethering_disable()
305 int tethering_enable(tethering_h tethering, tethering_type_e type);
308 * @brief Disables the tethering, asynchronously.
310 * @privlevel platform
311 * @privilege %http://tizen.org/privilege/tethering.admin
312 * @param[in] tethering The tethering handle
313 * @param[in] type The tethering type
314 * @return 0 on success, otherwise negative error value
315 * @retval #TETHERING_ERROR_NONE Successful
316 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
317 * @post tethering_disabled_cb() will be invoked.
318 * @see tethering_is_enabled()
319 * @see tethering_enable()
321 int tethering_disable(tethering_h tethering, tethering_type_e type);
324 * @brief Enables the IPv6 tethering, asynchronously.
326 * @privlevel platform
327 * @privilege %http://tizen.org/privilege/tethering.admin
328 * @remarks It supports Wi-Fi tethering and BT tethering only.
329 * @param[in] tethering The tethering handle
330 * @param[in] type The tethering type
331 * @return 0 on success, otherwise negative error value
332 * @retval #TETHERING_ERROR_NONE Successful
333 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
334 * @post tethering_enabled_cb() will be invoked.
335 * @see tethering_is_enabled()
336 * @see tethering_ipv6_disable()
338 int tethering_ipv6_enable(tethering_h tethering, tethering_type_e type);
341 * @brief Disables the IPv6 tethering, asynchronously.
343 * @privlevel platform
344 * @privilege %http://tizen.org/privilege/tethering.admin
345 * @remarks It supports Wi-Fi tethering and BT tethering only.
346 * @param[in] tethering The tethering handle
347 * @param[in] type The tethering type
348 * @return 0 on success, otherwise negative error value
349 * @retval #TETHERING_ERROR_NONE Successful
350 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
351 * @post tethering_disabled_cb() will be invoked.
352 * @see tethering_is_enabled()
353 * @see tethering_ipv6_enable()
355 int tethering_ipv6_disable(tethering_h tethering, tethering_type_e type);
358 * @brief Checks whether the tethering is enabled or not.
360 * @privlevel platform
361 * @privilege %http://tizen.org/privilege/tethering.admin
362 * @param[in] tethering The tethering handle
363 * @param[in] type The tethering type
364 * @return @c true if tethering is enabled, \n @c false if tethering is disabled
366 bool tethering_is_enabled(tethering_h tethering, tethering_type_e type);
369 * @brief Gets the MAC address of local device as "FC:A1:3E:D6:B1:B1".
371 * @privlevel platform
372 * @privilege %http://tizen.org/privilege/tethering.admin
373 * @remarks @a mac_address must be released using free().
374 * @param[in] tethering The tethering handle
375 * @param[in] type The tethering type
376 * @param[out] mac_address The MAC address
377 * @return 0 on success, otherwise a negative error value
378 * @retval #TETHERING_ERROR_NONE Successful
379 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
380 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
381 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
382 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
383 * @pre The tethering must be enabled.
384 * @see tethering_is_enabled()
385 * @see tethering_enable()
387 int tethering_get_mac_address(tethering_h tethering, tethering_type_e type, char **mac_address);
390 * @brief Gets the name of network interface (e.g. usb0).
392 * @privlevel platform
393 * @privilege %http://tizen.org/privilege/tethering.admin
394 * @remarks @a interface_name must be released using free().
395 * @param[in] tethering The tethering handle
396 * @param[in] type The tethering type
397 * @param[out] interface_name The name of the network interface
398 * @return 0 on success, otherwise negative error value
399 * @retval #TETHERING_ERROR_NONE Successful
400 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
401 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
402 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
403 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
404 * @pre The tethering must be enabled.
405 * @see tethering_is_enabled()
406 * @see tethering_enable()
408 int tethering_get_network_interface_name(tethering_h tethering, tethering_type_e type, char **interface_name);
411 * @brief Gets the local IP address.
413 * @privlevel platform
414 * @privilege %http://tizen.org/privilege/tethering.admin
415 * @remarks @a ip_address must be released using free().
416 * @param[in] tethering The tethering handle
417 * @param[in] type The tethering type
418 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
419 * @param[out] ip_address The local IP address
420 * @return 0 on success, otherwise negative error value
421 * @retval #TETHERING_ERROR_NONE Successful
422 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
423 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
424 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
425 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
426 * @pre The tethering must be enabled.
427 * @see tethering_is_enabled()
428 * @see tethering_enable()
430 int tethering_get_ip_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **ip_address);
433 * @brief Gets the Gateway address.
435 * @privlevel platform
436 * @privilege %http://tizen.org/privilege/tethering.admin
437 * @remarks @a gateway_address must be released using free().
438 * @param[in] tethering The tethering handle
439 * @param[in] type The tethering type
440 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
441 * @param[out] gateway_address The local IP address
442 * @return 0 on success, otherwise negative error value
443 * @retval #TETHERING_ERROR_NONE Successful
444 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
445 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
446 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
447 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
448 * @pre The tethering must be enabled.
449 * @see tethering_is_enabled()
450 * @see tethering_enable()
452 int tethering_get_gateway_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **gateway_address);
455 * @brief Gets the Subnet Mask.
457 * @privlevel platform
458 * @privilege %http://tizen.org/privilege/tethering.admin
459 * @remarks @a subnet_mask must be released using free().
460 * @param[in] tethering The tethering handle
461 * @param[in] type The tethering type
462 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
463 * @param[out] subnet_mask The local IP address
464 * @return 0 on success, otherwise negative error value
465 * @retval #TETHERING_ERROR_NONE Successful
466 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
467 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
468 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
469 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
470 * @pre The tethering must be enabled.
471 * @see tethering_is_enabled()
472 * @see tethering_enable()
474 int tethering_get_subnet_mask(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **subnet_mask);
477 * @brief Gets the data usage.
479 * @privlevel platform
480 * @privilege %http://tizen.org/privilege/tethering.admin
481 * @param[in] tethering The tethering handle
482 * @param[out] usage The data usage
483 * @return 0 on success, otherwise negative error value
484 * @retval #TETHERING_ERROR_NONE Successful
485 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
486 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
487 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
488 * @pre The tethering must be enabled.
489 * @see tethering_is_enabled()
490 * @see tethering_enable()
492 int tethering_get_data_usage(tethering_h tethering, tethering_data_usage_cb callback, void *user_data);
495 * @brief Gets the clients which are connected.
497 * @privlevel platform
498 * @privilege %http://tizen.org/privilege/tethering.admin
499 * @param[in] tethering The tethering handle
500 * @param[in] type The tethering type
501 * @param[in] callback The callback function to invoke
502 * @param[in] user_data The user data to be passed to the callback function
503 * @retval #TETHERING_ERROR_NONE Successful
504 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
505 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
506 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
507 * @pre The tethering must be enabled.
508 * @see tethering_is_enabled()
509 * @see tethering_enable()
511 int tethering_foreach_connected_clients(tethering_h tethering, tethering_type_e type, tethering_connected_client_cb callback, void *user_data);
514 * @brief Registers the callback function, which is called when tethering is enabled.
516 * @privlevel platform
517 * @privilege %http://tizen.org/privilege/tethering.admin
518 * @param[in] tethering The tethering handle
519 * @param[in] type The tethering type
520 * @param[in] callback The callback function to invoke
521 * @param[in] user_data The user data to be passed to the callback function
522 * @retval #TETHERING_ERROR_NONE Successful
523 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
524 * @see tethering_unset_enabled_cb()
526 int tethering_set_enabled_cb(tethering_h tethering, tethering_type_e type, tethering_enabled_cb callback, void *user_data);
529 * @brief Unregisters the callback function, which is called when tethering is enabled.
531 * @privlevel platform
532 * @privilege %http://tizen.org/privilege/tethering.admin
533 * @param[in] tethering The tethering handle
534 * @param[in] type The tethering type
535 * @retval #TETHERING_ERROR_NONE Successful
536 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
537 * @see tethering_set_enabled_cb()
539 int tethering_unset_enabled_cb(tethering_h tethering, tethering_type_e type);
542 * @brief Registers the callback function called when tethering is disabled.
544 * @privlevel platform
545 * @privilege %http://tizen.org/privilege/tethering.admin
546 * @param[in] tethering The tethering handle
547 * @param[in] type The tethering type
548 * @param[in] callback The callback function to invoke
549 * @param[in] user_data The user data to be passed to the callback function
550 * @retval #TETHERING_ERROR_NONE Successful
551 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
552 * @see tethering_unset_disabled_cb()
554 int tethering_set_disabled_cb(tethering_h tethering, tethering_type_e type, tethering_disabled_cb callback, void *user_data);
557 * @brief Unregisters the callback function, which is called when tethering is disabled.
559 * @privlevel platform
560 * @privilege %http://tizen.org/privilege/tethering.admin
561 * @param[in] tethering The tethering handle
562 * @param[in] type The tethering type
563 * @retval #TETHERING_ERROR_NONE Successful
564 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
565 * @see tethering_set_disabled_cb()
567 int tethering_unset_disabled_cb(tethering_h tethering, tethering_type_e type);
570 * @brief Registers the callback function, which is called when the state of connection is changed.
572 * @privlevel platform
573 * @privilege %http://tizen.org/privilege/tethering.admin
574 * @param[in] tethering The tethering handle
575 * @param[in] type The tethering type
576 * @param[in] callback The callback function to invoke
577 * @param[in] user_data The user data to be passed to the callback function
578 * @retval #TETHERING_ERROR_NONE Successful
579 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
580 * @see tethering_unset_connection_state_changed_cb_cb()
582 int tethering_set_connection_state_changed_cb(tethering_h tethering, tethering_type_e type, tethering_connection_state_changed_cb callback, void *user_data);
585 * @brief Unregisters the callback function, which is called when the state of connection is changed.
587 * @privlevel platform
588 * @privilege %http://tizen.org/privilege/tethering.admin
589 * @param[in] tethering The tethering handle
590 * @param[in] type The tethering type
591 * @retval #TETHERING_ERROR_NONE Successful
592 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
593 * @see tethering_set_connection_state_changed_cb()
595 int tethering_unset_connection_state_changed_cb(tethering_h tethering, tethering_type_e type);
598 * @brief Registers the callback function, which is called when the security type of Wi-Fi tethering is changed.
600 * @privlevel platform
601 * @privilege %http://tizen.org/privilege/tethering.admin
602 * @param[in] tethering The tethering handle
603 * @param[in] callback The callback function to invoke
604 * @param[in] user_data The user data to be passed to the callback function
605 * @retval #TETHERING_ERROR_NONE Successful
606 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
607 * @see tethering_wifi_unset_security_type_changed_cb()
609 int tethering_wifi_set_security_type_changed_cb(tethering_h tethering, tethering_wifi_security_type_changed_cb callback, void *user_data);
612 * @brief Unregisters the callback function, which is called when the security type of Wi-Fi tethering is changed.
614 * @privlevel platform
615 * @privilege %http://tizen.org/privilege/tethering.admin
616 * @param[in] tethering The tethering handle
617 * @param[in] type The tethering type
618 * @retval #TETHERING_ERROR_NONE Successful
619 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
620 * @see tethering_wifi_set_security_type_changed_cb()
622 int tethering_wifi_unset_security_type_changed_cb(tethering_h tethering);
625 * @brief Registers the callback function , which iscalled when the visibility of SSID is changed.
627 * @privlevel platform
628 * @privilege %http://tizen.org/privilege/tethering.admin
629 * @param[in] tethering The tethering handle
630 * @param[in] callback The callback function to invoke
631 * @param[in] user_data The user data to be passed to the callback function
632 * @retval #TETHERING_ERROR_NONE Successful
633 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
634 * @see tethering_wifi_unset_ssid_visibility_changed_cb_cb()
636 int tethering_wifi_set_ssid_visibility_changed_cb(tethering_h tethering, tethering_wifi_ssid_visibility_changed_cb callback, void *user_data);
639 * @brief Unregisters the callback function, which is called when the visibility of SSID is changed.
641 * @privlevel platform
642 * @privilege %http://tizen.org/privilege/tethering.admin
643 * @param[in] tethering The tethering handle
644 * @retval #TETHERING_ERROR_NONE Successful
645 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
646 * @see tethering_wifi_set_ssid_visibility_changed_cb()
648 int tethering_wifi_unset_ssid_visibility_changed_cb(tethering_h tethering);
651 * @brief Registers the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
653 * @privlevel platform
654 * @privilege %http://tizen.org/privilege/tethering.admin
655 * @param[in] tethering The tethering handle
656 * @param[in] callback The callback function to invoke
657 * @param[in] user_data The user data to be passed to the callback function
658 * @retval #TETHERING_ERROR_NONE Successful
659 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
660 * @see tethering_wifi_unset_passphrase_changed_cb()
662 int tethering_wifi_set_passphrase_changed_cb(tethering_h tethering, tethering_wifi_passphrase_changed_cb callback, void *user_data);
665 * @brief Unregisters the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
667 * @privlevel platform
668 * @privilege %http://tizen.org/privilege/tethering.admin
669 * @param[in] tethering The tethering handle
670 * @retval #TETHERING_ERROR_NONE Successful
671 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
672 * @see tethering_wifi_set_passphrase_changed_cb()
674 int tethering_wifi_unset_passphrase_changed_cb(tethering_h tethering);
682 * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
687 * @brief Sets the security type of Wi-Fi tethering.
689 * @privlevel platform
690 * @privilege %http://tizen.org/privilege/tethering.admin
691 * @remarks This change is applied next time Wi-Fi tethering is enabled.
692 * @param[in] tethering The tethering handle
693 * @param[in] type The security type
694 * @return 0 on success, otherwise negative error value
695 * @retval #TETHERING_ERROR_NONE Successful
696 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
697 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
698 * @see tethering_wifi_get_security_type()
700 int tethering_wifi_set_security_type(tethering_h tethering, tethering_wifi_security_type_e type);
703 * @brief Gets the security type of Wi-Fi tethering.
705 * @privlevel platform
706 * @privilege %http://tizen.org/privilege/tethering.admin
707 * @param[in] tethering The tethering handle
708 * @param[out] type The security type
709 * @return 0 on success, otherwise negative error value
710 * @retval #TETHERING_ERROR_NONE Successful
711 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
712 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
713 * @see tethering_wifi_set_security_type()
715 int tethering_wifi_get_security_type(tethering_h tethering, tethering_wifi_security_type_e *type);
718 * @brief Sets the SSID (service set identifier).
719 * @details The SSID cannot exceed 32 bytes. If SSID is not set, device name is used as SSID.
721 * @privlevel platform
722 * @privilege %http://tizen.org/privilege/tethering.admin
723 * @remarks This change is applied next time Wi-Fi tethering is enabled with same @a tethering handle.
724 * @param[in] tethering The tethering handle
725 * @param[in] ssid The SSID
726 * @return 0 on success, otherwise negative error value
727 * @retval #TETHERING_ERROR_NONE Successful
728 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
729 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
731 int tethering_wifi_set_ssid(tethering_h tethering, const char *ssid);
734 * @brief Gets the SSID (service set identifier).
736 * @privlevel platform
737 * @privilege %http://tizen.org/privilege/tethering.admin
738 * @remarks @a ssid must be released using free().
739 * @param[in] tethering The tethering handle
740 * @param[out] ssid The SSID
741 * @return 0 on success, otherwise negative error value
742 * @retval #TETHERING_ERROR_NONE Successful
743 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
744 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
745 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
747 int tethering_wifi_get_ssid(tethering_h tethering, char **ssid);
750 * @brief Sets the visibility of SSID (service set identifier).
751 * @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.
753 * @privlevel platform
754 * @privilege %http://tizen.org/privilege/tethering.admin
755 * @remarks This change is applied next time Wi-Fi tethering is enabled.
756 * @param[in] tethering The tethering handle
757 * @param[in] visible The visibility of SSID: (@c true = visible, @c false = invisible)
758 * @return 0 on success, otherwise negative error value
759 * @retval #TETHERING_ERROR_NONE Successful
760 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
761 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
762 * @see tethering_wifi_get_ssid_visibility()
764 int tethering_wifi_set_ssid_visibility(tethering_h tethering, bool visible);
767 * @brief Gets the visibility of SSID (service set identifier).
768 * @details If the visibility is set to invisible, then the SSID of this device is hidden and Wi-Fi scan will not find the device.
770 * @privlevel platform
771 * @privilege %http://tizen.org/privilege/tethering.admin
772 * @param[in] tethering The tethering handle
773 * @param[out] visible The visibility of SSID: (@c true = visible, @c false = invisible)
774 * @return 0 on success, otherwise negative error value
775 * @retval #TETHERING_ERROR_NONE Successful
776 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
777 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
778 * @see tethering_wifi_set_ssid_visibility()
780 int tethering_wifi_get_ssid_visibility(tethering_h tethering, bool *visible);
783 * @brief Sets the passphrase.
785 * @privlevel platform
786 * @privilege %http://tizen.org/privilege/tethering.admin
787 * @remarks This change is applied next time Wi-Fi tethering is enabled.
788 * @param[in] tethering The tethering handle
789 * @param[in] passphrase The passphrase
790 * @return 0 on success, otherwise negative error value
791 * @retval #TETHERING_ERROR_NONE Successful
792 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
793 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
794 * @see tethering_wifi_get_passphrase()
796 int tethering_wifi_set_passphrase(tethering_h tethering, const char *passphrase);
799 * @brief Gets the passphrase.
801 * @privlevel platform
802 * @privilege %http://tizen.org/privilege/tethering.admin
803 * @remarks @a passphrase must be released using free().
804 * @param[in] tethering The tethering handle
805 * @param[out] passphrase The passphrase
806 * @return 0 on success, otherwise negative error value
807 * @retval #TETHERING_ERROR_NONE Successful
808 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
809 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
810 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
811 * @see tethering_wifi_set_passphrase()
813 int tethering_wifi_get_passphrase(tethering_h tethering, char **passphrase);
816 * @brief Reloads the settings (SSID / Passphrase / Security type / SSID visibility).
818 * @privlevel platform
819 * @privilege %http://tizen.org/privilege/tethering.admin
820 * @remarks Connected devices via Wi-Fi tethering or MobileAP will be disconnected when the settings are reloaded.
821 * @param[in] tethering The tethering handle
822 * @param[in] callback The callback function to invoke
823 * @param[in] user_data The user data to be passed to the callback function
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
829 int tethering_wifi_reload_settings(tethering_h tethering, tethering_wifi_settings_reloaded_cb callback, void *user_data);
832 * @brief Gets the mac_filter for Wi-Fi Tethering.
833 * @details If you set the mac_filter to enable, then the device can be allowed/blocked based on mac-address.
834 * By default mac_filter is set to false.
836 * @privlevel platform
837 * @privilege %http://tizen.org/privilege/tethering.admin
838 * @param[in] tethering The handle of tethering
839 * @param[out] mac_filter The mac filter: (@c true = enable, @c false = disable)
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_NOT_SUPPORTED API is not supported
844 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
845 * @see tethering_mobileap_set_mac_filter()
847 int tethering_wifi_get_mac_filter(tethering_h tethering, bool *mac_filter);
850 * @brief Sets the mac-filter for Wi-Fi Tethering.
851 * @details If you set the mac_filter to enable, then the device can be allowed/blocked based on mac-address.
852 * By default mac_filter is set to @c false.
854 * @privlevel platform
855 * @privilege %http://tizen.org/privilege/tethering.admin
856 * @remarks This change is applied next time Wi-Fi tethering is enabled.
857 * @param[in] tethering The tethering handle
858 * @param[in] mac_filter The mac filter: (@c true = enable, @c false = disable)
859 * @return 0 on success, otherwise negative error value
860 * @retval #TETHERING_ERROR_NONE Successful
861 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
862 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
863 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
864 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
865 * @see tethering_mobileap_get_mac_filter()
867 int tethering_wifi_set_mac_filter(tethering_h tethering, bool mac_filter);
870 * @brief Adds the mac-address to the allowed client list.
871 * @details AP can allow the client by adding clients mac-address to the allowed list.
873 * @privlevel platform
874 * @privilege %http://tizen.org/privilege/tethering.admin
875 * @param[in] tethering The handle of tethering
876 * @param[in] mac The mac address
877 * @return 0 on success, otherwise negative error value.
878 * @retval #TETHERING_ERROR_NONE Successful
879 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
880 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
881 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
882 * @see tethering_mobileap_set_mac_filter()
884 int tethering_wifi_add_allowed_mac_list(tethering_h tethering, const char *mac);
887 * @brief Removes the mac-address from the allowed client list.
888 * @details Removes the mac-address from the allowed client list.
890 * @privlevel platform
891 * @privilege %http://tizen.org/privilege/tethering.admin
892 * @param[in] tethering The handle of tethering
893 * @param[in] mac The mac address
894 * @return 0 on success, otherwise negative error value.
895 * @retval #TETHERING_ERROR_NONE Successful
896 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
897 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
898 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
899 * @see tethering_mobileap_set_mac_filter()
901 int tethering_wifi_remove_allowed_mac_list(tethering_h tethering, const char *mac);
903 * @brief Gets the mac-addresses from the allowed client list.
904 * @details Gets the mac-addresses from the allowed client list.
906 * @privlevel platform
907 * @privilege %http://tizen.org/privilege/tethering.admin
908 * @param[in] tethering The handle of tethering
909 * @param[out] allowed_mac_list list of allowed mac addresses list
910 * @return 0 on success, otherwise negative error value.
911 * @retval #TETHERING_ERROR_NONE Successful
912 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
913 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
914 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
915 * @see tethering_mobileap_set_mac_filter()
917 int tethering_wifi_get_allowed_mac_list(tethering_h tethering, void **allowed_mac_list);
920 * @brief Adds the mac-address to the blocked client list.
921 * @details AP can disallow the client by adding clients mac-address to the blocked list.
923 * @privlevel platform
924 * @privilege %http://tizen.org/privilege/tethering.admin
925 * @param[in] tethering The handle of tethering
926 * @param[in] mac The mac address
927 * @return 0 on success, otherwise negative error value.
928 * @retval #TETHERING_ERROR_NONE Successful
929 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
930 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
931 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
932 * @see tethering_mobileap_set_mac_filter()
934 int tethering_wifi_add_blocked_mac_list(tethering_h tethering, const char *mac);
937 * @brief Removes the mac-address from the blocked client list.
938 * @details Removes the mac-address from the blocked client list.
940 * @privlevel platform
941 * @privilege %http://tizen.org/privilege/tethering.admin
942 * @param[in] tethering The handle of tethering
943 * @param[in] mac The mac address
944 * @return 0 on success, otherwise negative error value.
945 * @retval #TETHERING_ERROR_NONE Successful
946 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
947 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
948 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
949 * @see tethering_mobileap_set_mac_filter()
951 int tethering_wifi_remove_blocked_mac_list(tethering_h tethering, const char *mac);
954 * @brief Gets the mac-addresses from the blocked client list.
955 * @details Get the mac-addresses from the blocked client list.
957 * @privlevel platform
958 * @privilege %http://tizen.org/privilege/tethering.admin
959 * @param[in] tethering The handle of tethering
960 * @param[out] blocked_mac_list list of blocked mac addresses list
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_get_blocked_mac_list(tethering_h tethering, void **blocked_mac_list);
971 * @brief Enables/disables the dhcp server.
973 * @privlevel platform
974 * @privilege %http://tizen.org/privilege/tethering.admin
975 * @details Enable/disable the dhcp server.
976 * @param[in] tethering The handle of tethering
977 * @param[in] enable Enable/disable the dhcp server
978 * @return 0 on success, otherwise negative error value.
979 * @retval #TETHERING_ERROR_NONE Successful
980 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
982 int tethering_wifi_enable_dhcp(tethering_h tethering, bool enable);
985 * @brief Enables the dhcp server with the address range.
987 * @privlevel platform
988 * @privilege %http://tizen.org/privilege/tethering.admin
989 * @details Enable the dhcp server with the address range.
990 * @param[in] tethering The handle of tethering
991 * @param[in] rangestart Start address range
992 * @param[in] rangestop End address range
993 * @return 0 on success, otherwise negative error value.
994 * @retval #TETHERING_ERROR_NONE Successful
995 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
997 int tethering_wifi_set_dhcp_range(tethering_h tethering, char *rangestart, char *rangestop);
1000 * @brief Checks whether the dhcp is enabled or not.
1002 * @privlevel platform
1003 * @privilege %http://tizen.org/privilege/tethering.admin
1004 * @param[in] tethering The tethering handle
1005 * @param[out] dhcp_enabled @c true if dhcp is enabled, \n @c false if dhcp is disabled
1006 * @return 0 on success, otherwise a negative error value
1007 * @retval #TETHERING_ERROR_NONE Successful
1008 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1010 int tethering_wifi_is_dhcp_enabled(tethering_h tethering, bool *dhcp_enabled);
1013 * @brief Sets the Channel for Wi-Fi.
1014 * @details The Channel should be in between 1-14. If channel is not set, Wi-Fi sets default channel.
1016 * @privlevel platform
1017 * @privilege %http://tizen.org/privilege/tethering.admin
1018 * @param[in] tethering The tethering handle
1019 * @param[in] channel The channel number
1020 * @return 0 on success, otherwise negative error value
1021 * @retval #TETHERING_ERROR_NONE Successful
1022 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1024 int tethering_wifi_set_channel(tethering_h tethering, int channel);
1027 * @brief Gets the channel for Wi-Fi.
1028 * @details If channel is not set, Wi-Fi gets default channel.
1030 * @privlevel platform
1031 * @privilege %http://tizen.org/privilege/tethering.admin
1032 * @param[in] tethering The tethering handle
1033 * @param[out] channel The channel number
1034 * @return 0 on success, otherwise negative error value
1035 * @retval #TETHERING_ERROR_NONE Successful
1036 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1037 * @see tethering_wifi_set_channel()
1039 int tethering_wifi_get_channel(tethering_h tethering, int *channel);
1042 * @brief Sets the mode for Wi-Fi.
1043 * @details The mobile AP mode (ex: b only, g only, ad, a). If mode is not set, Wi-Fi sets default mode.
1045 * @privlevel platform
1046 * @privilege %http://tizen.org/privilege/tethering.admin
1047 * @param[in] tethering The tethering handle
1048 * @param[in] type The mobile AP mode
1049 * @return 0 on success, otherwise negative error value
1050 * @retval #TETHERING_ERROR_NONE Successful
1051 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1053 int tethering_wifi_set_mode(tethering_h tethering, tethering_wifi_mode_type_e type);
1056 * @brief Gets the mode for Wi-Fi.
1057 * @details If the mode is not set, Wi-Fi gets default mode.
1059 * @privlevel platform
1060 * @privilege %http://tizen.org/privilege/tethering.admin
1061 * @remarks @a mode must be released using free().
1062 * @param[in] tethering The tethering handle
1063 * @param[out] type The mode of Wi-Fi tethering
1064 * @return 0 on success, otherwise negative error value
1065 * @retval #TETHERING_ERROR_NONE Successful
1066 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1067 * @see tethering_wifi_set_mode()
1069 int tethering_wifi_get_mode(tethering_h tethering, tethering_wifi_mode_type_e *type);
1072 * @brief Sets txpower for Wi-Fi tethering.
1074 * @privlevel platform
1075 * @privilege http://tizen.org/privilege/tethering.admin
1076 * @param[in] tethering The tethering handle
1077 * @param[in] txpower value of txpower to be set
1078 * @return 0 on success, otherwise a negative error value
1079 * @retval #TETHERING_ERROR_NONE Successful
1080 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1081 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1082 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1083 * @see tethering_wifi_get_txpower()
1085 int tethering_wifi_set_txpower(tethering_h tethering, unsigned int txpower);
1088 * @brief Gets txpower for Wi-Fi tethering.
1090 * @privlevel platform
1091 * @privilege http://tizen.org/privilege/tethering.admin
1092 * @param[in] tethering The tethering handle
1093 * @param[out] txpower value of txpower
1094 * @return 0 on success, otherwise a negative error value
1095 * @retval #TETHERING_ERROR_NONE Successful
1096 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1097 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1098 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1099 * @see tethering_wifi_set_txpower()
1101 int tethering_wifi_get_txpower(tethering_h tethering, unsigned int *txpower);
1104 * @brief Sets mtu for Wi-Fi tethering.
1106 * @privlevel platform
1107 * @privilege %http://tizen.org/privilege/tethering.admin
1108 * @param[in] tethering The tethering handle
1109 * @param[in] mtu value of mtu to be set
1110 * @return 0 on success, otherwise a negative error value
1111 * @retval #TETHERING_ERROR_NONE Successful
1112 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1113 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1114 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1116 int tethering_wifi_set_mtu(tethering_h tethering, unsigned int mtu);
1119 * @brief Changes mac address for Wi-Fi tethering.
1121 * @privlevel platform
1122 * @privilege %http://tizen.org/privilege/tethering.admin
1123 * @param[in] tethering The client handle
1124 * @param[in] mac The mac address
1125 * @return 0 on success, otherwise a negative error value
1126 * @retval #TETHERING_ERROR_NONE Successful
1127 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1128 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1129 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1131 int tethering_wifi_change_mac(tethering_h tethering, char *mac);
1134 * @brief Sets max connected devices for Wi-Fi tethering.
1136 * @privlevel platform
1137 * @privilege %http://tizen.org/privilege/tethering.admin
1138 * @param[in] tethering The client handle
1139 * @param[in] max_device value of max_device to be set
1140 * @return 0 on success, otherwise a negative error value
1141 * @retval #TETHERING_ERROR_NONE Successful
1142 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1143 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1144 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1145 * @see tethering_wifi_get_max_connected_device()
1147 int tethering_wifi_set_max_connected_device(tethering_h tethering, int max_device);
1150 * @brief Gets max connected devices for Wi-Fi tethering.
1152 * @privlevel platform
1153 * @privilege %http://tizen.org/privilege/tethering.admin
1154 * @param[in] tethering The client handle
1155 * @param[out] max_device value of max_device
1156 * @return 0 on success, otherwise a negative error value
1157 * @retval #TETHERING_ERROR_NONE Successful
1158 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1159 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1160 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1161 * @see tethering_wifi_set_max_connected_device()
1163 int tethering_wifi_get_max_connected_device(tethering_h tethering, int *max_device);
1166 * @brief Enables port forwarding feature.
1168 * @privlevel platform
1169 * @privilege %http://tizen.org/privilege/tethering.admin
1170 * @details enable/disable port forwarding feature.
1171 * @param[in] tethering The handle of tethering
1172 * @param[in] enable Enable/Disable port forwarding
1173 * @return 0 on success, otherwise negative error value.
1174 * @retval #TETHERING_ERROR_NONE Successful
1175 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1176 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1177 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1179 int tethering_wifi_enable_port_forwarding(tethering_h tethering, bool enable);
1182 * @brief Sets port forwarding rule.
1184 * @privlevel platform
1185 * @privilege %http://tizen.org/privilege/tethering.admin
1186 * @details Set port forwarding rule.
1187 * @param[in] tethering The handle of tethering
1188 * @param[in] ifname interface name
1189 * @param[in] protocol protocol (tcp/udp)
1190 * @param[in] org_ip original destination ip where packet was meant to sent
1191 * @param[in] org_port original destination port where packet was meant to sent
1192 * @param[in] final_ip new destination ip where packet will be forwarded
1193 * @param[in] final_port new destination port where packet will be forwarded
1194 * @return 0 on success, otherwise negative error value.
1195 * @retval #TETHERING_ERROR_NONE Successful
1196 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1197 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1198 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1200 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);
1203 * @brief Resets port forwarding rule.
1205 * @privlevel platform
1206 * @privilege %http://tizen.org/privilege/tethering.admin
1207 * @details Reset port forwarding rule.
1208 * @param[in] tethering The handle of tethering
1209 * @return 0 on success, otherwise negative error value.
1210 * @retval #TETHERING_ERROR_NONE Successful
1211 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1212 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1213 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1215 int tethering_wifi_reset_port_forwarding_rule(tethering_h tethering);
1218 * @brief Checks whether the port forwarding is enabled or not.
1220 * @privlevel platform
1221 * @privilege %http://tizen.org/privilege/tethering.admin
1222 * @param[in] tethering The tethering handle
1223 * @param[out] forwarding_enabled @c true if port forwarding is enabled, \n @c false if port forwarding is disabled
1224 * @return 0 on success, otherwise a negative error value
1225 * @retval #TETHERING_ERROR_NONE Successful
1226 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1227 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1228 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1230 int tethering_wifi_is_port_forwarding_enabled(tethering_h tethering, bool* forwarding_enabled);
1233 * @brief Gets the port forwarding rule for Wi-Fi tethering.
1235 * @privlevel platform
1236 * @privilege %http://tizen.org/privilege/tethering.admin
1237 * @param[in] tethering The client handle
1238 * @param[out] port_forwarding_list list of port forwarding rules
1239 * @return 0 on success, otherwise a negative error value
1240 * @retval #TETHERING_ERROR_NONE Successful
1241 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1242 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1243 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1245 int tethering_wifi_get_port_forwarding_rule(tethering_h tethering, void **port_forwarding_list);
1248 * @brief Enables port filtering feature.
1250 * @privlevel platform
1251 * @privilege %http://tizen.org/privilege/tethering.admin
1252 * @details enable/disable port filtering feature.
1253 * @param[in] tethering The handle of tethering
1254 * @param[in] enable Enable/Disable port filtering
1255 * @return 0 on success, otherwise negative error value.
1256 * @retval #TETHERING_ERROR_NONE Successful
1257 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1258 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1259 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1261 int tethering_wifi_enable_port_filtering(tethering_h tethering, bool enable);
1264 * @brief Sets port filtering rule.
1266 * @privlevel platform
1267 * @privilege %http://tizen.org/privilege/tethering.admin
1268 * @details Set port filtering rule.
1269 * @param[in] tethering The handle of tethering
1270 * @param[in] port to be filtered
1271 * @param[in] protocol protocol (tcp/udp)
1272 * @param[in] allow allow/disallow port filtering
1273 * @return 0 on success, otherwise 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_add_port_filtering_rule(tethering_h tethering, int port, char *protocol, bool allow);
1282 * @brief Sets custom port filtering rule.
1284 * @privlevel platform
1285 * @privilege %http://tizen.org/privilege/tethering.admin
1286 * @details Set custom port filtering rule.
1287 * @param[in] tethering The handle of tethering
1288 * @param[in] port1 to be filtered
1289 * @param[in] port2 to be filtered
1290 * @param[in] protocol protocol (tcp/udp)
1291 * @param[in] allow allow/disallow port filtering
1292 * @return 0 on success, otherwise negative error value.
1293 * @retval #TETHERING_ERROR_NONE Successful
1294 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1295 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1296 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1298 int tethering_wifi_add_custom_port_filtering_rule(tethering_h tethering, int port1, int port2, char *protocol, bool allow);
1301 * @brief Gets the port filtering rule for Wi-Fi tethering.
1303 * @privlevel platform
1304 * @privilege %http://tizen.org/privilege/tethering.admin
1305 * @param[in] tethering The client handle
1306 * @param[out] port_filtering_list list of port filtering rules
1307 * @return 0 on success, otherwise a 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_get_port_filtering_rule(tethering_h tethering, void **port_filtering_list);
1316 * @brief Gets the custom port filtering rule for Wi-Fi tethering.
1318 * @privlevel platform
1319 * @privilege %http://tizen.org/privilege/tethering.admin
1320 * @param[in] tethering The client handle
1321 * @param[out] custom_port_filtering_list list of custom port filtering rules
1322 * @return 0 on success, otherwise a negative error value
1323 * @retval #TETHERING_ERROR_NONE Successful
1324 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1325 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1326 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1328 int tethering_wifi_get_custom_port_filtering_rule(tethering_h tethering, void **custom_port_filtering_list);
1331 * @brief Checks whether the port filtering is enabled or not.
1333 * @privlevel platform
1334 * @privilege %http://tizen.org/privilege/tethering.admin
1335 * @param[in] tethering The tethering handle
1336 * @param[out] filtering_enabled @c true if port filtering is enabled, \n @c false if port filtering is disabled
1337 * @return 0 on success, otherwise a negative error value
1338 * @retval #TETHERING_ERROR_NONE Successful
1339 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1340 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1341 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1343 int tethering_wifi_is_port_filtering_enabled(tethering_h tethering, bool* filtering_enabled);
1346 * @brief Sets vpn passthrough rule.
1348 * @privlevel platform
1349 * @privilege %http://tizen.org/privilege/tethering.admin
1350 * @details Set vpn passthrough rule.
1351 * @param[in] tethering The handle of tethering
1352 * @param[in] type vpn passthrough type
1353 * @param[in] enable @c true if vpn passthrough is enabled, \n @c false if vpn passthrough is disabled
1354 * @return 0 on success, otherwise negative error value.
1355 * @retval #TETHERING_ERROR_NONE Successful
1356 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1357 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1358 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1360 int tethering_wifi_set_vpn_passthrough_rule(tethering_h tethering, tethering_vpn_passthrough_type_e type, bool enable);
1363 * @brief Pushes the WPS button to connect with Wi-Fi Tethering client. (WPS PBC)
1365 * @remarks The WPS button should be pushed when client tries to connect with Soft AP by using WPS PBC.
1366 * @param[in] tethering The tethering handle
1367 * @return 0 on success, otherwise negative error value
1368 * @retval #TETHERING_ERROR_NONE Successful
1369 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1370 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
1371 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission denied
1372 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
1374 int tethering_wifi_push_wps_button(tethering_h tethering);
1377 * @brief Sets the WPS PIN to connect with Wi-Fi Tethering client. (WPS PIN)
1379 * @remarks The WPS PIN should be inserted when client tries to connect with Soft AP by using WPS PIN.
1380 * @param[in] tethering The tethering handle
1381 * @param[in] wps_pin The WPS PIN
1382 * @return 0 on success, otherwise negative error value
1383 * @retval #TETHERING_ERROR_NONE Successful
1384 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1385 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
1386 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission denied
1387 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
1389 int tethering_wifi_set_wps_pin(tethering_h tethering, const char *wps_pin);
1392 * @brief Checks whether wifi-sharing is supported or not.
1394 * @privlevel platform
1395 * @privilege %http://tizen.org/privilege/tethering.admin
1396 * @param[in] tethering The tethering handle
1397 * @param[out] supported @c true if wifi-sharing is supported, \n @c false if wifi-sharing is unsupported
1398 * @return 0 on success, otherwise a negative error value
1399 * @retval #TETHERING_ERROR_NONE Successful
1400 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1401 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission denied
1402 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
1404 int tethering_wifi_is_sharing_supported(tethering_h tethering, bool *supported);
1413 * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
1418 * @brief Clones the handle of a client.
1420 * @privlevel platform
1421 * @privilege %http://tizen.org/privilege/tethering.admin
1422 * @remarks @a dest must be release using tethering_client_destroy().
1423 * @param[out] dest The cloned client handle
1424 * @param[in] origin The origin client handle
1425 * @return 0 on success, otherwise a negative error value
1426 * @retval #TETHERING_ERROR_NONE Successful
1427 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1428 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1429 * @see tethering_client_destroy()
1431 int tethering_client_clone(tethering_client_h *dest, tethering_client_h origin);
1434 * @brief Destroys the handle of a client.
1436 * @privlevel platform
1437 * @privilege %http://tizen.org/privilege/tethering.admin
1438 * @param[in] client The client handle
1439 * @return 0 on success, otherwise a negative error value
1440 * @retval #TETHERING_ERROR_NONE Successful
1441 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1442 * @see tethering_client_clone()
1444 int tethering_client_destroy(tethering_client_h client);
1447 * @brief Gets the tethering type of client.
1449 * @privlevel platform
1450 * @privilege %http://tizen.org/privilege/tethering.admin
1451 * @param[in] client The handle of client
1452 * @param[out] type The type of tethering
1453 * @return 0 on success, otherwise a negative error value.
1454 * @retval #TETHERING_ERROR_NONE Successful
1455 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1456 * @see tethering_usb_get_connected_client()
1457 * @see tethering_connection_state_changed_cb()
1459 int tethering_client_get_tethering_type(tethering_client_h client, tethering_type_e *type);
1462 * @brief Gets the name of a client.
1464 * @privlevel platform
1465 * @privilege %http://tizen.org/privilege/tethering.admin
1466 * @remarks @a name must be released using free().
1467 * @param[in] client The client handle
1468 * @param[out] name The name of the client
1469 * @return 0 on success, otherwise a negative error value
1470 * @retval #TETHERING_ERROR_NONE Successful
1471 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1472 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1473 * @see tethering_usb_get_connected_client()
1474 * @see tethering_connection_state_changed_cb()
1476 int tethering_client_get_name(tethering_client_h client, char **name);
1479 * @brief Gets the IP address of a client.
1481 * @privlevel platform
1482 * @privilege %http://tizen.org/privilege/tethering.admin
1483 * @remarks @a ip_address must be released using free().
1484 * @param[in] client The client handle
1485 * @param[in] address_family The address family of IP address. Currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported
1486 * @param[out] ip_address The IP address
1487 * @return 0 on success, otherwise a negative error value
1488 * @retval #TETHERING_ERROR_NONE Successful
1489 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1490 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1491 * @see tethering_usb_get_connected_client()
1492 * @see tethering_connection_state_changed_cb()
1494 int tethering_client_get_ip_address(tethering_client_h client, tethering_address_family_e address_family, char **ip_address);
1497 * @brief Gets the MAC address of a client such as "FC:A1:3E:D6:B1:B1".
1499 * @privlevel platform
1500 * @privilege %http://tizen.org/privilege/tethering.admin
1501 * @remarks @a mac_address must be released using free().
1502 * @param[in] client The client handle
1503 * @param[out] mac_address The MAC address
1504 * @return 0 on success, otherwise a negative error value
1505 * @retval #TETHERING_ERROR_NONE Successful
1506 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1507 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1508 * @see tethering_usb_get_connected_client()
1509 * @see tethering_connection_state_changed_cb()
1511 int tethering_client_get_mac_address(tethering_client_h client, char **mac_address);
1514 * @brief Gets the connection time of a client.
1516 * @privlevel platform
1517 * @privilege %http://tizen.org/privilege/tethering.admin
1518 * @param[in] client The client handle
1519 * @param[out] time The connected time of the client
1520 * @return 0 on success, otherwise a negative error value
1521 * @retval #TETHERING_ERROR_NONE Successful
1522 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1523 * @see tethering_usb_get_connected_client()
1524 * @see tethering_connection_state_changed_cb()
1526 int tethering_client_get_time(tethering_client_h client, time_t *timestamp);
1537 #endif /* __TIZEN_NETWORK_TETHERING_H__ */