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 */
72 * @brief Enumeration for the cause of disabling the tethering.
76 TETHERING_DISABLED_BY_USB_DISCONNECTION = 0, /**< Disabled due to usb disconnection */
77 TETHERING_DISABLED_BY_FLIGHT_MODE, /**< Disabled due to flight mode */
78 TETHERING_DISABLED_BY_LOW_BATTERY, /**< Disabled due to low battery */
79 TETHERING_DISABLED_BY_NETWORK_CLOSE, /**< Disabled due to pdp network close */
80 TETHERING_DISABLED_BY_TIMEOUT, /**< Disabled due to timeout */
81 TETHERING_DISABLED_BY_OTHERS, /**< Disabled by other apps */
82 TETHERING_DISABLED_BY_REQUEST, /**< Disabled by your request */
83 TETHERING_DISABLED_BY_WIFI_ON, /**< Disabled due to Wi-Fi on */
84 TETHERING_DISABLED_BY_BT_OFF, /**< Disabled due to Bluetooth off */
85 } tethering_disabled_cause_e;
93 * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
98 * @brief Enumeration for the Wi-Fi security.
102 TETHERING_WIFI_SECURITY_TYPE_NONE = 0, /**< No Security type */
103 TETHERING_WIFI_SECURITY_TYPE_WPA2_PSK, /**< WPA2_PSK */
104 TETHERING_WIFI_SECURITY_TYPE_WPS, /**< WPA2_PSK */
105 } tethering_wifi_security_type_e;
108 * @brief Enumeration for the Wi-Fi mode
112 TETHERING_WIFI_MODE_TYPE_B = 0, /**< mode b */
113 TETHERING_WIFI_MODE_TYPE_G, /**< mode g */
114 TETHERING_WIFI_MODE_TYPE_A, /**< mode a */
115 TETHERING_WIFI_MODE_TYPE_AD, /**< mode ad */
116 } tethering_wifi_mode_type_e;
119 TETHERING_TYPE_IPSEC_PASSTHROUGH = 0, /**< IPSEC */
120 TETHERING_TYPE_PPTP_PASSTHROUGH, /**< PPTP type */
121 TETHERING_TYPE_L2TP_PASSTHROUGH, /**< L2TP type */
122 } tethering_vpn_passthrough_type_e;
130 * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
135 * @brief The tethering client handle.
138 typedef void * tethering_client_h;
141 * @brief Enumeration for address family.
145 TETHERING_ADDRESS_FAMILY_IPV4 = 0, /**< IPV4 Address type */
146 TETHERING_ADDRESS_FAMILY_IPV6 = 1, /**< IPV6 Address type (Since 4.0) */
147 } tethering_address_family_e;
155 * @addtogroup CAPI_NETWORK_TETHERING_MANAGER_MODULE
160 * @brief Called when the tethering is enabled.
162 * @param[in] result The result of enabling the tethering
163 * @param[in] type The tethering type
164 * @param[in] is_requested Indicates whether this change is requested
165 * @param[in] user_data The user data passed from tethering_set_enabled_cb()
166 * @pre If you register callback function using tethering_set_enabled_cb(), this will be invoked when the tethering is enabled.
167 * @see tethering_enable()
168 * @see tethering_unset_enabled_cb()
170 typedef void (*tethering_enabled_cb)(tethering_error_e result, tethering_type_e type, bool is_requested, void *user_data);
173 * @brief Called when the tethering is disabled.
175 * @param[in] result The result of disabling the tethering
176 * @param[in] type The tethering type
177 * @param[in] cause The cause of disabling
178 * @param[in] user_data The user data passed from tethering_set_disabled_cb()
179 * @pre If you register callback function using tethering_set_disabled_cb(), this will be invoked when the tethering is disabled.
180 * @see tethering_set_disabled_cb()
181 * @see tethering_unset_disabled_cb()
183 typedef void (*tethering_disabled_cb)(tethering_error_e result, tethering_type_e type, tethering_disabled_cause_e cause, void *user_data);
186 * @brief Called when the connection state is changed.
188 * @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().
189 * @param[in] client The client of which connection state is changed
190 * @param[in] opened @c true when connection is opened, otherwise false
191 * @param[in] user_data The user data passed from tethering_set_connection_state_changed_cb()
192 * @pre If you register callback function using tethering_set_connection_state_changed_cb(), this will be invoked when the connection state is changed.
193 * @see tethering_set_connection_state_changed_cb()
194 * @see tethering_unset_connection_state_changed_cb()
196 typedef void (*tethering_connection_state_changed_cb)(tethering_client_h client, bool opened, void *user_data);
199 * @brief Called when you get the connected client repeatedly.
201 * @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().
202 * @param[in] client The connected client
203 * @param[in] user_data The user data passed from the request function
204 * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
205 * @pre tethering_foreach_connected_clients() will invoke this callback.
206 * @see tethering_foreach_connected_clients()
208 typedef bool(*tethering_connected_client_cb)(tethering_client_h client, void *user_data);
211 * @brief Called when you get the data usage.
213 * @param[in] result The result of getting the data usage
214 * @param[in] received_data The usage of received data
215 * @param[in] sent_data The usage of sent data
216 * @param[in] user_data The user data passed from the request function
217 * @pre tethering_get_data_usage() will invoked this callback.
219 typedef void (*tethering_data_usage_cb)(tethering_error_e result, unsigned long long received_data, unsigned long long sent_data, void *user_data);
222 * @brief Called when the security type of Wi-Fi tethering is changed.
224 * @param[in] changed_type The changed security type of Wi-Fi tethering
225 * @param[in] user_data The user data passed from the register function
226 * @see tethering_wifi_set_security_type_changed_cb()
227 * @see tethering_wifi_unset_security_type_changed_cb()
229 typedef void (*tethering_wifi_security_type_changed_cb)(tethering_wifi_security_type_e changed_type, void *user_data);
232 * @brief Called when the visibility of SSID is changed.
234 * @param[in] changed_visible The changed visibility of SSID
235 * @param[in] user_data The user data passed from the register function
236 * @see tethering_wifi_set_ssid_visibility_changed_cb()
237 * @see tethering_wifi_unset_ssid_visibility_changed_cb()
239 typedef void (*tethering_wifi_ssid_visibility_changed_cb)(bool changed_visible, void *user_data);
242 * @brief Called when the passphrase of Wi-Fi tethering is changed.
244 * @param[in] user_data The user data passed from the register function
245 * @see tethering_wifi_set_passphrase_changed_cb()
246 * @see tethering_wifi_unset_passphrase_changed_cb()
248 typedef void (*tethering_wifi_passphrase_changed_cb)(void *user_data);
251 * @brief Called when the settings are reloaded.
253 * @param[in] result The result of reloading the settings
254 * @param[in] user_data The user data passed from the request function
255 * @pre tethering_wifi_reload_settings() will invoke this callback.
257 typedef void (*tethering_wifi_settings_reloaded_cb)(tethering_error_e result, void *user_data);
260 * @brief Creates the handle for tethering.
262 * @privlevel platform
263 * @privilege %http://tizen.org/privilege/tethering.admin
264 * @remarks The @a tethering must be released using tethering_destroy().
265 * @param[out] tethering A handle of a new mobile ap handle on success
266 * @return 0 on success, otherwise a negative error value
267 * @retval #TETHERING_ERROR_NONE Successful
268 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
269 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
270 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API is not supported
271 * @see tethering_destroy()
273 int tethering_create(tethering_h *tethering);
276 * @brief Destroys the handle for tethering.
278 * @privlevel platform
279 * @privilege %http://tizen.org/privilege/tethering.admin
280 * @param[in] tethering The tethering handle
281 * @return 0 on success, otherwise a negative error value
282 * @retval #TETHERING_ERROR_NONE Successful
283 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
284 * @see tethering_create()
286 int tethering_destroy(tethering_h tethering);
289 * @brief Enables the tethering, asynchronously.
291 * @privlevel platform
292 * @privilege %http://tizen.org/privilege/tethering.admin
293 * @param[in] tethering The tethering handle
294 * @param[in] type The tethering type
295 * @return 0 on success, otherwise negative error value
296 * @retval #TETHERING_ERROR_NONE Successful
297 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
298 * @post tethering_enabled_cb() will be invoked.
299 * @see tethering_is_enabled()
300 * @see tethering_disable()
302 int tethering_enable(tethering_h tethering, tethering_type_e type);
305 * @brief Disables the tethering, asynchronously.
307 * @privlevel platform
308 * @privilege %http://tizen.org/privilege/tethering.admin
309 * @param[in] tethering The tethering handle
310 * @param[in] type The tethering type
311 * @return 0 on success, otherwise negative error value
312 * @retval #TETHERING_ERROR_NONE Successful
313 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
314 * @post tethering_disabled_cb() will be invoked.
315 * @see tethering_is_enabled()
316 * @see tethering_enable()
318 int tethering_disable(tethering_h tethering, tethering_type_e type);
321 * @brief Enables the IPv6 tethering, asynchronously.
323 * @privlevel platform
324 * @privilege %http://tizen.org/privilege/tethering.admin
325 * @remarks It supports Wi-Fi tethering and BT tethering only.
326 * @param[in] tethering The tethering handle
327 * @param[in] type The tethering type
328 * @return 0 on success, otherwise negative error value
329 * @retval #TETHERING_ERROR_NONE Successful
330 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
331 * @post tethering_enabled_cb() will be invoked.
332 * @see tethering_is_enabled()
333 * @see tethering_ipv6_disable()
335 int tethering_ipv6_enable(tethering_h tethering, tethering_type_e type);
338 * @brief Disables the IPv6 tethering, asynchronously.
340 * @privlevel platform
341 * @privilege %http://tizen.org/privilege/tethering.admin
342 * @remarks It supports Wi-Fi tethering and BT tethering only.
343 * @param[in] tethering The tethering handle
344 * @param[in] type The tethering type
345 * @return 0 on success, otherwise negative error value
346 * @retval #TETHERING_ERROR_NONE Successful
347 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
348 * @post tethering_disabled_cb() will be invoked.
349 * @see tethering_is_enabled()
350 * @see tethering_ipv6_enable()
352 int tethering_ipv6_disable(tethering_h tethering, tethering_type_e type);
355 * @brief Checks whether the tethering is enabled or not.
357 * @privlevel platform
358 * @privilege %http://tizen.org/privilege/tethering.admin
359 * @param[in] tethering The tethering handle
360 * @param[in] type The tethering type
361 * @return @c true if tethering is enabled, \n @c false if tethering is disabled
363 bool tethering_is_enabled(tethering_h tethering, tethering_type_e type);
366 * @brief Gets the MAC address of local device as "FC:A1:3E:D6:B1:B1".
368 * @privlevel platform
369 * @privilege %http://tizen.org/privilege/tethering.admin
370 * @remarks @a mac_address must be released using free().
371 * @param[in] tethering The tethering handle
372 * @param[in] type The tethering type
373 * @param[out] mac_address The MAC address
374 * @return 0 on success, otherwise a negative error value
375 * @retval #TETHERING_ERROR_NONE Successful
376 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
377 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
378 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
379 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
380 * @pre The tethering must be enabled.
381 * @see tethering_is_enabled()
382 * @see tethering_enable()
384 int tethering_get_mac_address(tethering_h tethering, tethering_type_e type, char **mac_address);
387 * @brief Gets the name of network interface (e.g. usb0).
389 * @privlevel platform
390 * @privilege %http://tizen.org/privilege/tethering.admin
391 * @remarks @a interface_name must be released using free().
392 * @param[in] tethering The tethering handle
393 * @param[in] type The tethering type
394 * @param[out] interface_name The name of the network interface
395 * @return 0 on success, otherwise negative error value
396 * @retval #TETHERING_ERROR_NONE Successful
397 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
398 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
399 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
400 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
401 * @pre The tethering must be enabled.
402 * @see tethering_is_enabled()
403 * @see tethering_enable()
405 int tethering_get_network_interface_name(tethering_h tethering, tethering_type_e type, char **interface_name);
408 * @brief Gets the local IP address.
410 * @privlevel platform
411 * @privilege %http://tizen.org/privilege/tethering.admin
412 * @remarks @a ip_address must be released using free().
413 * @param[in] tethering The tethering handle
414 * @param[in] type The tethering type
415 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
416 * @param[out] ip_address The local IP address
417 * @return 0 on success, otherwise negative error value
418 * @retval #TETHERING_ERROR_NONE Successful
419 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
420 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
421 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
422 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
423 * @pre The tethering must be enabled.
424 * @see tethering_is_enabled()
425 * @see tethering_enable()
427 int tethering_get_ip_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **ip_address);
430 * @brief Gets the Gateway address.
432 * @privlevel platform
433 * @privilege %http://tizen.org/privilege/tethering.admin
434 * @remarks @a gateway_address must be released using free().
435 * @param[in] tethering The tethering handle
436 * @param[in] type The tethering type
437 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
438 * @param[out] gateway_address The local IP address
439 * @return 0 on success, otherwise negative error value
440 * @retval #TETHERING_ERROR_NONE Successful
441 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
442 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
443 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
444 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
445 * @pre The tethering must be enabled.
446 * @see tethering_is_enabled()
447 * @see tethering_enable()
449 int tethering_get_gateway_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **gateway_address);
452 * @brief Gets the Subnet Mask.
454 * @privlevel platform
455 * @privilege %http://tizen.org/privilege/tethering.admin
456 * @remarks @a subnet_mask must be released using free().
457 * @param[in] tethering The tethering handle
458 * @param[in] type The tethering type
459 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
460 * @param[out] subnet_mask The local IP address
461 * @return 0 on success, otherwise negative error value
462 * @retval #TETHERING_ERROR_NONE Successful
463 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
464 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
465 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
466 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
467 * @pre The tethering must be enabled.
468 * @see tethering_is_enabled()
469 * @see tethering_enable()
471 int tethering_get_subnet_mask(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **subnet_mask);
474 * @brief Gets the data usage.
476 * @privlevel platform
477 * @privilege %http://tizen.org/privilege/tethering.admin
478 * @param[in] tethering The tethering handle
479 * @param[out] usage The data usage
480 * @return 0 on success, otherwise negative error value
481 * @retval #TETHERING_ERROR_NONE Successful
482 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
483 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
484 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
485 * @pre The tethering must be enabled.
486 * @see tethering_is_enabled()
487 * @see tethering_enable()
489 int tethering_get_data_usage(tethering_h tethering, tethering_data_usage_cb callback, void *user_data);
492 * @brief Gets the clients which are connected.
494 * @privlevel platform
495 * @privilege %http://tizen.org/privilege/tethering.admin
496 * @param[in] tethering The tethering handle
497 * @param[in] type The tethering type
498 * @param[in] callback The callback function to invoke
499 * @param[in] user_data The user data to be passed to the callback function
500 * @retval #TETHERING_ERROR_NONE Successful
501 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
502 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
503 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
504 * @pre The tethering must be enabled.
505 * @see tethering_is_enabled()
506 * @see tethering_enable()
508 int tethering_foreach_connected_clients(tethering_h tethering, tethering_type_e type, tethering_connected_client_cb callback, void *user_data);
511 * @brief Registers the callback function, which is called when tethering is enabled.
513 * @privlevel platform
514 * @privilege %http://tizen.org/privilege/tethering.admin
515 * @param[in] tethering The tethering handle
516 * @param[in] type The tethering type
517 * @param[in] callback The callback function to invoke
518 * @param[in] user_data The user data to be passed to the callback function
519 * @retval #TETHERING_ERROR_NONE Successful
520 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
521 * @see tethering_unset_enabled_cb()
523 int tethering_set_enabled_cb(tethering_h tethering, tethering_type_e type, tethering_enabled_cb callback, void *user_data);
526 * @brief Unregisters the callback function, which is called when tethering is enabled.
528 * @privlevel platform
529 * @privilege %http://tizen.org/privilege/tethering.admin
530 * @param[in] tethering The tethering handle
531 * @param[in] type The tethering type
532 * @retval #TETHERING_ERROR_NONE Successful
533 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
534 * @see tethering_set_enabled_cb()
536 int tethering_unset_enabled_cb(tethering_h tethering, tethering_type_e type);
539 * @brief Registers the callback function called when tethering is disabled.
541 * @privlevel platform
542 * @privilege %http://tizen.org/privilege/tethering.admin
543 * @param[in] tethering The tethering handle
544 * @param[in] type The tethering type
545 * @param[in] callback The callback function to invoke
546 * @param[in] user_data The user data to be passed to the callback function
547 * @retval #TETHERING_ERROR_NONE Successful
548 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
549 * @see tethering_unset_disabled_cb()
551 int tethering_set_disabled_cb(tethering_h tethering, tethering_type_e type, tethering_disabled_cb callback, void *user_data);
554 * @brief Unregisters the callback function, which is called when tethering is disabled.
556 * @privlevel platform
557 * @privilege %http://tizen.org/privilege/tethering.admin
558 * @param[in] tethering The tethering handle
559 * @param[in] type The tethering type
560 * @retval #TETHERING_ERROR_NONE Successful
561 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
562 * @see tethering_set_disabled_cb()
564 int tethering_unset_disabled_cb(tethering_h tethering, tethering_type_e type);
567 * @brief Registers the callback function, which is called when the state of connection is changed.
569 * @privlevel platform
570 * @privilege %http://tizen.org/privilege/tethering.admin
571 * @param[in] tethering The tethering handle
572 * @param[in] type The tethering type
573 * @param[in] callback The callback function to invoke
574 * @param[in] user_data The user data to be passed to the callback function
575 * @retval #TETHERING_ERROR_NONE Successful
576 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
577 * @see tethering_unset_connection_state_changed_cb_cb()
579 int tethering_set_connection_state_changed_cb(tethering_h tethering, tethering_type_e type, tethering_connection_state_changed_cb callback, void *user_data);
582 * @brief Unregisters the callback function, which is called when the state of connection is changed.
584 * @privlevel platform
585 * @privilege %http://tizen.org/privilege/tethering.admin
586 * @param[in] tethering The tethering handle
587 * @param[in] type The tethering type
588 * @retval #TETHERING_ERROR_NONE Successful
589 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
590 * @see tethering_set_connection_state_changed_cb()
592 int tethering_unset_connection_state_changed_cb(tethering_h tethering, tethering_type_e type);
595 * @brief Registers the callback function, which is called when the security type of Wi-Fi tethering is changed.
597 * @privlevel platform
598 * @privilege %http://tizen.org/privilege/tethering.admin
599 * @param[in] tethering The tethering handle
600 * @param[in] callback The callback function to invoke
601 * @param[in] user_data The user data to be passed to the callback function
602 * @retval #TETHERING_ERROR_NONE Successful
603 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
604 * @see tethering_wifi_unset_security_type_changed_cb()
606 int tethering_wifi_set_security_type_changed_cb(tethering_h tethering, tethering_wifi_security_type_changed_cb callback, void *user_data);
609 * @brief Unregisters the callback function, which is called when the security type of Wi-Fi tethering is changed.
611 * @privlevel platform
612 * @privilege %http://tizen.org/privilege/tethering.admin
613 * @param[in] tethering The tethering handle
614 * @param[in] type The tethering type
615 * @retval #TETHERING_ERROR_NONE Successful
616 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
617 * @see tethering_wifi_set_security_type_changed_cb()
619 int tethering_wifi_unset_security_type_changed_cb(tethering_h tethering);
622 * @brief Registers the callback function , which iscalled when the visibility of SSID is changed.
624 * @privlevel platform
625 * @privilege %http://tizen.org/privilege/tethering.admin
626 * @param[in] tethering The tethering handle
627 * @param[in] callback The callback function to invoke
628 * @param[in] user_data The user data to be passed to the callback function
629 * @retval #TETHERING_ERROR_NONE Successful
630 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
631 * @see tethering_wifi_unset_ssid_visibility_changed_cb_cb()
633 int tethering_wifi_set_ssid_visibility_changed_cb(tethering_h tethering, tethering_wifi_ssid_visibility_changed_cb callback, void *user_data);
636 * @brief Unregisters the callback function, which is called when the visibility of SSID is changed.
638 * @privlevel platform
639 * @privilege %http://tizen.org/privilege/tethering.admin
640 * @param[in] tethering The tethering handle
641 * @retval #TETHERING_ERROR_NONE Successful
642 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
643 * @see tethering_wifi_set_ssid_visibility_changed_cb()
645 int tethering_wifi_unset_ssid_visibility_changed_cb(tethering_h tethering);
648 * @brief Registers the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
650 * @privlevel platform
651 * @privilege %http://tizen.org/privilege/tethering.admin
652 * @param[in] tethering The tethering handle
653 * @param[in] callback The callback function to invoke
654 * @param[in] user_data The user data to be passed to the callback function
655 * @retval #TETHERING_ERROR_NONE Successful
656 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
657 * @see tethering_wifi_unset_passphrase_changed_cb()
659 int tethering_wifi_set_passphrase_changed_cb(tethering_h tethering, tethering_wifi_passphrase_changed_cb callback, void *user_data);
662 * @brief Unregisters the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
664 * @privlevel platform
665 * @privilege %http://tizen.org/privilege/tethering.admin
666 * @param[in] tethering The tethering handle
667 * @retval #TETHERING_ERROR_NONE Successful
668 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
669 * @see tethering_wifi_set_passphrase_changed_cb()
671 int tethering_wifi_unset_passphrase_changed_cb(tethering_h tethering);
679 * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
684 * @brief Sets the security type of Wi-Fi tethering.
686 * @privlevel platform
687 * @privilege %http://tizen.org/privilege/tethering.admin
688 * @remarks This change is applied next time Wi-Fi tethering is enabled.
689 * @param[in] tethering The tethering handle
690 * @param[in] type The security type
691 * @return 0 on success, otherwise negative error value
692 * @retval #TETHERING_ERROR_NONE Successful
693 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
694 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
695 * @see tethering_wifi_get_security_type()
697 int tethering_wifi_set_security_type(tethering_h tethering, tethering_wifi_security_type_e type);
700 * @brief Gets the security type of Wi-Fi tethering.
702 * @privlevel platform
703 * @privilege %http://tizen.org/privilege/tethering.admin
704 * @param[in] tethering The tethering handle
705 * @param[out] type The security type
706 * @return 0 on success, otherwise negative error value
707 * @retval #TETHERING_ERROR_NONE Successful
708 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
709 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
710 * @see tethering_wifi_set_security_type()
712 int tethering_wifi_get_security_type(tethering_h tethering, tethering_wifi_security_type_e *type);
715 * @brief Sets the SSID (service set identifier).
716 * @details The SSID cannot exceed 32 bytes. If SSID is not set, device name is used as SSID.
718 * @privlevel platform
719 * @privilege %http://tizen.org/privilege/tethering.admin
720 * @remarks This change is applied next time Wi-Fi tethering is enabled with same @a tethering handle.
721 * @param[in] tethering The tethering handle
722 * @param[in] ssid The SSID
723 * @return 0 on success, otherwise negative error value
724 * @retval #TETHERING_ERROR_NONE Successful
725 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
726 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
728 int tethering_wifi_set_ssid(tethering_h tethering, const char *ssid);
731 * @brief Gets the SSID (service set identifier).
733 * @privlevel platform
734 * @privilege %http://tizen.org/privilege/tethering.admin
735 * @remarks @a ssid must be released using free().
736 * @param[in] tethering The tethering handle
737 * @param[out] ssid The SSID
738 * @return 0 on success, otherwise negative error value
739 * @retval #TETHERING_ERROR_NONE Successful
740 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
741 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
742 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
744 int tethering_wifi_get_ssid(tethering_h tethering, char **ssid);
747 * @brief Sets the visibility of SSID (service set identifier).
748 * @details If the visibility is set to invisible, then the SSID of this device is hidden and Wi-Fi scan will not find the device.
750 * @privlevel platform
751 * @privilege %http://tizen.org/privilege/tethering.admin
752 * @remarks This change is applied next time Wi-Fi tethering is enabled.
753 * @param[in] tethering The tethering handle
754 * @param[in] visible The visibility of SSID: (@c true = visible, @c false = invisible)
755 * @return 0 on success, otherwise negative error value
756 * @retval #TETHERING_ERROR_NONE Successful
757 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
758 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
759 * @see tethering_wifi_get_ssid_visibility()
761 int tethering_wifi_set_ssid_visibility(tethering_h tethering, bool visible);
764 * @brief Gets the visibility of SSID (service set identifier).
765 * @details If the visibility is set to invisible, then the SSID of this device is hidden and Wi-Fi scan will not find the device.
767 * @privlevel platform
768 * @privilege %http://tizen.org/privilege/tethering.admin
769 * @param[in] tethering The tethering handle
770 * @param[out] visible The visibility of SSID: (@c true = visible, @c false = invisible)
771 * @return 0 on success, otherwise negative error value
772 * @retval #TETHERING_ERROR_NONE Successful
773 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
774 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
775 * @see tethering_wifi_set_ssid_visibility()
777 int tethering_wifi_get_ssid_visibility(tethering_h tethering, bool *visible);
780 * @brief Sets the passphrase.
782 * @privlevel platform
783 * @privilege %http://tizen.org/privilege/tethering.admin
784 * @remarks This change is applied next time Wi-Fi tethering is enabled.
785 * @param[in] tethering The tethering handle
786 * @param[in] passphrase The passphrase
787 * @return 0 on success, otherwise negative error value
788 * @retval #TETHERING_ERROR_NONE Successful
789 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
790 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
791 * @see tethering_wifi_get_passphrase()
793 int tethering_wifi_set_passphrase(tethering_h tethering, const char *passphrase);
796 * @brief Gets the passphrase.
798 * @privlevel platform
799 * @privilege %http://tizen.org/privilege/tethering.admin
800 * @remarks @a passphrase must be released using free().
801 * @param[in] tethering The tethering handle
802 * @param[out] passphrase The passphrase
803 * @return 0 on success, otherwise negative error value
804 * @retval #TETHERING_ERROR_NONE Successful
805 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
806 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
807 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
808 * @see tethering_wifi_set_passphrase()
810 int tethering_wifi_get_passphrase(tethering_h tethering, char **passphrase);
813 * @brief Reloads the settings (SSID / Passphrase / Security type / SSID visibility).
815 * @privlevel platform
816 * @privilege %http://tizen.org/privilege/tethering.admin
817 * @remarks Connected devices via Wi-Fi tethering or MobileAP will be disconnected when the settings are reloaded.
818 * @param[in] tethering The tethering handle
819 * @param[in] callback The callback function to invoke
820 * @param[in] user_data The user data to be passed to the callback function
821 * @return 0 on success, otherwise negative error value
822 * @retval #TETHERING_ERROR_NONE Successful
823 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
824 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
826 int tethering_wifi_reload_settings(tethering_h tethering, tethering_wifi_settings_reloaded_cb callback, void *user_data);
829 * @brief Gets the mac_filter for Wi-Fi Tethering.
830 * @details If you set the mac_filter to enable, then the device can be allowed/blocked based on mac-address.
831 * By default mac_filter is set to false.
833 * @privlevel platform
834 * @privilege %http://tizen.org/privilege/tethering.admin
835 * @param[in] tethering The handle of tethering
836 * @param[out] mac_filter The mac filter: (@c true = enable, @c false = disable)
837 * @return 0 on success, otherwise negative error value.
838 * @retval #TETHERING_ERROR_NONE Successful
839 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
840 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
841 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
842 * @see tethering_mobileap_set_mac_filter()
844 int tethering_wifi_get_mac_filter(tethering_h tethering, bool *mac_filter);
847 * @brief Sets the mac-filter for Wi-Fi Tethering.
848 * @details If you set the mac_filter to enable, then the device can be allowed/blocked based on mac-address.
849 * By default mac_filter is set to @c false.
851 * @privlevel platform
852 * @privilege %http://tizen.org/privilege/tethering.admin
853 * @remarks This change is applied next time Wi-Fi tethering is enabled.
854 * @param[in] tethering The tethering handle
855 * @param[in] mac_filter The mac filter: (@c true = enable, @c false = disable)
856 * @return 0 on success, otherwise negative error value
857 * @retval #TETHERING_ERROR_NONE Successful
858 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
859 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
860 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
861 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
862 * @see tethering_mobileap_get_mac_filter()
864 int tethering_wifi_set_mac_filter(tethering_h tethering, bool mac_filter);
867 * @brief Adds the mac-address to the allowed client list.
868 * @details AP can allow the client by adding clients mac-address to the allowed list.
870 * @privlevel platform
871 * @privilege %http://tizen.org/privilege/tethering.admin
872 * @param[in] tethering The handle of tethering
873 * @param[in] mac The mac address
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_add_allowed_mac_list(tethering_h tethering, const char *mac);
884 * @brief Removes the mac-address from the allowed client list.
885 * @details Removes the mac-address from the allowed client list.
887 * @privlevel platform
888 * @privilege %http://tizen.org/privilege/tethering.admin
889 * @param[in] tethering The handle of tethering
890 * @param[in] mac The mac address
891 * @return 0 on success, otherwise negative error value.
892 * @retval #TETHERING_ERROR_NONE Successful
893 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
894 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
895 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
896 * @see tethering_mobileap_set_mac_filter()
898 int tethering_wifi_remove_allowed_mac_list(tethering_h tethering, const char *mac);
900 * @brief Gets the mac-addresses from the allowed client list.
901 * @details Gets the mac-addresses from the allowed client list.
903 * @privlevel platform
904 * @privilege %http://tizen.org/privilege/tethering.admin
905 * @param[in] tethering The handle of tethering
906 * @param[out] allowed_mac_list list of allowed mac addresses list
907 * @return 0 on success, otherwise negative error value.
908 * @retval #TETHERING_ERROR_NONE Successful
909 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
910 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
911 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
912 * @see tethering_mobileap_set_mac_filter()
914 int tethering_wifi_get_allowed_mac_list(tethering_h tethering, void **allowed_mac_list);
917 * @brief Adds the mac-address to the blocked(black list) client list.
918 * @details AP can disallow the client by adding clients mac-address to the blocked list.
920 * @privlevel platform
921 * @privilege %http://tizen.org/privilege/tethering.admin
922 * @param[in] tethering The handle of tethering
923 * @param[in] mac The mac address
924 * @return 0 on success, otherwise negative error value.
925 * @retval #TETHERING_ERROR_NONE Successful
926 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
927 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
928 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
929 * @see tethering_mobileap_set_mac_filter()
931 int tethering_wifi_add_blocked_mac_list(tethering_h tethering, const char *mac);
934 * @brief Removes the mac-address from the blocked(black list) client list.
935 * @details Removes the mac-address from the blocked client list.
937 * @privlevel platform
938 * @privilege %http://tizen.org/privilege/tethering.admin
939 * @param[in] tethering The handle of tethering
940 * @param[in] mac The mac address
941 * @return 0 on success, otherwise negative error value.
942 * @retval #TETHERING_ERROR_NONE Successful
943 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
944 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
945 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
946 * @see tethering_mobileap_set_mac_filter()
948 int tethering_wifi_remove_blocked_mac_list(tethering_h tethering, const char *mac);
951 * @brief Gets the mac-addresses from the blocked client list.
952 * @details Get the mac-addresses from the blocked client list.
954 * @privlevel platform
955 * @privilege %http://tizen.org/privilege/tethering.admin
956 * @param[in] tethering The handle of tethering
957 * @param[out] blocked_mac_list list of blocked mac addresses list
958 * @return 0 on success, otherwise negative error value.
959 * @retval #TETHERING_ERROR_NONE Successful
960 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
961 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
962 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
963 * @see tethering_mobileap_set_mac_filter()
965 int tethering_wifi_get_blocked_mac_list(tethering_h tethering, void **blocked_mac_list);
968 * @brief Enables/disables the dhcp server.
970 * @privlevel platform
971 * @privilege %http://tizen.org/privilege/tethering.admin
972 * @details Enable/disable the dhcp server.
973 * @param[in] tethering The handle of tethering
974 * @param[in] enable Enable/disable the dhcp server
975 * @return 0 on success, otherwise negative error value.
976 * @retval #TETHERING_ERROR_NONE Successful
977 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
979 int tethering_wifi_enable_dhcp(tethering_h tethering, bool enable);
982 * @brief Enables the dhcp server with the address range.
984 * @privlevel platform
985 * @privilege %http://tizen.org/privilege/tethering.admin
986 * @details Enable the dhcp server with the address range.
987 * @param[in] tethering The handle of tethering
988 * @param[in] rangestart Start address range
989 * @param[in] rangestop End address range
990 * @return 0 on success, otherwise negative error value.
991 * @retval #TETHERING_ERROR_NONE Successful
992 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
994 int tethering_wifi_set_dhcp_range(tethering_h tethering, char *rangestart, char *rangestop);
997 * @brief Checks whether the dhcp is enabled or not.
999 * @privlevel platform
1000 * @privilege %http://tizen.org/privilege/tethering.admin
1001 * @param[in] tethering The tethering handle
1002 * @param[out] dhcp_enabled @c true if dhcp is enabled, \n @c false if dhcp is disabled
1003 * @return 0 on success, otherwise a negative error value
1004 * @retval #TETHERING_ERROR_NONE Successful
1005 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1007 int tethering_wifi_is_dhcp_enabled(tethering_h tethering, bool *dhcp_enabled);
1010 * @brief Sets the Channel for Wi-Fi.
1011 * @details The Channel should be in between 1-14. If channel is not set, Wi-Fi sets default channel.
1013 * @privlevel platform
1014 * @privilege %http://tizen.org/privilege/tethering.admin
1015 * @param[in] tethering The tethering handle
1016 * @param[in] channel The channel number
1017 * @return 0 on success, otherwise negative error value
1018 * @retval #TETHERING_ERROR_NONE Successful
1019 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1021 int tethering_wifi_set_channel(tethering_h tethering, int channel);
1024 * @brief Gets the channel for Wi-Fi.
1025 * @details If channel is not set, Wi-Fi gets default channel.
1027 * @privlevel platform
1028 * @privilege %http://tizen.org/privilege/tethering.admin
1029 * @param[in] tethering The tethering handle
1030 * @param[out] channel The channel number
1031 * @return 0 on success, otherwise negative error value
1032 * @retval #TETHERING_ERROR_NONE Successful
1033 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1034 * @see tethering_wifi_set_channel()
1036 int tethering_wifi_get_channel(tethering_h tethering, int *channel);
1039 * @brief Sets the mode for Wi-Fi.
1040 * @details The mobile AP mode (ex: b only, g only, ad, a). If mode is not set, Wi-Fi sets default mode.
1042 * @privlevel platform
1043 * @privilege %http://tizen.org/privilege/tethering.admin
1044 * @param[in] tethering The tethering handle
1045 * @param[in] type The mobile AP mode
1046 * @return 0 on success, otherwise negative error value
1047 * @retval #TETHERING_ERROR_NONE Successful
1048 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1050 int tethering_wifi_set_mode(tethering_h tethering, tethering_wifi_mode_type_e type);
1053 * @brief Gets the mode for Wi-Fi.
1054 * @details If the mode is not set, Wi-Fi gets default mode.
1056 * @privlevel platform
1057 * @privilege %http://tizen.org/privilege/tethering.admin
1058 * @remarks @a mode must be released using free().
1059 * @param[in] tethering The tethering handle
1060 * @param[out] type The mode of Wi-Fi tethering
1061 * @return 0 on success, otherwise negative error value
1062 * @retval #TETHERING_ERROR_NONE Successful
1063 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1064 * @see tethering_wifi_set_mode()
1066 int tethering_wifi_get_mode(tethering_h tethering, tethering_wifi_mode_type_e *type);
1069 * @brief Sets txpower for Wi-Fi tethering.
1071 * @privlevel platform
1072 * @privilege http://tizen.org/privilege/tethering.admin
1073 * @param[in] tethering The tethering handle
1074 * @param[in] txpower value of txpower to be set
1075 * @return 0 on success, otherwise a negative error value
1076 * @retval #TETHERING_ERROR_NONE Successful
1077 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1078 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1079 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1080 * @see tethering_wifi_get_txpower()
1082 int tethering_wifi_set_txpower(tethering_h tethering, unsigned int txpower);
1085 * @brief Gets txpower for Wi-Fi tethering.
1087 * @privlevel platform
1088 * @privilege http://tizen.org/privilege/tethering.admin
1089 * @param[in] tethering The tethering handle
1090 * @param[out] txpower value of txpower
1091 * @return 0 on success, otherwise a negative error value
1092 * @retval #TETHERING_ERROR_NONE Successful
1093 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1094 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1095 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1096 * @see tethering_wifi_set_txpower()
1098 int tethering_wifi_get_txpower(tethering_h tethering, unsigned int *txpower);
1101 * @brief Sets mtu for Wi-Fi tethering.
1103 * @privlevel platform
1104 * @privilege %http://tizen.org/privilege/tethering.admin
1105 * @param[in] tethering The tethering handle
1106 * @param[in] mtu value of mtu to be set
1107 * @return 0 on success, otherwise a negative error value
1108 * @retval #TETHERING_ERROR_NONE Successful
1109 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1110 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1111 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1113 int tethering_wifi_set_mtu(tethering_h tethering, unsigned int mtu);
1116 * @brief Changes mac address for Wi-Fi tethering.
1118 * @privlevel platform
1119 * @privilege %http://tizen.org/privilege/tethering.admin
1120 * @param[in] tethering The client handle
1121 * @param[in] mac The mac address
1122 * @return 0 on success, otherwise a negative error value
1123 * @retval #TETHERING_ERROR_NONE Successful
1124 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1125 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1126 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1128 int tethering_wifi_change_mac(tethering_h tethering, char *mac);
1131 * @brief Sets max connected devices for Wi-Fi tethering.
1133 * @privlevel platform
1134 * @privilege %http://tizen.org/privilege/tethering.admin
1135 * @param[in] tethering The client handle
1136 * @param[in] max_device value of max_device to be set
1137 * @return 0 on success, otherwise a negative error value
1138 * @retval #TETHERING_ERROR_NONE Successful
1139 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1140 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1141 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1142 * @see tethering_wifi_get_max_connected_device()
1144 int tethering_wifi_set_max_connected_device(tethering_h tethering, int max_device);
1147 * @brief Gets max connected devices for Wi-Fi tethering.
1149 * @privlevel platform
1150 * @privilege %http://tizen.org/privilege/tethering.admin
1151 * @param[in] tethering The client handle
1152 * @param[out] max_device value of max_device
1153 * @return 0 on success, otherwise a negative error value
1154 * @retval #TETHERING_ERROR_NONE Successful
1155 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1156 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1157 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1158 * @see tethering_wifi_set_max_connected_device()
1160 int tethering_wifi_get_max_connected_device(tethering_h tethering, int *max_device);
1163 * @brief Enables port forwarding feature.
1165 * @privlevel platform
1166 * @privilege %http://tizen.org/privilege/tethering.admin
1167 * @details enable/disable port forwarding feature.
1168 * @param[in] tethering The handle of tethering
1169 * @param[in] enable Enable/Disable port forwarding
1170 * @return 0 on success, otherwise negative error value.
1171 * @retval #TETHERING_ERROR_NONE Successful
1172 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1173 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1174 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1176 int tethering_wifi_enable_port_forwarding(tethering_h tethering, bool enable);
1179 * @brief Sets port forwarding rule.
1181 * @privlevel platform
1182 * @privilege %http://tizen.org/privilege/tethering.admin
1183 * @details Set port forwarding rule.
1184 * @param[in] tethering The handle of tethering
1185 * @param[in] ifname interface name
1186 * @param[in] protocol protocol (tcp/udp)
1187 * @param[in] org_ip original destination ip where packet was meant to sent
1188 * @param[in] org_port original destination port where packet was meant to sent
1189 * @param[in] final_ip new destination ip where packet will be forwarded
1190 * @param[in] final_port new destination port where packet will be forwarded
1191 * @return 0 on success, otherwise negative error value.
1192 * @retval #TETHERING_ERROR_NONE Successful
1193 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1194 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1195 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1197 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);
1200 * @brief Resets port forwarding rule.
1202 * @privlevel platform
1203 * @privilege %http://tizen.org/privilege/tethering.admin
1204 * @details Reset port forwarding rule.
1205 * @param[in] tethering The handle of tethering
1206 * @return 0 on success, otherwise negative error value.
1207 * @retval #TETHERING_ERROR_NONE Successful
1208 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1209 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1210 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1212 int tethering_wifi_reset_port_forwarding_rule(tethering_h tethering);
1215 * @brief Checks whether the port forwarding is enabled or not.
1217 * @privlevel platform
1218 * @privilege %http://tizen.org/privilege/tethering.admin
1219 * @param[in] tethering The tethering handle
1220 * @param[out] forwarding_enabled @c true if port forwarding is enabled, \n @c false if port forwarding is disabled
1221 * @return 0 on success, otherwise a negative error value
1222 * @retval #TETHERING_ERROR_NONE Successful
1223 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1224 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1225 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1227 int tethering_wifi_is_port_forwarding_enabled(tethering_h tethering, bool* forwarding_enabled);
1230 * @brief Gets the port forwarding rule for Wi-Fi tethering.
1232 * @privlevel platform
1233 * @privilege %http://tizen.org/privilege/tethering.admin
1234 * @param[in] tethering The client handle
1235 * @param[out] port_forwarding_list list of port forwarding rules
1236 * @return 0 on success, otherwise a negative error value
1237 * @retval #TETHERING_ERROR_NONE Successful
1238 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1239 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1240 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1242 int tethering_wifi_get_port_forwarding_rule(tethering_h tethering, void **port_forwarding_list);
1245 * @brief Enables port filtering feature.
1247 * @privlevel platform
1248 * @privilege %http://tizen.org/privilege/tethering.admin
1249 * @details enable/disable port filtering feature.
1250 * @param[in] tethering The handle of tethering
1251 * @param[in] enable Enable/Disable port filtering
1252 * @return 0 on success, otherwise negative error value.
1253 * @retval #TETHERING_ERROR_NONE Successful
1254 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1255 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1256 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1258 int tethering_wifi_enable_port_filtering(tethering_h tethering, bool enable);
1261 * @brief Sets port filtering rule.
1263 * @privlevel platform
1264 * @privilege %http://tizen.org/privilege/tethering.admin
1265 * @details Set port filtering rule.
1266 * @param[in] tethering The handle of tethering
1267 * @param[in] port to be filtered
1268 * @param[in] protocol protocol (tcp/udp)
1269 * @param[in] allow allow/disallow port filtering
1270 * @return 0 on success, otherwise negative error value.
1271 * @retval #TETHERING_ERROR_NONE Successful
1272 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1273 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1274 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1276 int tethering_wifi_add_port_filtering_rule(tethering_h tethering, int port, char *protocol, bool allow);
1279 * @brief Sets custom port filtering rule.
1281 * @privlevel platform
1282 * @privilege %http://tizen.org/privilege/tethering.admin
1283 * @details Set custom port filtering rule.
1284 * @param[in] tethering The handle of tethering
1285 * @param[in] port1 to be filtered
1286 * @param[in] port2 to be filtered
1287 * @param[in] protocol protocol (tcp/udp)
1288 * @param[in] allow allow/disallow 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_add_custom_port_filtering_rule(tethering_h tethering, int port1, int port2, char *protocol, bool allow);
1298 * @brief Gets the port filtering rule for Wi-Fi tethering.
1300 * @privlevel platform
1301 * @privilege %http://tizen.org/privilege/tethering.admin
1302 * @param[in] tethering The client handle
1303 * @param[out] port_filtering_list list of port filtering rules
1304 * @return 0 on success, otherwise a negative error value
1305 * @retval #TETHERING_ERROR_NONE Successful
1306 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1307 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1308 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1310 int tethering_wifi_get_port_filtering_rule(tethering_h tethering, void **port_filtering_list);
1313 * @brief Gets the custom port filtering rule for Wi-Fi tethering.
1315 * @privlevel platform
1316 * @privilege %http://tizen.org/privilege/tethering.admin
1317 * @param[in] tethering The client handle
1318 * @param[out] custom_port_filtering_list list of custom port filtering rules
1319 * @return 0 on success, otherwise a negative error value
1320 * @retval #TETHERING_ERROR_NONE Successful
1321 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1322 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1323 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1325 int tethering_wifi_get_custom_port_filtering_rule(tethering_h tethering, void **custom_port_filtering_list);
1328 * @brief Checks whether the port filtering is enabled or not.
1330 * @privlevel platform
1331 * @privilege %http://tizen.org/privilege/tethering.admin
1332 * @param[in] tethering The tethering handle
1333 * @param[out] filtering_enabled @c true if port filtering is enabled, \n @c false if port filtering is disabled
1334 * @return 0 on success, otherwise a negative error value
1335 * @retval #TETHERING_ERROR_NONE Successful
1336 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1337 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1338 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1340 int tethering_wifi_is_port_filtering_enabled(tethering_h tethering, bool* filtering_enabled);
1343 * @brief Sets vpn passthrough rule.
1345 * @privlevel platform
1346 * @privilege %http://tizen.org/privilege/tethering.admin
1347 * @details Set vpn passthrough rule.
1348 * @param[in] tethering The handle of tethering
1349 * @param[in] type vpn passthrough type
1350 * @param[in] enable @c true if vpn passthrough is enabled, \n @c false if vpn passthrough is disabled
1351 * @return 0 on success, otherwise negative error value.
1352 * @retval #TETHERING_ERROR_NONE Successful
1353 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1354 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1355 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1357 int tethering_wifi_set_vpn_passthrough_rule(tethering_h tethering, tethering_vpn_passthrough_type_e type, bool enable);
1360 * @brief Pushes the WPS button to connect with Wi-Fi Tethering client. (WPS PBC)
1362 * @remarks The WPS button should be pushed when client tries to connect with Soft AP by using WPS PBC.
1363 * @param[in] tethering The tethering handle
1364 * @return 0 on success, otherwise negative error value
1365 * @retval #TETHERING_ERROR_NONE Successful
1366 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1367 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
1368 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission denied
1369 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
1371 int tethering_wifi_push_wps_button(tethering_h tethering);
1374 * @brief Sets the WPS PIN to connect with Wi-Fi Tethering client. (WPS PIN)
1376 * @remarks The WPS PIN should be inserted when client tries to connect with Soft AP by using WPS PIN.
1377 * @param[in] tethering The tethering handle
1378 * @param[in] wps_pin The WPS PIN
1379 * @return 0 on success, otherwise negative error value
1380 * @retval #TETHERING_ERROR_NONE Successful
1381 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1382 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
1383 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission denied
1384 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
1386 int tethering_wifi_set_wps_pin(tethering_h tethering, const char *wps_pin);
1395 * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
1400 * @brief Clones the handle of a client.
1402 * @privlevel platform
1403 * @privilege %http://tizen.org/privilege/tethering.admin
1404 * @remarks @a dest must be release using tethering_client_destroy().
1405 * @param[out] dest The cloned client handle
1406 * @param[in] origin The origin client handle
1407 * @return 0 on success, otherwise a negative error value
1408 * @retval #TETHERING_ERROR_NONE Successful
1409 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1410 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1411 * @see tethering_client_destroy()
1413 int tethering_client_clone(tethering_client_h *dest, tethering_client_h origin);
1416 * @brief Destroys the handle of a client.
1418 * @privlevel platform
1419 * @privilege %http://tizen.org/privilege/tethering.admin
1420 * @param[in] client The client handle
1421 * @return 0 on success, otherwise a negative error value
1422 * @retval #TETHERING_ERROR_NONE Successful
1423 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1424 * @see tethering_client_clone()
1426 int tethering_client_destroy(tethering_client_h client);
1429 * @brief Gets the tethering type of client.
1431 * @privlevel platform
1432 * @privilege %http://tizen.org/privilege/tethering.admin
1433 * @param[in] client The handle of client
1434 * @param[out] type The type of tethering
1435 * @return 0 on success, otherwise a negative error value.
1436 * @retval #TETHERING_ERROR_NONE Successful
1437 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1438 * @see tethering_usb_get_connected_client()
1439 * @see tethering_connection_state_changed_cb()
1441 int tethering_client_get_tethering_type(tethering_client_h client, tethering_type_e *type);
1444 * @brief Gets the name of a client.
1446 * @privlevel platform
1447 * @privilege %http://tizen.org/privilege/tethering.admin
1448 * @remarks @a name must be released using free().
1449 * @param[in] client The client handle
1450 * @param[out] name The name of the client
1451 * @return 0 on success, otherwise a negative error value
1452 * @retval #TETHERING_ERROR_NONE Successful
1453 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1454 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1455 * @see tethering_usb_get_connected_client()
1456 * @see tethering_connection_state_changed_cb()
1458 int tethering_client_get_name(tethering_client_h client, char **name);
1461 * @brief Gets the IP address of a client.
1463 * @privlevel platform
1464 * @privilege %http://tizen.org/privilege/tethering.admin
1465 * @remarks @a ip_address must be released using free().
1466 * @param[in] client The client handle
1467 * @param[in] address_family The address family of IP address. Currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported
1468 * @param[out] ip_address The IP address
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_ip_address(tethering_client_h client, tethering_address_family_e address_family, char **ip_address);
1479 * @brief Gets the MAC address of a client such as "FC:A1:3E:D6:B1:B1".
1481 * @privlevel platform
1482 * @privilege %http://tizen.org/privilege/tethering.admin
1483 * @remarks @a mac_address must be released using free().
1484 * @param[in] client The client handle
1485 * @param[out] mac_address The MAC address
1486 * @return 0 on success, otherwise a negative error value
1487 * @retval #TETHERING_ERROR_NONE Successful
1488 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1489 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1490 * @see tethering_usb_get_connected_client()
1491 * @see tethering_connection_state_changed_cb()
1493 int tethering_client_get_mac_address(tethering_client_h client, char **mac_address);
1496 * @brief Gets the connection time of a client.
1498 * @privlevel platform
1499 * @privilege %http://tizen.org/privilege/tethering.admin
1500 * @param[in] client The client handle
1501 * @param[out] time The connected time of the client
1502 * @return 0 on success, otherwise a negative error value
1503 * @retval #TETHERING_ERROR_NONE Successful
1504 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1505 * @see tethering_usb_get_connected_client()
1506 * @see tethering_connection_state_changed_cb()
1508 int tethering_client_get_time(tethering_client_h client, time_t *timestamp);
1519 #endif /* __TIZEN_NETWORK_TETHERING_H__ */