2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __TIZEN_NETWORK_TETHERING_H__
18 #define __TIZEN_NETWORK_TETHERING_H__
32 * @addtogroup CAPI_NETWORK_TETHERING_MANAGER_MODULE
37 * @brief The tethering handle.
40 typedef void * tethering_h;
43 * @brief Enumeration for the tethering.
47 TETHERING_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
48 TETHERING_ERROR_NOT_PERMITTED = TIZEN_ERROR_NOT_PERMITTED, /**< Operation not permitted */
49 TETHERING_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
50 TETHERING_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
51 TETHERING_ERROR_RESOURCE_BUSY = TIZEN_ERROR_RESOURCE_BUSY, /**< Resource busy */
52 TETHERING_ERROR_NOT_ENABLED = TIZEN_ERROR_TETHERING | 0x0501, /**< Not enabled */
53 TETHERING_ERROR_OPERATION_FAILED = TIZEN_ERROR_TETHERING | 0x0502, /**< Operation failed */
54 TETHERING_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid operation */
55 TETHERING_ERROR_NOT_SUPPORT_API = TIZEN_ERROR_NOT_SUPPORTED, /**< API is not supported */
56 TETHERING_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
60 * @brief Enumeration for the type of tethering.
64 TETHERING_TYPE_ALL = 0, /**< All type */
65 TETHERING_TYPE_USB, /**< USB type */
66 TETHERING_TYPE_WIFI, /**< Wi-Fi type */
67 TETHERING_TYPE_BT, /**< BT type */
68 TETHERING_TYPE_P2P, /**< P2P type */
69 TETHERING_TYPE_MAX, /**< Maximum */
73 TETHERING_WIFI_BAND_2G = 0,
74 TETHERING_WIFI_BAND_5G,
77 * @brief Enumeration for the cause of disabling the tethering.
81 TETHERING_DISABLED_BY_USB_DISCONNECTION = 0, /**< Disabled due to usb disconnection */
82 TETHERING_DISABLED_BY_FLIGHT_MODE, /**< Disabled due to flight mode */
83 TETHERING_DISABLED_BY_LOW_BATTERY, /**< Disabled due to low battery */
84 TETHERING_DISABLED_BY_NETWORK_CLOSE, /**< Disabled due to pdp network close */
85 TETHERING_DISABLED_BY_TIMEOUT, /**< Disabled due to timeout */
86 TETHERING_DISABLED_BY_OTHERS, /**< Disabled by other apps */
87 TETHERING_DISABLED_BY_REQUEST, /**< Disabled by your request */
88 TETHERING_DISABLED_BY_WIFI_ON, /**< Disabled due to Wi-Fi on */
89 TETHERING_DISABLED_BY_BT_OFF, /**< Disabled due to Bluetooth off */
90 } tethering_disabled_cause_e;
98 * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
103 * @brief Enumeration for the Wi-Fi security.
107 TETHERING_WIFI_SECURITY_TYPE_NONE = 0, /**< No Security type */
108 TETHERING_WIFI_SECURITY_TYPE_WPA2_PSK, /**< WPA2_PSK */
109 TETHERING_WIFI_SECURITY_TYPE_WPS, /**< WPA2_PSK */
110 TETHERING_WIFI_SECURITY_TYPE_SAE, /**< SAE */
111 } tethering_wifi_security_type_e;
114 * @brief Enumeration for the Wi-Fi mode
118 TETHERING_WIFI_MODE_TYPE_B = 0, /**< mode b */
119 TETHERING_WIFI_MODE_TYPE_G, /**< mode g */
120 TETHERING_WIFI_MODE_TYPE_A, /**< mode a */
121 TETHERING_WIFI_MODE_TYPE_AD, /**< mode ad */
122 } tethering_wifi_mode_type_e;
125 TETHERING_TYPE_IPSEC_PASSTHROUGH = 0, /**< IPSEC */
126 TETHERING_TYPE_PPTP_PASSTHROUGH, /**< PPTP type */
127 TETHERING_TYPE_L2TP_PASSTHROUGH, /**< L2TP type */
128 } tethering_vpn_passthrough_type_e;
136 * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
141 * @brief The tethering client handle.
144 typedef void * tethering_client_h;
147 * @brief Enumeration for address family.
151 TETHERING_ADDRESS_FAMILY_IPV4 = 0, /**< IPV4 Address type */
152 TETHERING_ADDRESS_FAMILY_IPV6 = 1, /**< IPV6 Address type (Since 4.0) */
153 } tethering_address_family_e;
161 * @addtogroup CAPI_NETWORK_TETHERING_MANAGER_MODULE
166 * @brief Called when the tethering is enabled.
168 * @param[in] result The result of enabling the tethering
169 * @param[in] type The tethering type
170 * @param[in] is_requested Indicates whether this change is requested
171 * @param[in] user_data The user data passed from tethering_set_enabled_cb()
172 * @pre If you register callback function using tethering_set_enabled_cb(), this will be invoked when the tethering is enabled.
173 * @see tethering_enable()
174 * @see tethering_unset_enabled_cb()
176 typedef void (*tethering_enabled_cb)(tethering_error_e result, tethering_type_e type, bool is_requested, void *user_data);
179 * @brief Called when the tethering is disabled.
181 * @param[in] result The result of disabling the tethering
182 * @param[in] type The tethering type
183 * @param[in] cause The cause of disabling
184 * @param[in] user_data The user data passed from tethering_set_disabled_cb()
185 * @pre If you register callback function using tethering_set_disabled_cb(), this will be invoked when the tethering is disabled.
186 * @see tethering_set_disabled_cb()
187 * @see tethering_unset_disabled_cb()
189 typedef void (*tethering_disabled_cb)(tethering_error_e result, tethering_type_e type, tethering_disabled_cause_e cause, void *user_data);
192 * @brief Called when the connection state is changed.
194 * @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().
195 * @param[in] client The client of which connection state is changed
196 * @param[in] opened @c true when connection is opened, otherwise false
197 * @param[in] user_data The user data passed from tethering_set_connection_state_changed_cb()
198 * @pre If you register callback function using tethering_set_connection_state_changed_cb(), this will be invoked when the connection state is changed.
199 * @see tethering_set_connection_state_changed_cb()
200 * @see tethering_unset_connection_state_changed_cb()
202 typedef void (*tethering_connection_state_changed_cb)(tethering_client_h client, bool opened, void *user_data);
205 * @brief Called when you get the connected client repeatedly.
207 * @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().
208 * @param[in] client The connected client
209 * @param[in] user_data The user data passed from the request function
210 * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
211 * @pre tethering_foreach_connected_clients() will invoke this callback.
212 * @see tethering_foreach_connected_clients()
214 typedef bool(*tethering_connected_client_cb)(tethering_client_h client, void *user_data);
217 * @brief Called when you get the data usage.
219 * @param[in] result The result of getting the data usage
220 * @param[in] received_data The usage of received data
221 * @param[in] sent_data The usage of sent data
222 * @param[in] user_data The user data passed from the request function
223 * @pre tethering_get_data_usage() will invoked this callback.
225 typedef void (*tethering_data_usage_cb)(tethering_error_e result, unsigned long long received_data, unsigned long long sent_data, void *user_data);
228 * @brief Called when the security type of Wi-Fi tethering is changed.
230 * @param[in] changed_type The changed security type of Wi-Fi tethering
231 * @param[in] user_data The user data passed from the register function
232 * @see tethering_wifi_set_security_type_changed_cb()
233 * @see tethering_wifi_unset_security_type_changed_cb()
235 typedef void (*tethering_wifi_security_type_changed_cb)(tethering_wifi_security_type_e changed_type, void *user_data);
238 * @brief Called when the visibility of SSID is changed.
240 * @param[in] changed_visible The changed visibility of SSID
241 * @param[in] user_data The user data passed from the register function
242 * @see tethering_wifi_set_ssid_visibility_changed_cb()
243 * @see tethering_wifi_unset_ssid_visibility_changed_cb()
245 typedef void (*tethering_wifi_ssid_visibility_changed_cb)(bool changed_visible, void *user_data);
248 * @brief Called when the passphrase of Wi-Fi tethering is changed.
250 * @param[in] user_data The user data passed from the register function
251 * @see tethering_wifi_set_passphrase_changed_cb()
252 * @see tethering_wifi_unset_passphrase_changed_cb()
254 typedef void (*tethering_wifi_passphrase_changed_cb)(void *user_data);
257 * @brief Called when the settings are reloaded.
259 * @param[in] result The result of reloading the settings
260 * @param[in] user_data The user data passed from the request function
261 * @pre tethering_wifi_reload_settings() will invoke this callback.
263 typedef void (*tethering_wifi_settings_reloaded_cb)(tethering_error_e result, void *user_data);
266 * @brief Creates the handle for tethering.
268 * @privlevel platform
269 * @privilege %http://tizen.org/privilege/tethering.admin
270 * @remarks The @a tethering must be released using tethering_destroy().
271 * @param[out] tethering A handle of a new mobile ap handle on success
272 * @return 0 on success, otherwise a negative error value
273 * @retval #TETHERING_ERROR_NONE Successful
274 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
275 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
276 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API is not supported
277 * @see tethering_destroy()
279 int tethering_create(tethering_h *tethering);
282 * @brief Destroys the handle for tethering.
284 * @privlevel platform
285 * @privilege %http://tizen.org/privilege/tethering.admin
286 * @param[in] tethering The tethering handle
287 * @return 0 on success, otherwise a negative error value
288 * @retval #TETHERING_ERROR_NONE Successful
289 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
290 * @see tethering_create()
292 int tethering_destroy(tethering_h tethering);
295 * @brief Enables the tethering, asynchronously.
297 * @privlevel platform
298 * @privilege %http://tizen.org/privilege/tethering.admin
299 * @param[in] tethering The tethering handle
300 * @param[in] type The tethering type
301 * @return 0 on success, otherwise negative error value
302 * @retval #TETHERING_ERROR_NONE Successful
303 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
304 * @post tethering_enabled_cb() will be invoked.
305 * @see tethering_is_enabled()
306 * @see tethering_disable()
308 int tethering_enable(tethering_h tethering, tethering_type_e type);
311 * @brief Disables the tethering, asynchronously.
313 * @privlevel platform
314 * @privilege %http://tizen.org/privilege/tethering.admin
315 * @param[in] tethering The tethering handle
316 * @param[in] type The tethering type
317 * @return 0 on success, otherwise negative error value
318 * @retval #TETHERING_ERROR_NONE Successful
319 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
320 * @post tethering_disabled_cb() will be invoked.
321 * @see tethering_is_enabled()
322 * @see tethering_enable()
324 int tethering_disable(tethering_h tethering, tethering_type_e type);
327 * @brief Enables the IPv6 tethering, asynchronously.
329 * @privlevel platform
330 * @privilege %http://tizen.org/privilege/tethering.admin
331 * @remarks It supports Wi-Fi tethering and BT tethering only.
332 * @param[in] tethering The tethering handle
333 * @param[in] type The tethering type
334 * @return 0 on success, otherwise negative error value
335 * @retval #TETHERING_ERROR_NONE Successful
336 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
337 * @post tethering_enabled_cb() will be invoked.
338 * @see tethering_is_enabled()
339 * @see tethering_ipv6_disable()
341 int tethering_ipv6_enable(tethering_h tethering, tethering_type_e type);
344 * @brief Disables the IPv6 tethering, asynchronously.
346 * @privlevel platform
347 * @privilege %http://tizen.org/privilege/tethering.admin
348 * @remarks It supports Wi-Fi tethering and BT tethering only.
349 * @param[in] tethering The tethering handle
350 * @param[in] type The tethering type
351 * @return 0 on success, otherwise negative error value
352 * @retval #TETHERING_ERROR_NONE Successful
353 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
354 * @post tethering_disabled_cb() will be invoked.
355 * @see tethering_is_enabled()
356 * @see tethering_ipv6_enable()
358 int tethering_ipv6_disable(tethering_h tethering, tethering_type_e type);
361 * @brief Checks whether the tethering is enabled or not.
363 * @privlevel platform
364 * @privilege %http://tizen.org/privilege/tethering.admin
365 * @param[in] tethering The tethering handle
366 * @param[in] type The tethering type
367 * @return @c true if tethering is enabled, \n @c false if tethering is disabled
369 bool tethering_is_enabled(tethering_h tethering, tethering_type_e type);
372 * @brief Gets the MAC address of local device as "FC:A1:3E:D6:B1:B1".
374 * @privlevel platform
375 * @privilege %http://tizen.org/privilege/tethering.admin
376 * @remarks @a mac_address must be released using free().
377 * @param[in] tethering The tethering handle
378 * @param[in] type The tethering type
379 * @param[out] mac_address The MAC address
380 * @return 0 on success, otherwise a negative error value
381 * @retval #TETHERING_ERROR_NONE Successful
382 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
383 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
384 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
385 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
386 * @pre The tethering must be enabled.
387 * @see tethering_is_enabled()
388 * @see tethering_enable()
390 int tethering_get_mac_address(tethering_h tethering, tethering_type_e type, char **mac_address);
393 * @brief Gets the name of network interface (e.g. usb0).
395 * @privlevel platform
396 * @privilege %http://tizen.org/privilege/tethering.admin
397 * @remarks @a interface_name must be released using free().
398 * @param[in] tethering The tethering handle
399 * @param[in] type The tethering type
400 * @param[out] interface_name The name of the network interface
401 * @return 0 on success, otherwise negative error value
402 * @retval #TETHERING_ERROR_NONE Successful
403 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
404 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
405 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
406 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
407 * @pre The tethering must be enabled.
408 * @see tethering_is_enabled()
409 * @see tethering_enable()
411 int tethering_get_network_interface_name(tethering_h tethering, tethering_type_e type, char **interface_name);
414 * @brief Gets the local IP address.
416 * @privlevel platform
417 * @privilege %http://tizen.org/privilege/tethering.admin
418 * @remarks @a ip_address must be released using free().
419 * @param[in] tethering The tethering handle
420 * @param[in] type The tethering type
421 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
422 * @param[out] ip_address The local IP address
423 * @return 0 on success, otherwise negative error value
424 * @retval #TETHERING_ERROR_NONE Successful
425 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
426 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
427 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
428 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
429 * @pre The tethering must be enabled.
430 * @see tethering_is_enabled()
431 * @see tethering_enable()
433 int tethering_get_ip_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **ip_address);
436 * @brief Gets the Gateway address.
438 * @privlevel platform
439 * @privilege %http://tizen.org/privilege/tethering.admin
440 * @remarks @a gateway_address must be released using free().
441 * @param[in] tethering The tethering handle
442 * @param[in] type The tethering type
443 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
444 * @param[out] gateway_address The local IP address
445 * @return 0 on success, otherwise negative error value
446 * @retval #TETHERING_ERROR_NONE Successful
447 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
448 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
449 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
450 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
451 * @pre The tethering must be enabled.
452 * @see tethering_is_enabled()
453 * @see tethering_enable()
455 int tethering_get_gateway_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **gateway_address);
458 * @brief Gets the Subnet Mask.
460 * @privlevel platform
461 * @privilege %http://tizen.org/privilege/tethering.admin
462 * @remarks @a subnet_mask must be released using free().
463 * @param[in] tethering The tethering handle
464 * @param[in] type The tethering type
465 * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
466 * @param[out] subnet_mask The local IP address
467 * @return 0 on success, otherwise negative error value
468 * @retval #TETHERING_ERROR_NONE Successful
469 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
470 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
471 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
472 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
473 * @pre The tethering must be enabled.
474 * @see tethering_is_enabled()
475 * @see tethering_enable()
477 int tethering_get_subnet_mask(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **subnet_mask);
480 * @brief Gets the data usage.
482 * @privlevel platform
483 * @privilege %http://tizen.org/privilege/tethering.admin
484 * @param[in] tethering The tethering handle
485 * @param[out] usage The data usage
486 * @return 0 on success, otherwise negative error value
487 * @retval #TETHERING_ERROR_NONE Successful
488 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
489 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
490 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
491 * @pre The tethering must be enabled.
492 * @see tethering_is_enabled()
493 * @see tethering_enable()
495 int tethering_get_data_usage(tethering_h tethering, tethering_data_usage_cb callback, void *user_data);
498 * @brief Gets the clients which are connected.
500 * @privlevel platform
501 * @privilege %http://tizen.org/privilege/tethering.admin
502 * @param[in] tethering The tethering handle
503 * @param[in] type The tethering type
504 * @param[in] callback The callback function to invoke
505 * @param[in] user_data The user data to be passed to the callback function
506 * @retval #TETHERING_ERROR_NONE Successful
507 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
508 * @retval #TETHERING_ERROR_NOT_ENABLED Not enabled
509 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
510 * @pre The tethering must be enabled.
511 * @see tethering_is_enabled()
512 * @see tethering_enable()
514 int tethering_foreach_connected_clients(tethering_h tethering, tethering_type_e type, tethering_connected_client_cb callback, void *user_data);
517 * @brief Gets the clients which are connected.
519 * @privlevel platform
520 * @privilege %http://tizen.org/privilege/tethering.admin
521 * @param[in] tethering The tethering handle
522 * @param[in] type The tethering type
523 * @retval #TETHERING_ERROR_NONE Successful
524 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
525 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
527 int tethering_is_dualband_supported(tethering_h tethering, tethering_type_e type, bool *supported);
530 * @brief Registers the callback function, which is called when tethering is enabled.
532 * @privlevel platform
533 * @privilege %http://tizen.org/privilege/tethering.admin
534 * @param[in] tethering The tethering handle
535 * @param[in] type The tethering type
536 * @param[in] callback The callback function to invoke
537 * @param[in] user_data The user data to be passed to the callback function
538 * @retval #TETHERING_ERROR_NONE Successful
539 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
540 * @see tethering_unset_enabled_cb()
542 int tethering_set_enabled_cb(tethering_h tethering, tethering_type_e type, tethering_enabled_cb callback, void *user_data);
545 * @brief Unregisters the callback function, which is called when tethering is enabled.
547 * @privlevel platform
548 * @privilege %http://tizen.org/privilege/tethering.admin
549 * @param[in] tethering The tethering handle
550 * @param[in] type The tethering type
551 * @retval #TETHERING_ERROR_NONE Successful
552 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
553 * @see tethering_set_enabled_cb()
555 int tethering_unset_enabled_cb(tethering_h tethering, tethering_type_e type);
558 * @brief Registers the callback function called when tethering is disabled.
560 * @privlevel platform
561 * @privilege %http://tizen.org/privilege/tethering.admin
562 * @param[in] tethering The tethering handle
563 * @param[in] type The tethering type
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_unset_disabled_cb()
570 int tethering_set_disabled_cb(tethering_h tethering, tethering_type_e type, tethering_disabled_cb callback, void *user_data);
573 * @brief Unregisters the callback function, which is called when tethering is disabled.
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_set_disabled_cb()
583 int tethering_unset_disabled_cb(tethering_h tethering, tethering_type_e type);
586 * @brief Registers the callback function, which is called when the state of connection is changed.
588 * @privlevel platform
589 * @privilege %http://tizen.org/privilege/tethering.admin
590 * @param[in] tethering The tethering handle
591 * @param[in] type The tethering type
592 * @param[in] callback The callback function to invoke
593 * @param[in] user_data The user data to be passed to the callback function
594 * @retval #TETHERING_ERROR_NONE Successful
595 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
596 * @see tethering_unset_connection_state_changed_cb_cb()
598 int tethering_set_connection_state_changed_cb(tethering_h tethering, tethering_type_e type, tethering_connection_state_changed_cb callback, void *user_data);
601 * @brief Unregisters the callback function, which is called when the state of connection is changed.
603 * @privlevel platform
604 * @privilege %http://tizen.org/privilege/tethering.admin
605 * @param[in] tethering The tethering handle
606 * @param[in] type The tethering type
607 * @retval #TETHERING_ERROR_NONE Successful
608 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
609 * @see tethering_set_connection_state_changed_cb()
611 int tethering_unset_connection_state_changed_cb(tethering_h tethering, tethering_type_e type);
614 * @brief Registers the callback function, which is called when the security type of Wi-Fi tethering is changed.
616 * @privlevel platform
617 * @privilege %http://tizen.org/privilege/tethering.admin
618 * @param[in] tethering The tethering handle
619 * @param[in] callback The callback function to invoke
620 * @param[in] user_data The user data to be passed to the callback function
621 * @retval #TETHERING_ERROR_NONE Successful
622 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
623 * @see tethering_wifi_unset_security_type_changed_cb()
625 int tethering_wifi_set_security_type_changed_cb(tethering_h tethering, tethering_wifi_security_type_changed_cb callback, void *user_data);
628 * @brief Unregisters the callback function, which is called when the security type of Wi-Fi tethering is changed.
630 * @privlevel platform
631 * @privilege %http://tizen.org/privilege/tethering.admin
632 * @param[in] tethering The tethering handle
633 * @param[in] type The tethering type
634 * @retval #TETHERING_ERROR_NONE Successful
635 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
636 * @see tethering_wifi_set_security_type_changed_cb()
638 int tethering_wifi_unset_security_type_changed_cb(tethering_h tethering);
641 * @brief Registers the callback function , which iscalled when the visibility of SSID is changed.
643 * @privlevel platform
644 * @privilege %http://tizen.org/privilege/tethering.admin
645 * @param[in] tethering The tethering handle
646 * @param[in] callback The callback function to invoke
647 * @param[in] user_data The user data to be passed to the callback function
648 * @retval #TETHERING_ERROR_NONE Successful
649 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
650 * @see tethering_wifi_unset_ssid_visibility_changed_cb_cb()
652 int tethering_wifi_set_ssid_visibility_changed_cb(tethering_h tethering, tethering_wifi_ssid_visibility_changed_cb callback, void *user_data);
655 * @brief Unregisters the callback function, which is called when the visibility of SSID is changed.
657 * @privlevel platform
658 * @privilege %http://tizen.org/privilege/tethering.admin
659 * @param[in] tethering The tethering handle
660 * @retval #TETHERING_ERROR_NONE Successful
661 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
662 * @see tethering_wifi_set_ssid_visibility_changed_cb()
664 int tethering_wifi_unset_ssid_visibility_changed_cb(tethering_h tethering);
667 * @brief Registers the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
669 * @privlevel platform
670 * @privilege %http://tizen.org/privilege/tethering.admin
671 * @param[in] tethering The tethering handle
672 * @param[in] callback The callback function to invoke
673 * @param[in] user_data The user data to be passed to the callback function
674 * @retval #TETHERING_ERROR_NONE Successful
675 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
676 * @see tethering_wifi_unset_passphrase_changed_cb()
678 int tethering_wifi_set_passphrase_changed_cb(tethering_h tethering, tethering_wifi_passphrase_changed_cb callback, void *user_data);
681 * @brief Unregisters the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
683 * @privlevel platform
684 * @privilege %http://tizen.org/privilege/tethering.admin
685 * @param[in] tethering The tethering handle
686 * @retval #TETHERING_ERROR_NONE Successful
687 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
688 * @see tethering_wifi_set_passphrase_changed_cb()
690 int tethering_wifi_unset_passphrase_changed_cb(tethering_h tethering);
698 * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
703 * @brief Sets the security type of Wi-Fi tethering.
705 * @privlevel platform
706 * @privilege %http://tizen.org/privilege/tethering.admin
707 * @remarks This change is applied next time Wi-Fi tethering is enabled.
708 * @param[in] tethering The tethering handle
709 * @param[in] type The security type
710 * @return 0 on success, otherwise negative error value
711 * @retval #TETHERING_ERROR_NONE Successful
712 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
713 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
714 * @see tethering_wifi_get_security_type()
716 int tethering_wifi_set_security_type(tethering_h tethering, tethering_wifi_security_type_e type);
719 * @brief Gets the security type of Wi-Fi tethering.
721 * @privlevel platform
722 * @privilege %http://tizen.org/privilege/tethering.admin
723 * @param[in] tethering The tethering handle
724 * @param[out] type The security type
725 * @return 0 on success, otherwise negative error value
726 * @retval #TETHERING_ERROR_NONE Successful
727 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
728 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
729 * @see tethering_wifi_set_security_type()
731 int tethering_wifi_get_security_type(tethering_h tethering, tethering_wifi_security_type_e *type);
734 * @brief Sets the SSID (service set identifier).
735 * @details The SSID cannot exceed 32 bytes. If SSID is not set, device name is used as SSID.
737 * @privlevel platform
738 * @privilege %http://tizen.org/privilege/tethering.admin
739 * @remarks This change is applied next time Wi-Fi tethering is enabled with same @a tethering handle.
740 * @param[in] tethering The tethering handle
741 * @param[in] ssid The SSID
742 * @return 0 on success, otherwise negative error value
743 * @retval #TETHERING_ERROR_NONE Successful
744 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
745 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
747 int tethering_wifi_set_ssid(tethering_h tethering, const char *ssid);
750 * @brief Gets the SSID (service set identifier).
752 * @privlevel platform
753 * @privilege %http://tizen.org/privilege/tethering.admin
754 * @remarks @a ssid must be released using free().
755 * @param[in] tethering The tethering handle
756 * @param[out] ssid The SSID
757 * @return 0 on success, otherwise negative error value
758 * @retval #TETHERING_ERROR_NONE Successful
759 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
760 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
761 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
763 int tethering_wifi_get_ssid(tethering_h tethering, char **ssid);
766 * @brief Sets the visibility of SSID (service set identifier).
767 * @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.
769 * @privlevel platform
770 * @privilege %http://tizen.org/privilege/tethering.admin
771 * @remarks This change is applied next time Wi-Fi tethering is enabled.
772 * @param[in] tethering The tethering handle
773 * @param[in] visible The visibility of SSID: (@c true = visible, @c false = invisible)
774 * @return 0 on success, otherwise negative error value
775 * @retval #TETHERING_ERROR_NONE Successful
776 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
777 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
778 * @see tethering_wifi_get_ssid_visibility()
780 int tethering_wifi_set_ssid_visibility(tethering_h tethering, bool visible);
783 * @brief Gets the visibility of SSID (service set identifier).
784 * @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.
786 * @privlevel platform
787 * @privilege %http://tizen.org/privilege/tethering.admin
788 * @param[in] tethering The tethering handle
789 * @param[out] visible The visibility of SSID: (@c true = visible, @c false = invisible)
790 * @return 0 on success, otherwise negative error value
791 * @retval #TETHERING_ERROR_NONE Successful
792 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
793 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
794 * @see tethering_wifi_set_ssid_visibility()
796 int tethering_wifi_get_ssid_visibility(tethering_h tethering, bool *visible);
799 * @brief Sets the passphrase.
801 * @privlevel platform
802 * @privilege %http://tizen.org/privilege/tethering.admin
803 * @remarks This change is applied next time Wi-Fi tethering is enabled.
804 * @param[in] tethering The tethering handle
805 * @param[in] passphrase The passphrase
806 * @return 0 on success, otherwise negative error value
807 * @retval #TETHERING_ERROR_NONE Successful
808 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
809 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
810 * @see tethering_wifi_get_passphrase()
812 int tethering_wifi_set_passphrase(tethering_h tethering, const char *passphrase);
815 * @brief Gets the passphrase.
817 * @privlevel platform
818 * @privilege %http://tizen.org/privilege/tethering.admin
819 * @remarks @a passphrase must be released using free().
820 * @param[in] tethering The tethering handle
821 * @param[out] passphrase The passphrase
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_OUT_OF_MEMORY Out of memory
826 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
827 * @see tethering_wifi_set_passphrase()
829 int tethering_wifi_get_passphrase(tethering_h tethering, char **passphrase);
832 * @brief Reloads the settings (SSID / Passphrase / Security type / SSID visibility).
834 * @privlevel platform
835 * @privilege %http://tizen.org/privilege/tethering.admin
836 * @remarks Connected devices via Wi-Fi tethering or MobileAP will be disconnected when the settings are reloaded.
837 * @param[in] tethering The tethering handle
838 * @param[in] callback The callback function to invoke
839 * @param[in] user_data The user data to be passed to the callback function
840 * @return 0 on success, otherwise negative error value
841 * @retval #TETHERING_ERROR_NONE Successful
842 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
843 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
845 int tethering_wifi_reload_settings(tethering_h tethering, tethering_wifi_settings_reloaded_cb callback, void *user_data);
848 * @brief Gets 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 false.
852 * @privlevel platform
853 * @privilege %http://tizen.org/privilege/tethering.admin
854 * @param[in] tethering The handle of tethering
855 * @param[out] mac_filter The mac filter: (@c true = enable, @c false = disable)
856 * @return 0 on success, otherwise negative error value.
857 * @retval #TETHERING_ERROR_NONE Successful
858 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
859 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
860 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
861 * @see tethering_mobileap_set_mac_filter()
863 int tethering_wifi_get_mac_filter(tethering_h tethering, bool *mac_filter);
866 * @brief Sets the mac-filter for Wi-Fi Tethering.
867 * @details If you set the mac_filter to enable, then the device can be allowed/blocked based on mac-address.
868 * By default mac_filter is set to @c false.
870 * @privlevel platform
871 * @privilege %http://tizen.org/privilege/tethering.admin
872 * @remarks This change is applied next time Wi-Fi tethering is enabled.
873 * @param[in] tethering The tethering handle
874 * @param[in] mac_filter The mac filter: (@c true = enable, @c false = disable)
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_OPERATION_FAILED Operation failed
879 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
880 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
881 * @see tethering_mobileap_get_mac_filter()
883 int tethering_wifi_set_mac_filter(tethering_h tethering, bool mac_filter);
886 * @brief Adds the mac-address to the allowed client list.
887 * @details AP can allow the client by adding clients mac-address to the allowed list.
889 * @privlevel platform
890 * @privilege %http://tizen.org/privilege/tethering.admin
891 * @param[in] tethering The handle of tethering
892 * @param[in] mac The mac address
893 * @return 0 on success, otherwise negative error value.
894 * @retval #TETHERING_ERROR_NONE Successful
895 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
896 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
897 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
898 * @see tethering_mobileap_set_mac_filter()
900 int tethering_wifi_add_allowed_mac_list(tethering_h tethering, const char *mac);
903 * @brief Removes the mac-address from the allowed client list.
904 * @details Removes the mac-address from the allowed client list.
906 * @privlevel platform
907 * @privilege %http://tizen.org/privilege/tethering.admin
908 * @param[in] tethering The handle of tethering
909 * @param[in] mac The mac address
910 * @return 0 on success, otherwise negative error value.
911 * @retval #TETHERING_ERROR_NONE Successful
912 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
913 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
914 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
915 * @see tethering_mobileap_set_mac_filter()
917 int tethering_wifi_remove_allowed_mac_list(tethering_h tethering, const char *mac);
919 * @brief Gets the mac-addresses from the allowed client list.
920 * @details Gets the mac-addresses from the allowed client list.
922 * @privlevel platform
923 * @privilege %http://tizen.org/privilege/tethering.admin
924 * @param[in] tethering The handle of tethering
925 * @param[out] allowed_mac_list list of allowed mac addresses list
926 * @return 0 on success, otherwise negative error value.
927 * @retval #TETHERING_ERROR_NONE Successful
928 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
929 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
930 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
931 * @see tethering_mobileap_set_mac_filter()
933 int tethering_wifi_get_allowed_mac_list(tethering_h tethering, void **allowed_mac_list);
936 * @brief Adds the mac-address to the blocked client list.
937 * @details AP can disallow the client by adding clients mac-address to the blocked list.
939 * @privlevel platform
940 * @privilege %http://tizen.org/privilege/tethering.admin
941 * @param[in] tethering The handle of tethering
942 * @param[in] mac The mac address
943 * @return 0 on success, otherwise negative error value.
944 * @retval #TETHERING_ERROR_NONE Successful
945 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
946 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
947 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
948 * @see tethering_mobileap_set_mac_filter()
950 int tethering_wifi_add_blocked_mac_list(tethering_h tethering, const char *mac);
953 * @brief Removes the mac-address from the blocked client list.
954 * @details Removes the mac-address from the blocked client list.
956 * @privlevel platform
957 * @privilege %http://tizen.org/privilege/tethering.admin
958 * @param[in] tethering The handle of tethering
959 * @param[in] mac The mac address
960 * @return 0 on success, otherwise negative error value.
961 * @retval #TETHERING_ERROR_NONE Successful
962 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
963 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
964 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
965 * @see tethering_mobileap_set_mac_filter()
967 int tethering_wifi_remove_blocked_mac_list(tethering_h tethering, const char *mac);
970 * @brief Gets the mac-addresses from the blocked client list.
971 * @details Get the mac-addresses from the blocked client list.
973 * @privlevel platform
974 * @privilege %http://tizen.org/privilege/tethering.admin
975 * @param[in] tethering The handle of tethering
976 * @param[out] blocked_mac_list list of blocked mac addresses list
977 * @return 0 on success, otherwise negative error value.
978 * @retval #TETHERING_ERROR_NONE Successful
979 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
980 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
981 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
982 * @see tethering_mobileap_set_mac_filter()
984 int tethering_wifi_get_blocked_mac_list(tethering_h tethering, void **blocked_mac_list);
987 * @brief Enables/disables the dhcp server.
989 * @privlevel platform
990 * @privilege %http://tizen.org/privilege/tethering.admin
991 * @details Enable/disable the dhcp server.
992 * @param[in] tethering The handle of tethering
993 * @param[in] enable Enable/disable the dhcp server
994 * @return 0 on success, otherwise negative error value.
995 * @retval #TETHERING_ERROR_NONE Successful
996 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
998 int tethering_wifi_enable_dhcp(tethering_h tethering, bool enable);
1001 * @brief Enables the dhcp server with the address range.
1003 * @privlevel platform
1004 * @privilege %http://tizen.org/privilege/tethering.admin
1005 * @details Enable the dhcp server with the address range.
1006 * @param[in] tethering The handle of tethering
1007 * @param[in] rangestart Start address range
1008 * @param[in] rangestop End address range
1009 * @return 0 on success, otherwise negative error value.
1010 * @retval #TETHERING_ERROR_NONE Successful
1011 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1013 int tethering_wifi_set_dhcp_range(tethering_h tethering, char *rangestart, char *rangestop);
1016 * @brief Checks whether the dhcp is enabled or not.
1018 * @privlevel platform
1019 * @privilege %http://tizen.org/privilege/tethering.admin
1020 * @param[in] tethering The tethering handle
1021 * @param[out] dhcp_enabled @c true if dhcp is enabled, \n @c false if dhcp is disabled
1022 * @return 0 on success, otherwise a negative error value
1023 * @retval #TETHERING_ERROR_NONE Successful
1024 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1026 int tethering_wifi_is_dhcp_enabled(tethering_h tethering, bool *dhcp_enabled);
1029 * @brief Sets the Channel for Wi-Fi.
1030 * @details The Channel should be in between 1-14. If channel is not set, Wi-Fi sets default channel.
1032 * @privlevel platform
1033 * @privilege %http://tizen.org/privilege/tethering.admin
1034 * @param[in] tethering The tethering handle
1035 * @param[in] channel The channel number
1036 * @return 0 on success, otherwise negative error value
1037 * @retval #TETHERING_ERROR_NONE Successful
1038 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1040 int tethering_wifi_set_channel(tethering_h tethering, int channel);
1043 * @brief Gets the channel for Wi-Fi.
1044 * @details If channel is not set, Wi-Fi gets default channel.
1046 * @privlevel platform
1047 * @privilege %http://tizen.org/privilege/tethering.admin
1048 * @param[in] tethering The tethering handle
1049 * @param[out] channel The channel number
1050 * @return 0 on success, otherwise negative error value
1051 * @retval #TETHERING_ERROR_NONE Successful
1052 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1053 * @see tethering_wifi_set_channel()
1055 int tethering_wifi_get_channel(tethering_h tethering, int *channel);
1058 * @brief Sets the mode for Wi-Fi.
1059 * @details The mobile AP mode (ex: b only, g only, ad, a). If mode is not set, Wi-Fi sets default mode.
1061 * @privlevel platform
1062 * @privilege %http://tizen.org/privilege/tethering.admin
1063 * @param[in] tethering The tethering handle
1064 * @param[in] type The mobile AP mode
1065 * @return 0 on success, otherwise negative error value
1066 * @retval #TETHERING_ERROR_NONE Successful
1067 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1069 int tethering_wifi_set_mode(tethering_h tethering, tethering_wifi_mode_type_e type);
1072 * @brief Gets the mode for Wi-Fi.
1073 * @details If the mode is not set, Wi-Fi gets default mode.
1075 * @privlevel platform
1076 * @privilege %http://tizen.org/privilege/tethering.admin
1077 * @remarks @a mode must be released using free().
1078 * @param[in] tethering The tethering handle
1079 * @param[out] type The mode of Wi-Fi tethering
1080 * @return 0 on success, otherwise negative error value
1081 * @retval #TETHERING_ERROR_NONE Successful
1082 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1083 * @see tethering_wifi_set_mode()
1085 int tethering_wifi_get_mode(tethering_h tethering, tethering_wifi_mode_type_e *type);
1088 * @brief Sets txpower for Wi-Fi tethering.
1090 * @privlevel platform
1091 * @privilege http://tizen.org/privilege/tethering.admin
1092 * @param[in] tethering The tethering handle
1093 * @param[in] txpower value of txpower to be set
1094 * @return 0 on success, otherwise a negative error value
1095 * @retval #TETHERING_ERROR_NONE Successful
1096 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1097 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1098 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1099 * @see tethering_wifi_get_txpower()
1101 int tethering_wifi_set_txpower(tethering_h tethering, unsigned int txpower);
1104 * @brief Gets txpower for Wi-Fi tethering.
1106 * @privlevel platform
1107 * @privilege http://tizen.org/privilege/tethering.admin
1108 * @param[in] tethering The tethering handle
1109 * @param[out] txpower value of txpower
1110 * @return 0 on success, otherwise a negative error value
1111 * @retval #TETHERING_ERROR_NONE Successful
1112 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1113 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1114 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1115 * @see tethering_wifi_set_txpower()
1117 int tethering_wifi_get_txpower(tethering_h tethering, unsigned int *txpower);
1120 * @brief Sets mtu for Wi-Fi tethering.
1122 * @privlevel platform
1123 * @privilege %http://tizen.org/privilege/tethering.admin
1124 * @param[in] tethering The tethering handle
1125 * @param[in] mtu value of mtu to be set
1126 * @return 0 on success, otherwise a negative error value
1127 * @retval #TETHERING_ERROR_NONE Successful
1128 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1129 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1130 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1132 int tethering_wifi_set_mtu(tethering_h tethering, unsigned int mtu);
1135 * @brief Changes mac address for Wi-Fi tethering.
1137 * @privlevel platform
1138 * @privilege %http://tizen.org/privilege/tethering.admin
1139 * @param[in] tethering The client handle
1140 * @param[in] mac The mac address
1141 * @return 0 on success, otherwise a negative error value
1142 * @retval #TETHERING_ERROR_NONE Successful
1143 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1144 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1145 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1147 int tethering_wifi_change_mac(tethering_h tethering, char *mac);
1150 * @brief Sets max connected devices for Wi-Fi tethering.
1152 * @privlevel platform
1153 * @privilege %http://tizen.org/privilege/tethering.admin
1154 * @param[in] tethering The client handle
1155 * @param[in] max_device value of max_device to be set
1156 * @return 0 on success, otherwise a negative error value
1157 * @retval #TETHERING_ERROR_NONE Successful
1158 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1159 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1160 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1161 * @see tethering_wifi_get_max_connected_device()
1163 int tethering_wifi_set_max_connected_device(tethering_h tethering, int max_device);
1166 * @brief Gets max connected devices for Wi-Fi tethering.
1168 * @privlevel platform
1169 * @privilege %http://tizen.org/privilege/tethering.admin
1170 * @param[in] tethering The client handle
1171 * @param[out] max_device value of max_device
1172 * @return 0 on success, otherwise a negative error value
1173 * @retval #TETHERING_ERROR_NONE Successful
1174 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1175 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1176 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1177 * @see tethering_wifi_set_max_connected_device()
1179 int tethering_wifi_get_max_connected_device(tethering_h tethering, int *max_device);
1182 * @brief Enables port forwarding feature.
1184 * @privlevel platform
1185 * @privilege %http://tizen.org/privilege/tethering.admin
1186 * @details enable/disable port forwarding feature.
1187 * @param[in] tethering The handle of tethering
1188 * @param[in] enable Enable/Disable port forwarding
1189 * @return 0 on success, otherwise negative error value.
1190 * @retval #TETHERING_ERROR_NONE Successful
1191 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1192 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1193 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1195 int tethering_wifi_enable_port_forwarding(tethering_h tethering, bool enable);
1198 * @brief Sets port forwarding rule.
1200 * @privlevel platform
1201 * @privilege %http://tizen.org/privilege/tethering.admin
1202 * @details Set port forwarding rule.
1203 * @param[in] tethering The handle of tethering
1204 * @param[in] ifname interface name
1205 * @param[in] protocol protocol (tcp/udp)
1206 * @param[in] org_ip original destination ip where packet was meant to sent
1207 * @param[in] org_port original destination port where packet was meant to sent
1208 * @param[in] final_ip new destination ip where packet will be forwarded
1209 * @param[in] final_port new destination port where packet will be forwarded
1210 * @return 0 on success, otherwise negative error value.
1211 * @retval #TETHERING_ERROR_NONE Successful
1212 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1213 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1214 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1216 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);
1219 * @brief Resets port forwarding rule.
1221 * @privlevel platform
1222 * @privilege %http://tizen.org/privilege/tethering.admin
1223 * @details Reset port forwarding rule.
1224 * @param[in] tethering The handle of tethering
1225 * @return 0 on success, otherwise negative error value.
1226 * @retval #TETHERING_ERROR_NONE Successful
1227 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1228 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1229 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1231 int tethering_wifi_reset_port_forwarding_rule(tethering_h tethering);
1234 * @brief Checks whether the port forwarding is enabled or not.
1236 * @privlevel platform
1237 * @privilege %http://tizen.org/privilege/tethering.admin
1238 * @param[in] tethering The tethering handle
1239 * @param[out] forwarding_enabled @c true if port forwarding is enabled, \n @c false if port forwarding is disabled
1240 * @return 0 on success, otherwise a negative error value
1241 * @retval #TETHERING_ERROR_NONE Successful
1242 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1243 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1244 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1246 int tethering_wifi_is_port_forwarding_enabled(tethering_h tethering, bool* forwarding_enabled);
1249 * @brief Gets the port forwarding rule for Wi-Fi tethering.
1251 * @privlevel platform
1252 * @privilege %http://tizen.org/privilege/tethering.admin
1253 * @param[in] tethering The client handle
1254 * @param[out] port_forwarding_list list of port forwarding rules
1255 * @return 0 on success, otherwise a negative error value
1256 * @retval #TETHERING_ERROR_NONE Successful
1257 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1258 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1259 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1261 int tethering_wifi_get_port_forwarding_rule(tethering_h tethering, void **port_forwarding_list);
1264 * @brief Enables port filtering feature.
1266 * @privlevel platform
1267 * @privilege %http://tizen.org/privilege/tethering.admin
1268 * @details enable/disable port filtering feature.
1269 * @param[in] tethering The handle of tethering
1270 * @param[in] enable Enable/Disable 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_enable_port_filtering(tethering_h tethering, bool enable);
1280 * @brief Sets port filtering rule.
1282 * @privlevel platform
1283 * @privilege %http://tizen.org/privilege/tethering.admin
1284 * @details Set port filtering rule.
1285 * @param[in] tethering The handle of tethering
1286 * @param[in] port to be filtered
1287 * @param[in] protocol protocol (tcp/udp)
1288 * @param[in] allow allow/disallow port filtering
1289 * @return 0 on success, otherwise negative error value.
1290 * @retval #TETHERING_ERROR_NONE Successful
1291 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1292 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1293 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1295 int tethering_wifi_add_port_filtering_rule(tethering_h tethering, int port, char *protocol, bool allow);
1298 * @brief Sets custom port filtering rule.
1300 * @privlevel platform
1301 * @privilege %http://tizen.org/privilege/tethering.admin
1302 * @details Set custom port filtering rule.
1303 * @param[in] tethering The handle of tethering
1304 * @param[in] port1 to be filtered
1305 * @param[in] port2 to be filtered
1306 * @param[in] protocol protocol (tcp/udp)
1307 * @param[in] allow allow/disallow port filtering
1308 * @return 0 on success, otherwise negative error value.
1309 * @retval #TETHERING_ERROR_NONE Successful
1310 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1311 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1312 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1314 int tethering_wifi_add_custom_port_filtering_rule(tethering_h tethering, int port1, int port2, char *protocol, bool allow);
1317 * @brief Gets the port filtering rule for Wi-Fi tethering.
1319 * @privlevel platform
1320 * @privilege %http://tizen.org/privilege/tethering.admin
1321 * @param[in] tethering The client handle
1322 * @param[out] port_filtering_list list of port filtering rules
1323 * @return 0 on success, otherwise a negative error value
1324 * @retval #TETHERING_ERROR_NONE Successful
1325 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1326 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1327 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1329 int tethering_wifi_get_port_filtering_rule(tethering_h tethering, void **port_filtering_list);
1332 * @brief Gets the custom port filtering rule for Wi-Fi tethering.
1334 * @privlevel platform
1335 * @privilege %http://tizen.org/privilege/tethering.admin
1336 * @param[in] tethering The client handle
1337 * @param[out] custom_port_filtering_list list of custom port filtering rules
1338 * @return 0 on success, otherwise a negative error value
1339 * @retval #TETHERING_ERROR_NONE Successful
1340 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1341 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1342 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1344 int tethering_wifi_get_custom_port_filtering_rule(tethering_h tethering, void **custom_port_filtering_list);
1347 * @brief Checks whether the port filtering is enabled or not.
1349 * @privlevel platform
1350 * @privilege %http://tizen.org/privilege/tethering.admin
1351 * @param[in] tethering The tethering handle
1352 * @param[out] filtering_enabled @c true if port filtering is enabled, \n @c false if port filtering is disabled
1353 * @return 0 on success, otherwise a negative error value
1354 * @retval #TETHERING_ERROR_NONE Successful
1355 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1356 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1357 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1359 int tethering_wifi_is_port_filtering_enabled(tethering_h tethering, bool* filtering_enabled);
1362 * @brief Sets vpn passthrough rule.
1364 * @privlevel platform
1365 * @privilege %http://tizen.org/privilege/tethering.admin
1366 * @details Set vpn passthrough rule.
1367 * @param[in] tethering The handle of tethering
1368 * @param[in] type vpn passthrough type
1369 * @param[in] enable @c true if vpn passthrough is enabled, \n @c false if vpn passthrough is disabled
1370 * @return 0 on success, otherwise negative error value.
1371 * @retval #TETHERING_ERROR_NONE Successful
1372 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1373 * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported
1374 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied
1376 int tethering_wifi_set_vpn_passthrough_rule(tethering_h tethering, tethering_vpn_passthrough_type_e type, bool enable);
1379 * @brief Pushes the WPS button to connect with Wi-Fi Tethering client. (WPS PBC)
1381 * @remarks The WPS button should be pushed when client tries to connect with Soft AP by using WPS PBC.
1382 * @param[in] tethering The tethering handle
1383 * @return 0 on success, otherwise negative error value
1384 * @retval #TETHERING_ERROR_NONE Successful
1385 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1386 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
1387 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission denied
1388 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
1390 int tethering_wifi_push_wps_button(tethering_h tethering);
1393 * @brief Sets the WPS PIN to connect with Wi-Fi Tethering client. (WPS PIN)
1395 * @remarks The WPS PIN should be inserted when client tries to connect with Soft AP by using WPS PIN.
1396 * @param[in] tethering The tethering handle
1397 * @param[in] wps_pin The WPS PIN
1398 * @return 0 on success, otherwise negative error value
1399 * @retval #TETHERING_ERROR_NONE Successful
1400 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1401 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
1402 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission denied
1403 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
1405 int tethering_wifi_set_wps_pin(tethering_h tethering, const char *wps_pin);
1408 * @brief Checks whether wifi-sharing is supported or not.
1410 * @privlevel platform
1411 * @privilege %http://tizen.org/privilege/tethering.admin
1412 * @param[in] tethering The tethering handle
1413 * @param[out] supported @c true if wifi-sharing is supported, \n @c false if wifi-sharing is unsupported
1414 * @return 0 on success, otherwise a negative error value
1415 * @retval #TETHERING_ERROR_NONE Successful
1416 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1417 * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission denied
1418 * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed
1420 int tethering_wifi_is_sharing_supported(tethering_h tethering, bool *supported);
1423 * @brief Sets the wifi-sharing flag.
1425 * @privlevel platform
1426 * @param[in] tethering The tethering handle
1427 * @param[in] sharing @c true if wifi-sharing is set, \n @c false if wifi-sharing is unset
1428 * @return 0 on success, otherwise a negative error value
1429 * @retval #TETHERING_ERROR_NONE Successful
1430 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1431 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
1433 int tethering_wifi_set_sharing(tethering_h tethering, bool sharing);
1436 * @brief Gets the wifi-sharing flag.
1438 * @privlevel platform
1439 * @param[in] tethering The tethering handle
1440 * @param[out] sharing @c true if wifi-sharing is set, \n @c otherwise false.
1441 * @return 0 on success, otherwise a negative error value
1442 * @retval #TETHERING_ERROR_NONE Successful
1443 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1444 * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported
1446 int tethering_wifi_get_sharing(tethering_h tethering, bool *sharing);
1454 * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
1459 * @brief Clones the handle of a client.
1461 * @privlevel platform
1462 * @privilege %http://tizen.org/privilege/tethering.admin
1463 * @remarks @a dest must be release using tethering_client_destroy().
1464 * @param[out] dest The cloned client handle
1465 * @param[in] origin The origin client handle
1466 * @return 0 on success, otherwise a negative error value
1467 * @retval #TETHERING_ERROR_NONE Successful
1468 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1469 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1470 * @see tethering_client_destroy()
1472 int tethering_client_clone(tethering_client_h *dest, tethering_client_h origin);
1475 * @brief Destroys the handle of a client.
1477 * @privlevel platform
1478 * @privilege %http://tizen.org/privilege/tethering.admin
1479 * @param[in] client The client handle
1480 * @return 0 on success, otherwise a negative error value
1481 * @retval #TETHERING_ERROR_NONE Successful
1482 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1483 * @see tethering_client_clone()
1485 int tethering_client_destroy(tethering_client_h client);
1488 * @brief Gets the tethering type of client.
1490 * @privlevel platform
1491 * @privilege %http://tizen.org/privilege/tethering.admin
1492 * @param[in] client The handle of client
1493 * @param[out] type The type of tethering
1494 * @return 0 on success, otherwise a negative error value.
1495 * @retval #TETHERING_ERROR_NONE Successful
1496 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1497 * @see tethering_usb_get_connected_client()
1498 * @see tethering_connection_state_changed_cb()
1500 int tethering_client_get_tethering_type(tethering_client_h client, tethering_type_e *type);
1503 * @brief Gets the tethering band of client.
1505 * @privlevel platform
1506 * @privilege %http://tizen.org/privilege/tethering.admin
1507 * @param[in] client The handle of client
1508 * @param[out] band The band of tethering
1509 * @return 0 on success, otherwise a negative error value.
1510 * @retval #TETHERING_ERROR_NONE Successful
1511 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1512 * @see tethering_usb_get_connected_client()
1513 * @see tethering_connection_state_changed_cb()
1515 int tethering_client_get_tethering_band(tethering_client_h client, tethering_band_e *band);
1519 * @brief Gets the name of a client.
1521 * @privlevel platform
1522 * @privilege %http://tizen.org/privilege/tethering.admin
1523 * @remarks @a name must be released using free().
1524 * @param[in] client The client handle
1525 * @param[out] name The name of the client
1526 * @return 0 on success, otherwise a negative error value
1527 * @retval #TETHERING_ERROR_NONE Successful
1528 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1529 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1530 * @see tethering_usb_get_connected_client()
1531 * @see tethering_connection_state_changed_cb()
1533 int tethering_client_get_name(tethering_client_h client, char **name);
1536 * @brief Gets the IP address of a client.
1538 * @privlevel platform
1539 * @privilege %http://tizen.org/privilege/tethering.admin
1540 * @remarks @a ip_address must be released using free().
1541 * @param[in] client The client handle
1542 * @param[in] address_family The address family of IP address. Currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported
1543 * @param[out] ip_address The IP address
1544 * @return 0 on success, otherwise a negative error value
1545 * @retval #TETHERING_ERROR_NONE Successful
1546 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1547 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1548 * @see tethering_usb_get_connected_client()
1549 * @see tethering_connection_state_changed_cb()
1551 int tethering_client_get_ip_address(tethering_client_h client, tethering_address_family_e address_family, char **ip_address);
1554 * @brief Gets the MAC address of a client such as "FC:A1:3E:D6:B1:B1".
1556 * @privlevel platform
1557 * @privilege %http://tizen.org/privilege/tethering.admin
1558 * @remarks @a mac_address must be released using free().
1559 * @param[in] client The client handle
1560 * @param[out] mac_address The MAC address
1561 * @return 0 on success, otherwise a negative error value
1562 * @retval #TETHERING_ERROR_NONE Successful
1563 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1564 * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory
1565 * @see tethering_usb_get_connected_client()
1566 * @see tethering_connection_state_changed_cb()
1568 int tethering_client_get_mac_address(tethering_client_h client, char **mac_address);
1571 * @brief Gets the connection time of a client.
1573 * @privlevel platform
1574 * @privilege %http://tizen.org/privilege/tethering.admin
1575 * @param[in] client The client handle
1576 * @param[out] time The connected time of the client
1577 * @return 0 on success, otherwise a negative error value
1578 * @retval #TETHERING_ERROR_NONE Successful
1579 * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter
1580 * @see tethering_usb_get_connected_client()
1581 * @see tethering_connection_state_changed_cb()
1583 int tethering_client_get_time(tethering_client_h client, time_t *timestamp);
1595 #endif /* __TIZEN_NETWORK_TETHERING_H__ */