* @return @c 0 on success, otherwise a negative error value
* @retval #CONNECTION_ERROR_NONE Successful
* @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CONNECTION_ERROR_INVALID_OPERATION Invalid operation
* @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission denied
* @retval #CONNECTION_ERROR_OPERATION_FAILED Operation Failed
* @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
connection_cellular_subscriber_id_e sim_id);
int _connection_libnet_enable_ethernet_eap(bool enable, const char *profilename);
-int _connection_libnet_ethernet_eap_enabled(bool *enabled);
+int _connection_libnet_ethernet_eap_enabled(const char *profilename, bool *enabled);
int _connection_libnet_profile_save_ethernet_eap_config(connection_handle_s *conn_handle,
connection_profile_h profile);
Name: capi-network-connection
Summary: Network Connection library in TIZEN C API
Version: 1.0.123
-Release: 1
+Release: 2
Group: System/Network
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
return CONNECTION_ERROR_INVALID_PARAMETER;
}
- int ret = _connection_libnet_ethernet_eap_enabled(enabled);
+ net_profile_info_t *profile_info = profile;
+ net_dev_info_t *net_info = __profile_get_net_info(profile_info);
+
+ if (!net_info) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid operation"); //LCOV_EXCL_LINE
+ CONN_UNLOCK; //LCOV_EXCL_LINE
+ return CONNECTION_ERROR_INVALID_OPERATION; //LCOV_EXCL_LINE
+ }
+
+ if (net_info->use_eapol == true) {
+ *enabled = net_info->use_eapol;
+ goto out;
+ }
+
+ int ret = _connection_libnet_ethernet_eap_enabled(net_info->ProfileName, enabled);
if (ret != CONNECTION_ERROR_NONE) {
CONNECTION_LOG(CONNECTION_ERROR, "Failed to get EAP over Ethernet enabled status."); //LCOV_EXCL_LINE
CONN_UNLOCK; //LCOV_EXCL_LINE
return ret; //LCOV_EXCL_LINE
}
+out:
CONNECTION_LOG(CONNECTION_INFO, "EAP over Ethernet enabled status: [%s]", enabled ? "true" : "false");
CONN_UNLOCK;
return CONNECTION_ERROR_NONE;
}
-int _connection_libnet_ethernet_eap_enabled(bool *enabled)
+int _connection_libnet_ethernet_eap_enabled(const char *profilename, bool *enabled)
{
int rv = 0;
gboolean eap_enabled = false;
- rv = net_ethernet_eap_supported(&eap_enabled);
+ rv = net_ethernet_eap_enabled(profilename, &eap_enabled);
if (rv == NET_ERR_ACCESS_DENIED) {
CONNECTION_LOG(CONNECTION_ERROR, "Access denied");
return CONNECTION_ERROR_PERMISSION_DENIED;
if (test_get_user_selected_profile(&profile, true) == false)
return -1;
+ bool enabled = false;
+ if (connection_profile_is_ethernet_eap_enabled(profile, &enabled) != CONNECTION_ERROR_NONE) {
+ printf("Failed to get ethernet eap enabled status!!\n");
+ }
+ printf("EAP over Ethernet is %s\n", enabled ? "enabled" : "not enabled");
+
if (connection_profile_get_name(profile, &profile_name) != CONNECTION_ERROR_NONE) {
printf("Fail to get profile name\n");
return -1;
return NET_ERR_NONE;
}
-API int net_ethernet_eap_supported(gboolean *supported)
+API int net_ethernet_eap_enabled(const char *profilename, gboolean *enabled)
{
- *supported = TRUE;
+ *enabled = TRUE;
return NET_ERR_NONE;
}