X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Ftethering.h;h=e6a3515a097959822f82ecc476d583140f2e85d6;hb=HEAD;hp=aba8f717d14a616efb6e354067af77a9d555db82;hpb=39c1211c56c3a990d22d848a3ee98a280c395b79;p=platform%2Fcore%2Fapi%2Ftethering.git diff --git a/include/tethering.h b/include/tethering.h index aba8f71..e6a3515 100644 --- a/include/tethering.h +++ b/include/tethering.h @@ -61,19 +61,23 @@ typedef enum { * @since_tizen 2.3 */ typedef enum { - TETHERING_TYPE_ALL = 0, /**< All type except for TETHERING_TYPE_RESERVED */ + TETHERING_TYPE_ALL = 0, /**< All type */ TETHERING_TYPE_USB, /**< USB type */ TETHERING_TYPE_WIFI, /**< Wi-Fi type */ TETHERING_TYPE_BT, /**< BT type */ - TETHERING_TYPE_RESERVED, /**< Reserved type */ + TETHERING_TYPE_P2P, /**< P2P type */ + TETHERING_TYPE_MAX, /**< Maximum */ } tethering_type_e; +typedef enum { + TETHERING_WIFI_BAND_2G = 0, + TETHERING_WIFI_BAND_5G, +} tethering_band_e; /** * @brief Enumeration for the cause of disabling the tethering. * @since_tizen 2.3 */ -typedef enum -{ +typedef enum { TETHERING_DISABLED_BY_USB_DISCONNECTION = 0, /**< Disabled due to usb disconnection */ TETHERING_DISABLED_BY_FLIGHT_MODE, /**< Disabled due to flight mode */ TETHERING_DISABLED_BY_LOW_BATTERY, /**< Disabled due to low battery */ @@ -102,6 +106,8 @@ typedef enum typedef enum { TETHERING_WIFI_SECURITY_TYPE_NONE = 0, /**< No Security type */ TETHERING_WIFI_SECURITY_TYPE_WPA2_PSK, /**< WPA2_PSK */ + TETHERING_WIFI_SECURITY_TYPE_WPS, /**< WPA2_PSK */ + TETHERING_WIFI_SECURITY_TYPE_SAE, /**< SAE */ } tethering_wifi_security_type_e; /** @@ -115,6 +121,12 @@ typedef enum { TETHERING_WIFI_MODE_TYPE_AD, /**< mode ad */ } tethering_wifi_mode_type_e; +typedef enum { + TETHERING_TYPE_IPSEC_PASSTHROUGH = 0, /**< IPSEC */ + TETHERING_TYPE_PPTP_PASSTHROUGH, /**< PPTP type */ + TETHERING_TYPE_L2TP_PASSTHROUGH, /**< L2TP type */ +} tethering_vpn_passthrough_type_e; + /** * @} */ @@ -137,6 +149,7 @@ typedef void * tethering_client_h; */ typedef enum { TETHERING_ADDRESS_FAMILY_IPV4 = 0, /**< IPV4 Address type */ + TETHERING_ADDRESS_FAMILY_IPV6 = 1, /**< IPV6 Address type (Since 4.0) */ } tethering_address_family_e; /** @@ -250,15 +263,6 @@ typedef void (*tethering_wifi_passphrase_changed_cb)(void *user_data); typedef void (*tethering_wifi_settings_reloaded_cb)(tethering_error_e result, void *user_data); /** - * @brief Called when Wi-Fi AP settings are reloaded. - * @since_tizen 2.3 - * @param[in] result The result of reloading the settings - * @param[in] user_data The user data passed from the request function - * @pre tethering_wifi_ap_reload_settings() will invoke this callback. - */ -typedef void (*tethering_wifi_ap_settings_reloaded_cb)(tethering_error_e result, void *user_data); - -/** * @brief Creates the handle for tethering. * @since_tizen 2.3 * @privlevel platform @@ -320,6 +324,40 @@ int tethering_enable(tethering_h tethering, tethering_type_e type); int tethering_disable(tethering_h tethering, tethering_type_e type); /** + * @brief Enables the IPv6 tethering, asynchronously. + * @since_tizen 4.0 + * @privlevel platform + * @privilege %http://tizen.org/privilege/tethering.admin + * @remarks It supports Wi-Fi tethering and BT tethering only. + * @param[in] tethering The tethering handle + * @param[in] type The tethering type + * @return 0 on success, otherwise negative error value + * @retval #TETHERING_ERROR_NONE Successful + * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter + * @post tethering_enabled_cb() will be invoked. + * @see tethering_is_enabled() + * @see tethering_ipv6_disable() + */ +int tethering_ipv6_enable(tethering_h tethering, tethering_type_e type); + +/** + * @brief Disables the IPv6 tethering, asynchronously. + * @since_tizen 4.0 + * @privlevel platform + * @privilege %http://tizen.org/privilege/tethering.admin + * @remarks It supports Wi-Fi tethering and BT tethering only. + * @param[in] tethering The tethering handle + * @param[in] type The tethering type + * @return 0 on success, otherwise negative error value + * @retval #TETHERING_ERROR_NONE Successful + * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter + * @post tethering_disabled_cb() will be invoked. + * @see tethering_is_enabled() + * @see tethering_ipv6_enable() + */ +int tethering_ipv6_disable(tethering_h tethering, tethering_type_e type); + +/** * @brief Checks whether the tethering is enabled or not. * @since_tizen 2.3 * @privlevel platform @@ -395,6 +433,24 @@ int tethering_get_network_interface_name(tethering_h tethering, tethering_type_e int tethering_get_ip_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **ip_address); /** + * @brief Sets the local IP address. + * @since_tizen 6.5 + * @privlevel platform + * @privilege %http://tizen.org/privilege/tethering.admin + * @param[in] tethering The tethering handle + * @param[in] type The tethering type + * @param[in] address_family The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported) + * @param[out] ip_address The local IP address + * @return 0 on success, otherwise negative error value + * @retval #TETHERING_ERROR_NONE Successful + * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory + * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed + * @see tethering_enable() + */ +int tethering_set_ip_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, const char *ip_address); + +/** * @brief Gets the Gateway address. * @since_tizen 2.3 * @privlevel platform @@ -476,6 +532,19 @@ int tethering_get_data_usage(tethering_h tethering, tethering_data_usage_cb call int tethering_foreach_connected_clients(tethering_h tethering, tethering_type_e type, tethering_connected_client_cb callback, void *user_data); /** + * @brief Gets the clients which are connected. + * @since_tizen 6.0 + * @privlevel platform + * @privilege %http://tizen.org/privilege/tethering.admin + * @param[in] tethering The tethering handle + * @param[in] type The tethering type + * @retval #TETHERING_ERROR_NONE Successful + * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed + */ +int tethering_is_dualband_supported(tethering_h tethering, tethering_type_e type, bool *supported); + +/** * @brief Registers the callback function, which is called when tethering is enabled. * @since_tizen 2.3 * @privlevel platform @@ -882,7 +951,7 @@ int tethering_wifi_remove_allowed_mac_list(tethering_h tethering, const char *ma int tethering_wifi_get_allowed_mac_list(tethering_h tethering, void **allowed_mac_list); /** - * @brief Adds the mac-address to the blocked(black list) client list. + * @brief Adds the mac-address to the blocked client list. * @details AP can disallow the client by adding clients mac-address to the blocked list. * @since_tizen 3.0 * @privlevel platform @@ -899,7 +968,7 @@ int tethering_wifi_get_allowed_mac_list(tethering_h tethering, void **allowed_ma int tethering_wifi_add_blocked_mac_list(tethering_h tethering, const char *mac); /** - * @brief Removes the mac-address from the blocked(black list) client list. + * @brief Removes the mac-address from the blocked client list. * @details Removes the mac-address from the blocked client list. * @since_tizen 3.0 * @privlevel platform @@ -999,7 +1068,7 @@ int tethering_wifi_set_channel(tethering_h tethering, int channel); * @return 0 on success, otherwise negative error value * @retval #TETHERING_ERROR_NONE Successful * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter - * @see tethering_wifi_ap_set_channel() + * @see tethering_wifi_set_channel() */ int tethering_wifi_get_channel(tethering_h tethering, int *channel); @@ -1025,7 +1094,7 @@ int tethering_wifi_set_mode(tethering_h tethering, tethering_wifi_mode_type_e ty * @privilege %http://tizen.org/privilege/tethering.admin * @remarks @a mode must be released using free(). * @param[in] tethering The tethering handle - * @param[out] type The mode of Wi-Fi AP + * @param[out] type The mode of Wi-Fi tethering * @return 0 on success, otherwise negative error value * @retval #TETHERING_ERROR_NONE Successful * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter @@ -1034,148 +1103,366 @@ int tethering_wifi_set_mode(tethering_h tethering, tethering_wifi_mode_type_e ty int tethering_wifi_get_mode(tethering_h tethering, tethering_wifi_mode_type_e *type); /** - * @brief Sets the security type of Wi-Fi AP. - * @details If security type is not set, WPA2_PSK is used. - * @since_tizen 2.3 + * @brief Sets txpower for Wi-Fi tethering. + * @since_tizen 3.0 + * @privlevel platform + * @privilege http://tizen.org/privilege/tethering.admin + * @param[in] tethering The tethering handle + * @param[in] txpower value of txpower to be set + * @return 0 on success, otherwise a negative error value + * @retval #TETHERING_ERROR_NONE Successful + * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported + * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied + * @see tethering_wifi_get_txpower() + */ +int tethering_wifi_set_txpower(tethering_h tethering, unsigned int txpower); + +/** + * @brief Gets txpower for Wi-Fi tethering. + * @since_tizen 3.0 + * @privlevel platform + * @privilege http://tizen.org/privilege/tethering.admin + * @param[in] tethering The tethering handle + * @param[out] txpower value of txpower + * @return 0 on success, otherwise a negative error value + * @retval #TETHERING_ERROR_NONE Successful + * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported + * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied + * @see tethering_wifi_set_txpower() + */ +int tethering_wifi_get_txpower(tethering_h tethering, unsigned int *txpower); + +/** + * @brief Sets mtu for Wi-Fi tethering. + * @since_tizen 3.0 + * @privlevel platform + * @privilege %http://tizen.org/privilege/tethering.admin + * @param[in] tethering The tethering handle + * @param[in] mtu value of mtu to be set + * @return 0 on success, otherwise a negative error value + * @retval #TETHERING_ERROR_NONE Successful + * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported + * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied + */ +int tethering_wifi_set_mtu(tethering_h tethering, unsigned int mtu); + +/** + * @brief Changes mac address for Wi-Fi tethering. + * @since_tizen 3.0 + * @privlevel platform + * @privilege %http://tizen.org/privilege/tethering.admin + * @param[in] tethering The client handle + * @param[in] mac The mac address + * @return 0 on success, otherwise a negative error value + * @retval #TETHERING_ERROR_NONE Successful + * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported + * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied + */ +int tethering_wifi_change_mac(tethering_h tethering, char *mac); + +/** + * @brief Sets max connected devices for Wi-Fi tethering. + * @since_tizen 3.0 + * @privlevel platform + * @privilege %http://tizen.org/privilege/tethering.admin + * @param[in] tethering The client handle + * @param[in] max_device value of max_device to be set + * @return 0 on success, otherwise a negative error value + * @retval #TETHERING_ERROR_NONE Successful + * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported + * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied + * @see tethering_wifi_get_max_connected_device() + */ +int tethering_wifi_set_max_connected_device(tethering_h tethering, int max_device); + +/** + * @brief Gets max connected devices for Wi-Fi tethering. + * @since_tizen 3.0 + * @privlevel platform + * @privilege %http://tizen.org/privilege/tethering.admin + * @param[in] tethering The client handle + * @param[out] max_device value of max_device + * @return 0 on success, otherwise a negative error value + * @retval #TETHERING_ERROR_NONE Successful + * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported + * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied + * @see tethering_wifi_set_max_connected_device() + */ +int tethering_wifi_get_max_connected_device(tethering_h tethering, int *max_device); + +/** + * @brief Enables port forwarding feature. + * @since_tizen 3.0 + * @privlevel platform + * @privilege %http://tizen.org/privilege/tethering.admin + * @details enable/disable port forwarding feature. + * @param[in] tethering The handle of tethering + * @param[in] enable Enable/Disable port forwarding + * @return 0 on success, otherwise negative error value. + * @retval #TETHERING_ERROR_NONE Successful + * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported + * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied + */ +int tethering_wifi_enable_port_forwarding(tethering_h tethering, bool enable); + +/** + * @brief Sets port forwarding rule. + * @since_tizen 3.0 + * @privlevel platform + * @privilege %http://tizen.org/privilege/tethering.admin + * @details Set port forwarding rule. + * @param[in] tethering The handle of tethering + * @param[in] ifname interface name + * @param[in] protocol protocol (tcp/udp) + * @param[in] org_ip original destination ip where packet was meant to sent + * @param[in] org_port original destination port where packet was meant to sent + * @param[in] final_ip new destination ip where packet will be forwarded + * @param[in] final_port new destination port where packet will be forwarded + * @return 0 on success, otherwise negative error value. + * @retval #TETHERING_ERROR_NONE Successful + * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported + * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied + */ +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); + +/** + * @brief Resets port forwarding rule. + * @since_tizen 3.0 + * @privlevel platform + * @privilege %http://tizen.org/privilege/tethering.admin + * @details Reset port forwarding rule. + * @param[in] tethering The handle of tethering + * @return 0 on success, otherwise negative error value. + * @retval #TETHERING_ERROR_NONE Successful + * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported + * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied + */ +int tethering_wifi_reset_port_forwarding_rule(tethering_h tethering); + +/** + * @brief Checks whether the port forwarding is enabled or not. + * @since_tizen 3.0 * @privlevel platform * @privilege %http://tizen.org/privilege/tethering.admin * @param[in] tethering The tethering handle - * @param[in] type The security type - * @return 0 on success, otherwise negative error value + * @param[out] forwarding_enabled @c true if port forwarding is enabled, \n @c false if port forwarding is disabled + * @return 0 on success, otherwise a negative error value * @retval #TETHERING_ERROR_NONE Successful * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed - * @see tethering_wifi_ap_get_security_type() + * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported + * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied */ -int tethering_wifi_ap_set_security_type(tethering_h tethering, tethering_wifi_security_type_e type); +int tethering_wifi_is_port_forwarding_enabled(tethering_h tethering, bool* forwarding_enabled); /** - * @brief Gets the security type of Wi-Fi AP. - * @details If security type is not set, WPA2_PSK is used. - * @since_tizen 2.3 + * @brief Gets the port forwarding rule for Wi-Fi tethering. + * @since_tizen 3.0 * @privlevel platform * @privilege %http://tizen.org/privilege/tethering.admin - * @param[in] tethering The tethering handle - * @param[out] type The security type - * @return 0 on success, otherwise negative error value + * @param[in] tethering The client handle + * @param[out] port_forwarding_list list of port forwarding rules + * @return 0 on success, otherwise a negative error value + * @retval #TETHERING_ERROR_NONE Successful + * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported + * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied + */ +int tethering_wifi_get_port_forwarding_rule(tethering_h tethering, void **port_forwarding_list); + +/** + * @brief Enables port filtering feature. + * @since_tizen 3.0 + * @privlevel platform + * @privilege %http://tizen.org/privilege/tethering.admin + * @details enable/disable port filtering feature. + * @param[in] tethering The handle of tethering + * @param[in] enable Enable/Disable port filtering + * @return 0 on success, otherwise negative error value. * @retval #TETHERING_ERROR_NONE Successful * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter - * @see tethering_wifi_ap_set_security_type() + * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported + * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied */ -int tethering_wifi_ap_get_security_type(tethering_h tethering, tethering_wifi_security_type_e *type); +int tethering_wifi_enable_port_filtering(tethering_h tethering, bool enable); /** - * @brief Sets the SSID (service set identifier) for Wi-Fi AP. - * @details The SSID cannot exceed 32 bytes. If SSID is not set, device name is used as SSID. - * @since_tizen 2.3 + * @brief Sets port filtering rule. + * @since_tizen 3.0 * @privlevel platform * @privilege %http://tizen.org/privilege/tethering.admin - * @param[in] tethering The tethering handle - * @param[in] ssid The SSID - * @return 0 on success, otherwise negative error value + * @details Set port filtering rule. + * @param[in] tethering The handle of tethering + * @param[in] port to be filtered + * @param[in] protocol protocol (tcp/udp) + * @param[in] allow allow/disallow port filtering + * @return 0 on success, otherwise negative error value. * @retval #TETHERING_ERROR_NONE Successful * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory + * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported + * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied */ -int tethering_wifi_ap_set_ssid(tethering_h tethering, const char *ssid); +int tethering_wifi_add_port_filtering_rule(tethering_h tethering, int port, char *protocol, bool allow); /** - * @brief Gets the SSID (service set identifier) for Wi-Fi AP. - * @details If SSID is not set, Device name is used as SSID. - * @since_tizen 2.3 + * @brief Sets custom port filtering rule. + * @since_tizen 3.0 * @privlevel platform * @privilege %http://tizen.org/privilege/tethering.admin - * @remarks @a ssid must be released using free(). - * @param[in] tethering The tethering handle - * @param[out] ssid The SSID - * @return 0 on success, otherwise negative error value + * @details Set custom port filtering rule. + * @param[in] tethering The handle of tethering + * @param[in] port1 to be filtered + * @param[in] port2 to be filtered + * @param[in] protocol protocol (tcp/udp) + * @param[in] allow allow/disallow port filtering + * @return 0 on success, otherwise negative error value. * @retval #TETHERING_ERROR_NONE Successful * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory + * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported + * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied */ -int tethering_wifi_ap_get_ssid(tethering_h tethering, char **ssid); +int tethering_wifi_add_custom_port_filtering_rule(tethering_h tethering, int port1, int port2, char *protocol, bool allow); /** - * @brief Sets the visibility of SSID (service set identifier) for Wi-Fi AP. - * @details If you set the visibility to invisible, then the SSID of this device is hidden and Wi-Fi scan won't find your device. - * @details By default visibility is set to @c true. - * @since_tizen 2.3 + * @brief Gets the port filtering rule for Wi-Fi tethering. + * @since_tizen 3.0 * @privlevel platform * @privilege %http://tizen.org/privilege/tethering.admin - * @remarks This change is applied next time Wi-Fi tethering is enabled. - * @param[in] tethering The tethering handle - * @param[in] visible The visibility of SSID: (@c true = visible, @c false = invisible) - * @return 0 on success, otherwise negative error value + * @param[in] tethering The client handle + * @param[out] port_filtering_list list of port filtering rules + * @return 0 on success, otherwise a negative error value * @retval #TETHERING_ERROR_NONE Successful * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed - * @see tethering_wifi_ap_get_ssid_visibility() + * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported + * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied */ -int tethering_wifi_ap_set_ssid_visibility(tethering_h tethering, bool visible); +int tethering_wifi_get_port_filtering_rule(tethering_h tethering, void **port_filtering_list); /** - * @brief Gets the visibility of SSID (service set identifier) for Wi-Fi AP. - * @details If the visibility is set to invisible, then the SSID of this device is hidden and Wi-Fi scan won't find your device. - * @details By default visibility is set to @c true. - * @since_tizen 2.3 + * @brief Gets the custom port filtering rule for Wi-Fi tethering. + * @since_tizen 3.0 * @privlevel platform * @privilege %http://tizen.org/privilege/tethering.admin - * @param[in] tethering The tethering handle - * @param[out] visible The visibility of SSID: (@c true = visible, @c false = invisible) - * @return 0 on success, otherwise negative error value + * @param[in] tethering The client handle + * @param[out] custom_port_filtering_list list of custom port filtering rules + * @return 0 on success, otherwise a negative error value * @retval #TETHERING_ERROR_NONE Successful * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter - * @see tethering_wifi_ap_set_ssid_visibility() + * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported + * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied */ -int tethering_wifi_ap_get_ssid_visibility(tethering_h tethering, bool *visible); +int tethering_wifi_get_custom_port_filtering_rule(tethering_h tethering, void **custom_port_filtering_list); /** - * @brief Sets the passphrase for Wi-Fi AP. - * @details If the passphrase is not set, random string of 8 characters will be used. - * @since_tizen 2.3 + * @brief Checks whether the port filtering is enabled or not. + * @since_tizen 3.0 * @privlevel platform * @privilege %http://tizen.org/privilege/tethering.admin * @param[in] tethering The tethering handle - * @param[in] passphrase The passphrase - * @return 0 on success, otherwise negative error value + * @param[out] filtering_enabled @c true if port filtering is enabled, \n @c false if port filtering is disabled + * @return 0 on success, otherwise a negative error value * @retval #TETHERING_ERROR_NONE Successful * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter - * @see tethering_wifi_ap_get_passphrase() + * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported + * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied */ -int tethering_wifi_ap_set_passphrase(tethering_h tethering, const char *passphrase); +int tethering_wifi_is_port_filtering_enabled(tethering_h tethering, bool* filtering_enabled); /** - * @brief Gets the passphrase for Wi-Fi AP. - * @details If the passphrase is not set, random string of 8 characters will be used. - * @since_tizen 2.3 + * @brief Sets vpn passthrough rule. + * @since_tizen 3.0 * @privlevel platform * @privilege %http://tizen.org/privilege/tethering.admin - * @remarks @a passphrase must be released using free(). + * @details Set vpn passthrough rule. + * @param[in] tethering The handle of tethering + * @param[in] type vpn passthrough type + * @param[in] enable @c true if vpn passthrough is enabled, \n @c false if vpn passthrough is disabled + * @return 0 on success, otherwise negative error value. + * @retval #TETHERING_ERROR_NONE Successful + * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #TETHERING_ERROR_NOT_SUPPORT_API API not supported + * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission Denied + */ +int tethering_wifi_set_vpn_passthrough_rule(tethering_h tethering, tethering_vpn_passthrough_type_e type, bool enable); + +/** + * @brief Pushes the WPS button to connect with Wi-Fi Tethering client. (WPS PBC) + * @since_tizen 3.0 + * @remarks The WPS button should be pushed when client tries to connect with Soft AP by using WPS PBC. * @param[in] tethering The tethering handle - * @param[out] passphrase The passphrase * @return 0 on success, otherwise negative error value * @retval #TETHERING_ERROR_NONE Successful * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory - * @see tethering_wifi_ap_set_passphrase() + * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed + * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission denied + * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported */ -int tethering_wifi_ap_get_passphrase(tethering_h tethering, char **passphrase); +int tethering_wifi_push_wps_button(tethering_h tethering); /** - * @brief Reloads the settings (SSID / Passphrase / Security type / SSID visibility) for Wi-Fi AP. - * @since_tizen 2.3 + * @brief Sets the WPS PIN to connect with Wi-Fi Tethering client. (WPS PIN) + * @since_tizen 3.0 + * @remarks The WPS PIN should be inserted when client tries to connect with Soft AP by using WPS PIN. + * @param[in] tethering The tethering handle + * @param[in] wps_pin The WPS PIN + * @return 0 on success, otherwise negative error value + * @retval #TETHERING_ERROR_NONE Successful + * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed + * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission denied + * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported + */ +int tethering_wifi_set_wps_pin(tethering_h tethering, const char *wps_pin); + +/** + * @brief Checks whether wifi-sharing is supported or not. + * @since_tizen 6.0 * @privlevel platform * @privilege %http://tizen.org/privilege/tethering.admin - * @remarks Devices connected via MobileAP will be disconnected when the settings are reloaded. * @param[in] tethering The tethering handle - * @param[in] callback The callback function to invoke - * @param[in] user_data The user data to be passed to the callback function - * @return 0 on success, otherwise negative error value + * @param[out] supported @c true if wifi-sharing is supported, \n @c false if wifi-sharing is unsupported + * @return 0 on success, otherwise a negative error value * @retval #TETHERING_ERROR_NONE Successful * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #TETHERING_ERROR_PERMISSION_DENIED Permission denied * @retval #TETHERING_ERROR_OPERATION_FAILED Operation failed */ -int tethering_wifi_ap_reload_settings(tethering_h tethering, tethering_wifi_ap_settings_reloaded_cb callback, void *user_data); +int tethering_wifi_is_sharing_supported(tethering_h tethering, bool *supported); + +/** + * @brief Sets the wifi-sharing flag. + * @since_tizen 6.0 + * @privlevel platform + * @param[in] tethering The tethering handle + * @param[in] sharing @c true if wifi-sharing is set, \n @c false if wifi-sharing is unset + * @return 0 on success, otherwise a negative error value + * @retval #TETHERING_ERROR_NONE Successful + * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported + */ +int tethering_wifi_set_sharing(tethering_h tethering, bool sharing); + +/** + * @brief Gets the wifi-sharing flag. + * @since_tizen 6.0 + * @privlevel platform + * @param[in] tethering The tethering handle + * @param[out] sharing @c true if wifi-sharing is set, \n @c otherwise false. + * @return 0 on success, otherwise a negative error value + * @retval #TETHERING_ERROR_NONE Successful + * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #TETHERING_ERROR_NOT_SUPPORTED API is not supported + */ +int tethering_wifi_get_sharing(tethering_h tethering, bool *sharing); + /** * @} */ @@ -1231,6 +1518,22 @@ int tethering_client_destroy(tethering_client_h client); int tethering_client_get_tethering_type(tethering_client_h client, tethering_type_e *type); /** + * @brief Gets the tethering band of client. + * @since_tizen 6.0 + * @privlevel platform + * @privilege %http://tizen.org/privilege/tethering.admin + * @param[in] client The handle of client + * @param[out] band The band of tethering + * @return 0 on success, otherwise a negative error value. + * @retval #TETHERING_ERROR_NONE Successful + * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter + * @see tethering_usb_get_connected_client() + * @see tethering_connection_state_changed_cb() + */ +int tethering_client_get_tethering_band(tethering_client_h client, tethering_band_e *band); + + +/** * @brief Gets the name of a client. * @since_tizen 2.3 * @privlevel platform @@ -1297,6 +1600,7 @@ int tethering_client_get_mac_address(tethering_client_h client, char **mac_addre */ int tethering_client_get_time(tethering_client_h client, time_t *timestamp); + /** * @} */