2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __TIZEN_NETWORK_TETHERING_H__
18 #define __TIZEN_NETWORK_TETHERING_H__
32 * @addtogroup CAPI_NETWORK_TETHERING_MANAGER_MODULE
37 * @brief The tethering handle.
40 typedef void * tethering_h;
43 * @brief Enumeration for the tethering.
47 TETHERING_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
48 TETHERING_ERROR_NOT_PERMITTED = TIZEN_ERROR_NOT_PERMITTED, /**< Operation not permitted */
49 TETHERING_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
50 TETHERING_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
51 TETHERING_ERROR_RESOURCE_BUSY = TIZEN_ERROR_RESOURCE_BUSY, /**< Resource busy */
52 TETHERING_ERROR_NOT_ENABLED = TIZEN_ERROR_TETHERING | 0x0501, /**< Not enabled */
53 TETHERING_ERROR_OPERATION_FAILED = TIZEN_ERROR_TETHERING | 0x0502, /**< Operation failed */
54 TETHERING_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid operation */
55 TETHERING_ERROR_NOT_SUPPORT_API = TIZEN_ERROR_NOT_SUPPORTED, /**< API is not supported */
56 TETHERING_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
60 * @brief Enumeration for the type of tethering.
64 TETHERING_TYPE_ALL = 0, /**< All type */
65 TETHERING_TYPE_USB, /**< USB type */
66 TETHERING_TYPE_WIFI, /**< Wi-Fi type */
67 TETHERING_TYPE_BT, /**< BT type */
71 * @brief Enumeration for the cause of disabling the tethering.
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_e;
154 * @addtogroup CAPI_NETWORK_TETHERING_MANAGER_MODULE
159 * @brief Called when the tethering is enabled.
161 * @param[in] result The result of enabling the tethering
162 * @param[in] type The tethering type
163 * @param[in] is_requested Indicates whether this change is requested
164 * @param[in] user_data The user data passed from tethering_set_enabled_cb()
165 * @pre If you register callback function using tethering_set_enabled_cb(), this will be invoked when the tethering is enabled.
166 * @see tethering_enable()
167 * @see tethering_unset_enabled_cb()
169 typedef void (*tethering_enabled_cb)(tethering_error_e result, tethering_type_e type, bool is_requested, void *user_data);
172 * @brief Called when the tethering is disabled.
174 * @param[in] result The result of disabling the tethering
175 * @param[in] type The tethering type
176 * @param[in] cause The cause of disabling
177 * @param[in] user_data The user data passed from tethering_set_disabled_cb()
178 * @pre If you register callback function using tethering_set_disabled_cb(), this will be invoked when the tethering is disabled.
179 * @see tethering_set_disabled_cb()
180 * @see tethering_unset_disabled_cb()
182 typedef void (*tethering_disabled_cb)(tethering_error_e result, tethering_type_e type, tethering_disabled_cause_e cause, void *user_data);
185 * @brief Called when the connection state is changed.
187 * @remarks @a client is valid only in this function. In order to use it outside this function, a user must copy the client with tethering_client_clone().
188 * @param[in] client The client of which connection state is changed
189 * @param[in] opened @c true when connection is opened, otherwise false
190 * @param[in] user_data The user data passed from tethering_set_connection_state_changed_cb()
191 * @pre If you register callback function using tethering_set_connection_state_changed_cb(), this will be invoked when the connection state is changed.
192 * @see tethering_set_connection_state_changed_cb()
193 * @see tethering_unset_connection_state_changed_cb()
195 typedef void (*tethering_connection_state_changed_cb)(tethering_client_h client, bool opened, void *user_data);
198 * @brief Called when you get the connected client repeatedly.
200 * @remarks @a client is valid only in this function. In order to use the client outside this function, a user must copy the client with tethering_client_clone().
201 * @param[in] client The connected client
202 * @param[in] user_data The user data passed from the request function
203 * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
204 * @pre tethering_foreach_connected_clients() will invoke this callback.
205 * @see tethering_foreach_connected_clients()
207 typedef bool(*tethering_connected_client_cb)(tethering_client_h client, void *user_data);
210 * @brief Called when you get the data usage.
212 * @param[in] result The result of getting the data usage
213 * @param[in] received_data The usage of received data
214 * @param[in] sent_data The usage of sent data
215 * @param[in] user_data The user data passed from the request function
216 * @pre tethering_get_data_usage() will invoked this callback.
218 typedef void (*tethering_data_usage_cb)(tethering_error_e result, unsigned long long received_data, unsigned long long sent_data, void *user_data);
221 * @brief Called when the security type of Wi-Fi tethering is changed.
223 * @param[in] changed_type The changed security type of Wi-Fi tethering
224 * @param[in] user_data The user data passed from the register function
225 * @see tethering_wifi_set_security_type_changed_cb()
226 * @see tethering_wifi_unset_security_type_changed_cb()
228 typedef void (*tethering_wifi_security_type_changed_cb)(tethering_wifi_security_type_e changed_type, void *user_data);
231 * @brief Called when the visibility of SSID is changed.
233 * @param[in] changed_visible The changed visibility of SSID
234 * @param[in] user_data The user data passed from the register function
235 * @see tethering_wifi_set_ssid_visibility_changed_cb()
236 * @see tethering_wifi_unset_ssid_visibility_changed_cb()
238 typedef void (*tethering_wifi_ssid_visibility_changed_cb)(bool changed_visible, void *user_data);
241 * @brief Called when the passphrase of Wi-Fi tethering is changed.
243 * @param[in] user_data The user data passed from the register function
244 * @see tethering_wifi_set_passphrase_changed_cb()
245 * @see tethering_wifi_unset_passphrase_changed_cb()
247 typedef void (*tethering_wifi_passphrase_changed_cb)(void *user_data);
250 * @brief Called when the settings are reloaded.
252 * @param[in] result The result of reloading the settings
253 * @param[in] user_data The user data passed from the request function
254 * @pre tethering_wifi_reload_settings() will invoke this callback.
256 typedef void (*tethering_wifi_settings_reloaded_cb)(tethering_error_e result, void *user_data);
259 * @brief Creates the handle for tethering.
261 * @privlevel platform
262 * @privilege %http://tizen.org/privilege/tethering.admin
263 * @remarks The @a tethering must be released using tethering_destroy().
264 * @param[out] tethering A handle of a new mobile ap handle on success
265 * @return 0 on success, otherwise a negative error value
266 * @retval #TETHERING_ERROR_NONE Successful
267 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
268 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
269 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API is not supported
270 * @see tethering_destroy()
272 int tethering_create(tethering_h *tethering);
275 * @brief Destroys the handle for tethering.
277 * @privlevel platform
278 * @privilege %http://tizen.org/privilege/tethering.admin
279 * @param[in] tethering The tethering handle
280 * @return 0 on success, otherwise a negative error value
281 * @retval #TETHERING_ERROR_NONE Successful
282 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
283 * @see tethering_create()
285 int tethering_destroy(tethering_h tethering);
288 * @brief Enables the tethering, asynchronously.
290 * @privlevel platform
291 * @privilege %http://tizen.org/privilege/tethering.admin
292 * @param[in] tethering The tethering handle
293 * @param[in] type The tethering type
294 * @return 0 on success, otherwise negative error value
295 * @retval #TETHERING_ERROR_NONE Successful
296 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
297 * @post tethering_enabled_cb() will be invoked.
298 * @see tethering_is_enabled()
299 * @see tethering_disable()
301 int tethering_enable(tethering_h tethering, tethering_type_e type);
304 * @brief Disables the tethering, asynchronously.
306 * @privlevel platform
307 * @privilege %http://tizen.org/privilege/tethering.admin
308 * @param[in] tethering The tethering handle
309 * @param[in] type The tethering type
310 * @return 0 on success, otherwise negative error value
311 * @retval #TETHERING_ERROR_NONE Successful
312 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
313 * @post tethering_disabled_cb() will be invoked.
314 * @see tethering_is_enabled()
315 * @see tethering_enable()
317 int tethering_disable(tethering_h tethering, tethering_type_e type);
320 * @brief Checks whether the tethering is enabled or not.
322 * @privlevel platform
323 * @privilege %http://tizen.org/privilege/tethering.admin
324 * @param[in] tethering The tethering handle
325 * @param[in] type The tethering type
326 * @return @c true if tethering is enabled, \n @c false if tethering is disabled
328 bool tethering_is_enabled(tethering_h tethering, tethering_type_e type);
331 * @brief Gets the MAC address of local device as "FC:A1:3E:D6:B1:B1".
333 * @privlevel platform
334 * @privilege %http://tizen.org/privilege/tethering.admin
335 * @remarks @a mac_address must be released using free().
336 * @param[in] tethering The tethering handle
337 * @param[in] type The tethering type
338 * @param[out] mac_address The MAC address
339 * @return 0 on success, otherwise a negative error value
340 * @retval #TETHERING_ERROR_NONE Successful
341 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
342 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
343 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
344 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
345 * @pre The tethering must be enabled.
346 * @see tethering_is_enabled()
347 * @see tethering_enable()
349 int tethering_get_mac_address(tethering_h tethering, tethering_type_e type, char **mac_address);
352 * @brief Gets the name of network interface (e.g. usb0).
354 * @privlevel platform
355 * @privilege %http://tizen.org/privilege/tethering.admin
356 * @remarks @a interface_name must be released using free().
357 * @param[in] tethering The tethering handle
358 * @param[in] type The tethering type
359 * @param[out] interface_name The name of the network interface
360 * @return 0 on success, otherwise negative error value
361 * @retval #TETHERING_ERROR_NONE Successful
362 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
363 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
364 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
365 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
366 * @pre The tethering must be enabled.
367 * @see tethering_is_enabled()
368 * @see tethering_enable()
370 int tethering_get_network_interface_name(tethering_h tethering, tethering_type_e type, char **interface_name);
373 * @brief Gets the local IP address.
375 * @privlevel platform
376 * @privilege %http://tizen.org/privilege/tethering.admin
377 * @remarks @a ip_address must be released using free().
378 * @param[in] tethering The tethering handle
379 * @param[in] type The tethering type
380 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
381 * @param[out] ip_address The local IP address
382 * @return 0 on success, otherwise negative error value
383 * @retval #TETHERING_ERROR_NONE Successful
384 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
385 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
386 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
387 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
388 * @pre The tethering must be enabled.
389 * @see tethering_is_enabled()
390 * @see tethering_enable()
392 int tethering_get_ip_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **ip_address);
395 * @brief Gets the Gateway address.
397 * @privlevel platform
398 * @privilege %http://tizen.org/privilege/tethering.admin
399 * @remarks @a gateway_address must be released using free().
400 * @param[in] tethering The tethering handle
401 * @param[in] type The tethering type
402 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
403 * @param[out] gateway_address The local IP address
404 * @return 0 on success, otherwise negative error value
405 * @retval #TETHERING_ERROR_NONE Successful
406 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
407 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
408 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
409 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
410 * @pre The tethering must be enabled.
411 * @see tethering_is_enabled()
412 * @see tethering_enable()
414 int tethering_get_gateway_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **gateway_address);
417 * @brief Gets the Subnet Mask.
419 * @privlevel platform
420 * @privilege %http://tizen.org/privilege/tethering.admin
421 * @remarks @a subnet_mask must be released using free().
422 * @param[in] tethering The tethering handle
423 * @param[in] type The tethering type
424 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
425 * @param[out] subnet_mask The local IP address
426 * @return 0 on success, otherwise negative error value
427 * @retval #TETHERING_ERROR_NONE Successful
428 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
429 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
430 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
431 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
432 * @pre The tethering must be enabled.
433 * @see tethering_is_enabled()
434 * @see tethering_enable()
436 int tethering_get_subnet_mask(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **subnet_mask);
439 * @brief Gets the data usage.
441 * @privlevel platform
442 * @privilege %http://tizen.org/privilege/tethering.admin
443 * @param[in] tethering The tethering handle
444 * @param[out] usage The data usage
445 * @return 0 on success, otherwise negative error value
446 * @retval #TETHERING_ERROR_NONE Successful
447 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
448 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
449 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
450 * @pre The tethering must be enabled.
451 * @see tethering_is_enabled()
452 * @see tethering_enable()
454 int tethering_get_data_usage(tethering_h tethering, tethering_data_usage_cb callback, void *user_data);
457 * @brief Gets the clients which are connected.
459 * @privlevel platform
460 * @privilege %http://tizen.org/privilege/tethering.admin
461 * @param[in] tethering The tethering handle
462 * @param[in] type The tethering type
463 * @param[in] callback The callback function to invoke
464 * @param[in] user_data The user data to be passed to the callback function
465 * @retval #TETHERING_ERROR_NONE Successful
466 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
467 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
468 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
469 * @pre The tethering must be enabled.
470 * @see tethering_is_enabled()
471 * @see tethering_enable()
473 int tethering_foreach_connected_clients(tethering_h tethering, tethering_type_e type, tethering_connected_client_cb callback, void *user_data);
476 * @brief Registers the callback function, which is called when tethering is enabled.
478 * @privlevel platform
479 * @privilege %http://tizen.org/privilege/tethering.admin
480 * @param[in] tethering The tethering handle
481 * @param[in] type The tethering type
482 * @param[in] callback The callback function to invoke
483 * @param[in] user_data The user data to be passed to the callback function
484 * @retval #TETHERING_ERROR_NONE Successful
485 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
486 * @see tethering_unset_enabled_cb()
488 int tethering_set_enabled_cb(tethering_h tethering, tethering_type_e type, tethering_enabled_cb callback, void *user_data);
491 * @brief Unregisters the callback function, which is called when tethering is enabled.
493 * @privlevel platform
494 * @privilege %http://tizen.org/privilege/tethering.admin
495 * @param[in] tethering The tethering handle
496 * @param[in] type The tethering type
497 * @retval #TETHERING_ERROR_NONE Successful
498 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
499 * @see tethering_set_enabled_cb()
501 int tethering_unset_enabled_cb(tethering_h tethering, tethering_type_e type);
504 * @brief Registers the callback function called when tethering is disabled.
506 * @privlevel platform
507 * @privilege %http://tizen.org/privilege/tethering.admin
508 * @param[in] tethering The tethering handle
509 * @param[in] type The tethering type
510 * @param[in] callback The callback function to invoke
511 * @param[in] user_data The user data to be passed to the callback function
512 * @retval #TETHERING_ERROR_NONE Successful
513 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
514 * @see tethering_unset_disabled_cb()
516 int tethering_set_disabled_cb(tethering_h tethering, tethering_type_e type, tethering_disabled_cb callback, void *user_data);
519 * @brief Unregisters the callback function, which is called when tethering is disabled.
521 * @privlevel platform
522 * @privilege %http://tizen.org/privilege/tethering.admin
523 * @param[in] tethering The tethering handle
524 * @param[in] type The tethering type
525 * @retval #TETHERING_ERROR_NONE Successful
526 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
527 * @see tethering_set_disabled_cb()
529 int tethering_unset_disabled_cb(tethering_h tethering, tethering_type_e type);
532 * @brief Registers the callback function, which is called when the state of connection is changed.
534 * @privlevel platform
535 * @privilege %http://tizen.org/privilege/tethering.admin
536 * @param[in] tethering The tethering handle
537 * @param[in] type The tethering type
538 * @param[in] callback The callback function to invoke
539 * @param[in] user_data The user data to be passed to the callback function
540 * @retval #TETHERING_ERROR_NONE Successful
541 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
542 * @see tethering_unset_connection_state_changed_cb_cb()
544 int tethering_set_connection_state_changed_cb(tethering_h tethering, tethering_type_e type, tethering_connection_state_changed_cb callback, void *user_data);
547 * @brief Unregisters the callback function, which is called when the state of connection is changed.
549 * @privlevel platform
550 * @privilege %http://tizen.org/privilege/tethering.admin
551 * @param[in] tethering The tethering handle
552 * @param[in] type The tethering type
553 * @retval #TETHERING_ERROR_NONE Successful
554 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
555 * @see tethering_set_connection_state_changed_cb()
557 int tethering_unset_connection_state_changed_cb(tethering_h tethering, tethering_type_e type);
560 * @brief Registers the callback function, which is called when the security type of Wi-Fi tethering is changed.
562 * @privlevel platform
563 * @privilege %http://tizen.org/privilege/tethering.admin
564 * @param[in] tethering The tethering handle
565 * @param[in] callback The callback function to invoke
566 * @param[in] user_data The user data to be passed to the callback function
567 * @retval #TETHERING_ERROR_NONE Successful
568 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
569 * @see tethering_wifi_unset_security_type_changed_cb()
571 int tethering_wifi_set_security_type_changed_cb(tethering_h tethering, tethering_wifi_security_type_changed_cb callback, void *user_data);
574 * @brief Unregisters the callback function, which is called when the security type of Wi-Fi tethering is changed.
576 * @privlevel platform
577 * @privilege %http://tizen.org/privilege/tethering.admin
578 * @param[in] tethering The tethering handle
579 * @param[in] type The tethering type
580 * @retval #TETHERING_ERROR_NONE Successful
581 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
582 * @see tethering_wifi_set_security_type_changed_cb()
584 int tethering_wifi_unset_security_type_changed_cb(tethering_h tethering);
587 * @brief Registers the callback function , which iscalled when the visibility of SSID is changed.
589 * @privlevel platform
590 * @privilege %http://tizen.org/privilege/tethering.admin
591 * @param[in] tethering The tethering handle
592 * @param[in] callback The callback function to invoke
593 * @param[in] user_data The user data to be passed to the callback function
594 * @retval #TETHERING_ERROR_NONE Successful
595 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
596 * @see tethering_wifi_unset_ssid_visibility_changed_cb_cb()
598 int tethering_wifi_set_ssid_visibility_changed_cb(tethering_h tethering, tethering_wifi_ssid_visibility_changed_cb callback, void *user_data);
601 * @brief Unregisters the callback function, which is called when the visibility of SSID is changed.
603 * @privlevel platform
604 * @privilege %http://tizen.org/privilege/tethering.admin
605 * @param[in] tethering The tethering handle
606 * @retval #TETHERING_ERROR_NONE Successful
607 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
608 * @see tethering_wifi_set_ssid_visibility_changed_cb()
610 int tethering_wifi_unset_ssid_visibility_changed_cb(tethering_h tethering);
613 * @brief Registers the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
615 * @privlevel platform
616 * @privilege %http://tizen.org/privilege/tethering.admin
617 * @param[in] tethering The tethering handle
618 * @param[in] callback The callback function to invoke
619 * @param[in] user_data The user data to be passed to the callback function
620 * @retval #TETHERING_ERROR_NONE Successful
621 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
622 * @see tethering_wifi_unset_passphrase_changed_cb()
624 int tethering_wifi_set_passphrase_changed_cb(tethering_h tethering, tethering_wifi_passphrase_changed_cb callback, void *user_data);
627 * @brief Unregisters the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
629 * @privlevel platform
630 * @privilege %http://tizen.org/privilege/tethering.admin
631 * @param[in] tethering The tethering handle
632 * @retval #TETHERING_ERROR_NONE Successful
633 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
634 * @see tethering_wifi_set_passphrase_changed_cb()
636 int tethering_wifi_unset_passphrase_changed_cb(tethering_h tethering);
644 * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
649 * @brief Sets the security type of Wi-Fi tethering.
651 * @privlevel platform
652 * @privilege %http://tizen.org/privilege/tethering.admin
653 * @remarks This change is applied next time Wi-Fi tethering is enabled.
654 * @param[in] tethering The tethering handle
655 * @param[in] type The security type
656 * @return 0 on success, otherwise negative error value
657 * @retval #TETHERING_ERROR_NONE Successful
658 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
659 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
660 * @see tethering_wifi_get_security_type()
662 int tethering_wifi_set_security_type(tethering_h tethering, tethering_wifi_security_type_e type);
665 * @brief Gets the security type of Wi-Fi tethering.
667 * @privlevel platform
668 * @privilege %http://tizen.org/privilege/tethering.admin
669 * @param[in] tethering The tethering handle
670 * @param[out] type The security type
671 * @return 0 on success, otherwise negative error value
672 * @retval #TETHERING_ERROR_NONE Successful
673 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
674 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
675 * @see tethering_wifi_set_security_type()
677 int tethering_wifi_get_security_type(tethering_h tethering, tethering_wifi_security_type_e *type);
680 * @brief Sets the SSID (service set identifier).
681 * @details The SSID cannot exceed 32 bytes. If SSID is not set, device name is used as SSID.
683 * @privlevel platform
684 * @privilege %http://tizen.org/privilege/tethering.admin
685 * @remarks This change is applied next time Wi-Fi tethering is enabled with same @a tethering handle.
686 * @param[in] tethering The tethering handle
687 * @param[in] ssid The SSID
688 * @return 0 on success, otherwise negative error value
689 * @retval #TETHERING_ERROR_NONE Successful
690 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
691 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
693 int tethering_wifi_set_ssid(tethering_h tethering, const char *ssid);
696 * @brief Gets the SSID (service set identifier).
698 * @privlevel platform
699 * @privilege %http://tizen.org/privilege/tethering.admin
700 * @remarks @a ssid must be released using free().
701 * @param[in] tethering The tethering handle
702 * @param[out] ssid The SSID
703 * @return 0 on success, otherwise negative error value
704 * @retval #TETHERING_ERROR_NONE Successful
705 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
706 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
707 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
709 int tethering_wifi_get_ssid(tethering_h tethering, char **ssid);
712 * @brief Sets the visibility of SSID (service set identifier).
713 * @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.
715 * @privlevel platform
716 * @privilege %http://tizen.org/privilege/tethering.admin
717 * @remarks This change is applied next time Wi-Fi tethering is enabled.
718 * @param[in] tethering The tethering handle
719 * @param[in] visible The visibility of SSID: (@c true = visible, @c false = invisible)
720 * @return 0 on success, otherwise negative error value
721 * @retval #TETHERING_ERROR_NONE Successful
722 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
723 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
724 * @see tethering_wifi_get_ssid_visibility()
726 int tethering_wifi_set_ssid_visibility(tethering_h tethering, bool visible);
729 * @brief Gets the visibility of SSID (service set identifier).
730 * @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.
732 * @privlevel platform
733 * @privilege %http://tizen.org/privilege/tethering.admin
734 * @param[in] tethering The tethering handle
735 * @param[out] visible The visibility of SSID: (@c true = visible, @c false = invisible)
736 * @return 0 on success, otherwise negative error value
737 * @retval #TETHERING_ERROR_NONE Successful
738 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
739 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
740 * @see tethering_wifi_set_ssid_visibility()
742 int tethering_wifi_get_ssid_visibility(tethering_h tethering, bool *visible);
745 * @brief Sets the passphrase.
747 * @privlevel platform
748 * @privilege %http://tizen.org/privilege/tethering.admin
749 * @remarks This change is applied next time Wi-Fi tethering is enabled.
750 * @param[in] tethering The tethering handle
751 * @param[in] passphrase The passphrase
752 * @return 0 on success, otherwise negative error value
753 * @retval #TETHERING_ERROR_NONE Successful
754 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
755 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
756 * @see tethering_wifi_get_passphrase()
758 int tethering_wifi_set_passphrase(tethering_h tethering, const char *passphrase);
761 * @brief Gets the passphrase.
763 * @privlevel platform
764 * @privilege %http://tizen.org/privilege/tethering.admin
765 * @remarks @a passphrase must be released using free().
766 * @param[in] tethering The tethering handle
767 * @param[out] passphrase The passphrase
768 * @return 0 on success, otherwise negative error value
769 * @retval #TETHERING_ERROR_NONE Successful
770 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
771 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
772 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
773 * @see tethering_wifi_set_passphrase()
775 int tethering_wifi_get_passphrase(tethering_h tethering, char **passphrase);
778 * @brief Reloads the settings (SSID / Passphrase / Security type / SSID visibility).
780 * @privlevel platform
781 * @privilege %http://tizen.org/privilege/tethering.admin
782 * @remarks Connected devices via Wi-Fi tethering or MobileAP will be disconnected when the settings are reloaded.
783 * @param[in] tethering The tethering handle
784 * @param[in] callback The callback function to invoke
785 * @param[in] user_data The user data to be passed to the callback function
786 * @return 0 on success, otherwise negative error value
787 * @retval #TETHERING_ERROR_NONE Successful
788 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
789 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
791 int tethering_wifi_reload_settings(tethering_h tethering, tethering_wifi_settings_reloaded_cb callback, void *user_data);
794 * @brief Gets the mac_filter for Wi-Fi Tethering.
795 * @details If you set the mac_filter to enable, then the device can be allowed/blocked based on mac-address.
796 * By default mac_filter is set to false.
798 * @privlevel platform
799 * @privilege %http://tizen.org/privilege/tethering.admin
800 * @param[in] tethering The handle of tethering
801 * @param[out] mac_filter The mac filter: (@c true = enable, @c false = disable)
802 * @return 0 on success, otherwise negative error value.
803 * @retval #TETHERING_ERROR_NONE Successful
804 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
805 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
806 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
807 * @see tethering_mobileap_set_mac_filter()
809 int tethering_wifi_get_mac_filter(tethering_h tethering, bool *mac_filter);
812 * @brief Sets the mac-filter for Wi-Fi Tethering.
813 * @details If you set the mac_filter to enable, then the device can be allowed/blocked based on mac-address.
814 * By default mac_filter is set to @c false.
816 * @privlevel platform
817 * @privilege %http://tizen.org/privilege/tethering.admin
818 * @remarks This change is applied next time Wi-Fi tethering is enabled.
819 * @param[in] tethering The tethering handle
820 * @param[in] mac_filter The mac filter: (@c true = enable, @c false = disable)
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
825 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
826 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
827 * @see tethering_mobileap_get_mac_filter()
829 int tethering_wifi_set_mac_filter(tethering_h tethering, bool mac_filter);
832 * @brief Adds the mac-address to the allowed client list.
833 * @details AP can allow the client by adding clients mac-address to the allowed list.
835 * @privlevel platform
836 * @privilege %http://tizen.org/privilege/tethering.admin
837 * @param[in] tethering The handle of tethering
838 * @param[in] mac The mac address
839 * @return 0 on success, otherwise negative error value.
840 * @retval #TETHERING_ERROR_NONE Successful
841 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
842 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
843 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
844 * @see tethering_mobileap_set_mac_filter()
846 int tethering_wifi_add_allowed_mac_list(tethering_h tethering, const char *mac);
849 * @brief Removes the mac-address from the allowed client list.
850 * @details Removes the mac-address from the allowed client list.
852 * @privlevel platform
853 * @privilege %http://tizen.org/privilege/tethering.admin
854 * @param[in] tethering The handle of tethering
855 * @param[in] mac The mac address
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_NOT_SUPPORTED API is not supported
860 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
861 * @see tethering_mobileap_set_mac_filter()
863 int tethering_wifi_remove_allowed_mac_list(tethering_h tethering, const char *mac);
865 * @brief Gets the mac-addresses from the allowed client list.
866 * @details Gets the mac-addresses from the allowed client list.
868 * @privlevel platform
869 * @privilege %http://tizen.org/privilege/tethering.admin
870 * @param[in] tethering The handle of tethering
871 * @param[out] allowed_mac_list list of allowed mac addresses list
872 * @return 0 on success, otherwise negative error value.
873 * @retval #TETHERING_ERROR_NONE Successful
874 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
875 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
876 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
877 * @see tethering_mobileap_set_mac_filter()
879 int tethering_wifi_get_allowed_mac_list(tethering_h tethering, void **allowed_mac_list);
882 * @brief Adds the mac-address to the blocked(black list) client list.
883 * @details AP can disallow the client by adding clients mac-address to the blocked list.
885 * @privlevel platform
886 * @privilege %http://tizen.org/privilege/tethering.admin
887 * @param[in] tethering The handle of tethering
888 * @param[in] mac The mac address
889 * @return 0 on success, otherwise negative error value.
890 * @retval #TETHERING_ERROR_NONE Successful
891 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
892 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
893 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
894 * @see tethering_mobileap_set_mac_filter()
896 int tethering_wifi_add_blocked_mac_list(tethering_h tethering, const char *mac);
899 * @brief Removes the mac-address from the blocked(black list) client list.
900 * @details Removes the mac-address from the blocked client list.
902 * @privlevel platform
903 * @privilege %http://tizen.org/privilege/tethering.admin
904 * @param[in] tethering The handle of tethering
905 * @param[in] mac The mac address
906 * @return 0 on success, otherwise negative error value.
907 * @retval #TETHERING_ERROR_NONE Successful
908 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
909 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
910 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
911 * @see tethering_mobileap_set_mac_filter()
913 int tethering_wifi_remove_blocked_mac_list(tethering_h tethering, const char *mac);
916 * @brief Gets the mac-addresses from the blocked client list.
917 * @details Get the mac-addresses from the blocked client list.
919 * @privlevel platform
920 * @privilege %http://tizen.org/privilege/tethering.admin
921 * @param[in] tethering The handle of tethering
922 * @param[out] blocked_mac_list list of blocked mac addresses list
923 * @return 0 on success, otherwise negative error value.
924 * @retval #TETHERING_ERROR_NONE Successful
925 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
926 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
927 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
928 * @see tethering_mobileap_set_mac_filter()
930 int tethering_wifi_get_blocked_mac_list(tethering_h tethering, void **blocked_mac_list);
933 * @brief Enables/disables the dhcp server.
935 * @privlevel platform
936 * @privilege %http://tizen.org/privilege/tethering.admin
937 * @details Enable/disable the dhcp server.
938 * @param[in] tethering The handle of tethering
939 * @param[in] enable Enable/disable the dhcp server
940 * @return 0 on success, otherwise negative error value.
941 * @retval #TETHERING_ERROR_NONE Successful
942 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
944 int tethering_wifi_enable_dhcp(tethering_h tethering, bool enable);
947 * @brief Enables the dhcp server with the address range.
949 * @privlevel platform
950 * @privilege %http://tizen.org/privilege/tethering.admin
951 * @details Enable the dhcp server with the address range.
952 * @param[in] tethering The handle of tethering
953 * @param[in] rangestart Start address range
954 * @param[in] rangestop End address range
955 * @return 0 on success, otherwise negative error value.
956 * @retval #TETHERING_ERROR_NONE Successful
957 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
959 int tethering_wifi_set_dhcp_range(tethering_h tethering, char *rangestart, char *rangestop);
962 * @brief Checks whether the dhcp is enabled or not.
964 * @privlevel platform
965 * @privilege %http://tizen.org/privilege/tethering.admin
966 * @param[in] tethering The tethering handle
967 * @param[out] dhcp_enabled @c true if dhcp is enabled, \n @c false if dhcp is disabled
968 * @return 0 on success, otherwise a negative error value
969 * @retval #TETHERING_ERROR_NONE Successful
970 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
972 int tethering_wifi_is_dhcp_enabled(tethering_h tethering, bool *dhcp_enabled);
975 * @brief Sets the Channel for Wi-Fi.
976 * @details The Channel should be in between 1-14. If channel is not set, Wi-Fi sets default channel.
978 * @privlevel platform
979 * @privilege %http://tizen.org/privilege/tethering.admin
980 * @param[in] tethering The tethering handle
981 * @param[in] channel The channel number
982 * @return 0 on success, otherwise negative error value
983 * @retval #TETHERING_ERROR_NONE Successful
984 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
986 int tethering_wifi_set_channel(tethering_h tethering, int channel);
989 * @brief Gets the channel for Wi-Fi.
990 * @details If channel is not set, Wi-Fi gets default channel.
992 * @privlevel platform
993 * @privilege %http://tizen.org/privilege/tethering.admin
994 * @param[in] tethering The tethering handle
995 * @param[out] channel The channel number
996 * @return 0 on success, otherwise negative error value
997 * @retval #TETHERING_ERROR_NONE Successful
998 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
999 * @see tethering_wifi_set_channel()
1001 int tethering_wifi_get_channel(tethering_h tethering, int *channel);
1004 * @brief Sets the mode for Wi-Fi.
1005 * @details The mobile AP mode (ex: b only, g only, ad, a). If mode is not set, Wi-Fi sets default mode.
1007 * @privlevel platform
1008 * @privilege %http://tizen.org/privilege/tethering.admin
1009 * @param[in] tethering The tethering handle
1010 * @param[in] type The mobile AP mode
1011 * @return 0 on success, otherwise negative error value
1012 * @retval #TETHERING_ERROR_NONE Successful
1013 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1015 int tethering_wifi_set_mode(tethering_h tethering, tethering_wifi_mode_type_e type);
1018 * @brief Gets the mode for Wi-Fi.
1019 * @details If the mode is not set, Wi-Fi gets default mode.
1021 * @privlevel platform
1022 * @privilege %http://tizen.org/privilege/tethering.admin
1023 * @remarks @a mode must be released using free().
1024 * @param[in] tethering The tethering handle
1025 * @param[out] type The mode of Wi-Fi tethering
1026 * @return 0 on success, otherwise negative error value
1027 * @retval #TETHERING_ERROR_NONE Successful
1028 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1029 * @see tethering_wifi_set_mode()
1031 int tethering_wifi_get_mode(tethering_h tethering, tethering_wifi_mode_type_e *type);
1034 * @brief Sets txpower for Wi-Fi tethering.
1036 * @privlevel platform
1037 * @privilege http://tizen.org/privilege/tethering.admin
1038 * @param[in] tethering The tethering handle
1039 * @param[in] txpower value of txpower to be set
1040 * @return 0 on success, otherwise a negative error value
1041 * @retval #TETHERING_ERROR_NONE Successful
1042 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1043 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1044 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1045 * @see tethering_wifi_get_txpower()
1047 int tethering_wifi_set_txpower(tethering_h tethering, unsigned int txpower);
1050 * @brief Gets txpower for Wi-Fi tethering.
1052 * @privlevel platform
1053 * @privilege http://tizen.org/privilege/tethering.admin
1054 * @param[in] tethering The tethering handle
1055 * @param[out] txpower value of txpower
1056 * @return 0 on success, otherwise a negative error value
1057 * @retval #TETHERING_ERROR_NONE Successful
1058 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1059 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1060 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1061 * @see tethering_wifi_set_txpower()
1063 int tethering_wifi_get_txpower(tethering_h tethering, unsigned int *txpower);
1066 * @brief Sets mtu for Wi-Fi tethering.
1068 * @privlevel platform
1069 * @privilege %http://tizen.org/privilege/tethering.admin
1070 * @param[in] tethering The tethering handle
1071 * @param[in] mtu value of mtu to be set
1072 * @return 0 on success, otherwise a negative error value
1073 * @retval #TETHERING_ERROR_NONE Successful
1074 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1075 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1076 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1078 int tethering_wifi_set_mtu(tethering_h tethering, unsigned int mtu);
1081 * @brief Changes mac address for Wi-Fi tethering.
1083 * @privlevel platform
1084 * @privilege %http://tizen.org/privilege/tethering.admin
1085 * @param[in] tethering The client handle
1086 * @param[in] mac The mac address
1087 * @return 0 on success, otherwise a negative error value
1088 * @retval #TETHERING_ERROR_NONE Successful
1089 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1090 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1091 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1093 int tethering_wifi_change_mac(tethering_h tethering, char *mac);
1096 * @brief Sets max connected devices for Wi-Fi tethering.
1098 * @privlevel platform
1099 * @privilege %http://tizen.org/privilege/tethering.admin
1100 * @param[in] tethering The client handle
1101 * @param[in] max_device value of max_device to be set
1102 * @return 0 on success, otherwise a negative error value
1103 * @retval #TETHERING_ERROR_NONE Successful
1104 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1105 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1106 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1107 * @see tethering_wifi_get_max_connected_device()
1109 int tethering_wifi_set_max_connected_device(tethering_h tethering, int max_device);
1112 * @brief Gets max connected devices for Wi-Fi tethering.
1114 * @privlevel platform
1115 * @privilege %http://tizen.org/privilege/tethering.admin
1116 * @param[in] tethering The client handle
1117 * @param[out] max_device value of max_device
1118 * @return 0 on success, otherwise a negative error value
1119 * @retval #TETHERING_ERROR_NONE Successful
1120 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1121 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1122 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1123 * @see tethering_wifi_set_max_connected_device()
1125 int tethering_wifi_get_max_connected_device(tethering_h tethering, int *max_device);
1128 * @brief Enables port forwarding feature.
1130 * @privlevel platform
1131 * @privilege %http://tizen.org/privilege/tethering.admin
1132 * @details enable/disable port forwarding feature.
1133 * @param[in] tethering The handle of tethering
1134 * @param[in] enable Enable/Disable port forwarding
1135 * @return 0 on success, otherwise negative error value.
1136 * @retval #TETHERING_ERROR_NONE Successful
1137 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1138 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1139 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1141 int tethering_wifi_enable_port_forwarding(tethering_h tethering, bool enable);
1144 * @brief Sets port forwarding rule.
1146 * @privlevel platform
1147 * @privilege %http://tizen.org/privilege/tethering.admin
1148 * @details Set port forwarding rule.
1149 * @param[in] tethering The handle of tethering
1150 * @param[in] ifname interface name
1151 * @param[in] protocol protocol (tcp/udp)
1152 * @param[in] org_ip original destination ip where packet was meant to sent
1153 * @param[in] org_port original destination port where packet was meant to sent
1154 * @param[in] final_ip new destination ip where packet will be forwarded
1155 * @param[in] final_port new destination port where packet will be forwarded
1156 * @return 0 on success, otherwise 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
1162 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);
1165 * @brief Resets port forwarding rule.
1167 * @privlevel platform
1168 * @privilege %http://tizen.org/privilege/tethering.admin
1169 * @details Reset port forwarding rule.
1170 * @param[in] tethering The handle of tethering
1171 * @return 0 on success, otherwise negative error value.
1172 * @retval #TETHERING_ERROR_NONE Successful
1173 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1174 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1175 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1177 int tethering_wifi_reset_port_forwarding_rule(tethering_h tethering);
1180 * @brief Checks whether the port forwarding is enabled or not.
1182 * @privlevel platform
1183 * @privilege %http://tizen.org/privilege/tethering.admin
1184 * @param[in] tethering The tethering handle
1185 * @param[out] forwarding_enabled @c true if port forwarding is enabled, \n @c false if port forwarding is disabled
1186 * @return 0 on success, otherwise a negative error value
1187 * @retval #TETHERING_ERROR_NONE Successful
1188 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1189 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1190 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1192 int tethering_wifi_is_port_forwarding_enabled(tethering_h tethering, bool* forwarding_enabled);
1195 * @brief Gets the port forwarding rule for Wi-Fi tethering.
1197 * @privlevel platform
1198 * @privilege %http://tizen.org/privilege/tethering.admin
1199 * @param[in] tethering The client handle
1200 * @param[out] port_forwarding_list list of port forwarding rules
1201 * @return 0 on success, otherwise a negative error value
1202 * @retval #TETHERING_ERROR_NONE Successful
1203 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1204 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1205 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1207 int tethering_wifi_get_port_forwarding_rule(tethering_h tethering, void **port_forwarding_list);
1210 * @brief Enables port filtering feature.
1212 * @privlevel platform
1213 * @privilege %http://tizen.org/privilege/tethering.admin
1214 * @details enable/disable port filtering feature.
1215 * @param[in] tethering The handle of tethering
1216 * @param[in] enable Enable/Disable port filtering
1217 * @return 0 on success, otherwise negative error value.
1218 * @retval #TETHERING_ERROR_NONE Successful
1219 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1220 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1221 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1223 int tethering_wifi_enable_port_filtering(tethering_h tethering, bool enable);
1226 * @brief Sets port filtering rule.
1228 * @privlevel platform
1229 * @privilege %http://tizen.org/privilege/tethering.admin
1230 * @details Set port filtering rule.
1231 * @param[in] tethering The handle of tethering
1232 * @param[in] port to be filtered
1233 * @param[in] protocol protocol (tcp/udp)
1234 * @param[in] allow allow/disallow port filtering
1235 * @return 0 on success, otherwise negative error value.
1236 * @retval #TETHERING_ERROR_NONE Successful
1237 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1238 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1239 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1241 int tethering_wifi_add_port_filtering_rule(tethering_h tethering, int port, char *protocol, bool allow);
1244 * @brief Sets custom port filtering rule.
1246 * @privlevel platform
1247 * @privilege %http://tizen.org/privilege/tethering.admin
1248 * @details Set custom port filtering rule.
1249 * @param[in] tethering The handle of tethering
1250 * @param[in] port1 to be filtered
1251 * @param[in] port2 to be filtered
1252 * @param[in] protocol protocol (tcp/udp)
1253 * @param[in] allow allow/disallow port filtering
1254 * @return 0 on success, otherwise negative error value.
1255 * @retval #TETHERING_ERROR_NONE Successful
1256 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1257 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1258 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1260 int tethering_wifi_add_custom_port_filtering_rule(tethering_h tethering, int port1, int port2, char *protocol, bool allow);
1263 * @brief Gets the port filtering rule for Wi-Fi tethering.
1265 * @privlevel platform
1266 * @privilege %http://tizen.org/privilege/tethering.admin
1267 * @param[in] tethering The client handle
1268 * @param[out] port_filtering_list list of port filtering rules
1269 * @return 0 on success, otherwise a negative error value
1270 * @retval #TETHERING_ERROR_NONE Successful
1271 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1272 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1273 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1275 int tethering_wifi_get_port_filtering_rule(tethering_h tethering, void **port_filtering_list);
1278 * @brief Gets the custom port filtering rule for Wi-Fi tethering.
1280 * @privlevel platform
1281 * @privilege %http://tizen.org/privilege/tethering.admin
1282 * @param[in] tethering The client handle
1283 * @param[out] custom_port_filtering_list list of custom port filtering rules
1284 * @return 0 on success, otherwise a negative error value
1285 * @retval #TETHERING_ERROR_NONE Successful
1286 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1287 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1288 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1290 int tethering_wifi_get_custom_port_filtering_rule(tethering_h tethering, void **custom_port_filtering_list);
1293 * @brief Checks whether the port filtering is enabled or not.
1295 * @privlevel platform
1296 * @privilege %http://tizen.org/privilege/tethering.admin
1297 * @param[in] tethering The tethering handle
1298 * @param[out] filtering_enabled @c true if port filtering is enabled, \n @c false if port filtering is disabled
1299 * @return 0 on success, otherwise a negative error value
1300 * @retval #TETHERING_ERROR_NONE Successful
1301 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1302 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1303 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1305 int tethering_wifi_is_port_filtering_enabled(tethering_h tethering, bool* filtering_enabled);
1308 * @brief Sets vpn passthrough rule.
1310 * @privlevel platform
1311 * @privilege %http://tizen.org/privilege/tethering.admin
1312 * @details Set vpn passthrough rule.
1313 * @param[in] tethering The handle of tethering
1314 * @param[in] type vpn passthrough type
1315 * @param[in] enable @c true if vpn passthrough is enabled, \n @c false if vpn passthrough is disabled
1316 * @return 0 on success, otherwise negative error value.
1317 * @retval #TETHERING_ERROR_NONE Successful
1318 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1319 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1320 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1322 int tethering_wifi_set_vpn_passthrough_rule(tethering_h tethering, tethering_vpn_passthrough_type_e type, bool enable);
1325 * @brief Pushes the WPS button to connect with Wi-Fi Tethering client. (WPS PBC)
1327 * @remarks The WPS button should be pushed when client tries to connect with Soft AP by using WPS PBC.
1328 * @param[in] tethering The tethering handle
1329 * @return 0 on success, otherwise negative error value
1330 * @retval #TETHERING_ERROR_NONE Successful
1331 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1332 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
1333 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission denied
1334 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
1336 int tethering_wifi_push_wps_button(tethering_h tethering);
1339 * @brief Sets the WPS PIN to connect with Wi-Fi Tethering client. (WPS PIN)
1341 * @remarks The WPS PIN should be inserted when client tries to connect with Soft AP by using WPS PIN.
1342 * @param[in] tethering The tethering handle
1343 * @param[in] wps_pin The WPS PIN
1344 * @return 0 on success, otherwise negative error value
1345 * @retval #TETHERING_ERROR_NONE Successful
1346 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1347 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
1348 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission denied
1349 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
1351 int tethering_wifi_set_wps_pin(tethering_h tethering, const char *wps_pin);
1360 * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
1365 * @brief Clones the handle of a client.
1367 * @privlevel platform
1368 * @privilege %http://tizen.org/privilege/tethering.admin
1369 * @remarks @a dest must be release using tethering_client_destroy().
1370 * @param[out] dest The cloned client handle
1371 * @param[in] origin The origin client handle
1372 * @return 0 on success, otherwise a negative error value
1373 * @retval #TETHERING_ERROR_NONE Successful
1374 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1375 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1376 * @see tethering_client_destroy()
1378 int tethering_client_clone(tethering_client_h *dest, tethering_client_h origin);
1381 * @brief Destroys the handle of a client.
1383 * @privlevel platform
1384 * @privilege %http://tizen.org/privilege/tethering.admin
1385 * @param[in] client The client handle
1386 * @return 0 on success, otherwise a negative error value
1387 * @retval #TETHERING_ERROR_NONE Successful
1388 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1389 * @see tethering_client_clone()
1391 int tethering_client_destroy(tethering_client_h client);
1394 * @brief Gets the tethering type of client.
1396 * @privlevel platform
1397 * @privilege %http://tizen.org/privilege/tethering.admin
1398 * @param[in] client The handle of client
1399 * @param[out] type The type of tethering
1400 * @return 0 on success, otherwise a negative error value.
1401 * @retval #TETHERING_ERROR_NONE Successful
1402 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1403 * @see tethering_usb_get_connected_client()
1404 * @see tethering_connection_state_changed_cb()
1406 int tethering_client_get_tethering_type(tethering_client_h client, tethering_type_e *type);
1409 * @brief Gets the name of a client.
1411 * @privlevel platform
1412 * @privilege %http://tizen.org/privilege/tethering.admin
1413 * @remarks @a name must be released using free().
1414 * @param[in] client The client handle
1415 * @param[out] name The name of the client
1416 * @return 0 on success, otherwise a negative error value
1417 * @retval #TETHERING_ERROR_NONE Successful
1418 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1419 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1420 * @see tethering_usb_get_connected_client()
1421 * @see tethering_connection_state_changed_cb()
1423 int tethering_client_get_name(tethering_client_h client, char **name);
1426 * @brief Gets the IP address of a client.
1428 * @privlevel platform
1429 * @privilege %http://tizen.org/privilege/tethering.admin
1430 * @remarks @a ip_address must be released using free().
1431 * @param[in] client The client handle
1432 * @param[in] address_family The address family of IP address. Currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported
1433 * @param[out] ip_address The IP address
1434 * @return 0 on success, otherwise a negative error value
1435 * @retval #TETHERING_ERROR_NONE Successful
1436 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1437 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1438 * @see tethering_usb_get_connected_client()
1439 * @see tethering_connection_state_changed_cb()
1441 int tethering_client_get_ip_address(tethering_client_h client, tethering_address_family_e address_family, char **ip_address);
1444 * @brief Gets the MAC address of a client such as "FC:A1:3E:D6:B1:B1".
1446 * @privlevel platform
1447 * @privilege %http://tizen.org/privilege/tethering.admin
1448 * @remarks @a mac_address must be released using free().
1449 * @param[in] client The client handle
1450 * @param[out] mac_address The MAC address
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_mac_address(tethering_client_h client, char **mac_address);
1461 * @brief Gets the connection time of a client.
1463 * @privlevel platform
1464 * @privilege %http://tizen.org/privilege/tethering.admin
1465 * @param[in] client The client handle
1466 * @param[out] time The connected time of the client
1467 * @return 0 on success, otherwise a negative error value
1468 * @retval #TETHERING_ERROR_NONE Successful
1469 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1470 * @see tethering_usb_get_connected_client()
1471 * @see tethering_connection_state_changed_cb()
1473 int tethering_client_get_time(tethering_client_h client, time_t *timestamp);
1484 #endif /* __TIZEN_NETWORK_TETHERING_H__ */