2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __TIZEN_NETWORK_TETHERING_H__
18 #define __TIZEN_NETWORK_TETHERING_H__
32 * @addtogroup CAPI_NETWORK_TETHERING_MANAGER_MODULE
37 * @brief The tethering handle.
40 typedef void * tethering_h;
43 * @brief Enumeration for the tethering.
47 TETHERING_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
48 TETHERING_ERROR_NOT_PERMITTED = TIZEN_ERROR_NOT_PERMITTED, /**< Operation not permitted */
49 TETHERING_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
50 TETHERING_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
51 TETHERING_ERROR_RESOURCE_BUSY = TIZEN_ERROR_RESOURCE_BUSY, /**< Resource busy */
52 TETHERING_ERROR_NOT_ENABLED = TIZEN_ERROR_TETHERING | 0x0501, /**< Not enabled */
53 TETHERING_ERROR_OPERATION_FAILED = TIZEN_ERROR_TETHERING | 0x0502, /**< Operation failed */
54 TETHERING_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid operation */
55 TETHERING_ERROR_NOT_SUPPORT_API = TIZEN_ERROR_NOT_SUPPORTED, /**< API is not supported */
56 TETHERING_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
60 * @brief Enumeration for the type of tethering.
64 TETHERING_TYPE_ALL = 0, /**< All type */
65 TETHERING_TYPE_USB, /**< USB type */
66 TETHERING_TYPE_WIFI, /**< Wi-Fi type */
67 TETHERING_TYPE_BT, /**< BT type */
68 TETHERING_TYPE_P2P, /**< P2P type */
72 * @brief Enumeration for the cause of disabling the tethering.
76 TETHERING_DISABLED_BY_USB_DISCONNECTION = 0, /**< Disabled due to usb disconnection */
77 TETHERING_DISABLED_BY_FLIGHT_MODE, /**< Disabled due to flight mode */
78 TETHERING_DISABLED_BY_LOW_BATTERY, /**< Disabled due to low battery */
79 TETHERING_DISABLED_BY_NETWORK_CLOSE, /**< Disabled due to pdp network close */
80 TETHERING_DISABLED_BY_TIMEOUT, /**< Disabled due to timeout */
81 TETHERING_DISABLED_BY_OTHERS, /**< Disabled by other apps */
82 TETHERING_DISABLED_BY_REQUEST, /**< Disabled by your request */
83 TETHERING_DISABLED_BY_WIFI_ON, /**< Disabled due to Wi-Fi on */
84 TETHERING_DISABLED_BY_BT_OFF, /**< Disabled due to Bluetooth off */
85 } tethering_disabled_cause_e;
93 * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
98 * @brief Enumeration for the Wi-Fi security.
102 TETHERING_WIFI_SECURITY_TYPE_NONE = 0, /**< No Security type */
103 TETHERING_WIFI_SECURITY_TYPE_WPA2_PSK, /**< WPA2_PSK */
104 TETHERING_WIFI_SECURITY_TYPE_WPS, /**< WPA2_PSK */
105 TETHERING_WIFI_SECURITY_TYPE_SAE, /**< SAE */
106 } tethering_wifi_security_type_e;
109 * @brief Enumeration for the Wi-Fi mode
113 TETHERING_WIFI_MODE_TYPE_B = 0, /**< mode b */
114 TETHERING_WIFI_MODE_TYPE_G, /**< mode g */
115 TETHERING_WIFI_MODE_TYPE_A, /**< mode a */
116 TETHERING_WIFI_MODE_TYPE_AD, /**< mode ad */
117 } tethering_wifi_mode_type_e;
120 TETHERING_TYPE_IPSEC_PASSTHROUGH = 0, /**< IPSEC */
121 TETHERING_TYPE_PPTP_PASSTHROUGH, /**< PPTP type */
122 TETHERING_TYPE_L2TP_PASSTHROUGH, /**< L2TP type */
123 } tethering_vpn_passthrough_type_e;
131 * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
136 * @brief The tethering client handle.
139 typedef void * tethering_client_h;
142 * @brief Enumeration for address family.
146 TETHERING_ADDRESS_FAMILY_IPV4 = 0, /**< IPV4 Address type */
147 TETHERING_ADDRESS_FAMILY_IPV6 = 1, /**< IPV6 Address type (Since 4.0) */
148 } tethering_address_family_e;
156 * @addtogroup CAPI_NETWORK_TETHERING_MANAGER_MODULE
161 * @brief Called when the tethering is enabled.
163 * @param[in] result The result of enabling the tethering
164 * @param[in] type The tethering type
165 * @param[in] is_requested Indicates whether this change is requested
166 * @param[in] user_data The user data passed from tethering_set_enabled_cb()
167 * @pre If you register callback function using tethering_set_enabled_cb(), this will be invoked when the tethering is enabled.
168 * @see tethering_enable()
169 * @see tethering_unset_enabled_cb()
171 typedef void (*tethering_enabled_cb)(tethering_error_e result, tethering_type_e type, bool is_requested, void *user_data);
174 * @brief Called when the tethering is disabled.
176 * @param[in] result The result of disabling the tethering
177 * @param[in] type The tethering type
178 * @param[in] cause The cause of disabling
179 * @param[in] user_data The user data passed from tethering_set_disabled_cb()
180 * @pre If you register callback function using tethering_set_disabled_cb(), this will be invoked when the tethering is disabled.
181 * @see tethering_set_disabled_cb()
182 * @see tethering_unset_disabled_cb()
184 typedef void (*tethering_disabled_cb)(tethering_error_e result, tethering_type_e type, tethering_disabled_cause_e cause, void *user_data);
187 * @brief Called when the connection state is changed.
189 * @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().
190 * @param[in] client The client of which connection state is changed
191 * @param[in] opened @c true when connection is opened, otherwise false
192 * @param[in] user_data The user data passed from tethering_set_connection_state_changed_cb()
193 * @pre If you register callback function using tethering_set_connection_state_changed_cb(), this will be invoked when the connection state is changed.
194 * @see tethering_set_connection_state_changed_cb()
195 * @see tethering_unset_connection_state_changed_cb()
197 typedef void (*tethering_connection_state_changed_cb)(tethering_client_h client, bool opened, void *user_data);
200 * @brief Called when you get the connected client repeatedly.
202 * @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().
203 * @param[in] client The connected client
204 * @param[in] user_data The user data passed from the request function
205 * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
206 * @pre tethering_foreach_connected_clients() will invoke this callback.
207 * @see tethering_foreach_connected_clients()
209 typedef bool(*tethering_connected_client_cb)(tethering_client_h client, void *user_data);
212 * @brief Called when you get the data usage.
214 * @param[in] result The result of getting the data usage
215 * @param[in] received_data The usage of received data
216 * @param[in] sent_data The usage of sent data
217 * @param[in] user_data The user data passed from the request function
218 * @pre tethering_get_data_usage() will invoked this callback.
220 typedef void (*tethering_data_usage_cb)(tethering_error_e result, unsigned long long received_data, unsigned long long sent_data, void *user_data);
223 * @brief Called when the security type of Wi-Fi tethering is changed.
225 * @param[in] changed_type The changed security type of Wi-Fi tethering
226 * @param[in] user_data The user data passed from the register function
227 * @see tethering_wifi_set_security_type_changed_cb()
228 * @see tethering_wifi_unset_security_type_changed_cb()
230 typedef void (*tethering_wifi_security_type_changed_cb)(tethering_wifi_security_type_e changed_type, void *user_data);
233 * @brief Called when the visibility of SSID is changed.
235 * @param[in] changed_visible The changed visibility of SSID
236 * @param[in] user_data The user data passed from the register function
237 * @see tethering_wifi_set_ssid_visibility_changed_cb()
238 * @see tethering_wifi_unset_ssid_visibility_changed_cb()
240 typedef void (*tethering_wifi_ssid_visibility_changed_cb)(bool changed_visible, void *user_data);
243 * @brief Called when the passphrase of Wi-Fi tethering is changed.
245 * @param[in] user_data The user data passed from the register function
246 * @see tethering_wifi_set_passphrase_changed_cb()
247 * @see tethering_wifi_unset_passphrase_changed_cb()
249 typedef void (*tethering_wifi_passphrase_changed_cb)(void *user_data);
252 * @brief Called when the settings are reloaded.
254 * @param[in] result The result of reloading the settings
255 * @param[in] user_data The user data passed from the request function
256 * @pre tethering_wifi_reload_settings() will invoke this callback.
258 typedef void (*tethering_wifi_settings_reloaded_cb)(tethering_error_e result, void *user_data);
261 * @brief Creates the handle for tethering.
263 * @privlevel platform
264 * @privilege %http://tizen.org/privilege/tethering.admin
265 * @remarks The @a tethering must be released using tethering_destroy().
266 * @param[out] tethering A handle of a new mobile ap handle on success
267 * @return 0 on success, otherwise a negative error value
268 * @retval #TETHERING_ERROR_NONE Successful
269 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
270 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
271 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API is not supported
272 * @see tethering_destroy()
274 int tethering_create(tethering_h *tethering);
277 * @brief Destroys the handle for tethering.
279 * @privlevel platform
280 * @privilege %http://tizen.org/privilege/tethering.admin
281 * @param[in] tethering The tethering handle
282 * @return 0 on success, otherwise a negative error value
283 * @retval #TETHERING_ERROR_NONE Successful
284 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
285 * @see tethering_create()
287 int tethering_destroy(tethering_h tethering);
290 * @brief Enables the tethering, asynchronously.
292 * @privlevel platform
293 * @privilege %http://tizen.org/privilege/tethering.admin
294 * @param[in] tethering The tethering handle
295 * @param[in] type The tethering type
296 * @return 0 on success, otherwise negative error value
297 * @retval #TETHERING_ERROR_NONE Successful
298 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
299 * @post tethering_enabled_cb() will be invoked.
300 * @see tethering_is_enabled()
301 * @see tethering_disable()
303 int tethering_enable(tethering_h tethering, tethering_type_e type);
306 * @brief Disables the tethering, asynchronously.
308 * @privlevel platform
309 * @privilege %http://tizen.org/privilege/tethering.admin
310 * @param[in] tethering The tethering handle
311 * @param[in] type The tethering type
312 * @return 0 on success, otherwise negative error value
313 * @retval #TETHERING_ERROR_NONE Successful
314 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
315 * @post tethering_disabled_cb() will be invoked.
316 * @see tethering_is_enabled()
317 * @see tethering_enable()
319 int tethering_disable(tethering_h tethering, tethering_type_e type);
322 * @brief Enables the IPv6 tethering, asynchronously.
324 * @privlevel platform
325 * @privilege %http://tizen.org/privilege/tethering.admin
326 * @remarks It supports Wi-Fi tethering and BT tethering only.
327 * @param[in] tethering The tethering handle
328 * @param[in] type The tethering type
329 * @return 0 on success, otherwise negative error value
330 * @retval #TETHERING_ERROR_NONE Successful
331 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
332 * @post tethering_enabled_cb() will be invoked.
333 * @see tethering_is_enabled()
334 * @see tethering_ipv6_disable()
336 int tethering_ipv6_enable(tethering_h tethering, tethering_type_e type);
339 * @brief Disables the IPv6 tethering, asynchronously.
341 * @privlevel platform
342 * @privilege %http://tizen.org/privilege/tethering.admin
343 * @remarks It supports Wi-Fi tethering and BT tethering only.
344 * @param[in] tethering The tethering handle
345 * @param[in] type The tethering type
346 * @return 0 on success, otherwise negative error value
347 * @retval #TETHERING_ERROR_NONE Successful
348 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
349 * @post tethering_disabled_cb() will be invoked.
350 * @see tethering_is_enabled()
351 * @see tethering_ipv6_enable()
353 int tethering_ipv6_disable(tethering_h tethering, tethering_type_e type);
356 * @brief Checks whether the tethering is enabled or not.
358 * @privlevel platform
359 * @privilege %http://tizen.org/privilege/tethering.admin
360 * @param[in] tethering The tethering handle
361 * @param[in] type The tethering type
362 * @return @c true if tethering is enabled, \n @c false if tethering is disabled
364 bool tethering_is_enabled(tethering_h tethering, tethering_type_e type);
367 * @brief Gets the MAC address of local device as "FC:A1:3E:D6:B1:B1".
369 * @privlevel platform
370 * @privilege %http://tizen.org/privilege/tethering.admin
371 * @remarks @a mac_address must be released using free().
372 * @param[in] tethering The tethering handle
373 * @param[in] type The tethering type
374 * @param[out] mac_address The MAC address
375 * @return 0 on success, otherwise a negative error value
376 * @retval #TETHERING_ERROR_NONE Successful
377 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
378 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
379 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
380 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
381 * @pre The tethering must be enabled.
382 * @see tethering_is_enabled()
383 * @see tethering_enable()
385 int tethering_get_mac_address(tethering_h tethering, tethering_type_e type, char **mac_address);
388 * @brief Gets the name of network interface (e.g. usb0).
390 * @privlevel platform
391 * @privilege %http://tizen.org/privilege/tethering.admin
392 * @remarks @a interface_name must be released using free().
393 * @param[in] tethering The tethering handle
394 * @param[in] type The tethering type
395 * @param[out] interface_name The name of the network interface
396 * @return 0 on success, otherwise negative error value
397 * @retval #TETHERING_ERROR_NONE Successful
398 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
399 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
400 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
401 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
402 * @pre The tethering must be enabled.
403 * @see tethering_is_enabled()
404 * @see tethering_enable()
406 int tethering_get_network_interface_name(tethering_h tethering, tethering_type_e type, char **interface_name);
409 * @brief Gets the local IP address.
411 * @privlevel platform
412 * @privilege %http://tizen.org/privilege/tethering.admin
413 * @remarks @a ip_address must be released using free().
414 * @param[in] tethering The tethering handle
415 * @param[in] type The tethering type
416 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
417 * @param[out] ip_address The local IP address
418 * @return 0 on success, otherwise negative error value
419 * @retval #TETHERING_ERROR_NONE Successful
420 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
421 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
422 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
423 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
424 * @pre The tethering must be enabled.
425 * @see tethering_is_enabled()
426 * @see tethering_enable()
428 int tethering_get_ip_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **ip_address);
431 * @brief Gets the Gateway address.
433 * @privlevel platform
434 * @privilege %http://tizen.org/privilege/tethering.admin
435 * @remarks @a gateway_address must be released using free().
436 * @param[in] tethering The tethering handle
437 * @param[in] type The tethering type
438 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
439 * @param[out] gateway_address The local IP address
440 * @return 0 on success, otherwise negative error value
441 * @retval #TETHERING_ERROR_NONE Successful
442 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
443 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
444 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
445 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
446 * @pre The tethering must be enabled.
447 * @see tethering_is_enabled()
448 * @see tethering_enable()
450 int tethering_get_gateway_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **gateway_address);
453 * @brief Gets the Subnet Mask.
455 * @privlevel platform
456 * @privilege %http://tizen.org/privilege/tethering.admin
457 * @remarks @a subnet_mask must be released using free().
458 * @param[in] tethering The tethering handle
459 * @param[in] type The tethering type
460 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
461 * @param[out] subnet_mask The local IP address
462 * @return 0 on success, otherwise negative error value
463 * @retval #TETHERING_ERROR_NONE Successful
464 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
465 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
466 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
467 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
468 * @pre The tethering must be enabled.
469 * @see tethering_is_enabled()
470 * @see tethering_enable()
472 int tethering_get_subnet_mask(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **subnet_mask);
475 * @brief Gets the data usage.
477 * @privlevel platform
478 * @privilege %http://tizen.org/privilege/tethering.admin
479 * @param[in] tethering The tethering handle
480 * @param[out] usage The data usage
481 * @return 0 on success, otherwise negative error value
482 * @retval #TETHERING_ERROR_NONE Successful
483 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
484 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
485 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
486 * @pre The tethering must be enabled.
487 * @see tethering_is_enabled()
488 * @see tethering_enable()
490 int tethering_get_data_usage(tethering_h tethering, tethering_data_usage_cb callback, void *user_data);
493 * @brief Gets the clients which are connected.
495 * @privlevel platform
496 * @privilege %http://tizen.org/privilege/tethering.admin
497 * @param[in] tethering The tethering handle
498 * @param[in] type The tethering type
499 * @param[in] callback The callback function to invoke
500 * @param[in] user_data The user data to be passed to the callback function
501 * @retval #TETHERING_ERROR_NONE Successful
502 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
503 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
504 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
505 * @pre The tethering must be enabled.
506 * @see tethering_is_enabled()
507 * @see tethering_enable()
509 int tethering_foreach_connected_clients(tethering_h tethering, tethering_type_e type, tethering_connected_client_cb callback, void *user_data);
512 * @brief Registers the callback function, which is called when tethering is enabled.
514 * @privlevel platform
515 * @privilege %http://tizen.org/privilege/tethering.admin
516 * @param[in] tethering The tethering handle
517 * @param[in] type The tethering type
518 * @param[in] callback The callback function to invoke
519 * @param[in] user_data The user data to be passed to the callback function
520 * @retval #TETHERING_ERROR_NONE Successful
521 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
522 * @see tethering_unset_enabled_cb()
524 int tethering_set_enabled_cb(tethering_h tethering, tethering_type_e type, tethering_enabled_cb callback, void *user_data);
527 * @brief Unregisters the callback function, which is called when tethering is enabled.
529 * @privlevel platform
530 * @privilege %http://tizen.org/privilege/tethering.admin
531 * @param[in] tethering The tethering handle
532 * @param[in] type The tethering type
533 * @retval #TETHERING_ERROR_NONE Successful
534 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
535 * @see tethering_set_enabled_cb()
537 int tethering_unset_enabled_cb(tethering_h tethering, tethering_type_e type);
540 * @brief Registers the callback function called when tethering is disabled.
542 * @privlevel platform
543 * @privilege %http://tizen.org/privilege/tethering.admin
544 * @param[in] tethering The tethering handle
545 * @param[in] type The tethering type
546 * @param[in] callback The callback function to invoke
547 * @param[in] user_data The user data to be passed to the callback function
548 * @retval #TETHERING_ERROR_NONE Successful
549 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
550 * @see tethering_unset_disabled_cb()
552 int tethering_set_disabled_cb(tethering_h tethering, tethering_type_e type, tethering_disabled_cb callback, void *user_data);
555 * @brief Unregisters the callback function, which is called when tethering is disabled.
557 * @privlevel platform
558 * @privilege %http://tizen.org/privilege/tethering.admin
559 * @param[in] tethering The tethering handle
560 * @param[in] type The tethering type
561 * @retval #TETHERING_ERROR_NONE Successful
562 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
563 * @see tethering_set_disabled_cb()
565 int tethering_unset_disabled_cb(tethering_h tethering, tethering_type_e type);
568 * @brief Registers the callback function, which is called when the state of connection is changed.
570 * @privlevel platform
571 * @privilege %http://tizen.org/privilege/tethering.admin
572 * @param[in] tethering The tethering handle
573 * @param[in] type The tethering type
574 * @param[in] callback The callback function to invoke
575 * @param[in] user_data The user data to be passed to the callback function
576 * @retval #TETHERING_ERROR_NONE Successful
577 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
578 * @see tethering_unset_connection_state_changed_cb_cb()
580 int tethering_set_connection_state_changed_cb(tethering_h tethering, tethering_type_e type, tethering_connection_state_changed_cb callback, void *user_data);
583 * @brief Unregisters the callback function, which is called when the state of connection is changed.
585 * @privlevel platform
586 * @privilege %http://tizen.org/privilege/tethering.admin
587 * @param[in] tethering The tethering handle
588 * @param[in] type The tethering type
589 * @retval #TETHERING_ERROR_NONE Successful
590 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
591 * @see tethering_set_connection_state_changed_cb()
593 int tethering_unset_connection_state_changed_cb(tethering_h tethering, tethering_type_e type);
596 * @brief Registers the callback function, which is called when the security type of Wi-Fi tethering is changed.
598 * @privlevel platform
599 * @privilege %http://tizen.org/privilege/tethering.admin
600 * @param[in] tethering The tethering handle
601 * @param[in] callback The callback function to invoke
602 * @param[in] user_data The user data to be passed to the callback function
603 * @retval #TETHERING_ERROR_NONE Successful
604 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
605 * @see tethering_wifi_unset_security_type_changed_cb()
607 int tethering_wifi_set_security_type_changed_cb(tethering_h tethering, tethering_wifi_security_type_changed_cb callback, void *user_data);
610 * @brief Unregisters the callback function, which is called when the security type of Wi-Fi tethering is changed.
612 * @privlevel platform
613 * @privilege %http://tizen.org/privilege/tethering.admin
614 * @param[in] tethering The tethering handle
615 * @param[in] type The tethering type
616 * @retval #TETHERING_ERROR_NONE Successful
617 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
618 * @see tethering_wifi_set_security_type_changed_cb()
620 int tethering_wifi_unset_security_type_changed_cb(tethering_h tethering);
623 * @brief Registers the callback function , which iscalled when the visibility of SSID is changed.
625 * @privlevel platform
626 * @privilege %http://tizen.org/privilege/tethering.admin
627 * @param[in] tethering The tethering handle
628 * @param[in] callback The callback function to invoke
629 * @param[in] user_data The user data to be passed to the callback function
630 * @retval #TETHERING_ERROR_NONE Successful
631 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
632 * @see tethering_wifi_unset_ssid_visibility_changed_cb_cb()
634 int tethering_wifi_set_ssid_visibility_changed_cb(tethering_h tethering, tethering_wifi_ssid_visibility_changed_cb callback, void *user_data);
637 * @brief Unregisters the callback function, which is called when the visibility of SSID is changed.
639 * @privlevel platform
640 * @privilege %http://tizen.org/privilege/tethering.admin
641 * @param[in] tethering The tethering handle
642 * @retval #TETHERING_ERROR_NONE Successful
643 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
644 * @see tethering_wifi_set_ssid_visibility_changed_cb()
646 int tethering_wifi_unset_ssid_visibility_changed_cb(tethering_h tethering);
649 * @brief Registers the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
651 * @privlevel platform
652 * @privilege %http://tizen.org/privilege/tethering.admin
653 * @param[in] tethering The tethering handle
654 * @param[in] callback The callback function to invoke
655 * @param[in] user_data The user data to be passed to the callback function
656 * @retval #TETHERING_ERROR_NONE Successful
657 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
658 * @see tethering_wifi_unset_passphrase_changed_cb()
660 int tethering_wifi_set_passphrase_changed_cb(tethering_h tethering, tethering_wifi_passphrase_changed_cb callback, void *user_data);
663 * @brief Unregisters the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
665 * @privlevel platform
666 * @privilege %http://tizen.org/privilege/tethering.admin
667 * @param[in] tethering The tethering handle
668 * @retval #TETHERING_ERROR_NONE Successful
669 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
670 * @see tethering_wifi_set_passphrase_changed_cb()
672 int tethering_wifi_unset_passphrase_changed_cb(tethering_h tethering);
680 * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
685 * @brief Sets the security type of Wi-Fi tethering.
687 * @privlevel platform
688 * @privilege %http://tizen.org/privilege/tethering.admin
689 * @remarks This change is applied next time Wi-Fi tethering is enabled.
690 * @param[in] tethering The tethering handle
691 * @param[in] type The security type
692 * @return 0 on success, otherwise negative error value
693 * @retval #TETHERING_ERROR_NONE Successful
694 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
695 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
696 * @see tethering_wifi_get_security_type()
698 int tethering_wifi_set_security_type(tethering_h tethering, tethering_wifi_security_type_e type);
701 * @brief Gets the security type of Wi-Fi tethering.
703 * @privlevel platform
704 * @privilege %http://tizen.org/privilege/tethering.admin
705 * @param[in] tethering The tethering handle
706 * @param[out] type The security type
707 * @return 0 on success, otherwise negative error value
708 * @retval #TETHERING_ERROR_NONE Successful
709 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
710 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
711 * @see tethering_wifi_set_security_type()
713 int tethering_wifi_get_security_type(tethering_h tethering, tethering_wifi_security_type_e *type);
716 * @brief Sets the SSID (service set identifier).
717 * @details The SSID cannot exceed 32 bytes. If SSID is not set, device name is used as SSID.
719 * @privlevel platform
720 * @privilege %http://tizen.org/privilege/tethering.admin
721 * @remarks This change is applied next time Wi-Fi tethering is enabled with same @a tethering handle.
722 * @param[in] tethering The tethering handle
723 * @param[in] ssid The SSID
724 * @return 0 on success, otherwise negative error value
725 * @retval #TETHERING_ERROR_NONE Successful
726 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
727 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
729 int tethering_wifi_set_ssid(tethering_h tethering, const char *ssid);
732 * @brief Gets the SSID (service set identifier).
734 * @privlevel platform
735 * @privilege %http://tizen.org/privilege/tethering.admin
736 * @remarks @a ssid must be released using free().
737 * @param[in] tethering The tethering handle
738 * @param[out] ssid The SSID
739 * @return 0 on success, otherwise negative error value
740 * @retval #TETHERING_ERROR_NONE Successful
741 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
742 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
743 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
745 int tethering_wifi_get_ssid(tethering_h tethering, char **ssid);
748 * @brief Sets the visibility of SSID (service set identifier).
749 * @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.
751 * @privlevel platform
752 * @privilege %http://tizen.org/privilege/tethering.admin
753 * @remarks This change is applied next time Wi-Fi tethering is enabled.
754 * @param[in] tethering The tethering handle
755 * @param[in] visible The visibility of SSID: (@c true = visible, @c false = invisible)
756 * @return 0 on success, otherwise negative error value
757 * @retval #TETHERING_ERROR_NONE Successful
758 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
759 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
760 * @see tethering_wifi_get_ssid_visibility()
762 int tethering_wifi_set_ssid_visibility(tethering_h tethering, bool visible);
765 * @brief Gets the visibility of SSID (service set identifier).
766 * @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.
768 * @privlevel platform
769 * @privilege %http://tizen.org/privilege/tethering.admin
770 * @param[in] tethering The tethering handle
771 * @param[out] visible The visibility of SSID: (@c true = visible, @c false = invisible)
772 * @return 0 on success, otherwise negative error value
773 * @retval #TETHERING_ERROR_NONE Successful
774 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
775 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
776 * @see tethering_wifi_set_ssid_visibility()
778 int tethering_wifi_get_ssid_visibility(tethering_h tethering, bool *visible);
781 * @brief Sets the passphrase.
783 * @privlevel platform
784 * @privilege %http://tizen.org/privilege/tethering.admin
785 * @remarks This change is applied next time Wi-Fi tethering is enabled.
786 * @param[in] tethering The tethering handle
787 * @param[in] passphrase The passphrase
788 * @return 0 on success, otherwise negative error value
789 * @retval #TETHERING_ERROR_NONE Successful
790 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
791 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
792 * @see tethering_wifi_get_passphrase()
794 int tethering_wifi_set_passphrase(tethering_h tethering, const char *passphrase);
797 * @brief Gets the passphrase.
799 * @privlevel platform
800 * @privilege %http://tizen.org/privilege/tethering.admin
801 * @remarks @a passphrase must be released using free().
802 * @param[in] tethering The tethering handle
803 * @param[out] passphrase The passphrase
804 * @return 0 on success, otherwise negative error value
805 * @retval #TETHERING_ERROR_NONE Successful
806 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
807 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
808 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
809 * @see tethering_wifi_set_passphrase()
811 int tethering_wifi_get_passphrase(tethering_h tethering, char **passphrase);
814 * @brief Reloads the settings (SSID / Passphrase / Security type / SSID visibility).
816 * @privlevel platform
817 * @privilege %http://tizen.org/privilege/tethering.admin
818 * @remarks Connected devices via Wi-Fi tethering or MobileAP will be disconnected when the settings are reloaded.
819 * @param[in] tethering The tethering handle
820 * @param[in] callback The callback function to invoke
821 * @param[in] user_data The user data to be passed to the callback function
822 * @return 0 on success, otherwise negative error value
823 * @retval #TETHERING_ERROR_NONE Successful
824 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
825 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
827 int tethering_wifi_reload_settings(tethering_h tethering, tethering_wifi_settings_reloaded_cb callback, void *user_data);
830 * @brief Gets the mac_filter for Wi-Fi Tethering.
831 * @details If you set the mac_filter to enable, then the device can be allowed/blocked based on mac-address.
832 * By default mac_filter is set to false.
834 * @privlevel platform
835 * @privilege %http://tizen.org/privilege/tethering.admin
836 * @param[in] tethering The handle of tethering
837 * @param[out] mac_filter The mac filter: (@c true = enable, @c false = disable)
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_get_mac_filter(tethering_h tethering, bool *mac_filter);
848 * @brief Sets the mac-filter for Wi-Fi Tethering.
849 * @details If you set the mac_filter to enable, then the device can be allowed/blocked based on mac-address.
850 * By default mac_filter is set to @c false.
852 * @privlevel platform
853 * @privilege %http://tizen.org/privilege/tethering.admin
854 * @remarks This change is applied next time Wi-Fi tethering is enabled.
855 * @param[in] tethering The tethering handle
856 * @param[in] mac_filter The mac filter: (@c true = enable, @c false = disable)
857 * @return 0 on success, otherwise negative error value
858 * @retval #TETHERING_ERROR_NONE Successful
859 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
860 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
861 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
862 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
863 * @see tethering_mobileap_get_mac_filter()
865 int tethering_wifi_set_mac_filter(tethering_h tethering, bool mac_filter);
868 * @brief Adds the mac-address to the allowed client list.
869 * @details AP can allow the client by adding clients mac-address to the allowed list.
871 * @privlevel platform
872 * @privilege %http://tizen.org/privilege/tethering.admin
873 * @param[in] tethering The handle of tethering
874 * @param[in] mac The mac address
875 * @return 0 on success, otherwise negative error value.
876 * @retval #TETHERING_ERROR_NONE Successful
877 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
878 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
879 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
880 * @see tethering_mobileap_set_mac_filter()
882 int tethering_wifi_add_allowed_mac_list(tethering_h tethering, const char *mac);
885 * @brief Removes the mac-address from the allowed client list.
886 * @details Removes the mac-address from the allowed client list.
888 * @privlevel platform
889 * @privilege %http://tizen.org/privilege/tethering.admin
890 * @param[in] tethering The handle of tethering
891 * @param[in] mac The mac address
892 * @return 0 on success, otherwise negative error value.
893 * @retval #TETHERING_ERROR_NONE Successful
894 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
895 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
896 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
897 * @see tethering_mobileap_set_mac_filter()
899 int tethering_wifi_remove_allowed_mac_list(tethering_h tethering, const char *mac);
901 * @brief Gets the mac-addresses from the allowed client list.
902 * @details Gets the mac-addresses from the allowed client list.
904 * @privlevel platform
905 * @privilege %http://tizen.org/privilege/tethering.admin
906 * @param[in] tethering The handle of tethering
907 * @param[out] allowed_mac_list list of allowed mac addresses list
908 * @return 0 on success, otherwise negative error value.
909 * @retval #TETHERING_ERROR_NONE Successful
910 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
911 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
912 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
913 * @see tethering_mobileap_set_mac_filter()
915 int tethering_wifi_get_allowed_mac_list(tethering_h tethering, void **allowed_mac_list);
918 * @brief Adds the mac-address to the blocked(black list) client list.
919 * @details AP can disallow the client by adding clients mac-address to the blocked list.
921 * @privlevel platform
922 * @privilege %http://tizen.org/privilege/tethering.admin
923 * @param[in] tethering The handle of tethering
924 * @param[in] mac The mac address
925 * @return 0 on success, otherwise negative error value.
926 * @retval #TETHERING_ERROR_NONE Successful
927 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
928 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
929 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
930 * @see tethering_mobileap_set_mac_filter()
932 int tethering_wifi_add_blocked_mac_list(tethering_h tethering, const char *mac);
935 * @brief Removes the mac-address from the blocked(black list) client list.
936 * @details Removes the mac-address from the blocked client list.
938 * @privlevel platform
939 * @privilege %http://tizen.org/privilege/tethering.admin
940 * @param[in] tethering The handle of tethering
941 * @param[in] mac The mac address
942 * @return 0 on success, otherwise negative error value.
943 * @retval #TETHERING_ERROR_NONE Successful
944 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
945 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
946 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
947 * @see tethering_mobileap_set_mac_filter()
949 int tethering_wifi_remove_blocked_mac_list(tethering_h tethering, const char *mac);
952 * @brief Gets the mac-addresses from the blocked client list.
953 * @details Get the mac-addresses from the blocked client list.
955 * @privlevel platform
956 * @privilege %http://tizen.org/privilege/tethering.admin
957 * @param[in] tethering The handle of tethering
958 * @param[out] blocked_mac_list list of blocked mac addresses list
959 * @return 0 on success, otherwise negative error value.
960 * @retval #TETHERING_ERROR_NONE Successful
961 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
962 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
963 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
964 * @see tethering_mobileap_set_mac_filter()
966 int tethering_wifi_get_blocked_mac_list(tethering_h tethering, void **blocked_mac_list);
969 * @brief Enables/disables the dhcp server.
971 * @privlevel platform
972 * @privilege %http://tizen.org/privilege/tethering.admin
973 * @details Enable/disable the dhcp server.
974 * @param[in] tethering The handle of tethering
975 * @param[in] enable Enable/disable the dhcp server
976 * @return 0 on success, otherwise negative error value.
977 * @retval #TETHERING_ERROR_NONE Successful
978 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
980 int tethering_wifi_enable_dhcp(tethering_h tethering, bool enable);
983 * @brief Enables the dhcp server with the address range.
985 * @privlevel platform
986 * @privilege %http://tizen.org/privilege/tethering.admin
987 * @details Enable the dhcp server with the address range.
988 * @param[in] tethering The handle of tethering
989 * @param[in] rangestart Start address range
990 * @param[in] rangestop End address range
991 * @return 0 on success, otherwise negative error value.
992 * @retval #TETHERING_ERROR_NONE Successful
993 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
995 int tethering_wifi_set_dhcp_range(tethering_h tethering, char *rangestart, char *rangestop);
998 * @brief Checks whether the dhcp is enabled or not.
1000 * @privlevel platform
1001 * @privilege %http://tizen.org/privilege/tethering.admin
1002 * @param[in] tethering The tethering handle
1003 * @param[out] dhcp_enabled @c true if dhcp is enabled, \n @c false if dhcp is disabled
1004 * @return 0 on success, otherwise a negative error value
1005 * @retval #TETHERING_ERROR_NONE Successful
1006 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1008 int tethering_wifi_is_dhcp_enabled(tethering_h tethering, bool *dhcp_enabled);
1011 * @brief Sets the Channel for Wi-Fi.
1012 * @details The Channel should be in between 1-14. If channel is not set, Wi-Fi sets default channel.
1014 * @privlevel platform
1015 * @privilege %http://tizen.org/privilege/tethering.admin
1016 * @param[in] tethering The tethering handle
1017 * @param[in] channel The channel number
1018 * @return 0 on success, otherwise negative error value
1019 * @retval #TETHERING_ERROR_NONE Successful
1020 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1022 int tethering_wifi_set_channel(tethering_h tethering, int channel);
1025 * @brief Gets the channel for Wi-Fi.
1026 * @details If channel is not set, Wi-Fi gets default channel.
1028 * @privlevel platform
1029 * @privilege %http://tizen.org/privilege/tethering.admin
1030 * @param[in] tethering The tethering handle
1031 * @param[out] channel The channel number
1032 * @return 0 on success, otherwise negative error value
1033 * @retval #TETHERING_ERROR_NONE Successful
1034 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1035 * @see tethering_wifi_set_channel()
1037 int tethering_wifi_get_channel(tethering_h tethering, int *channel);
1040 * @brief Sets the mode for Wi-Fi.
1041 * @details The mobile AP mode (ex: b only, g only, ad, a). If mode is not set, Wi-Fi sets default mode.
1043 * @privlevel platform
1044 * @privilege %http://tizen.org/privilege/tethering.admin
1045 * @param[in] tethering The tethering handle
1046 * @param[in] type The mobile AP mode
1047 * @return 0 on success, otherwise negative error value
1048 * @retval #TETHERING_ERROR_NONE Successful
1049 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1051 int tethering_wifi_set_mode(tethering_h tethering, tethering_wifi_mode_type_e type);
1054 * @brief Gets the mode for Wi-Fi.
1055 * @details If the mode is not set, Wi-Fi gets default mode.
1057 * @privlevel platform
1058 * @privilege %http://tizen.org/privilege/tethering.admin
1059 * @remarks @a mode must be released using free().
1060 * @param[in] tethering The tethering handle
1061 * @param[out] type The mode of Wi-Fi tethering
1062 * @return 0 on success, otherwise negative error value
1063 * @retval #TETHERING_ERROR_NONE Successful
1064 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1065 * @see tethering_wifi_set_mode()
1067 int tethering_wifi_get_mode(tethering_h tethering, tethering_wifi_mode_type_e *type);
1070 * @brief Sets txpower for Wi-Fi tethering.
1072 * @privlevel platform
1073 * @privilege http://tizen.org/privilege/tethering.admin
1074 * @param[in] tethering The tethering handle
1075 * @param[in] txpower value of txpower to be set
1076 * @return 0 on success, otherwise a negative error value
1077 * @retval #TETHERING_ERROR_NONE Successful
1078 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1079 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1080 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1081 * @see tethering_wifi_get_txpower()
1083 int tethering_wifi_set_txpower(tethering_h tethering, unsigned int txpower);
1086 * @brief Gets txpower for Wi-Fi tethering.
1088 * @privlevel platform
1089 * @privilege http://tizen.org/privilege/tethering.admin
1090 * @param[in] tethering The tethering handle
1091 * @param[out] txpower value of txpower
1092 * @return 0 on success, otherwise a negative error value
1093 * @retval #TETHERING_ERROR_NONE Successful
1094 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1095 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1096 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1097 * @see tethering_wifi_set_txpower()
1099 int tethering_wifi_get_txpower(tethering_h tethering, unsigned int *txpower);
1102 * @brief Sets mtu for Wi-Fi tethering.
1104 * @privlevel platform
1105 * @privilege %http://tizen.org/privilege/tethering.admin
1106 * @param[in] tethering The tethering handle
1107 * @param[in] mtu value of mtu to be set
1108 * @return 0 on success, otherwise a negative error value
1109 * @retval #TETHERING_ERROR_NONE Successful
1110 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1111 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1112 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1114 int tethering_wifi_set_mtu(tethering_h tethering, unsigned int mtu);
1117 * @brief Changes mac address for Wi-Fi tethering.
1119 * @privlevel platform
1120 * @privilege %http://tizen.org/privilege/tethering.admin
1121 * @param[in] tethering The client handle
1122 * @param[in] mac The mac address
1123 * @return 0 on success, otherwise a negative error value
1124 * @retval #TETHERING_ERROR_NONE Successful
1125 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1126 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1127 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1129 int tethering_wifi_change_mac(tethering_h tethering, char *mac);
1132 * @brief Sets max connected devices for Wi-Fi tethering.
1134 * @privlevel platform
1135 * @privilege %http://tizen.org/privilege/tethering.admin
1136 * @param[in] tethering The client handle
1137 * @param[in] max_device value of max_device to be set
1138 * @return 0 on success, otherwise a negative error value
1139 * @retval #TETHERING_ERROR_NONE Successful
1140 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1141 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1142 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1143 * @see tethering_wifi_get_max_connected_device()
1145 int tethering_wifi_set_max_connected_device(tethering_h tethering, int max_device);
1148 * @brief Gets max connected devices for Wi-Fi tethering.
1150 * @privlevel platform
1151 * @privilege %http://tizen.org/privilege/tethering.admin
1152 * @param[in] tethering The client handle
1153 * @param[out] max_device value of max_device
1154 * @return 0 on success, otherwise a negative error value
1155 * @retval #TETHERING_ERROR_NONE Successful
1156 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1157 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1158 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1159 * @see tethering_wifi_set_max_connected_device()
1161 int tethering_wifi_get_max_connected_device(tethering_h tethering, int *max_device);
1164 * @brief Enables port forwarding feature.
1166 * @privlevel platform
1167 * @privilege %http://tizen.org/privilege/tethering.admin
1168 * @details enable/disable port forwarding feature.
1169 * @param[in] tethering The handle of tethering
1170 * @param[in] enable Enable/Disable port forwarding
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_enable_port_forwarding(tethering_h tethering, bool enable);
1180 * @brief Sets port forwarding rule.
1182 * @privlevel platform
1183 * @privilege %http://tizen.org/privilege/tethering.admin
1184 * @details Set port forwarding rule.
1185 * @param[in] tethering The handle of tethering
1186 * @param[in] ifname interface name
1187 * @param[in] protocol protocol (tcp/udp)
1188 * @param[in] org_ip original destination ip where packet was meant to sent
1189 * @param[in] org_port original destination port where packet was meant to sent
1190 * @param[in] final_ip new destination ip where packet will be forwarded
1191 * @param[in] final_port new destination port where packet will be forwarded
1192 * @return 0 on success, otherwise negative error value.
1193 * @retval #TETHERING_ERROR_NONE Successful
1194 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1195 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1196 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1198 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);
1201 * @brief Resets port forwarding rule.
1203 * @privlevel platform
1204 * @privilege %http://tizen.org/privilege/tethering.admin
1205 * @details Reset port forwarding rule.
1206 * @param[in] tethering The handle of tethering
1207 * @return 0 on success, otherwise negative error value.
1208 * @retval #TETHERING_ERROR_NONE Successful
1209 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1210 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1211 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1213 int tethering_wifi_reset_port_forwarding_rule(tethering_h tethering);
1216 * @brief Checks whether the port forwarding is enabled or not.
1218 * @privlevel platform
1219 * @privilege %http://tizen.org/privilege/tethering.admin
1220 * @param[in] tethering The tethering handle
1221 * @param[out] forwarding_enabled @c true if port forwarding is enabled, \n @c false if port forwarding is disabled
1222 * @return 0 on success, otherwise a negative error value
1223 * @retval #TETHERING_ERROR_NONE Successful
1224 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1225 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1226 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1228 int tethering_wifi_is_port_forwarding_enabled(tethering_h tethering, bool* forwarding_enabled);
1231 * @brief Gets the port forwarding rule for Wi-Fi tethering.
1233 * @privlevel platform
1234 * @privilege %http://tizen.org/privilege/tethering.admin
1235 * @param[in] tethering The client handle
1236 * @param[out] port_forwarding_list list of port forwarding rules
1237 * @return 0 on success, otherwise a negative error value
1238 * @retval #TETHERING_ERROR_NONE Successful
1239 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1240 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1241 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1243 int tethering_wifi_get_port_forwarding_rule(tethering_h tethering, void **port_forwarding_list);
1246 * @brief Enables port filtering feature.
1248 * @privlevel platform
1249 * @privilege %http://tizen.org/privilege/tethering.admin
1250 * @details enable/disable port filtering feature.
1251 * @param[in] tethering The handle of tethering
1252 * @param[in] enable Enable/Disable 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_enable_port_filtering(tethering_h tethering, bool enable);
1262 * @brief Sets port filtering rule.
1264 * @privlevel platform
1265 * @privilege %http://tizen.org/privilege/tethering.admin
1266 * @details Set port filtering rule.
1267 * @param[in] tethering The handle of tethering
1268 * @param[in] port to be filtered
1269 * @param[in] protocol protocol (tcp/udp)
1270 * @param[in] allow allow/disallow port filtering
1271 * @return 0 on success, otherwise negative error value.
1272 * @retval #TETHERING_ERROR_NONE Successful
1273 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1274 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1275 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1277 int tethering_wifi_add_port_filtering_rule(tethering_h tethering, int port, char *protocol, bool allow);
1280 * @brief Sets custom port filtering rule.
1282 * @privlevel platform
1283 * @privilege %http://tizen.org/privilege/tethering.admin
1284 * @details Set custom port filtering rule.
1285 * @param[in] tethering The handle of tethering
1286 * @param[in] port1 to be filtered
1287 * @param[in] port2 to be filtered
1288 * @param[in] protocol protocol (tcp/udp)
1289 * @param[in] allow allow/disallow port filtering
1290 * @return 0 on success, otherwise negative error value.
1291 * @retval #TETHERING_ERROR_NONE Successful
1292 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1293 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1294 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1296 int tethering_wifi_add_custom_port_filtering_rule(tethering_h tethering, int port1, int port2, char *protocol, bool allow);
1299 * @brief Gets the port filtering rule for Wi-Fi tethering.
1301 * @privlevel platform
1302 * @privilege %http://tizen.org/privilege/tethering.admin
1303 * @param[in] tethering The client handle
1304 * @param[out] port_filtering_list list of port filtering rules
1305 * @return 0 on success, otherwise a negative error value
1306 * @retval #TETHERING_ERROR_NONE Successful
1307 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1308 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1309 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1311 int tethering_wifi_get_port_filtering_rule(tethering_h tethering, void **port_filtering_list);
1314 * @brief Gets the custom port filtering rule for Wi-Fi tethering.
1316 * @privlevel platform
1317 * @privilege %http://tizen.org/privilege/tethering.admin
1318 * @param[in] tethering The client handle
1319 * @param[out] custom_port_filtering_list list of custom port filtering rules
1320 * @return 0 on success, otherwise a negative error value
1321 * @retval #TETHERING_ERROR_NONE Successful
1322 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1323 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1324 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1326 int tethering_wifi_get_custom_port_filtering_rule(tethering_h tethering, void **custom_port_filtering_list);
1329 * @brief Checks whether the port filtering is enabled or not.
1331 * @privlevel platform
1332 * @privilege %http://tizen.org/privilege/tethering.admin
1333 * @param[in] tethering The tethering handle
1334 * @param[out] filtering_enabled @c true if port filtering is enabled, \n @c false if port filtering is disabled
1335 * @return 0 on success, otherwise a negative error value
1336 * @retval #TETHERING_ERROR_NONE Successful
1337 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1338 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1339 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1341 int tethering_wifi_is_port_filtering_enabled(tethering_h tethering, bool* filtering_enabled);
1344 * @brief Sets vpn passthrough rule.
1346 * @privlevel platform
1347 * @privilege %http://tizen.org/privilege/tethering.admin
1348 * @details Set vpn passthrough rule.
1349 * @param[in] tethering The handle of tethering
1350 * @param[in] type vpn passthrough type
1351 * @param[in] enable @c true if vpn passthrough is enabled, \n @c false if vpn passthrough is disabled
1352 * @return 0 on success, otherwise negative error value.
1353 * @retval #TETHERING_ERROR_NONE Successful
1354 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1355 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1356 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1358 int tethering_wifi_set_vpn_passthrough_rule(tethering_h tethering, tethering_vpn_passthrough_type_e type, bool enable);
1361 * @brief Pushes the WPS button to connect with Wi-Fi Tethering client. (WPS PBC)
1363 * @remarks The WPS button should be pushed when client tries to connect with Soft AP by using WPS PBC.
1364 * @param[in] tethering The tethering handle
1365 * @return 0 on success, otherwise negative error value
1366 * @retval #TETHERING_ERROR_NONE Successful
1367 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1368 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
1369 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission denied
1370 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
1372 int tethering_wifi_push_wps_button(tethering_h tethering);
1375 * @brief Sets the WPS PIN to connect with Wi-Fi Tethering client. (WPS PIN)
1377 * @remarks The WPS PIN should be inserted when client tries to connect with Soft AP by using WPS PIN.
1378 * @param[in] tethering The tethering handle
1379 * @param[in] wps_pin The WPS PIN
1380 * @return 0 on success, otherwise negative error value
1381 * @retval #TETHERING_ERROR_NONE Successful
1382 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1383 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
1384 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission denied
1385 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
1387 int tethering_wifi_set_wps_pin(tethering_h tethering, const char *wps_pin);
1396 * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
1401 * @brief Clones the handle of a client.
1403 * @privlevel platform
1404 * @privilege %http://tizen.org/privilege/tethering.admin
1405 * @remarks @a dest must be release using tethering_client_destroy().
1406 * @param[out] dest The cloned client handle
1407 * @param[in] origin The origin client handle
1408 * @return 0 on success, otherwise a negative error value
1409 * @retval #TETHERING_ERROR_NONE Successful
1410 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1411 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1412 * @see tethering_client_destroy()
1414 int tethering_client_clone(tethering_client_h *dest, tethering_client_h origin);
1417 * @brief Destroys the handle of a client.
1419 * @privlevel platform
1420 * @privilege %http://tizen.org/privilege/tethering.admin
1421 * @param[in] client The client handle
1422 * @return 0 on success, otherwise a negative error value
1423 * @retval #TETHERING_ERROR_NONE Successful
1424 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1425 * @see tethering_client_clone()
1427 int tethering_client_destroy(tethering_client_h client);
1430 * @brief Gets the tethering type of client.
1432 * @privlevel platform
1433 * @privilege %http://tizen.org/privilege/tethering.admin
1434 * @param[in] client The handle of client
1435 * @param[out] type The type of tethering
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_tethering_type(tethering_client_h client, tethering_type_e *type);
1445 * @brief Gets the name of a client.
1447 * @privlevel platform
1448 * @privilege %http://tizen.org/privilege/tethering.admin
1449 * @remarks @a name must be released using free().
1450 * @param[in] client The client handle
1451 * @param[out] name The name of the client
1452 * @return 0 on success, otherwise a negative error value
1453 * @retval #TETHERING_ERROR_NONE Successful
1454 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1455 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1456 * @see tethering_usb_get_connected_client()
1457 * @see tethering_connection_state_changed_cb()
1459 int tethering_client_get_name(tethering_client_h client, char **name);
1462 * @brief Gets the IP address of a client.
1464 * @privlevel platform
1465 * @privilege %http://tizen.org/privilege/tethering.admin
1466 * @remarks @a ip_address must be released using free().
1467 * @param[in] client The client handle
1468 * @param[in] address_family The address family of IP address. Currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported
1469 * @param[out] ip_address The IP address
1470 * @return 0 on success, otherwise a negative error value
1471 * @retval #TETHERING_ERROR_NONE Successful
1472 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1473 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1474 * @see tethering_usb_get_connected_client()
1475 * @see tethering_connection_state_changed_cb()
1477 int tethering_client_get_ip_address(tethering_client_h client, tethering_address_family_e address_family, char **ip_address);
1480 * @brief Gets the MAC address of a client such as "FC:A1:3E:D6:B1:B1".
1482 * @privlevel platform
1483 * @privilege %http://tizen.org/privilege/tethering.admin
1484 * @remarks @a mac_address must be released using free().
1485 * @param[in] client The client handle
1486 * @param[out] mac_address The MAC address
1487 * @return 0 on success, otherwise a negative error value
1488 * @retval #TETHERING_ERROR_NONE Successful
1489 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1490 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1491 * @see tethering_usb_get_connected_client()
1492 * @see tethering_connection_state_changed_cb()
1494 int tethering_client_get_mac_address(tethering_client_h client, char **mac_address);
1497 * @brief Gets the connection time of a client.
1499 * @privlevel platform
1500 * @privilege %http://tizen.org/privilege/tethering.admin
1501 * @param[in] client The client handle
1502 * @param[out] time The connected time of the client
1503 * @return 0 on success, otherwise a negative error value
1504 * @retval #TETHERING_ERROR_NONE Successful
1505 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1506 * @see tethering_usb_get_connected_client()
1507 * @see tethering_connection_state_changed_cb()
1509 int tethering_client_get_time(tethering_client_h client, time_t *timestamp);
1520 #endif /* __TIZEN_NETWORK_TETHERING_H__ */