profile_info->profile_type = NET_DEVICE_CELLULAR;
profile_info->ProfileState = NET_STATE_TYPE_IDLE;
+ profile_info->ProfileInfo.Pdp.PdnType = NET_PDN_TYPE_UNKNOWN;
+ profile_info->ProfileInfo.Pdp.RoamPdnType = NET_PDN_TYPE_UNKNOWN;
profile_info->ProfileInfo.Pdp.net_info.IpConfigType = NET_IP_CONFIG_TYPE_OFF;
profile_info->ProfileInfo.Pdp.net_info.ProxyMethod = NET_PROXY_TYPE_DIRECT;
g_strlcpy(profile_info->ProfileInfo.Pdp.Keyword, keyword, NET_PDP_APN_LEN_MAX);
}
//LCOV_EXCL_START
-static const char* __profile_get_ethernet_proxy(void)
+static char* __profile_get_ethernet_proxy(void)
{
char *proxy;
}
//LCOV_EXCL_STOP
+static int __profile_convert_netmask_to_prefix_len(const char *netmask)
+{
+ if (netmask == NULL)
+ return 0;
+
+ in_addr_t mask = inet_network(netmask);
+ int prefix_len = 0;
+
+ for (; mask; mask <<= 1)
+ ++prefix_len;
+
+ return prefix_len;
+}
+
+static in_addr_t __profile_convert_prefix_len_to_netmask(int prefix_len)
+{
+ return (prefix_len ? (in_addr_t) 0xFFFFFFFFu >> (32 - prefix_len) : 0);
+}
+
//LCOV_EXCL_START
connection_cellular_service_type_e _profile_convert_to_connection_cellular_service_type(net_service_type_t svc_type)
{
EXPORT_API int connection_profile_get_subnet_mask(connection_profile_h profile,
connection_address_family_e address_family, char** subnet_mask)
{
- char* prefixlen;
-
CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE, TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
if (!(_connection_libnet_check_profile_validity(profile)) ||
return CONNECTION_ERROR_INVALID_PARAMETER;
}
+ if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
+ CONNECTION_LOG(CONNECTION_ERROR,
+ "Please uses connection_profile_get_prefix_length()");
+ return CONNECTION_ERROR_NOT_SUPPORTED;
+ }
+
net_profile_info_t *profile_info = profile;
net_dev_info_t *net_info = __profile_get_net_info(profile_info);
if (net_info == NULL)
return CONNECTION_ERROR_OPERATION_FAILED;
- if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
- //LCOV_EXCL_START
- prefixlen = g_try_malloc0(MAX_PREFIX_LENGTH);
- 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,
+ *subnet_mask = __profile_convert_ip_to_string(&net_info->SubnetMask,
address_family);
if (*subnet_mask == NULL)
return CONNECTION_ERROR_NONE;
}
+EXPORT_API int connection_profile_get_dhcp_server_address(
+ connection_profile_h profile,
+ connection_address_family_e address_family, char** dhcp_server)
+{
+ CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE, TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
+
+ if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Not supported");
+ return CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED;
+ }
+
+ if (!(_connection_libnet_check_profile_validity(profile)) ||
+ (address_family != CONNECTION_ADDRESS_FAMILY_IPV4) ||
+ dhcp_server == NULL) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ net_profile_info_t *profile_info = profile;
+ net_dev_info_t *net_info = __profile_get_net_info(profile_info);
+ if (net_info == NULL)
+ return CONNECTION_ERROR_OPERATION_FAILED;
+
+ CONNECTION_LOG(CONNECTION_INFO, "IP Config %d, DHCP Server Address %s",
+ net_info->IpConfigType, (net_info->BServerAddr ? "TRUE" : "FALSE"));
+
+ *dhcp_server = __profile_convert_ip_to_string(&net_info->ServerAddr,
+ address_family);
+
+ if (*dhcp_server == NULL)
+ return CONNECTION_ERROR_OUT_OF_MEMORY;
+
+ return CONNECTION_ERROR_NONE;
+}
+
EXPORT_API int connection_profile_get_dns_address(connection_profile_h profile, int order,
connection_address_family_e address_family, char** dns_address)
{
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"); //LCOV_EXCL_LINE
if (*dns_address == NULL)
return CONNECTION_ERROR_OUT_OF_MEMORY;
return CONNECTION_ERROR_INVALID_PARAMETER;
}
- const char *proxy;
net_profile_info_t *profile_info = profile;
net_dev_info_t *net_info = __profile_get_net_info(profile_info);
if (net_info == NULL)
//LCOV_EXCL_START
if (profile_info->profile_type == NET_DEVICE_ETHERNET) {
- proxy = __profile_get_ethernet_proxy();
- if (proxy == NULL)
+ char *proxy = __profile_get_ethernet_proxy();
+ if (proxy == NULL) {
*type = CONNECTION_PROXY_TYPE_DIRECT;
- else
+ } else {
*type = CONNECTION_PROXY_TYPE_MANUAL;
+ free(proxy);
+ }
return CONNECTION_ERROR_NONE;
}
CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE, TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
if (!(_connection_libnet_check_profile_validity(profile)) ||
- (address_family != CONNECTION_ADDRESS_FAMILY_IPV4 &&
- address_family != CONNECTION_ADDRESS_FAMILY_IPV6)) {
+ (address_family != CONNECTION_ADDRESS_FAMILY_IPV4 &&
+ address_family != CONNECTION_ADDRESS_FAMILY_IPV6)) {
CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
return CONNECTION_ERROR_INVALID_PARAMETER;
}
+ if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
+ CONNECTION_LOG(CONNECTION_ERROR,
+ "Please uses connection_profile_set_prefix_length()");
+ return CONNECTION_ERROR_NOT_SUPPORTED;
+ }
+
net_profile_info_t *profile_info = profile;
net_dev_info_t *net_info = __profile_get_net_info(profile_info);
if (net_info == NULL)
return CONNECTION_ERROR_OPERATION_FAILED;
- 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)
- return CONNECTION_ERROR_INVALID_PARAMETER;
- }
+ 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)
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+
+ net_info->PrefixLen = __profile_convert_netmask_to_prefix_len(subnet_mask);
return CONNECTION_ERROR_NONE;
}
{
CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE, TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
+ CONNECTION_LOG(CONNECTION_ERROR, "Address Family: ", address_family);
if (!(_connection_libnet_check_profile_validity(profile)) ||
(address_family != CONNECTION_ADDRESS_FAMILY_IPV4 &&
address_family != CONNECTION_ADDRESS_FAMILY_IPV6)) {
if (profile_info->profile_type != NET_DEVICE_WIFI)
return CONNECTION_ERROR_INVALID_PARAMETER;
- *max_speed = (int)profile_info->ProfileInfo.Wlan.max_rate;
+ *max_speed = (int)profile_info->ProfileInfo.Wlan.max_rate / 1000000;
return CONNECTION_ERROR_NONE;
}
return CONNECTION_ERROR_NONE;
}
+EXPORT_API int connection_profile_get_cellular_pdn_type(connection_profile_h profile, connection_cellular_pdn_type_e *type)
+{
+ CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
+
+ if (!(_connection_libnet_check_profile_validity(profile)) || type == NULL) {
+ 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 parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ switch (profile_info->ProfileInfo.Pdp.PdnType) {
+ //LCOV_EXCL_START
+ case NET_PDN_TYPE_UNKNOWN:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_UNKNOWN;
+ break;
+ case NET_PDN_TYPE_IPV4:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_IPV4;
+ break;
+ case NET_PDN_TYPE_IPV6:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_IPV6;
+ break;
+ case NET_PDN_TYPE_IPV4_IPV6:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPv6;
+ break;
+ default:
+ return CONNECTION_ERROR_OPERATION_FAILED;
+ //LCOV_EXCL_STOP
+ }
+
+ return CONNECTION_ERROR_NONE;
+}
+
+EXPORT_API int connection_profile_get_cellular_roam_pdn_type(connection_profile_h profile, connection_cellular_pdn_type_e *type)
+{
+ CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
+
+ if (!(_connection_libnet_check_profile_validity(profile)) || type == NULL) {
+ 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 parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ switch (profile_info->ProfileInfo.Pdp.RoamPdnType) {
+ //LCOV_EXCL_START
+ case NET_PDN_TYPE_UNKNOWN:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_UNKNOWN;
+ break;
+ case NET_PDN_TYPE_IPV4:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_IPV4;
+ break;
+ case NET_PDN_TYPE_IPV6:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_IPV6;
+ break;
+ case NET_PDN_TYPE_IPV4_IPV6:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPv6;
+ break;
+ default:
+ return CONNECTION_ERROR_OPERATION_FAILED;
+ //LCOV_EXCL_STOP
+ }
+
+ return CONNECTION_ERROR_NONE;
+}
+
EXPORT_API int connection_profile_is_cellular_roaming(connection_profile_h profile, bool* is_roaming)
{
CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
return CONNECTION_ERROR_NONE;
}
+
+EXPORT_API int connection_profile_set_cellular_pdn_type(connection_profile_h profile, connection_cellular_pdn_type_e type)
+{
+ CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
+
+ if (!(_connection_libnet_check_profile_validity(profile))) {
+ 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 parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ switch (type) {
+ //LCOV_EXCL_START
+ case CONNECTION_CELLULAR_PDN_TYPE_IPV4:
+ profile_info->ProfileInfo.Pdp.PdnType = NET_PDN_TYPE_IPV4;
+ break;
+ case CONNECTION_CELLULAR_PDN_TYPE_IPV6:
+ profile_info->ProfileInfo.Pdp.PdnType = NET_PDN_TYPE_IPV6;
+ break;
+ case CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPv6:
+ profile_info->ProfileInfo.Pdp.PdnType = NET_PDN_TYPE_IPV4_IPV6;
+ CONNECTION_LOG(CONNECTION_WARN, "DEPRECATION WARNINIG: CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPv6 " \
+ "from next release. Use CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPV6 instead");
+ break;
+ case CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPV6:
+ profile_info->ProfileInfo.Pdp.PdnType = NET_PDN_TYPE_IPV4_IPV6;
+ break;
+ default:
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ //LCOV_EXCL_STOP
+ }
+
+ return CONNECTION_ERROR_NONE;
+}
+
+EXPORT_API int connection_profile_set_cellular_roam_pdn_type(connection_profile_h profile, connection_cellular_pdn_type_e type)
+{
+ CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
+
+ if (!(_connection_libnet_check_profile_validity(profile))) {
+ 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 parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ switch (type) {
+ //LCOV_EXCL_START
+ case CONNECTION_CELLULAR_PDN_TYPE_IPV4:
+ profile_info->ProfileInfo.Pdp.RoamPdnType = NET_PDN_TYPE_IPV4;
+ break;
+ case CONNECTION_CELLULAR_PDN_TYPE_IPV6:
+ profile_info->ProfileInfo.Pdp.RoamPdnType = NET_PDN_TYPE_IPV6;
+ break;
+ case CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPv6:
+ profile_info->ProfileInfo.Pdp.RoamPdnType = NET_PDN_TYPE_IPV4_IPV6;
+ CONNECTION_LOG(CONNECTION_WARN, "DEPRECATION WARNINIG: CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPv6 " \
+ "from next release. Use CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPV6 instead");
+ break;
+ case CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPV6:
+ profile_info->ProfileInfo.Pdp.RoamPdnType = NET_PDN_TYPE_IPV4_IPV6;
+ break;
+ default:
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ //LCOV_EXCL_STOP
+ }
+
+ return CONNECTION_ERROR_NONE;
+}
+
+EXPORT_API int connection_profile_get_ipv6_state(connection_profile_h profile, connection_profile_state_e *state)
+{
+ 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, "Invalid parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ net_profile_info_t *profile_info = profile;
+ *state = _profile_convert_to_cp_state(profile_info->ProfileState6);
+ if (*state < 0)
+ return CONNECTION_ERROR_OPERATION_FAILED;
+
+ return CONNECTION_ERROR_NONE;
+}
+
+EXPORT_API int connection_profile_set_dns_config_type(connection_profile_h profile,
+ connection_address_family_e address_family, connection_dns_config_type_e type)
+{
+ CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE,
+ TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
+
+ if (!(_connection_libnet_check_profile_validity(profile))) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ if ((address_family != CONNECTION_ADDRESS_FAMILY_IPV4 &&
+ address_family != CONNECTION_ADDRESS_FAMILY_IPV6) ||
+ (type != CONNECTION_DNS_CONFIG_TYPE_STATIC &&
+ type != CONNECTION_DNS_CONFIG_TYPE_DYNAMIC)) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ net_dns_config_type_t *profileType = NULL;
+ net_dns_config_type_t *profileType6 = NULL;
+ net_profile_info_t *profile_info = profile;
+
+ net_dev_info_t *net_info = __profile_get_net_info(profile_info);
+ if (net_info == NULL)
+ return CONNECTION_ERROR_OPERATION_FAILED;
+
+ if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4) {
+ profileType = &net_info->DnsConfigType;
+ net_info->DnsAddr[0].Data.Ipv4.s_addr = 0;
+ net_info->DnsAddr[1].Data.Ipv4.s_addr = 0;
+ *profileType = type;
+ } else {
+ profileType6 = &net_info->DnsConfigType6;
+ inet_pton(AF_INET6, "::", &net_info->DnsAddr6[0].Data.Ipv6);
+ inet_pton(AF_INET6, "::", &net_info->DnsAddr6[1].Data.Ipv6);
+ *profileType6 = type;
+ }
+
+ return CONNECTION_ERROR_NONE;
+}
+
+EXPORT_API int connection_profile_get_dns_config_type(connection_profile_h profile,
+ connection_address_family_e address_family, connection_dns_config_type_e *type)
+{
+ CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE,
+ TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
+
+ if (!(_connection_libnet_check_profile_validity(profile)) ||
+ (address_family != CONNECTION_ADDRESS_FAMILY_IPV4 &&
+ address_family != CONNECTION_ADDRESS_FAMILY_IPV6) ||
+ type == NULL) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ net_dns_config_type_t profileType;
+ net_profile_info_t *profile_info = profile;
+ net_dev_info_t *net_info = __profile_get_net_info(profile_info);
+ if (net_info == NULL)
+ return CONNECTION_ERROR_OPERATION_FAILED;
+
+ if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4)
+ profileType = net_info->DnsConfigType;
+ else
+ profileType = net_info->DnsConfigType6;
+
+ switch (profileType) {
+ case NET_DNS_CONFIG_TYPE_STATIC:
+ *type = CONNECTION_DNS_CONFIG_TYPE_STATIC;
+ break;
+ case NET_DNS_CONFIG_TYPE_DYNAMIC:
+ *type = CONNECTION_DNS_CONFIG_TYPE_DYNAMIC;
+ break;
+ default:
+ *type = CONNECTION_DNS_CONFIG_TYPE_NONE;
+ break;
+ }
+
+ return CONNECTION_ERROR_NONE;
+}
+
+EXPORT_API int connection_profile_set_prefix_length(connection_profile_h profile,
+ connection_address_family_e address_family, int prefix_len)
+{
+ CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE,
+ TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
+
+ if (!(_connection_libnet_check_profile_validity(profile)) ||
+ (address_family != CONNECTION_ADDRESS_FAMILY_IPV4 &&
+ address_family != CONNECTION_ADDRESS_FAMILY_IPV6)) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ net_profile_info_t *profile_info = profile;
+ net_dev_info_t *net_info = __profile_get_net_info(profile_info);
+ if (net_info == NULL)
+ return CONNECTION_ERROR_OPERATION_FAILED;
+
+ if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4) {
+ net_info->PrefixLen = prefix_len;
+ net_info->SubnetMask.Data.Ipv4.s_addr = __profile_convert_prefix_len_to_netmask(prefix_len);
+ } else
+ net_info->PrefixLen6 = prefix_len;
+
+ return CONNECTION_ERROR_NONE;
+}
+
+EXPORT_API int connection_profile_get_prefix_length(connection_profile_h profile,
+ connection_address_family_e address_family, int *prefix_len)
+{
+ CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE,
+ TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
+
+ if (!(_connection_libnet_check_profile_validity(profile)) ||
+ (address_family != CONNECTION_ADDRESS_FAMILY_IPV4 &&
+ address_family != CONNECTION_ADDRESS_FAMILY_IPV6) ||
+ prefix_len == NULL) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ net_profile_info_t *profile_info = profile;
+ net_dev_info_t *net_info = __profile_get_net_info(profile_info);
+ if (net_info == NULL)
+ return CONNECTION_ERROR_OPERATION_FAILED;
+
+ if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4)
+ *prefix_len = net_info->PrefixLen;
+ else if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6)
+ *prefix_len = net_info->PrefixLen6;
+
+ return CONNECTION_ERROR_NONE;
+}