scan: add scan_bss_get_security

This was already implemented in station but with no dependency on
that module at all. AP will need this for a scanning API so its
being moved into scan.c.
This commit is contained in:
James Prestwood 2022-02-24 09:04:54 -08:00 committed by Denis Kenzior
parent d38b7f2406
commit 27bf997545
2 changed files with 19 additions and 0 deletions

View File

@ -1680,6 +1680,23 @@ int scan_bss_get_rsn_info(const struct scan_bss *bss, struct ie_rsn_info *info)
return 0;
}
int scan_bss_get_security(const struct scan_bss *bss, enum security *security)
{
int ret;
struct ie_rsn_info info;
ret = scan_bss_get_rsn_info(bss, &info);
if (ret < 0) {
if (ret != -ENOENT)
return ret;
*security = security_determine(bss->capability, NULL);
} else
*security = security_determine(bss->capability, &info);
return 0;
}
int scan_bss_rank_compare(const void *a, const void *b, void *user_data)
{
const struct scan_bss *new_bss = a, *bss = b;

View File

@ -28,6 +28,7 @@ struct p2p_probe_req;
struct p2p_beacon;
struct mmpdu_header;
struct wiphy;
enum security;
enum scan_state {
SCAN_STATE_NOT_RUNNING,
@ -161,6 +162,7 @@ void scan_bss_free(struct scan_bss *bss);
int scan_bss_rank_compare(const void *a, const void *b, void *user);
int scan_bss_get_rsn_info(const struct scan_bss *bss, struct ie_rsn_info *info);
int scan_bss_get_security(const struct scan_bss *bss, enum security *security);
struct scan_bss *scan_bss_new_from_probe_req(const struct mmpdu_header *mpdu,
const uint8_t *body,