Apply coding rule
[platform/core/api/connection.git] / src / connection_profile.c
old mode 100644 (file)
new mode 100755 (executable)
index cdd4be7..8e03298
  * limitations under the License.
  */
 
+#include <glib.h>
 #include <stdio.h>
-#include <string.h>
 #include <stdlib.h>
+#include <string.h>
 #include <arpa/inet.h>
-#include <glib.h>
 #include <vconf/vconf.h>
+
 #include "net_connection_private.h"
 
 #define HTTP_PROXY "http_proxy"
@@ -33,7 +34,7 @@ static net_dev_info_t* __profile_get_net_info(net_profile_info_t *profile_info)
        case NET_DEVICE_WIFI:
                return &profile_info->ProfileInfo.Wlan.net_info;
        case NET_DEVICE_ETHERNET:
-               return &profile_info->ProfileInfo.Ethernet.net_info;
+               return &profile_info->ProfileInfo.Ethernet.net_info; //LCOV_EXCL_LINE
        case NET_DEVICE_BLUETOOTH:
                return &profile_info->ProfileInfo.Bluetooth.net_info;
        case NET_DEVICE_DEFAULT:
@@ -58,12 +59,14 @@ static char *__profile_convert_ip_to_string(net_addr_t *ip_addr, connection_addr
 
                inet_ntop(AF_INET, ipaddr, ipstr, INET_ADDRSTRLEN);
        } else {
+               //LCOV_EXCL_START
                ipaddr = (unsigned char *)&ip_addr->Data.Ipv6.s6_addr;
                ipstr = g_try_malloc0(INET6_ADDRSTRLEN);
                if (ipstr == NULL)
                                return NULL;
 
                inet_ntop(AF_INET6, ipaddr, ipstr, INET6_ADDRSTRLEN);
+               //LCOV_EXCL_STOP
        }
 
        return ipstr;
@@ -82,7 +85,7 @@ static void __profile_init_cellular_profile(net_profile_info_t *profile_info, co
 
        if (vconf_get_int(VCONF_TELEPHONY_DEFAULT_DATA_SERVICE,
                                        &default_subscriber_id) != 0)
-               CONNECTION_LOG(CONNECTION_ERROR,
+               CONNECTION_LOG(CONNECTION_ERROR, //LCOV_EXCL_LINE
                                                "Failed to get VCONF_TELEPHONY_DEFAULT_DATA_SERVICE");
 
        profile = (connection_profile_h)profile_info;
@@ -100,20 +103,23 @@ static void __profile_init_wifi_profile(net_profile_info_t *profile_info)
        profile_info->ProfileInfo.Wlan.security_info.enc_mode = WLAN_ENC_MODE_NONE;
 }
 
+//LCOV_EXCL_START
 static const char* __profile_get_ethernet_proxy(void)
 {
        char *proxy;
 
-       proxy = getenv(HTTP_PROXY);
+       proxy = vconf_get_str(VCONFKEY_NETWORK_PROXY);
 
-       if(proxy == NULL) {
+       if (proxy == NULL) {
                CONNECTION_LOG(CONNECTION_ERROR, "Fail to get system proxy");
                return NULL;
        }
 
        return proxy;
 }
+//LCOV_EXCL_STOP
 
+//LCOV_EXCL_START
 connection_cellular_service_type_e _profile_convert_to_connection_cellular_service_type(net_service_type_t svc_type)
 {
        switch (svc_type) {
@@ -202,24 +208,37 @@ net_state_type_t _connection_profile_convert_to_net_state(connection_profile_sta
 
        return libnet_state;
 }
-
+//LCOV_EXCL_STOP
 
 /* Connection profile ********************************************************/
 EXPORT_API int connection_profile_create(connection_profile_type_e type, const char* keyword, connection_profile_h* profile)
 {
        CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE);
 
-       if(type == CONNECTION_PROFILE_TYPE_CELLULAR)
+       if (type == CONNECTION_PROFILE_TYPE_CELLULAR)
                CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
-       else if(type == CONNECTION_PROFILE_TYPE_WIFI)
+       else if (type == CONNECTION_PROFILE_TYPE_WIFI)
                CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
 
-       if ((type != CONNECTION_PROFILE_TYPE_CELLULAR &&
-            type != CONNECTION_PROFILE_TYPE_WIFI) || profile == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+       if (type != CONNECTION_PROFILE_TYPE_CELLULAR &&
+            type != CONNECTION_PROFILE_TYPE_WIFI) {
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+               return CONNECTION_ERROR_INVALID_PARAMETER;
+       }
+
+       if (profile == NULL) {
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       int rv  = _connection_libnet_check_profile_privilege();
+       if (rv == CONNECTION_ERROR_PERMISSION_DENIED)
+               return rv;
+       else if (rv != CONNECTION_ERROR_NONE) {
+               CONNECTION_LOG(CONNECTION_ERROR, "Failed to create profile"); //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
+       }
+
        net_profile_info_t *profile_info = g_try_malloc0(sizeof(net_profile_info_t));
        if (profile_info == NULL)
                return CONNECTION_ERROR_OUT_OF_MEMORY;
@@ -227,7 +246,7 @@ EXPORT_API int connection_profile_create(connection_profile_type_e type, const c
        switch (type) {
        case CONNECTION_PROFILE_TYPE_CELLULAR:
                if (keyword == NULL) {
-                       CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+                       CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                        g_free(profile_info);
                        return CONNECTION_ERROR_INVALID_PARAMETER;
                }
@@ -251,7 +270,7 @@ EXPORT_API int connection_profile_destroy(connection_profile_h profile)
        CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE, TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile))) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
@@ -265,7 +284,7 @@ EXPORT_API int connection_profile_clone(connection_profile_h* cloned_profile, co
        CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE, TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(origin_profile)) || cloned_profile == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
@@ -284,7 +303,7 @@ EXPORT_API int connection_profile_get_id(connection_profile_h profile, char** pr
        CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE, TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) || profile_id == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
@@ -308,7 +327,7 @@ EXPORT_API int connection_profile_get_name(connection_profile_h profile, char**
        CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE, TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) || profile_name == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
@@ -322,8 +341,8 @@ EXPORT_API int connection_profile_get_name(connection_profile_h profile, char**
                *profile_name = g_strdup(profile_info->ProfileInfo.Wlan.essid);
                break;
        case NET_DEVICE_ETHERNET:
-               *profile_name = g_strdup(profile_info->ProfileInfo.Ethernet.net_info.DevName);
-               break;
+               *profile_name = g_strdup(profile_info->ProfileInfo.Ethernet.net_info.DevName); //LCOV_EXCL_LINE
+               break; //LCOV_EXCL_LINE
        case NET_DEVICE_BLUETOOTH: {
                char *bt_name = strrchr(profile_info->ProfileName, '/');
                if (bt_name == NULL)
@@ -342,12 +361,12 @@ EXPORT_API int connection_profile_get_name(connection_profile_h profile, char**
        return CONNECTION_ERROR_NONE;
 }
 
-EXPORT_API int connection_profile_get_type(connection_profile_h profile, connection_profile_type_etype)
+EXPORT_API int connection_profile_get_type(connection_profile_h profile, connection_profile_type_e *type)
 {
        CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE, TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) || type == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
@@ -361,13 +380,13 @@ EXPORT_API int connection_profile_get_type(connection_profile_h profile, connect
                *type = CONNECTION_PROFILE_TYPE_WIFI;
                break;
        case NET_DEVICE_ETHERNET:
-               *type = CONNECTION_PROFILE_TYPE_ETHERNET;
-               break;
+               *type = CONNECTION_PROFILE_TYPE_ETHERNET; //LCOV_EXCL_LINE
+               break; //LCOV_EXCL_LINE
        case NET_DEVICE_BLUETOOTH:
                *type = CONNECTION_PROFILE_TYPE_BT;
                break;
        default:
-               CONNECTION_LOG(CONNECTION_ERROR, "Invalid profile type\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid profile type");
                return CONNECTION_ERROR_OPERATION_FAILED;
        }
 
@@ -379,7 +398,7 @@ EXPORT_API int connection_profile_get_network_interface_name(connection_profile_
        CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE, TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) || interface_name == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
@@ -402,7 +421,7 @@ EXPORT_API int connection_profile_refresh(connection_profile_h profile)
        CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE, TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile))) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
@@ -411,11 +430,11 @@ EXPORT_API int connection_profile_refresh(connection_profile_h profile)
 
        rv = net_get_profile_info(profile_info->ProfileName, &profile_info_local);
        if (rv == NET_ERR_ACCESS_DENIED) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Access denied");
-               return CONNECTION_ERROR_PERMISSION_DENIED;
+               CONNECTION_LOG(CONNECTION_ERROR, "Access denied"); //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_PERMISSION_DENIED; //LCOV_EXCL_LINE
        } else if (rv != NET_ERR_NONE) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Failed to get profile information");
-               return CONNECTION_ERROR_OPERATION_FAILED;
+               CONNECTION_LOG(CONNECTION_ERROR, "Failed to get profile information"); //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        memcpy(profile, &profile_info_local, sizeof(net_profile_info_t));
@@ -428,20 +447,18 @@ EXPORT_API int connection_profile_get_state(connection_profile_h profile, connec
        CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE, TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) || state == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
        net_profile_info_t *profile_info = profile;
        *state = _profile_convert_to_cp_state(profile_info->ProfileState);
-       if (*state < 0)
-               return CONNECTION_ERROR_OPERATION_FAILED;
 
        return CONNECTION_ERROR_NONE;
 }
 
 EXPORT_API int connection_profile_get_ip_config_type(connection_profile_h profile,
-               connection_address_family_e address_family, connection_ip_config_type_etype)
+               connection_address_family_e address_family, connection_ip_config_type_e *type)
 {
        net_ip_config_type_t profile_type;
 
@@ -467,6 +484,7 @@ EXPORT_API int connection_profile_get_ip_config_type(connection_profile_h profil
 
        if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4) {
                switch (profile_type) {
+               //LCOV_EXCL_START
                case NET_IP_CONFIG_TYPE_STATIC:
                        *type = CONNECTION_IP_CONFIG_TYPE_STATIC;
                        break;
@@ -488,8 +506,10 @@ EXPORT_API int connection_profile_get_ip_config_type(connection_profile_h profil
                        break;
                default:
                        return CONNECTION_ERROR_OPERATION_FAILED;
+               //LCOV_EXCL_STOP
                }
        } else {
+               //LCOV_EXCL_START
                switch (profile_type) {
                case NET_IP_CONFIG_TYPE_STATIC:
                        *type = CONNECTION_IP_CONFIG_TYPE_STATIC;
@@ -507,6 +527,7 @@ EXPORT_API int connection_profile_get_ip_config_type(connection_profile_h profil
                        return  CONNECTION_ERROR_OPERATION_FAILED;
 
                }
+               //LCOV_EXCL_STOP
        }
 
        return CONNECTION_ERROR_NONE;
@@ -564,9 +585,14 @@ EXPORT_API int connection_profile_get_subnet_mask(connection_profile_h profile,
                return CONNECTION_ERROR_OPERATION_FAILED;
 
        if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
+               //LCOV_EXCL_START
                prefixlen = g_try_malloc0(MAX_PREFIX_LENGTH);
-               snprintf(prefixlen, MAX_PREFIX_LENGTH, "%d", net_info->PrefixLen6);
-               *subnet_mask =  prefixlen;
+               if (prefixlen != NULL) {
+                       snprintf(prefixlen, MAX_PREFIX_LENGTH, "%d", net_info->PrefixLen6);
+                       *subnet_mask = prefixlen;
+               } else
+                       *subnet_mask = NULL;
+               //LCOV_EXCL_STOP
        } else
                *subnet_mask = __profile_convert_ip_to_string(&net_info->SubnetMask,
                                address_family);
@@ -595,7 +621,7 @@ EXPORT_API int connection_profile_get_gateway_address(connection_profile_h profi
        if (net_info == NULL)
                return CONNECTION_ERROR_OPERATION_FAILED;
 
-       if(address_family == CONNECTION_ADDRESS_FAMILY_IPV6)
+       if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6)
                *gateway_address = __profile_convert_ip_to_string(
                                        &net_info->GatewayAddr6, address_family);
        else
@@ -628,14 +654,14 @@ EXPORT_API int connection_profile_get_dns_address(connection_profile_h profile,
        if (net_info == NULL)
                return CONNECTION_ERROR_OPERATION_FAILED;
 
-       if(address_family == CONNECTION_ADDRESS_FAMILY_IPV4)
+       if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4)
                *dns_address = __profile_convert_ip_to_string(&net_info->DnsAddr[order-1],
                                address_family);
-       else if(address_family == CONNECTION_ADDRESS_FAMILY_IPV6)
-               *dns_address = __profile_convert_ip_to_string(&net_info->DnsAddr6[order-1],
+       else if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6) //LCOV_EXCL_LINE
+               *dns_address = __profile_convert_ip_to_string(&net_info->DnsAddr6[order-1], //LCOV_EXCL_LINE
                                address_family);
        else
-               CONNECTION_LOG(CONNECTION_ERROR, "Invalid address family\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid address family\n"); //LCOV_EXCL_LINE
 
        if (*dns_address == NULL)
                return CONNECTION_ERROR_OUT_OF_MEMORY;
@@ -643,12 +669,12 @@ EXPORT_API int connection_profile_get_dns_address(connection_profile_h profile,
        return CONNECTION_ERROR_NONE;
 }
 
-EXPORT_API int connection_profile_get_proxy_type(connection_profile_h profile, connection_proxy_type_etype)
+EXPORT_API int connection_profile_get_proxy_type(connection_profile_h profile, connection_proxy_type_e *type)
 {
        CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE, TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) || type == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
@@ -658,6 +684,7 @@ EXPORT_API int connection_profile_get_proxy_type(connection_profile_h profile, c
        if (net_info == NULL)
                return CONNECTION_ERROR_OPERATION_FAILED;
 
+       //LCOV_EXCL_START
        if (profile_info->profile_type == NET_DEVICE_ETHERNET) {
                proxy = __profile_get_ethernet_proxy();
                if (proxy == NULL)
@@ -667,8 +694,10 @@ EXPORT_API int connection_profile_get_proxy_type(connection_profile_h profile, c
 
                return CONNECTION_ERROR_NONE;
        }
+       //LCOV_EXCL_STOP
 
        switch (net_info->ProxyMethod) {
+       //LCOV_EXCL_START
        case NET_PROXY_TYPE_DIRECT:
                *type = CONNECTION_PROXY_TYPE_DIRECT;
                break;
@@ -681,6 +710,7 @@ EXPORT_API int connection_profile_get_proxy_type(connection_profile_h profile, c
        case NET_PROXY_TYPE_UNKNOWN:
        default:
                return CONNECTION_ERROR_OPERATION_FAILED;
+       //LCOV_EXCL_STOP
        }
 
        return CONNECTION_ERROR_NONE;
@@ -731,13 +761,14 @@ EXPORT_API int connection_profile_set_ip_config_type(connection_profile_h profil
        if (net_info == NULL)
                return CONNECTION_ERROR_OPERATION_FAILED;
 
-       if(address_family == CONNECTION_ADDRESS_FAMILY_IPV4)
+       if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4)
                profile_type = &net_info->IpConfigType ;
        else
                profile_type = &net_info->IpConfigType6 ;
 
-       if(address_family == CONNECTION_ADDRESS_FAMILY_IPV4) {
+       if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4) {
                switch (type) {
+               //LCOV_EXCL_START
                case CONNECTION_IP_CONFIG_TYPE_STATIC:
                        *profile_type = NET_IP_CONFIG_TYPE_STATIC;
                        net_info->IpAddr.Data.Ipv4.s_addr = 0;
@@ -763,8 +794,10 @@ EXPORT_API int connection_profile_set_ip_config_type(connection_profile_h profil
 
                default:
                        return CONNECTION_ERROR_INVALID_PARAMETER;
+               //LCOV_EXCL_STOP
                }
        } else {
+               //LCOV_EXCL_START
                switch (type) {
                case CONNECTION_IP_CONFIG_TYPE_STATIC:
                        *profile_type = NET_IP_CONFIG_TYPE_STATIC;
@@ -785,6 +818,7 @@ EXPORT_API int connection_profile_set_ip_config_type(connection_profile_h profil
                default:
                        return CONNECTION_ERROR_INVALID_PARAMETER;
                }
+               //LCOV_EXCL_STOP
        }
 
        return CONNECTION_ERROR_NONE;
@@ -807,12 +841,14 @@ EXPORT_API int connection_profile_set_ip_address(connection_profile_h profile,
        if (net_info == NULL)
                return CONNECTION_ERROR_OPERATION_FAILED;
 
-       if(address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
+       if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
+               //LCOV_EXCL_START
                if (ip_address == NULL)
                        inet_pton(AF_INET6, "::", &net_info->IpAddr6.Data.Ipv6);
                else if (inet_pton(AF_INET6, ip_address,
                                        &net_info->IpAddr6.Data.Ipv6) < 1)
                        return CONNECTION_ERROR_INVALID_PARAMETER;
+               //LCOV_EXCL_STOP
        } else {
                if (ip_address == NULL)
                        net_info->IpAddr.Data.Ipv4.s_addr = 0;
@@ -841,15 +877,17 @@ EXPORT_API int connection_profile_set_subnet_mask(connection_profile_h profile,
        if (net_info == NULL)
                return CONNECTION_ERROR_OPERATION_FAILED;
 
-       if(address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
+       if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
+               //LCOV_EXCL_START
                if (subnet_mask == NULL)
                        net_info->PrefixLen6 = 0 ;
                else
                        net_info->PrefixLen6 = atoi(subnet_mask) ;
+               //LCOV_EXCL_STOP
        } else {
                if (subnet_mask == NULL)
                        net_info->SubnetMask.Data.Ipv4.s_addr = 0;
-               else if (inet_pton(AF_INET, subnet_mask , &net_info->SubnetMask.Data.Ipv4)  < 1 )
+               else if (inet_pton(AF_INET, subnet_mask , &net_info->SubnetMask.Data.Ipv4)  < 1)
                        return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
@@ -873,11 +911,13 @@ EXPORT_API int connection_profile_set_gateway_address(connection_profile_h profi
        if (net_info == NULL)
                return CONNECTION_ERROR_OPERATION_FAILED;
 
-       if(address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
+       if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
+               //LCOV_EXCL_START
                if (gateway_address == NULL)
                        inet_pton(AF_INET6, "::", &net_info->GatewayAddr6.Data.Ipv6);
                else if (inet_pton(AF_INET6, gateway_address, &net_info->GatewayAddr6.Data.Ipv6) < 1)
                        return CONNECTION_ERROR_INVALID_PARAMETER;
+               //LCOV_EXCL_STOP
        } else {
                if (gateway_address == NULL)
                        net_info->GatewayAddr.Data.Ipv4.s_addr = 0;
@@ -907,7 +947,8 @@ EXPORT_API int connection_profile_set_dns_address(connection_profile_h profile,
        if (net_info == NULL)
                return CONNECTION_ERROR_OPERATION_FAILED;
 
-       if(address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
+       if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
+               //LCOV_EXCL_START
                net_info->DnsAddr6[order-1].Type = NET_ADDR_IPV6;
                if (dns_address == NULL)
                        inet_pton(AF_INET6, "::", &net_info->DnsAddr6[order-1].Data.Ipv6);
@@ -915,6 +956,7 @@ EXPORT_API int connection_profile_set_dns_address(connection_profile_h profile,
                        return CONNECTION_ERROR_INVALID_PARAMETER;
                if (net_info->DnsCount6 < order)
                        net_info->DnsCount6 = order;
+               //LCOV_EXCL_STOP
        } else {
                net_info->DnsAddr[order-1].Type = NET_ADDR_IPV4;
                if (dns_address == NULL)
@@ -933,7 +975,7 @@ EXPORT_API int connection_profile_set_proxy_type(connection_profile_h profile, c
        CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE, TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile))) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
@@ -943,6 +985,7 @@ EXPORT_API int connection_profile_set_proxy_type(connection_profile_h profile, c
                return CONNECTION_ERROR_OPERATION_FAILED;
 
        switch (type) {
+       //LCOV_EXCL_START
        case CONNECTION_PROXY_TYPE_DIRECT:
                net_info->ProxyMethod = NET_PROXY_TYPE_DIRECT;
                break;
@@ -954,6 +997,7 @@ EXPORT_API int connection_profile_set_proxy_type(connection_profile_h profile, c
                break;
        default:
                return CONNECTION_ERROR_INVALID_PARAMETER;
+       //LCOV_EXCL_STOP
        }
 
        return CONNECTION_ERROR_NONE;
@@ -990,22 +1034,22 @@ EXPORT_API int connection_profile_set_state_changed_cb(connection_profile_h prof
        CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE, TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) || callback == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
        if (_connection_libnet_add_to_profile_cb_list(profile, callback, user_data))
                return CONNECTION_ERROR_NONE;
 
-       return CONNECTION_ERROR_OPERATION_FAILED;
+       return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
 }
 
 EXPORT_API int connection_profile_unset_state_changed_cb(connection_profile_h profile)
 {
        CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE, TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
 
-       if (!(_connection_libnet_check_profile_cb_validity(profile))) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+       if (!(_connection_libnet_check_profile_validity(profile))) {
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
@@ -1022,7 +1066,7 @@ EXPORT_API int connection_profile_get_wifi_essid(connection_profile_h profile, c
        CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) || essid == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
@@ -1043,7 +1087,7 @@ EXPORT_API int connection_profile_get_wifi_bssid(connection_profile_h profile, c
        CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) || bssid == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
@@ -1064,7 +1108,7 @@ EXPORT_API int connection_profile_get_wifi_rssi(connection_profile_h profile, in
        CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) || rssi == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
@@ -1083,7 +1127,7 @@ EXPORT_API int connection_profile_get_wifi_frequency(connection_profile_h profil
        CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) || frequency == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
@@ -1102,7 +1146,7 @@ EXPORT_API int connection_profile_get_wifi_max_speed(connection_profile_h profil
        CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) || max_speed == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
@@ -1116,12 +1160,12 @@ EXPORT_API int connection_profile_get_wifi_max_speed(connection_profile_h profil
        return CONNECTION_ERROR_NONE;
 }
 
-EXPORT_API int connection_profile_get_wifi_security_type(connection_profile_h profile, connection_wifi_security_type_etype)
+EXPORT_API int connection_profile_get_wifi_security_type(connection_profile_h profile, connection_wifi_security_type_e *type)
 {
        CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) || type == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
@@ -1131,6 +1175,7 @@ EXPORT_API int connection_profile_get_wifi_security_type(connection_profile_h pr
                return CONNECTION_ERROR_INVALID_PARAMETER;
 
        switch (profile_info->ProfileInfo.Wlan.security_info.sec_mode) {
+       //LCOV_EXCL_START
        case WLAN_SEC_MODE_NONE:
                *type = CONNECTION_WIFI_SECURITY_TYPE_NONE;
                break;
@@ -1148,17 +1193,18 @@ EXPORT_API int connection_profile_get_wifi_security_type(connection_profile_h pr
                break;
        default:
                return CONNECTION_ERROR_OPERATION_FAILED;
+       //LCOV_EXCL_STOP
        }
 
        return CONNECTION_ERROR_NONE;
 }
 
-EXPORT_API int connection_profile_get_wifi_encryption_type(connection_profile_h profile, connection_wifi_encryption_type_etype)
+EXPORT_API int connection_profile_get_wifi_encryption_type(connection_profile_h profile, connection_wifi_encryption_type_e *type)
 {
        CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) || type == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
@@ -1168,6 +1214,7 @@ EXPORT_API int connection_profile_get_wifi_encryption_type(connection_profile_h
                return CONNECTION_ERROR_INVALID_PARAMETER;
 
        switch (profile_info->ProfileInfo.Wlan.security_info.enc_mode) {
+       //LCOV_EXCL_START
        case WLAN_ENC_MODE_NONE:
                *type = CONNECTION_WIFI_ENCRYPTION_TYPE_NONE;
                break;
@@ -1185,6 +1232,7 @@ EXPORT_API int connection_profile_get_wifi_encryption_type(connection_profile_h
                break;
        default:
                return CONNECTION_ERROR_OPERATION_FAILED;
+       //LCOV_EXCL_STOP
        }
 
        return CONNECTION_ERROR_NONE;
@@ -1195,7 +1243,7 @@ EXPORT_API int connection_profile_is_wifi_passphrase_required(connection_profile
        CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) || required == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
@@ -1210,6 +1258,7 @@ EXPORT_API int connection_profile_is_wifi_passphrase_required(connection_profile
        }
 
        switch (profile_info->ProfileInfo.Wlan.security_info.sec_mode) {
+       //LCOV_EXCL_START
        case WLAN_SEC_MODE_NONE:
                *required = false;
                break;
@@ -1221,6 +1270,7 @@ EXPORT_API int connection_profile_is_wifi_passphrase_required(connection_profile
                break;
        default:
                return CONNECTION_ERROR_OPERATION_FAILED;
+       //LCOV_EXCL_STOP
        }
 
        return CONNECTION_ERROR_NONE;
@@ -1231,7 +1281,7 @@ EXPORT_API int connection_profile_set_wifi_passphrase(connection_profile_h profi
        CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) || passphrase == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
@@ -1251,7 +1301,7 @@ EXPORT_API int connection_profile_is_wifi_wps_supported(connection_profile_h pro
        CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) || supported == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
@@ -1270,70 +1320,28 @@ EXPORT_API int connection_profile_is_wifi_wps_supported(connection_profile_h pro
 
 
 /* Cellular profile **********************************************************/
-EXPORT_API int connection_profile_get_cellular_network_type(connection_profile_h profile, connection_cellular_network_type_e* type)
-{
-       CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
-
-       if (!(_connection_libnet_check_profile_validity(profile)) || type == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
-               return CONNECTION_ERROR_INVALID_PARAMETER;
-       }
-
-       int network_type;
-       net_profile_info_t *profile_info = profile;
-
-       if (profile_info->profile_type != NET_DEVICE_CELLULAR)
-               return CONNECTION_ERROR_INVALID_PARAMETER;
-
-       if (vconf_get_int(VCONFKEY_TELEPHONY_SVC_ACT, &network_type)) {
-               CONNECTION_LOG(CONNECTION_ERROR, "vconf_get_int Failed\n");
-               return CONNECTION_ERROR_OPERATION_FAILED;
-       }
-
-       CONNECTION_LOG(CONNECTION_INFO, "Cellular network type = %d\n", network_type);
-
-       switch (network_type) {
-       case VCONFKEY_TELEPHONY_SVC_ACT_NONE:
-               *type = CONNECTION_CELLULAR_NETWORK_TYPE_UNKNOWN;
-               break;
-       case VCONFKEY_TELEPHONY_SVC_ACT_GPRS:
-               *type = CONNECTION_CELLULAR_NETWORK_TYPE_GPRS;
-               break;
-       case VCONFKEY_TELEPHONY_SVC_ACT_EGPRS:
-               *type = CONNECTION_CELLULAR_NETWORK_TYPE_EDGE;
-               break;
-       case VCONFKEY_TELEPHONY_SVC_ACT_UMTS:
-               *type = CONNECTION_CELLULAR_NETWORK_TYPE_UMTS;
-               break;
-       default:
-               return CONNECTION_ERROR_OPERATION_FAILED;
-       }
-
-       return CONNECTION_ERROR_NONE;
-}
-
 EXPORT_API int connection_profile_get_cellular_service_type(connection_profile_h profile,
                                                connection_cellular_service_type_e* type)
 {
        CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) || type == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
        net_profile_info_t *profile_info = profile;
 
        if (profile_info->profile_type != NET_DEVICE_CELLULAR) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Invalid profile type Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
        *type = _profile_convert_to_connection_cellular_service_type(profile_info->ProfileInfo.Pdp.ServiceType);
 
        if (*type == CONNECTION_CELLULAR_SERVICE_TYPE_UNKNOWN) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Invalid service type Passed\n");
-               return CONNECTION_ERROR_OPERATION_FAILED;
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid service type Passed"); //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        return CONNECTION_ERROR_NONE;
@@ -1344,14 +1352,16 @@ EXPORT_API int connection_profile_get_cellular_apn(connection_profile_h profile,
        CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) || apn == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
        net_profile_info_t *profile_info = profile;
 
-       if (profile_info->profile_type != NET_DEVICE_CELLULAR)
-               return CONNECTION_ERROR_INVALID_PARAMETER;
+       if (profile_info->profile_type != NET_DEVICE_CELLULAR) {
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter"); //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
+       }
 
        *apn = g_strdup(profile_info->ProfileInfo.Pdp.Apn);
        if (*apn == NULL)
@@ -1361,22 +1371,25 @@ EXPORT_API int connection_profile_get_cellular_apn(connection_profile_h profile,
 }
 
 EXPORT_API int connection_profile_get_cellular_auth_info(connection_profile_h profile,
-               connection_cellular_auth_type_etype, char** user_name, char** password)
+               connection_cellular_auth_type_e *type, char** user_name, char** password)
 {
        CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) ||
            type == NULL || user_name == NULL || password == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
        net_profile_info_t *profile_info = profile;
 
-       if (profile_info->profile_type != NET_DEVICE_CELLULAR)
+       if (profile_info->profile_type != NET_DEVICE_CELLULAR) {
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
+       }
 
        switch (profile_info->ProfileInfo.Pdp.AuthInfo.AuthType) {
+       //LCOV_EXCL_START
        case NET_PDP_AUTH_NONE:
                *type = CONNECTION_CELLULAR_AUTH_TYPE_NONE;
                break;
@@ -1388,6 +1401,7 @@ EXPORT_API int connection_profile_get_cellular_auth_info(connection_profile_h pr
                break;
        default:
                return CONNECTION_ERROR_OPERATION_FAILED;
+       //LCOV_EXCL_STOP
        }
 
        *user_name = g_strdup(profile_info->ProfileInfo.Pdp.AuthInfo.UserName);
@@ -1396,8 +1410,8 @@ EXPORT_API int connection_profile_get_cellular_auth_info(connection_profile_h pr
 
        *password = g_strdup(profile_info->ProfileInfo.Pdp.AuthInfo.Password);
        if (*password == NULL) {
-               g_free(*user_name);
-               return CONNECTION_ERROR_OUT_OF_MEMORY;
+               g_free(*user_name); //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
        }
 
        return CONNECTION_ERROR_NONE;
@@ -1408,14 +1422,16 @@ EXPORT_API int connection_profile_get_cellular_home_url(connection_profile_h pro
        CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) || home_url == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
        net_profile_info_t *profile_info = profile;
 
-       if (profile_info->profile_type != NET_DEVICE_CELLULAR)
+       if (profile_info->profile_type != NET_DEVICE_CELLULAR) {
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
+       }
 
        *home_url = g_strdup(profile_info->ProfileInfo.Pdp.HomeURL);
        if (*home_url == NULL)
@@ -1429,14 +1445,16 @@ EXPORT_API int connection_profile_is_cellular_roaming(connection_profile_h profi
        CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) || is_roaming == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
        net_profile_info_t *profile_info = profile;
 
-       if (profile_info->profile_type != NET_DEVICE_CELLULAR)
+       if (profile_info->profile_type != NET_DEVICE_CELLULAR) {
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
+       }
 
        if (profile_info->ProfileInfo.Pdp.Roaming)
                *is_roaming = true;
@@ -1524,16 +1542,19 @@ EXPORT_API int connection_profile_set_cellular_service_type(connection_profile_h
        CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile))) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
        net_profile_info_t *profile_info = profile;
 
-       if (profile_info->profile_type != NET_DEVICE_CELLULAR)
+       if (profile_info->profile_type != NET_DEVICE_CELLULAR) {
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
+       }
 
        switch (service_type) {
+       //LCOV_EXCL_START
        case CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET:
                profile_info->ProfileInfo.Pdp.ServiceType = NET_SERVICE_INTERNET;
                break;
@@ -1555,6 +1576,7 @@ EXPORT_API int connection_profile_set_cellular_service_type(connection_profile_h
        case CONNECTION_CELLULAR_SERVICE_TYPE_UNKNOWN:
        default:
                return CONNECTION_ERROR_INVALID_PARAMETER;
+       //LCOV_EXCL_STOP
        }
 
        return CONNECTION_ERROR_NONE;
@@ -1565,14 +1587,16 @@ EXPORT_API int connection_profile_set_cellular_apn(connection_profile_h profile,
        CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) || apn == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
        net_profile_info_t *profile_info = profile;
 
-       if (profile_info->profile_type != NET_DEVICE_CELLULAR)
+       if (profile_info->profile_type != NET_DEVICE_CELLULAR) {
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
+       }
 
        g_strlcpy(profile_info->ProfileInfo.Pdp.Apn, apn, NET_PDP_APN_LEN_MAX+1);
 
@@ -1586,16 +1610,19 @@ EXPORT_API int connection_profile_set_cellular_auth_info(connection_profile_h pr
 
        if (!(_connection_libnet_check_profile_validity(profile)) ||
            user_name == NULL || password == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
        net_profile_info_t *profile_info = profile;
 
-       if (profile_info->profile_type != NET_DEVICE_CELLULAR)
+       if (profile_info->profile_type != NET_DEVICE_CELLULAR) {
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
+       }
 
        switch (type) {
+       //LCOV_EXCL_START
        case CONNECTION_CELLULAR_AUTH_TYPE_NONE:
                profile_info->ProfileInfo.Pdp.AuthInfo.AuthType = NET_PDP_AUTH_NONE;
                break;
@@ -1607,6 +1634,7 @@ EXPORT_API int connection_profile_set_cellular_auth_info(connection_profile_h pr
                break;
        default:
                return CONNECTION_ERROR_INVALID_PARAMETER;
+       //LCOV_EXCL_STOP
        }
 
        g_strlcpy(profile_info->ProfileInfo.Pdp.AuthInfo.UserName, user_name, NET_PDP_AUTH_USERNAME_LEN_MAX+1);
@@ -1620,14 +1648,16 @@ EXPORT_API int connection_profile_set_cellular_home_url(connection_profile_h pro
        CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
 
        if (!(_connection_libnet_check_profile_validity(profile)) || home_url == NULL) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
        net_profile_info_t *profile_info = profile;
 
-       if (profile_info->profile_type != NET_DEVICE_CELLULAR)
+       if (profile_info->profile_type != NET_DEVICE_CELLULAR) {
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
+       }
 
        g_strlcpy(profile_info->ProfileInfo.Pdp.HomeURL, home_url, NET_HOME_URL_LEN_MAX);