From 8a9b6143e9f6a486efee7c4ca6065931436665c7 Mon Sep 17 00:00:00 2001 From: Niraj Kumar Goit Date: Fri, 3 Aug 2018 10:27:56 +0530 Subject: [PATCH] Added config APIs for Hidden AP connection with static IP setting. Change-Id: Icf38c8ed7c42fe117a41c65c8d2b2f2ef5d5e273 Signed-off-by: Niraj Kumar Goit --- include/wifi-manager.h | 286 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 286 insertions(+) diff --git a/include/wifi-manager.h b/include/wifi-manager.h index bd801e9..dfa3d1c 100755 --- a/include/wifi-manager.h +++ b/include/wifi-manager.h @@ -3446,6 +3446,292 @@ int wifi_manager_config_set_hidden_ap_property(wifi_manager_config_h config, boo int wifi_manager_config_get_hidden_ap_property(wifi_manager_config_h config, bool *is_hidden); /** + * @brief Gets access point IP config type from configuration. + * @since_tizen 5.0 + * + * @param[in] config The access point configuration handle + * @param[in] address_family The address family + * @param[out] type The type of IP configuration + * + * @return 0 on success, otherwise negative error value + * @retval #WIFI_MANAGER_ERROR_NONE Successful + * @retval #WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized + * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #WIFI_MANAGER_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Address family not supported + * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported + */ +int wifi_manager_config_get_ip_config_type(wifi_manager_config_h config, + wifi_manager_address_family_e address_family, + wifi_manager_ip_config_type_e *type); + +/** + * @brief Sets access point IP config type to configuration. + * @since_tizen 5.0 + * + * @param[in] config The access point configuration handle + * @param[in] address_family The address family + * @param[in] type The type of IP configuration + * + * @return 0 on success, otherwise negative error value + * @retval #WIFI_MANAGER_ERROR_NONE Successful + * @retval #WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized + * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #WIFI_MANAGER_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family + * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported + * @see wifi_manager_config_save() + */ +int wifi_manager_config_set_ip_config_type(wifi_manager_config_h config, + wifi_manager_address_family_e address_family, + wifi_manager_ip_config_type_e type); + +/** + * @brief Gets access point IP address from configuration. + * @since_tizen 5.0 + * @remarks You must release @a ip_address using free(). + * + * @param[in] config The access point configuration handle + * @param[in] address_family The address family + * @param[out] ip_address The IP address; this value is for default address + * + * @return 0 on success, otherwise negative error value + * @retval #WIFI_MANAGER_ERROR_NONE Successful + * @retval #WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized + * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #WIFI_MANAGER_ERROR_OUT_OF_MEMORY Out of memory + * @retval #WIFI_MANAGER_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Address family not supported + * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported + */ +int wifi_manager_config_get_ip_address(wifi_manager_config_h config, + wifi_manager_address_family_e address_family, char **ip_address); + +/** + * @brief Sets access point IP address to configuration. + * @since_tizen 5.0 + * + * @param[in] config The access point configuration handle + * @param[in] address_family The address family + * @param[in] ip_address The IP address; if you set this value to NULL, then + * the existing value will be deleted. + * + * @return 0 on success, otherwise negative error value + * @retval #WIFI_MANAGER_ERROR_NONE Successful + * @retval #WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized + * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #WIFI_MANAGER_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family + * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported + * @see wifi_manager_config_save() + */ +int wifi_manager_config_set_ip_address(wifi_manager_config_h config, + wifi_manager_address_family_e address_family, const char *ip_address); + +/** + * @brief Gets access point subnet mask from configuration. + * @since_tizen 5.0 + * @remarks You must release @a subnet_mask using free(). + * + * @param[in] config The access point configuration handle + * @param[in] address_family The address family + * @param[out] subnet_mask The subnet mask + * + * @return 0 on success, otherwise negative error value + * @retval #WIFI_MANAGER_ERROR_NONE Successful + * @retval #WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized + * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #WIFI_MANAGER_ERROR_OUT_OF_MEMORY Out of memory + * @retval #WIFI_MANAGER_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Address family not supported + * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported + */ +int wifi_manager_config_get_subnet_mask(wifi_manager_config_h config, + wifi_manager_address_family_e address_family, char **subnet_mask); + +/** + * @brief Sets access point subnet mask to configuration. + * @since_tizen 5.0 + * + * @param[in] config The access point configuration handle + * @param[in] address_family The address family + * @param[in] subnet_mask The subnet mask; if you set this value to NULL, then + * the existing value will be deleted. + * + * @return 0 on success, otherwise negative error value + * @retval #WIFI_MANAGER_ERROR_NONE Successful + * @retval #WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized + * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #WIFI_MANAGER_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family + * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported + * @see wifi_manager_config_save() + */ +int wifi_manager_config_set_subnet_mask(wifi_manager_config_h config, + wifi_manager_address_family_e address_family, const char *subnet_mask); + +/** + * @brief Gets the network prefix length from configuration. + * @since_tizen 5.0 + * + * @param[in] config The access point configuration handle + * @param[in] address_family The address family + * @param[out] prefix_len The network prefix length. \n + * In case of IPv4, it means netmask length \n + * (also called a prefix, e.g. 8, 16, 24, 32) + * + * @return 0 on success, otherwise negative error value + * @retval #WIFI_MANAGER_ERROR_NONE Successful + * @retval #WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized + * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #WIFI_MANAGER_ERROR_OUT_OF_MEMORY Out of memory + * @retval #WIFI_MANAGER_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Address family not supported + * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported + */ +int wifi_manager_config_get_prefix_length(wifi_manager_config_h config, + wifi_manager_address_family_e address_family, int *prefix_len); + +/** + * @brief Sets the network prefix length to configuration. + * @since_tizen 5.0 + * + * @param[in] config The access point configuration handle + * @param[in] address_family The address family + * @param[in] prefix_len The network prefix length. \n + * In case of IPv4, it means netmask length \n + * (also called a prefix, e.g. 8, 16, 24, 32) + * + * @return 0 on success, otherwise negative error value + * @retval #WIFI_MANAGER_ERROR_NONE Successful + * @retval #WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized + * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #WIFI_MANAGER_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family + * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported + * @see wifi_manager_config_save() + */ +int wifi_manager_config_set_prefix_length(wifi_manager_config_h config, + wifi_manager_address_family_e address_family, int prefix_len); + +/** + * @brief Gets access point gateway address from configuration. + * @since_tizen 5.0 + * @remarks You must release @a gateway_address using free(). + * + * @param[in] config The access point configuration handle + * @param[in] address_family The address family + * @param[out] gateway_address The gateway address; this value is for default address + * + * @return 0 on success, otherwise negative error value + * @retval #WIFI_MANAGER_ERROR_NONE Successful + * @retval #WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized + * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #WIFI_MANAGER_ERROR_OUT_OF_MEMORY Out of memory + * @retval #WIFI_MANAGER_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Address family not supported + * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported + */ +int wifi_manager_config_get_gateway_address(wifi_manager_config_h config, + wifi_manager_address_family_e address_family, char **gateway_address); + +/** + * @brief Sets access point gateway address to configuration. + * @since_tizen 5.0 + * + * @param[in] config The access point configuration handle + * @param[in] address_family The address family + * @param[in] gateway_address The gateway address; if you set this value to NULL, then + * the existing value will be deleted. + * + * @return 0 on success, otherwise negative error value + * @retval #WIFI_MANAGER_ERROR_NONE Successful + * @retval #WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized + * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #WIFI_MANAGER_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family + * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported + * @see wifi_manager_config_save() + */ +int wifi_manager_config_set_gateway_address(wifi_manager_config_h config, + wifi_manager_address_family_e address_family, + const char *gateway_address); + +/** + * @brief Gets access point dns config type from configuration. + * @since_tizen 5.0 + * + * @param[in] config The access point configuration handle + * @param[in] address_family The address family + * @param[out] type The type of dns configuration + * + * @return 0 on success, otherwise negative error value + * @retval #WIFI_MANAGER_ERROR_NONE Successful + * @retval #WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized + * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #WIFI_MANAGER_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Address family not supported + * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported + */ +int wifi_manager_config_get_dns_config_type(wifi_manager_config_h config, + wifi_manager_address_family_e address_family, + wifi_manager_dns_config_type_e *type); + +/** + * @brief Sets access point dns config type to configuration. + * @since_tizen 5.0 + * + * @param[in] config The access point configuration handle + * @param[in] address_family The address family + * @param[in] type The type of DNS configuration + * + * @return 0 on success, otherwise negative error value + * @retval #WIFI_MANAGER_ERROR_NONE Successful + * @retval #WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized + * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #WIFI_MANAGER_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family + * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported + * @see wifi_manager_config_save() + */ +int wifi_manager_config_set_dns_config_type(wifi_manager_config_h config, + wifi_manager_address_family_e address_family, + wifi_manager_dns_config_type_e type); + +/** + * @brief Gets access point dns address from configuration. + * @since_tizen 5.0 + * @remarks The allowance of DNS address is @c 2.You must release @a dns_address using free(). + * + * @param[in] config The access point configuration handle + * @param[in] order The order of DNS address; it starts from 1, which means first DNS address + * @param[in] address_family The address family + * @param[out] dns_address The DNS address + * + * @return 0 on success, otherwise negative error value + * @retval #WIFI_MANAGER_ERROR_NONE Successful + * @retval #WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized + * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #WIFI_MANAGER_ERROR_OUT_OF_MEMORY Out of memory + * @retval #WIFI_MANAGER_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Address family not supported + * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported + */ +int wifi_manager_config_get_dns_address(wifi_manager_config_h config, + int order, wifi_manager_address_family_e address_family, + char **dns_address); + +/** + * @brief Sets access point dns address to configuration. + * @since_tizen 5.0 + * + * @param[in] config The access point configuration handle + * @param[in] order The order of DNS address \n + * It starts from 1, which means first DNS address. + * @param[in] address_family The address family + * @param[in] dns_address The dns address; if you set this value to NULL, then + * the existing value will be deleted. + * + * @return 0 on success, otherwise negative error value + * @retval #WIFI_MANAGER_ERROR_NONE Successful + * @retval #WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized + * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #WIFI_MANAGER_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family + * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported + * @see wifi_manager_config_save() + */ +int wifi_manager_config_set_dns_address(wifi_manager_config_h config, + int order, wifi_manager_address_family_e address_family, + const char *dns_address); + +/** * @brief Gets access point anonymous identity from configuration. * @since_tizen 3.0 * @remarks You must release @a anonymous_identity using free(). -- 2.7.4