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_e;
107 * @brief Enumeration for the Wi-Fi mode
111 TETHERING_WIFI_MODE_TYPE_B = 0, /**< mode b */
112 TETHERING_WIFI_MODE_TYPE_G, /**< mode g */
113 TETHERING_WIFI_MODE_TYPE_A, /**< mode a */
114 TETHERING_WIFI_MODE_TYPE_AD, /**< mode ad */
115 } tethering_wifi_mode_type_e;
118 TETHERING_TYPE_IPSEC_PASSTHROUGH = 0, /**< IPSEC */
119 TETHERING_TYPE_PPTP_PASSTHROUGH, /**< PPTP type */
120 TETHERING_TYPE_L2TP_PASSTHROUGH, /**< L2TP type */
121 } tethering_vpn_passthrough_type_e;
129 * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
134 * @brief The tethering client handle.
137 typedef void * tethering_client_h;
140 * @brief Enumeration for address family.
144 TETHERING_ADDRESS_FAMILY_IPV4 = 0, /**< IPV4 Address type */
145 } tethering_address_family_e;
153 * @addtogroup CAPI_NETWORK_TETHERING_MANAGER_MODULE
158 * @brief Called when the tethering is enabled.
160 * @param[in] result The result of enabling the tethering
161 * @param[in] type The tethering type
162 * @param[in] is_requested Indicates whether this change is requested
163 * @param[in] user_data The user data passed from tethering_set_enabled_cb()
164 * @pre If you register callback function using tethering_set_enabled_cb(), this will be invoked when the tethering is enabled.
165 * @see tethering_enable()
166 * @see tethering_unset_enabled_cb()
168 typedef void (*tethering_enabled_cb)(tethering_error_e result, tethering_type_e type, bool is_requested, void *user_data);
171 * @brief Called when the tethering is disabled.
173 * @param[in] result The result of disabling the tethering
174 * @param[in] type The tethering type
175 * @param[in] cause The cause of disabling
176 * @param[in] user_data The user data passed from tethering_set_disabled_cb()
177 * @pre If you register callback function using tethering_set_disabled_cb(), this will be invoked when the tethering is disabled.
178 * @see tethering_set_disabled_cb()
179 * @see tethering_unset_disabled_cb()
181 typedef void (*tethering_disabled_cb)(tethering_error_e result, tethering_type_e type, tethering_disabled_cause_e cause, void *user_data);
184 * @brief Called when the connection state is changed.
186 * @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().
187 * @param[in] client The client of which connection state is changed
188 * @param[in] opened @c true when connection is opened, otherwise false
189 * @param[in] user_data The user data passed from tethering_set_connection_state_changed_cb()
190 * @pre If you register callback function using tethering_set_connection_state_changed_cb(), this will be invoked when the connection state is changed.
191 * @see tethering_set_connection_state_changed_cb()
192 * @see tethering_unset_connection_state_changed_cb()
194 typedef void (*tethering_connection_state_changed_cb)(tethering_client_h client, bool opened, void *user_data);
197 * @brief Called when you get the connected client repeatedly.
199 * @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().
200 * @param[in] client The connected client
201 * @param[in] user_data The user data passed from the request function
202 * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
203 * @pre tethering_foreach_connected_clients() will invoke this callback.
204 * @see tethering_foreach_connected_clients()
206 typedef bool(*tethering_connected_client_cb)(tethering_client_h client, void *user_data);
209 * @brief Called when you get the data usage.
211 * @param[in] result The result of getting the data usage
212 * @param[in] received_data The usage of received data
213 * @param[in] sent_data The usage of sent data
214 * @param[in] user_data The user data passed from the request function
215 * @pre tethering_get_data_usage() will invoked this callback.
217 typedef void (*tethering_data_usage_cb)(tethering_error_e result, unsigned long long received_data, unsigned long long sent_data, void *user_data);
220 * @brief Called when the security type of Wi-Fi tethering is changed.
222 * @param[in] changed_type The changed security type of Wi-Fi tethering
223 * @param[in] user_data The user data passed from the register function
224 * @see tethering_wifi_set_security_type_changed_cb()
225 * @see tethering_wifi_unset_security_type_changed_cb()
227 typedef void (*tethering_wifi_security_type_changed_cb)(tethering_wifi_security_type_e changed_type, void *user_data);
230 * @brief Called when the visibility of SSID is changed.
232 * @param[in] changed_visible The changed visibility of SSID
233 * @param[in] user_data The user data passed from the register function
234 * @see tethering_wifi_set_ssid_visibility_changed_cb()
235 * @see tethering_wifi_unset_ssid_visibility_changed_cb()
237 typedef void (*tethering_wifi_ssid_visibility_changed_cb)(bool changed_visible, void *user_data);
240 * @brief Called when the passphrase of Wi-Fi tethering is changed.
242 * @param[in] user_data The user data passed from the register function
243 * @see tethering_wifi_set_passphrase_changed_cb()
244 * @see tethering_wifi_unset_passphrase_changed_cb()
246 typedef void (*tethering_wifi_passphrase_changed_cb)(void *user_data);
249 * @brief Called when the settings are reloaded.
251 * @param[in] result The result of reloading the settings
252 * @param[in] user_data The user data passed from the request function
253 * @pre tethering_wifi_reload_settings() will invoke this callback.
255 typedef void (*tethering_wifi_settings_reloaded_cb)(tethering_error_e result, void *user_data);
258 * @brief Creates the handle for tethering.
260 * @privlevel platform
261 * @privilege %http://tizen.org/privilege/tethering.admin
262 * @remarks The @a tethering must be released using tethering_destroy().
263 * @param[out] tethering A handle of a new mobile ap handle on success
264 * @return 0 on success, otherwise a negative error value
265 * @retval #TETHERING_ERROR_NONE Successful
266 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
267 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
268 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API is not supported
269 * @see tethering_destroy()
271 int tethering_create(tethering_h *tethering);
274 * @brief Destroys the handle for tethering.
276 * @privlevel platform
277 * @privilege %http://tizen.org/privilege/tethering.admin
278 * @param[in] tethering The tethering handle
279 * @return 0 on success, otherwise a negative error value
280 * @retval #TETHERING_ERROR_NONE Successful
281 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
282 * @see tethering_create()
284 int tethering_destroy(tethering_h tethering);
287 * @brief Enables the tethering, asynchronously.
289 * @privlevel platform
290 * @privilege %http://tizen.org/privilege/tethering.admin
291 * @param[in] tethering The tethering handle
292 * @param[in] type The tethering type
293 * @return 0 on success, otherwise negative error value
294 * @retval #TETHERING_ERROR_NONE Successful
295 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
296 * @post tethering_enabled_cb() will be invoked.
297 * @see tethering_is_enabled()
298 * @see tethering_disable()
300 int tethering_enable(tethering_h tethering, tethering_type_e type);
303 * @brief Disables the tethering, asynchronously.
305 * @privlevel platform
306 * @privilege %http://tizen.org/privilege/tethering.admin
307 * @param[in] tethering The tethering handle
308 * @param[in] type The tethering type
309 * @return 0 on success, otherwise negative error value
310 * @retval #TETHERING_ERROR_NONE Successful
311 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
312 * @post tethering_disabled_cb() will be invoked.
313 * @see tethering_is_enabled()
314 * @see tethering_enable()
316 int tethering_disable(tethering_h tethering, tethering_type_e type);
319 * @brief Checks whether the tethering is enabled or not.
321 * @privlevel platform
322 * @privilege %http://tizen.org/privilege/tethering.admin
323 * @param[in] tethering The tethering handle
324 * @param[in] type The tethering type
325 * @return @c true if tethering is enabled, \n @c false if tethering is disabled
327 bool tethering_is_enabled(tethering_h tethering, tethering_type_e type);
330 * @brief Gets the MAC address of local device as "FC:A1:3E:D6:B1:B1".
332 * @privlevel platform
333 * @privilege %http://tizen.org/privilege/tethering.admin
334 * @remarks @a mac_address must be released using free().
335 * @param[in] tethering The tethering handle
336 * @param[in] type The tethering type
337 * @param[out] mac_address The MAC address
338 * @return 0 on success, otherwise a negative error value
339 * @retval #TETHERING_ERROR_NONE Successful
340 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
341 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
342 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
343 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
344 * @pre The tethering must be enabled.
345 * @see tethering_is_enabled()
346 * @see tethering_enable()
348 int tethering_get_mac_address(tethering_h tethering, tethering_type_e type, char **mac_address);
351 * @brief Gets the name of network interface (e.g. usb0).
353 * @privlevel platform
354 * @privilege %http://tizen.org/privilege/tethering.admin
355 * @remarks @a interface_name must be released using free().
356 * @param[in] tethering The tethering handle
357 * @param[in] type The tethering type
358 * @param[out] interface_name The name of the network interface
359 * @return 0 on success, otherwise negative error value
360 * @retval #TETHERING_ERROR_NONE Successful
361 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
362 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
363 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
364 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
365 * @pre The tethering must be enabled.
366 * @see tethering_is_enabled()
367 * @see tethering_enable()
369 int tethering_get_network_interface_name(tethering_h tethering, tethering_type_e type, char **interface_name);
372 * @brief Gets the local IP address.
374 * @privlevel platform
375 * @privilege %http://tizen.org/privilege/tethering.admin
376 * @remarks @a ip_address must be released using free().
377 * @param[in] tethering The tethering handle
378 * @param[in] type The tethering type
379 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
380 * @param[out] ip_address The local IP address
381 * @return 0 on success, otherwise negative error value
382 * @retval #TETHERING_ERROR_NONE Successful
383 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
384 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
385 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
386 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
387 * @pre The tethering must be enabled.
388 * @see tethering_is_enabled()
389 * @see tethering_enable()
391 int tethering_get_ip_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **ip_address);
394 * @brief Gets the Gateway address.
396 * @privlevel platform
397 * @privilege %http://tizen.org/privilege/tethering.admin
398 * @remarks @a gateway_address must be released using free().
399 * @param[in] tethering The tethering handle
400 * @param[in] type The tethering type
401 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
402 * @param[out] gateway_address The local IP address
403 * @return 0 on success, otherwise negative error value
404 * @retval #TETHERING_ERROR_NONE Successful
405 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
406 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
407 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
408 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
409 * @pre The tethering must be enabled.
410 * @see tethering_is_enabled()
411 * @see tethering_enable()
413 int tethering_get_gateway_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **gateway_address);
416 * @brief Gets the Subnet Mask.
418 * @privlevel platform
419 * @privilege %http://tizen.org/privilege/tethering.admin
420 * @remarks @a subnet_mask must be released using free().
421 * @param[in] tethering The tethering handle
422 * @param[in] type The tethering type
423 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
424 * @param[out] subnet_mask The local IP address
425 * @return 0 on success, otherwise negative error value
426 * @retval #TETHERING_ERROR_NONE Successful
427 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
428 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
429 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
430 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
431 * @pre The tethering must be enabled.
432 * @see tethering_is_enabled()
433 * @see tethering_enable()
435 int tethering_get_subnet_mask(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **subnet_mask);
438 * @brief Gets the data usage.
440 * @privlevel platform
441 * @privilege %http://tizen.org/privilege/tethering.admin
442 * @param[in] tethering The tethering handle
443 * @param[out] usage The data usage
444 * @return 0 on success, otherwise negative error value
445 * @retval #TETHERING_ERROR_NONE Successful
446 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
447 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
448 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
449 * @pre The tethering must be enabled.
450 * @see tethering_is_enabled()
451 * @see tethering_enable()
453 int tethering_get_data_usage(tethering_h tethering, tethering_data_usage_cb callback, void *user_data);
456 * @brief Gets the clients which are connected.
458 * @privlevel platform
459 * @privilege %http://tizen.org/privilege/tethering.admin
460 * @param[in] tethering The tethering handle
461 * @param[in] type The tethering type
462 * @param[in] callback The callback function to invoke
463 * @param[in] user_data The user data to be passed to the callback function
464 * @retval #TETHERING_ERROR_NONE Successful
465 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
466 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
467 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
468 * @pre The tethering must be enabled.
469 * @see tethering_is_enabled()
470 * @see tethering_enable()
472 int tethering_foreach_connected_clients(tethering_h tethering, tethering_type_e type, tethering_connected_client_cb callback, void *user_data);
475 * @brief Registers the callback function, which is called when tethering is enabled.
477 * @privlevel platform
478 * @privilege %http://tizen.org/privilege/tethering.admin
479 * @param[in] tethering The tethering handle
480 * @param[in] type The tethering type
481 * @param[in] callback The callback function to invoke
482 * @param[in] user_data The user data to be passed to the callback function
483 * @retval #TETHERING_ERROR_NONE Successful
484 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
485 * @see tethering_unset_enabled_cb()
487 int tethering_set_enabled_cb(tethering_h tethering, tethering_type_e type, tethering_enabled_cb callback, void *user_data);
490 * @brief Unregisters the callback function, which is called when tethering is enabled.
492 * @privlevel platform
493 * @privilege %http://tizen.org/privilege/tethering.admin
494 * @param[in] tethering The tethering handle
495 * @param[in] type The tethering type
496 * @retval #TETHERING_ERROR_NONE Successful
497 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
498 * @see tethering_set_enabled_cb()
500 int tethering_unset_enabled_cb(tethering_h tethering, tethering_type_e type);
503 * @brief Registers the callback function called when tethering is disabled.
505 * @privlevel platform
506 * @privilege %http://tizen.org/privilege/tethering.admin
507 * @param[in] tethering The tethering handle
508 * @param[in] type The tethering type
509 * @param[in] callback The callback function to invoke
510 * @param[in] user_data The user data to be passed to the callback function
511 * @retval #TETHERING_ERROR_NONE Successful
512 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
513 * @see tethering_unset_disabled_cb()
515 int tethering_set_disabled_cb(tethering_h tethering, tethering_type_e type, tethering_disabled_cb callback, void *user_data);
518 * @brief Unregisters the callback function, which is called when tethering is disabled.
520 * @privlevel platform
521 * @privilege %http://tizen.org/privilege/tethering.admin
522 * @param[in] tethering The tethering handle
523 * @param[in] type The tethering type
524 * @retval #TETHERING_ERROR_NONE Successful
525 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
526 * @see tethering_set_disabled_cb()
528 int tethering_unset_disabled_cb(tethering_h tethering, tethering_type_e type);
531 * @brief Registers the callback function, which is called when the state of connection is changed.
533 * @privlevel platform
534 * @privilege %http://tizen.org/privilege/tethering.admin
535 * @param[in] tethering The tethering handle
536 * @param[in] type The tethering type
537 * @param[in] callback The callback function to invoke
538 * @param[in] user_data The user data to be passed to the callback function
539 * @retval #TETHERING_ERROR_NONE Successful
540 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
541 * @see tethering_unset_connection_state_changed_cb_cb()
543 int tethering_set_connection_state_changed_cb(tethering_h tethering, tethering_type_e type, tethering_connection_state_changed_cb callback, void *user_data);
546 * @brief Unregisters the callback function, which is called when the state of connection is changed.
548 * @privlevel platform
549 * @privilege %http://tizen.org/privilege/tethering.admin
550 * @param[in] tethering The tethering handle
551 * @param[in] type The tethering type
552 * @retval #TETHERING_ERROR_NONE Successful
553 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
554 * @see tethering_set_connection_state_changed_cb()
556 int tethering_unset_connection_state_changed_cb(tethering_h tethering, tethering_type_e type);
559 * @brief Registers the callback function, which is called when the security type of Wi-Fi tethering is changed.
561 * @privlevel platform
562 * @privilege %http://tizen.org/privilege/tethering.admin
563 * @param[in] tethering The tethering handle
564 * @param[in] callback The callback function to invoke
565 * @param[in] user_data The user data to be passed to the callback function
566 * @retval #TETHERING_ERROR_NONE Successful
567 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
568 * @see tethering_wifi_unset_security_type_changed_cb()
570 int tethering_wifi_set_security_type_changed_cb(tethering_h tethering, tethering_wifi_security_type_changed_cb callback, void *user_data);
573 * @brief Unregisters the callback function, which is called when the security type of Wi-Fi tethering is changed.
575 * @privlevel platform
576 * @privilege %http://tizen.org/privilege/tethering.admin
577 * @param[in] tethering The tethering handle
578 * @param[in] type The tethering type
579 * @retval #TETHERING_ERROR_NONE Successful
580 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
581 * @see tethering_wifi_set_security_type_changed_cb()
583 int tethering_wifi_unset_security_type_changed_cb(tethering_h tethering);
586 * @brief Registers the callback function , which iscalled when the visibility of SSID is changed.
588 * @privlevel platform
589 * @privilege %http://tizen.org/privilege/tethering.admin
590 * @param[in] tethering The tethering handle
591 * @param[in] callback The callback function to invoke
592 * @param[in] user_data The user data to be passed to the callback function
593 * @retval #TETHERING_ERROR_NONE Successful
594 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
595 * @see tethering_wifi_unset_ssid_visibility_changed_cb_cb()
597 int tethering_wifi_set_ssid_visibility_changed_cb(tethering_h tethering, tethering_wifi_ssid_visibility_changed_cb callback, void *user_data);
600 * @brief Unregisters the callback function, which is called when the visibility of SSID is changed.
602 * @privlevel platform
603 * @privilege %http://tizen.org/privilege/tethering.admin
604 * @param[in] tethering The tethering handle
605 * @retval #TETHERING_ERROR_NONE Successful
606 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
607 * @see tethering_wifi_set_ssid_visibility_changed_cb()
609 int tethering_wifi_unset_ssid_visibility_changed_cb(tethering_h tethering);
612 * @brief Registers the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
614 * @privlevel platform
615 * @privilege %http://tizen.org/privilege/tethering.admin
616 * @param[in] tethering The tethering handle
617 * @param[in] callback The callback function to invoke
618 * @param[in] user_data The user data to be passed to the callback function
619 * @retval #TETHERING_ERROR_NONE Successful
620 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
621 * @see tethering_wifi_unset_passphrase_changed_cb()
623 int tethering_wifi_set_passphrase_changed_cb(tethering_h tethering, tethering_wifi_passphrase_changed_cb callback, void *user_data);
626 * @brief Unregisters the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
628 * @privlevel platform
629 * @privilege %http://tizen.org/privilege/tethering.admin
630 * @param[in] tethering The tethering handle
631 * @retval #TETHERING_ERROR_NONE Successful
632 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
633 * @see tethering_wifi_set_passphrase_changed_cb()
635 int tethering_wifi_unset_passphrase_changed_cb(tethering_h tethering);
643 * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
648 * @brief Sets the security type of Wi-Fi tethering.
650 * @privlevel platform
651 * @privilege %http://tizen.org/privilege/tethering.admin
652 * @remarks This change is applied next time Wi-Fi tethering is enabled.
653 * @param[in] tethering The tethering handle
654 * @param[in] type The security type
655 * @return 0 on success, otherwise negative error value
656 * @retval #TETHERING_ERROR_NONE Successful
657 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
658 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
659 * @see tethering_wifi_get_security_type()
661 int tethering_wifi_set_security_type(tethering_h tethering, tethering_wifi_security_type_e type);
664 * @brief Gets the security type of Wi-Fi tethering.
666 * @privlevel platform
667 * @privilege %http://tizen.org/privilege/tethering.admin
668 * @param[in] tethering The tethering handle
669 * @param[out] type The security type
670 * @return 0 on success, otherwise negative error value
671 * @retval #TETHERING_ERROR_NONE Successful
672 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
673 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
674 * @see tethering_wifi_set_security_type()
676 int tethering_wifi_get_security_type(tethering_h tethering, tethering_wifi_security_type_e *type);
679 * @brief Sets the SSID (service set identifier).
680 * @details The SSID cannot exceed 32 bytes. If SSID is not set, device name is used as SSID.
682 * @privlevel platform
683 * @privilege %http://tizen.org/privilege/tethering.admin
684 * @remarks This change is applied next time Wi-Fi tethering is enabled with same @a tethering handle.
685 * @param[in] tethering The tethering handle
686 * @param[in] ssid The SSID
687 * @return 0 on success, otherwise negative error value
688 * @retval #TETHERING_ERROR_NONE Successful
689 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
690 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
692 int tethering_wifi_set_ssid(tethering_h tethering, const char *ssid);
695 * @brief Gets the SSID (service set identifier).
697 * @privlevel platform
698 * @privilege %http://tizen.org/privilege/tethering.admin
699 * @remarks @a ssid must be released using free().
700 * @param[in] tethering The tethering handle
701 * @param[out] ssid The SSID
702 * @return 0 on success, otherwise negative error value
703 * @retval #TETHERING_ERROR_NONE Successful
704 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
705 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
706 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
708 int tethering_wifi_get_ssid(tethering_h tethering, char **ssid);
711 * @brief Sets the visibility of SSID (service set identifier).
712 * @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.
714 * @privlevel platform
715 * @privilege %http://tizen.org/privilege/tethering.admin
716 * @remarks This change is applied next time Wi-Fi tethering is enabled.
717 * @param[in] tethering The tethering handle
718 * @param[in] visible The visibility of SSID: (@c true = visible, @c false = invisible)
719 * @return 0 on success, otherwise negative error value
720 * @retval #TETHERING_ERROR_NONE Successful
721 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
722 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
723 * @see tethering_wifi_get_ssid_visibility()
725 int tethering_wifi_set_ssid_visibility(tethering_h tethering, bool visible);
728 * @brief Gets the visibility of SSID (service set identifier).
729 * @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.
731 * @privlevel platform
732 * @privilege %http://tizen.org/privilege/tethering.admin
733 * @param[in] tethering The tethering handle
734 * @param[out] visible The visibility of SSID: (@c true = visible, @c false = invisible)
735 * @return 0 on success, otherwise negative error value
736 * @retval #TETHERING_ERROR_NONE Successful
737 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
738 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
739 * @see tethering_wifi_set_ssid_visibility()
741 int tethering_wifi_get_ssid_visibility(tethering_h tethering, bool *visible);
744 * @brief Sets the passphrase.
746 * @privlevel platform
747 * @privilege %http://tizen.org/privilege/tethering.admin
748 * @remarks This change is applied next time Wi-Fi tethering is enabled.
749 * @param[in] tethering The tethering handle
750 * @param[in] passphrase The passphrase
751 * @return 0 on success, otherwise negative error value
752 * @retval #TETHERING_ERROR_NONE Successful
753 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
754 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
755 * @see tethering_wifi_get_passphrase()
757 int tethering_wifi_set_passphrase(tethering_h tethering, const char *passphrase);
760 * @brief Gets the passphrase.
762 * @privlevel platform
763 * @privilege %http://tizen.org/privilege/tethering.admin
764 * @remarks @a passphrase must be released using free().
765 * @param[in] tethering The tethering handle
766 * @param[out] passphrase The passphrase
767 * @return 0 on success, otherwise negative error value
768 * @retval #TETHERING_ERROR_NONE Successful
769 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
770 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
771 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
772 * @see tethering_wifi_set_passphrase()
774 int tethering_wifi_get_passphrase(tethering_h tethering, char **passphrase);
777 * @brief Reloads the settings (SSID / Passphrase / Security type / SSID visibility).
779 * @privlevel platform
780 * @privilege %http://tizen.org/privilege/tethering.admin
781 * @remarks Connected devices via Wi-Fi tethering or MobileAP will be disconnected when the settings are reloaded.
782 * @param[in] tethering The tethering handle
783 * @param[in] callback The callback function to invoke
784 * @param[in] user_data The user data to be passed to the callback function
785 * @return 0 on success, otherwise negative error value
786 * @retval #TETHERING_ERROR_NONE Successful
787 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
788 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
790 int tethering_wifi_reload_settings(tethering_h tethering, tethering_wifi_settings_reloaded_cb callback, void *user_data);
793 * @brief Gets the mac_filter for Wi-Fi Tethering.
794 * @details If you set the mac_filter to enable, then the device can be allowed/blocked based on mac-address.
795 * By default mac_filter is set to false.
797 * @privlevel platform
798 * @privilege %http://tizen.org/privilege/tethering.admin
799 * @param[in] tethering The handle of tethering
800 * @param[out] mac_filter The mac filter: (@c true = enable, @c false = disable)
801 * @return 0 on success, otherwise negative error value.
802 * @retval #TETHERING_ERROR_NONE Successful
803 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
804 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
805 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
806 * @see tethering_mobileap_set_mac_filter()
808 int tethering_wifi_get_mac_filter(tethering_h tethering, bool *mac_filter);
811 * @brief Sets the mac-filter for Wi-Fi Tethering.
812 * @details If you set the mac_filter to enable, then the device can be allowed/blocked based on mac-address.
813 * By default mac_filter is set to @c false.
815 * @privlevel platform
816 * @privilege %http://tizen.org/privilege/tethering.admin
817 * @remarks This change is applied next time Wi-Fi tethering is enabled.
818 * @param[in] tethering The tethering handle
819 * @param[in] mac_filter The mac filter: (@c true = enable, @c false = disable)
820 * @return 0 on success, otherwise negative error value
821 * @retval #TETHERING_ERROR_NONE Successful
822 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
823 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
824 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
825 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
826 * @see tethering_mobileap_get_mac_filter()
828 int tethering_wifi_set_mac_filter(tethering_h tethering, bool mac_filter);
831 * @brief Adds the mac-address to the allowed client list.
832 * @details AP can allow the client by adding clients mac-address to the allowed list.
834 * @privlevel platform
835 * @privilege %http://tizen.org/privilege/tethering.admin
836 * @param[in] tethering The handle of tethering
837 * @param[in] mac The mac address
838 * @return 0 on success, otherwise negative error value.
839 * @retval #TETHERING_ERROR_NONE Successful
840 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
841 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
842 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
843 * @see tethering_mobileap_set_mac_filter()
845 int tethering_wifi_add_allowed_mac_list(tethering_h tethering, const char *mac);
848 * @brief Removes the mac-address from the allowed client list.
849 * @details Removes the mac-address from the allowed client list.
851 * @privlevel platform
852 * @privilege %http://tizen.org/privilege/tethering.admin
853 * @param[in] tethering The handle of tethering
854 * @param[in] mac The mac address
855 * @return 0 on success, otherwise negative error value.
856 * @retval #TETHERING_ERROR_NONE Successful
857 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
858 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
859 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
860 * @see tethering_mobileap_set_mac_filter()
862 int tethering_wifi_remove_allowed_mac_list(tethering_h tethering, const char *mac);
864 * @brief Gets the mac-addresses from the allowed client list.
865 * @details Gets the mac-addresses from the allowed client list.
867 * @privlevel platform
868 * @privilege %http://tizen.org/privilege/tethering.admin
869 * @param[in] tethering The handle of tethering
870 * @param[out] allowed_mac_list list of allowed mac addresses list
871 * @return 0 on success, otherwise negative error value.
872 * @retval #TETHERING_ERROR_NONE Successful
873 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
874 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
875 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
876 * @see tethering_mobileap_set_mac_filter()
878 int tethering_wifi_get_allowed_mac_list(tethering_h tethering, void **allowed_mac_list);
881 * @brief Adds the mac-address to the blocked(black list) client list.
882 * @details AP can disallow the client by adding clients mac-address to the blocked list.
884 * @privlevel platform
885 * @privilege %http://tizen.org/privilege/tethering.admin
886 * @param[in] tethering The handle of tethering
887 * @param[in] mac The mac address
888 * @return 0 on success, otherwise negative error value.
889 * @retval #TETHERING_ERROR_NONE Successful
890 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
891 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
892 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
893 * @see tethering_mobileap_set_mac_filter()
895 int tethering_wifi_add_blocked_mac_list(tethering_h tethering, const char *mac);
898 * @brief Removes the mac-address from the blocked(black list) client list.
899 * @details Removes the mac-address from the blocked client list.
901 * @privlevel platform
902 * @privilege %http://tizen.org/privilege/tethering.admin
903 * @param[in] tethering The handle of tethering
904 * @param[in] mac The mac address
905 * @return 0 on success, otherwise negative error value.
906 * @retval #TETHERING_ERROR_NONE Successful
907 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
908 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
909 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
910 * @see tethering_mobileap_set_mac_filter()
912 int tethering_wifi_remove_blocked_mac_list(tethering_h tethering, const char *mac);
915 * @brief Gets the mac-addresses from the blocked client list.
916 * @details Get the mac-addresses from the blocked client list.
918 * @privlevel platform
919 * @privilege %http://tizen.org/privilege/tethering.admin
920 * @param[in] tethering The handle of tethering
921 * @param[out] blocked_mac_list list of blocked mac addresses list
922 * @return 0 on success, otherwise negative error value.
923 * @retval #TETHERING_ERROR_NONE Successful
924 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
925 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
926 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
927 * @see tethering_mobileap_set_mac_filter()
929 int tethering_wifi_get_blocked_mac_list(tethering_h tethering, void **blocked_mac_list);
932 * @brief Enables/disables the dhcp server.
934 * @privlevel platform
935 * @privilege %http://tizen.org/privilege/tethering.admin
936 * @details Enable/disable the dhcp server.
937 * @param[in] tethering The handle of tethering
938 * @param[in] enable Enable/disable the dhcp server
939 * @return 0 on success, otherwise negative error value.
940 * @retval #TETHERING_ERROR_NONE Successful
941 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
943 int tethering_wifi_enable_dhcp(tethering_h tethering, bool enable);
946 * @brief Enables the dhcp server with the address range.
948 * @privlevel platform
949 * @privilege %http://tizen.org/privilege/tethering.admin
950 * @details Enable the dhcp server with the address range.
951 * @param[in] tethering The handle of tethering
952 * @param[in] rangestart Start address range
953 * @param[in] rangestop End address range
954 * @return 0 on success, otherwise negative error value.
955 * @retval #TETHERING_ERROR_NONE Successful
956 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
958 int tethering_wifi_set_dhcp_range(tethering_h tethering, char *rangestart, char *rangestop);
961 * @brief Checks whether the dhcp is enabled or not.
963 * @privlevel platform
964 * @privilege %http://tizen.org/privilege/tethering.admin
965 * @param[in] tethering The tethering handle
966 * @param[out] dhcp_enabled @c true if dhcp is enabled, \n @c false if dhcp is disabled
967 * @return 0 on success, otherwise a negative error value
968 * @retval #TETHERING_ERROR_NONE Successful
969 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
971 int tethering_wifi_is_dhcp_enabled(tethering_h tethering, bool *dhcp_enabled);
974 * @brief Sets the Channel for Wi-Fi.
975 * @details The Channel should be in between 1-14. If channel is not set, Wi-Fi sets default channel.
977 * @privlevel platform
978 * @privilege %http://tizen.org/privilege/tethering.admin
979 * @param[in] tethering The tethering handle
980 * @param[in] channel The channel number
981 * @return 0 on success, otherwise negative error value
982 * @retval #TETHERING_ERROR_NONE Successful
983 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
985 int tethering_wifi_set_channel(tethering_h tethering, int channel);
988 * @brief Gets the channel for Wi-Fi.
989 * @details If channel is not set, Wi-Fi gets default channel.
991 * @privlevel platform
992 * @privilege %http://tizen.org/privilege/tethering.admin
993 * @param[in] tethering The tethering handle
994 * @param[out] channel The channel number
995 * @return 0 on success, otherwise negative error value
996 * @retval #TETHERING_ERROR_NONE Successful
997 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
998 * @see tethering_wifi_set_channel()
1000 int tethering_wifi_get_channel(tethering_h tethering, int *channel);
1003 * @brief Sets the mode for Wi-Fi.
1004 * @details The mobile AP mode (ex: b only, g only, ad, a). If mode is not set, Wi-Fi sets default mode.
1006 * @privlevel platform
1007 * @privilege %http://tizen.org/privilege/tethering.admin
1008 * @param[in] tethering The tethering handle
1009 * @param[in] type The mobile AP mode
1010 * @return 0 on success, otherwise negative error value
1011 * @retval #TETHERING_ERROR_NONE Successful
1012 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1014 int tethering_wifi_set_mode(tethering_h tethering, tethering_wifi_mode_type_e type);
1017 * @brief Gets the mode for Wi-Fi.
1018 * @details If the mode is not set, Wi-Fi gets default mode.
1020 * @privlevel platform
1021 * @privilege %http://tizen.org/privilege/tethering.admin
1022 * @remarks @a mode must be released using free().
1023 * @param[in] tethering The tethering handle
1024 * @param[out] type The mode of Wi-Fi tethering
1025 * @return 0 on success, otherwise negative error value
1026 * @retval #TETHERING_ERROR_NONE Successful
1027 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1028 * @see tethering_wifi_set_mode()
1030 int tethering_wifi_get_mode(tethering_h tethering, tethering_wifi_mode_type_e *type);
1033 * @brief Sets txpower for Wi-Fi tethering.
1035 * @privlevel platform
1036 * @privilege http://tizen.org/privilege/tethering.admin
1037 * @param[in] tethering The tethering handle
1038 * @param[in] txpower value of txpower to be set
1039 * @return 0 on success, otherwise a negative error value
1040 * @retval #TETHERING_ERROR_NONE Successful
1041 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1042 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1043 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1044 * @see tethering_wifi_get_txpower()
1046 int tethering_wifi_set_txpower(tethering_h tethering, unsigned int txpower);
1049 * @brief Gets txpower for Wi-Fi tethering.
1051 * @privlevel platform
1052 * @privilege http://tizen.org/privilege/tethering.admin
1053 * @param[in] tethering The tethering handle
1054 * @param[out] txpower value of txpower
1055 * @return 0 on success, otherwise a negative error value
1056 * @retval #TETHERING_ERROR_NONE Successful
1057 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1058 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1059 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1060 * @see tethering_wifi_set_txpower()
1062 int tethering_wifi_get_txpower(tethering_h tethering, unsigned int *txpower);
1065 * @brief Sets mtu for Wi-Fi tethering.
1067 * @privlevel platform
1068 * @privilege %http://tizen.org/privilege/tethering.admin
1069 * @param[in] tethering The tethering handle
1070 * @param[in] mtu value of mtu to be set
1071 * @return 0 on success, otherwise a negative error value
1072 * @retval #TETHERING_ERROR_NONE Successful
1073 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1074 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1075 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1077 int tethering_wifi_set_mtu(tethering_h tethering, unsigned int mtu);
1080 * @brief Changes mac address for Wi-Fi tethering.
1082 * @privlevel platform
1083 * @privilege %http://tizen.org/privilege/tethering.admin
1084 * @param[in] tethering The client handle
1085 * @param[in] mac The mac address
1086 * @return 0 on success, otherwise a negative error value
1087 * @retval #TETHERING_ERROR_NONE Successful
1088 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1089 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1090 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1092 int tethering_wifi_change_mac(tethering_h tethering, char *mac);
1095 * @brief Sets max connected devices for Wi-Fi tethering.
1097 * @privlevel platform
1098 * @privilege %http://tizen.org/privilege/tethering.admin
1099 * @param[in] tethering The client handle
1100 * @param[in] max_device value of max_device to be set
1101 * @return 0 on success, otherwise a negative error value
1102 * @retval #TETHERING_ERROR_NONE Successful
1103 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1104 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1105 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1106 * @see tethering_wifi_get_max_connected_device()
1108 int tethering_wifi_set_max_connected_device(tethering_h tethering, int max_device);
1111 * @brief Gets max connected devices for Wi-Fi tethering.
1113 * @privlevel platform
1114 * @privilege %http://tizen.org/privilege/tethering.admin
1115 * @param[in] tethering The client handle
1116 * @param[out] max_device value of max_device
1117 * @return 0 on success, otherwise a negative error value
1118 * @retval #TETHERING_ERROR_NONE Successful
1119 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1120 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1121 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1122 * @see tethering_wifi_set_max_connected_device()
1124 int tethering_wifi_get_max_connected_device(tethering_h tethering, int *max_device);
1127 * @brief Enables port forwarding feature.
1129 * @privlevel platform
1130 * @privilege %http://tizen.org/privilege/tethering.admin
1131 * @details enable/disable port forwarding feature.
1132 * @param[in] tethering The handle of tethering
1133 * @param[in] enable Enable/Disable port forwarding
1134 * @return 0 on success, otherwise negative error value.
1135 * @retval #TETHERING_ERROR_NONE Successful
1136 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1137 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1138 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1140 int tethering_wifi_enable_port_forwarding(tethering_h tethering, bool enable);
1143 * @brief Sets port forwarding rule.
1145 * @privlevel platform
1146 * @privilege %http://tizen.org/privilege/tethering.admin
1147 * @details Set port forwarding rule.
1148 * @param[in] tethering The handle of tethering
1149 * @param[in] ifname interface name
1150 * @param[in] protocol protocol (tcp/udp)
1151 * @param[in] org_ip original destination ip where packet was meant to sent
1152 * @param[in] org_port original destination port where packet was meant to sent
1153 * @param[in] final_ip new destination ip where packet will be forwarded
1154 * @param[in] final_port new destination port where packet will be forwarded
1155 * @return 0 on success, otherwise negative error value.
1156 * @retval #TETHERING_ERROR_NONE Successful
1157 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1158 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1159 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1161 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);
1164 * @brief Resets port forwarding rule.
1166 * @privlevel platform
1167 * @privilege %http://tizen.org/privilege/tethering.admin
1168 * @details Reset port forwarding rule.
1169 * @param[in] tethering The handle of tethering
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_reset_port_forwarding_rule(tethering_h tethering);
1179 * @brief Checks whether the port forwarding is enabled or not.
1181 * @privlevel platform
1182 * @privilege %http://tizen.org/privilege/tethering.admin
1183 * @param[in] tethering The tethering handle
1184 * @param[out] forwarding_enabled @c true if port forwarding is enabled, \n @c false if port forwarding is disabled
1185 * @return 0 on success, otherwise a negative error value
1186 * @retval #TETHERING_ERROR_NONE Successful
1187 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1188 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1189 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1191 int tethering_wifi_is_port_forwarding_enabled(tethering_h tethering, bool* forwarding_enabled);
1194 * @brief Gets the port forwarding rule for Wi-Fi tethering.
1196 * @privlevel platform
1197 * @privilege %http://tizen.org/privilege/tethering.admin
1198 * @param[in] tethering The client handle
1199 * @param[out] port_forwarding_list list of port forwarding rules
1200 * @return 0 on success, otherwise a negative error value
1201 * @retval #TETHERING_ERROR_NONE Successful
1202 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1203 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1204 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1206 int tethering_wifi_get_port_forwarding_rule(tethering_h tethering, void **port_forwarding_list);
1209 * @brief Enables port filtering feature.
1211 * @privlevel platform
1212 * @privilege %http://tizen.org/privilege/tethering.admin
1213 * @details enable/disable port filtering feature.
1214 * @param[in] tethering The handle of tethering
1215 * @param[in] enable Enable/Disable port filtering
1216 * @return 0 on success, otherwise negative error value.
1217 * @retval #TETHERING_ERROR_NONE Successful
1218 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1219 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1220 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1222 int tethering_wifi_enable_port_filtering(tethering_h tethering, bool enable);
1225 * @brief Sets port filtering rule.
1227 * @privlevel platform
1228 * @privilege %http://tizen.org/privilege/tethering.admin
1229 * @details Set port filtering rule.
1230 * @param[in] tethering The handle of tethering
1231 * @param[in] port to be filtered
1232 * @param[in] protocol protocol (tcp/udp)
1233 * @param[in] allow allow/disallow port filtering
1234 * @return 0 on success, otherwise negative error value.
1235 * @retval #TETHERING_ERROR_NONE Successful
1236 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1237 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1238 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1240 int tethering_wifi_add_port_filtering_rule(tethering_h tethering, int port, char *protocol, bool allow);
1243 * @brief Sets custom port filtering rule.
1245 * @privlevel platform
1246 * @privilege %http://tizen.org/privilege/tethering.admin
1247 * @details Set custom port filtering rule.
1248 * @param[in] tethering The handle of tethering
1249 * @param[in] port1 to be filtered
1250 * @param[in] port2 to be filtered
1251 * @param[in] protocol protocol (tcp/udp)
1252 * @param[in] allow allow/disallow port filtering
1253 * @return 0 on success, otherwise negative error value.
1254 * @retval #TETHERING_ERROR_NONE Successful
1255 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1256 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1257 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1259 int tethering_wifi_add_custom_port_filtering_rule(tethering_h tethering, int port1, int port2, char *protocol, bool allow);
1262 * @brief Gets the port filtering rule for Wi-Fi tethering.
1264 * @privlevel platform
1265 * @privilege %http://tizen.org/privilege/tethering.admin
1266 * @param[in] tethering The client handle
1267 * @param[out] port_filtering_list list of port filtering rules
1268 * @return 0 on success, otherwise a negative error value
1269 * @retval #TETHERING_ERROR_NONE Successful
1270 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1271 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1272 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1274 int tethering_wifi_get_port_filtering_rule(tethering_h tethering, void **port_filtering_list);
1277 * @brief Gets the custom port filtering rule for Wi-Fi tethering.
1279 * @privlevel platform
1280 * @privilege %http://tizen.org/privilege/tethering.admin
1281 * @param[in] tethering The client handle
1282 * @param[out] custom_port_filtering_list list of custom port filtering rules
1283 * @return 0 on success, otherwise a negative error value
1284 * @retval #TETHERING_ERROR_NONE Successful
1285 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1286 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1287 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1289 int tethering_wifi_get_custom_port_filtering_rule(tethering_h tethering, void **custom_port_filtering_list);
1292 * @brief Checks whether the port filtering is enabled or not.
1294 * @privlevel platform
1295 * @privilege %http://tizen.org/privilege/tethering.admin
1296 * @param[in] tethering The tethering handle
1297 * @param[out] filtering_enabled @c true if port filtering is enabled, \n @c false if port filtering is disabled
1298 * @return 0 on success, otherwise a negative error value
1299 * @retval #TETHERING_ERROR_NONE Successful
1300 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1301 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1302 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1304 int tethering_wifi_is_port_filtering_enabled(tethering_h tethering, bool* filtering_enabled);
1307 * @brief Sets vpn passthrough rule.
1309 * @privlevel platform
1310 * @privilege %http://tizen.org/privilege/tethering.admin
1311 * @details Set vpn passthrough rule.
1312 * @param[in] tethering The handle of tethering
1313 * @param[in] type vpn passthrough type
1314 * @param[in] enable @c true if vpn passthrough is enabled, \n @c false if vpn passthrough is disabled
1315 * @return 0 on success, otherwise negative error value.
1316 * @retval #TETHERING_ERROR_NONE Successful
1317 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1318 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1319 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1321 int tethering_wifi_set_vpn_passthrough_rule(tethering_h tethering, tethering_vpn_passthrough_type_e type, bool enable);
1329 * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
1334 * @brief Clones the handle of a client.
1336 * @privlevel platform
1337 * @privilege %http://tizen.org/privilege/tethering.admin
1338 * @remarks @a dest must be release using tethering_client_destroy().
1339 * @param[out] dest The cloned client handle
1340 * @param[in] origin The origin client handle
1341 * @return 0 on success, otherwise a negative error value
1342 * @retval #TETHERING_ERROR_NONE Successful
1343 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1344 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1345 * @see tethering_client_destroy()
1347 int tethering_client_clone(tethering_client_h *dest, tethering_client_h origin);
1350 * @brief Destroys the handle of a client.
1352 * @privlevel platform
1353 * @privilege %http://tizen.org/privilege/tethering.admin
1354 * @param[in] client The client handle
1355 * @return 0 on success, otherwise a negative error value
1356 * @retval #TETHERING_ERROR_NONE Successful
1357 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1358 * @see tethering_client_clone()
1360 int tethering_client_destroy(tethering_client_h client);
1363 * @brief Gets the tethering type of client.
1365 * @privlevel platform
1366 * @privilege %http://tizen.org/privilege/tethering.admin
1367 * @param[in] client The handle of client
1368 * @param[out] type The type of tethering
1369 * @return 0 on success, otherwise a negative error value.
1370 * @retval #TETHERING_ERROR_NONE Successful
1371 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1372 * @see tethering_usb_get_connected_client()
1373 * @see tethering_connection_state_changed_cb()
1375 int tethering_client_get_tethering_type(tethering_client_h client, tethering_type_e *type);
1378 * @brief Gets the name of a client.
1380 * @privlevel platform
1381 * @privilege %http://tizen.org/privilege/tethering.admin
1382 * @remarks @a name must be released using free().
1383 * @param[in] client The client handle
1384 * @param[out] name The name of the client
1385 * @return 0 on success, otherwise a negative error value
1386 * @retval #TETHERING_ERROR_NONE Successful
1387 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1388 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1389 * @see tethering_usb_get_connected_client()
1390 * @see tethering_connection_state_changed_cb()
1392 int tethering_client_get_name(tethering_client_h client, char **name);
1395 * @brief Gets the IP address of a client.
1397 * @privlevel platform
1398 * @privilege %http://tizen.org/privilege/tethering.admin
1399 * @remarks @a ip_address must be released using free().
1400 * @param[in] client The client handle
1401 * @param[in] address_family The address family of IP address. Currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported
1402 * @param[out] ip_address The IP address
1403 * @return 0 on success, otherwise a negative error value
1404 * @retval #TETHERING_ERROR_NONE Successful
1405 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1406 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1407 * @see tethering_usb_get_connected_client()
1408 * @see tethering_connection_state_changed_cb()
1410 int tethering_client_get_ip_address(tethering_client_h client, tethering_address_family_e address_family, char **ip_address);
1413 * @brief Gets the MAC address of a client such as "FC:A1:3E:D6:B1:B1".
1415 * @privlevel platform
1416 * @privilege %http://tizen.org/privilege/tethering.admin
1417 * @remarks @a mac_address must be released using free().
1418 * @param[in] client The client handle
1419 * @param[out] mac_address The MAC address
1420 * @return 0 on success, otherwise a negative error value
1421 * @retval #TETHERING_ERROR_NONE Successful
1422 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1423 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1424 * @see tethering_usb_get_connected_client()
1425 * @see tethering_connection_state_changed_cb()
1427 int tethering_client_get_mac_address(tethering_client_h client, char **mac_address);
1430 * @brief Gets the connection time of a client.
1432 * @privlevel platform
1433 * @privilege %http://tizen.org/privilege/tethering.admin
1434 * @param[in] client The client handle
1435 * @param[out] time The connected time of the client
1436 * @return 0 on success, otherwise a negative error value
1437 * @retval #TETHERING_ERROR_NONE Successful
1438 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1439 * @see tethering_usb_get_connected_client()
1440 * @see tethering_connection_state_changed_cb()
1442 int tethering_client_get_time(tethering_client_h client, time_t *timestamp);
1453 #endif /* __TIZEN_NETWORK_TETHERING_H__ */