}
//LCOV_EXCL_START
-int _connection_libnet_get_ethernet_state(connection_ethernet_state_e* state)
+int _connection_libnet_get_ethernet_state(connection_ethernet_state_e *state)
{
int rv;
struct _profile_list_s ethernet_profiles = {0, 0, NULL};
}
//LCOV_EXCL_STOP
-int _connection_libnet_get_bluetooth_state(connection_bt_state_e* state)
+int _connection_libnet_get_bluetooth_state(connection_bt_state_e *state)
{
int i = 0;
int rv = 0;
}
//LCOV_EXCL_STOP
-done:
+done :
__libnet_clear_profile_list(&bluetooth_profiles);
return CONNECTION_ERROR_NONE;
}
//LCOV_EXCL_STOP
-done:
+done :
__libnet_clear_profile_list(&cellular_profiles);
prof_handle_list = g_slist_append(prof_handle_list, *profile);
char *endstr = NULL;
int address_family = 0;
- if (__libnet_check_address_type(AF_INET, host_address))
- address_family = AF_INET;
- else
- return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
+ address_family = AF_INET;
- switch (address_family) {
- case AF_INET:
- endstr = strrchr(host_address, '.');
- if (endstr == NULL ||
- strcmp(endstr, ".0") == 0 ||
- strncmp(host_address, "0.", 2) == 0 ||
- strstr(host_address, "255") != NULL) {
- CONNECTION_LOG(CONNECTION_ERROR, "Invalid IP address Passed\n"); //LCOV_EXCL_LINE
- return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
- }
- break;
- default:
- return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
+ endstr = strrchr(host_address, '.');
+ if (endstr == NULL ||
+ strcmp(endstr, ".0") == 0 ||
+ strncmp(host_address, "0.", 2) == 0 ||
+ strstr(host_address, "255") != NULL) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid IP address Passed\n"); //LCOV_EXCL_LINE
+ return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
rv = net_add_route(host_address, interface_name, address_family);
char *endstr = strrchr(host_address, '.');
int address_family = 0;
- if (__libnet_check_address_type(AF_INET, host_address))
- address_family = AF_INET;
- else
- return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
+ address_family = AF_INET;
- switch (address_family) {
- case AF_INET:
- endstr = strrchr(host_address, '.');
- if (endstr == NULL ||
- strcmp(endstr, ".0") == 0 ||
- strncmp(host_address, "0.", 2) == 0 ||
- strstr(host_address, ".0.") != NULL || strstr(host_address, "255") != NULL) {
- CONNECTION_LOG(CONNECTION_ERROR, "Invalid IP address Passed"); //LCOV_EXCL_LINE
- return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
- }
- break;
- default:
- return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
+ endstr = strrchr(host_address, '.');
+ if (endstr == NULL ||
+ strcmp(endstr, ".0") == 0 ||
+ strncmp(host_address, "0.", 2) == 0 ||
+ strstr(host_address, ".0.") != NULL || strstr(host_address, "255") != NULL) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid IP address Passed"); //LCOV_EXCL_LINE
+ return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
rv = net_remove_route(host_address, interface_name, address_family);
int address_family = 0;
address_family = AF_INET6;
-/* if(__libnet_check_address_type(AF_INET6, host_address))
- address_family = AF_INET6;
- else
- return CONNECTION_ERROR_INVALID_PARAMETER;*/
-
- switch (address_family) {
- case AF_INET6:
- if (strncmp(host_address, "fe80:", 5) == 0 ||
- strncmp(host_address, "ff00:", 5) == 0 ||
- strncmp(host_address, "::", 2) == 0) {
- CONNECTION_LOG(CONNECTION_ERROR, "Invalid IP address Passed\n"); //LCOV_EXCL_LINE
- return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
- }
- break;
- default:
- return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
+
+ if (strncmp(host_address, "fe80:", 5) == 0 ||
+ strncmp(host_address, "ff00:", 5) == 0 ||
+ strncmp(host_address, "::", 2) == 0) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid IP address Passed\n"); //LCOV_EXCL_LINE
+ return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
rv = net_add_route_ipv6(host_address, interface_name, address_family, gateway);
int address_family = 0;
address_family = AF_INET6;
-/* if (__libnet_check_address_type(AF_INET6, host_address))
- address_family = AF_INET6;
- else
- return CONNECTION_ERROR_INVALID_PARAMETER;*/
-
- switch (address_family) {
- case AF_INET6:
- if (strncmp(host_address, "fe80:", 5) == 0 ||
- strncmp(host_address, "ff00:", 5) == 0 ||
- strncmp(host_address, "::", 2) == 0) {
- CONNECTION_LOG(CONNECTION_ERROR, "Invalid IP address Passed\n"); //LCOV_EXCL_LINE
- return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
- }
- break;
- default:
- return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
+
+ if (strncmp(host_address, "fe80:", 5) == 0 ||
+ strncmp(host_address, "ff00:", 5) == 0 ||
+ strncmp(host_address, "::", 2) == 0) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid IP address Passed\n"); //LCOV_EXCL_LINE
+ return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
rv = net_remove_route_ipv6(host_address, interface_name, address_family, gateway);