eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit 07e6876ef54c7bc508e861fb620e69bdd365e227
parent d9e6b2263f890802e83ddbaa5f903a826cd4ce20
Author: James Prestwood <prestwoj@gmail.com>
Date:   Mon, 16 Sep 2019 13:14:13 -0700

knownnetworks: add roam frequency getter

Gets a newly created scan_freq_set containing the most recent
frequencies for the network. The currently connected BSS frequency
(passed as a parameters) will not be included in the set.

Diffstat:
Msrc/knownnetworks.c | 30++++++++++++++++++++++++++++++
Msrc/knownnetworks.h | 4++++
2 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/src/knownnetworks.c b/src/knownnetworks.c @@ -271,6 +271,36 @@ void network_info_set_uuid(struct network_info *info, const uint8_t *uuid) info->has_uuid = true; } +struct scan_freq_set *network_info_get_roam_frequencies( + const struct network_info *info, + uint32_t current_freq, + uint8_t max) +{ + struct scan_freq_set *freqs; + const struct l_queue_entry *entry; + + freqs = scan_freq_set_new(); + + for (entry = l_queue_get_entries(info->known_frequencies); entry && max; + entry = entry->next) { + struct known_frequency *kn = entry->data; + + if (kn->frequency == current_freq) + continue; + + scan_freq_set_add(freqs, kn->frequency); + + max--; + } + + if (scan_freq_set_isempty(freqs)) { + scan_freq_set_free(freqs); + return NULL; + } + + return freqs; +} + bool network_info_match_hessid(const struct network_info *info, const uint8_t *hessid) { diff --git a/src/knownnetworks.h b/src/knownnetworks.h @@ -108,6 +108,10 @@ const struct iovec *network_info_get_extra_ies(const struct network_info *info, /* Gets the UUID, or generates one if not yet created */ const uint8_t *network_info_get_uuid(struct network_info *info); void network_info_set_uuid(struct network_info *info, const uint8_t *uuid); +struct scan_freq_set *network_info_get_roam_frequencies( + const struct network_info *info, + uint32_t current_freq, + uint8_t max); bool network_info_match_hessid(const struct network_info *info, const uint8_t *hessid);