g_slist_free(managed_idler_list);
managed_idler_list = NULL;
}
+
+int _wifi_libnet_check_get_privilege()
+{
+ int rv;
+
+ rv = net_check_get_privilege();
+ if (rv == NET_ERR_ACCESS_DENIED) {
+ WIFI_LOG(WIFI_ERROR, "Access denied"); //LCOV_EXCL_LINE
+ return WIFI_ERROR_PERMISSION_DENIED; //LCOV_EXCL_LINE
+ } else if (rv != NET_ERR_NONE)
+ return WIFI_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
+
+ return WIFI_ERROR_NONE;
+}
+
+int _wifi_libnet_check_profile_privilege()
+{
+ int rv = net_check_profile_privilege();
+ if (rv == NET_ERR_ACCESS_DENIED) {
+ WIFI_LOG(WIFI_ERROR, "Access denied"); //LCOV_EXCL_LINE
+ return WIFI_ERROR_PERMISSION_DENIED; //LCOV_EXCL_LINE
+ } else if (rv != NET_ERR_NONE)
+ return WIFI_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
+
+ return WIFI_ERROR_NONE;
+}
return WIFI_ERROR_INVALID_PARAMETER;
}
+ int rv = _wifi_libnet_check_get_privilege();
+ if (rv == WIFI_ERROR_PERMISSION_DENIED)
+ return rv;
+ else if (rv != WIFI_ERROR_NONE) {
+ WIFI_LOG(WIFI_ERROR, "Failed to get statistics");
+ return WIFI_ERROR_OPERATION_FAILED;
+ }
+
+ rv = _wifi_libnet_check_profile_privilege();
+ if (rv == WIFI_ERROR_PERMISSION_DENIED)
+ return rv;
+ else if (rv != WIFI_ERROR_NONE) {
+ WIFI_LOG(WIFI_ERROR, "Failed to get statistics");
+ return WIFI_ERROR_OPERATION_FAILED;
+ }
+
net_profile_info_t *profile_info = ap;
if (address_family == WIFI_ADDRESS_FAMILY_IPV4) {
return WIFI_ERROR_INVALID_PARAMETER;
}
+ int rv = _wifi_libnet_check_get_privilege();
+ if (rv == WIFI_ERROR_PERMISSION_DENIED)
+ return rv;
+ else if (rv != WIFI_ERROR_NONE) {
+ WIFI_LOG(WIFI_ERROR, "Failed to get statistics");
+ return WIFI_ERROR_OPERATION_FAILED;
+ }
+
+ rv = _wifi_libnet_check_profile_privilege();
+ if (rv == WIFI_ERROR_PERMISSION_DENIED)
+ return rv;
+ else if (rv != WIFI_ERROR_NONE) {
+ WIFI_LOG(WIFI_ERROR, "Failed to get statistics");
+ return WIFI_ERROR_OPERATION_FAILED;
+ }
+
net_profile_info_t *profile_info = ap;
if (address_family == WIFI_ADDRESS_FAMILY_IPV4) {
return WIFI_ERROR_INVALID_PARAMETER;
}
+ int rv = _wifi_libnet_check_get_privilege();
+ if (rv == WIFI_ERROR_PERMISSION_DENIED)
+ return rv;
+ else if (rv != WIFI_ERROR_NONE) {
+ WIFI_LOG(WIFI_ERROR, "Failed to get statistics");
+ return WIFI_ERROR_OPERATION_FAILED;
+ }
+
+ rv = _wifi_libnet_check_profile_privilege();
+ if (rv == WIFI_ERROR_PERMISSION_DENIED)
+ return rv;
+ else if (rv != WIFI_ERROR_NONE) {
+ WIFI_LOG(WIFI_ERROR, "Failed to get statistics");
+ return WIFI_ERROR_OPERATION_FAILED;
+ }
+
net_profile_info_t *profile_info = ap;
/* Based on the family of address provided subnet mask should be set.
return WIFI_ERROR_INVALID_PARAMETER;
}
+ int rv = _wifi_libnet_check_get_privilege();
+ if (rv == WIFI_ERROR_PERMISSION_DENIED)
+ return rv;
+ else if (rv != WIFI_ERROR_NONE) {
+ WIFI_LOG(WIFI_ERROR, "Failed to get statistics");
+ return WIFI_ERROR_OPERATION_FAILED;
+ }
+
+ rv = _wifi_libnet_check_profile_privilege();
+ if (rv == WIFI_ERROR_PERMISSION_DENIED)
+ return rv;
+ else if (rv != WIFI_ERROR_NONE) {
+ WIFI_LOG(WIFI_ERROR, "Failed to get statistics");
+ return WIFI_ERROR_OPERATION_FAILED;
+ }
+
net_profile_info_t *profile_info = ap;
if (address_family == WIFI_ADDRESS_FAMILY_IPV6) {
if (gateway_address == NULL)
return WIFI_ERROR_INVALID_PARAMETER;
}
+ int rv = _wifi_libnet_check_get_privilege();
+ if (rv == WIFI_ERROR_PERMISSION_DENIED)
+ return rv;
+ else if (rv != WIFI_ERROR_NONE) {
+ WIFI_LOG(WIFI_ERROR, "Failed to get statistics");
+ return WIFI_ERROR_OPERATION_FAILED;
+ }
+
+ rv = _wifi_libnet_check_profile_privilege();
+ if (rv == WIFI_ERROR_PERMISSION_DENIED)
+ return rv;
+ else if (rv != WIFI_ERROR_NONE) {
+ WIFI_LOG(WIFI_ERROR, "Failed to get statistics");
+ return WIFI_ERROR_OPERATION_FAILED;
+ }
+
net_profile_info_t *profile_info = ap;
if (proxy_address == NULL)
return WIFI_ERROR_INVALID_PARAMETER;
}
+ int rv = _wifi_libnet_check_get_privilege();
+ if (rv == WIFI_ERROR_PERMISSION_DENIED)
+ return rv;
+ else if (rv != WIFI_ERROR_NONE) {
+ WIFI_LOG(WIFI_ERROR, "Failed to get statistics");
+ return WIFI_ERROR_OPERATION_FAILED;
+ }
+
+ rv = _wifi_libnet_check_profile_privilege();
+ if (rv == WIFI_ERROR_PERMISSION_DENIED)
+ return rv;
+ else if (rv != WIFI_ERROR_NONE) {
+ WIFI_LOG(WIFI_ERROR, "Failed to get statistics");
+ return WIFI_ERROR_OPERATION_FAILED;
+ }
+
net_profile_info_t *profile_info = ap;
- int rv;
switch (proxy_type) {
case WIFI_PROXY_TYPE_DIRECT:
return WIFI_ERROR_INVALID_PARAMETER;
}
+ int rv = _wifi_libnet_check_get_privilege();
+ if (rv == WIFI_ERROR_PERMISSION_DENIED)
+ return rv;
+ else if (rv != WIFI_ERROR_NONE) {
+ WIFI_LOG(WIFI_ERROR, "Failed to get statistics");
+ return WIFI_ERROR_OPERATION_FAILED;
+ }
+
+ rv = _wifi_libnet_check_profile_privilege();
+ if (rv == WIFI_ERROR_PERMISSION_DENIED)
+ return rv;
+ else if (rv != WIFI_ERROR_NONE) {
+ WIFI_LOG(WIFI_ERROR, "Failed to get statistics");
+ return WIFI_ERROR_OPERATION_FAILED;
+ }
+
net_profile_info_t *profile_info = ap;
if (address_family == WIFI_ADDRESS_FAMILY_IPV6) {