mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-03 10:32:33 +01:00
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:
parent
d38b7f2406
commit
27bf997545
17
src/scan.c
17
src/scan.c
@ -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;
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user