eiwd

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

commit 72c68622553797876149bfe2bb987e975b60f32e
parent d2feb535a5c1d4bc1c2542b08b068062576aadb8
Author: Tim Kourt <tim.a.kourt@linux.intel.com>
Date:   Tue, 10 Jul 2018 15:46:54 -0700

network: add network info accessors

This adds the accessors for the hidden field in network
info. In addition, it provides a lookup of the network infos
by ssid and security type.

Diffstat:
Msrc/network.c | 25+++++++++++++++++++++++++
Msrc/network.h | 4++++
2 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/src/network.c b/src/network.c @@ -1306,3 +1306,28 @@ bool network_info_has_hidden(void) { return num_known_hidden_networks ? true : false; } + +void network_info_set_hidden(struct network *network) +{ + if (network->info->is_hidden) + return; + + network->info->is_hidden = true; + num_known_hidden_networks += 1; +} + +bool network_info_is_hidden(struct network *network) +{ + return network->info->is_hidden; +} + +const struct network_info *network_info_find(const char *ssid, + enum security security) +{ + struct network_info query; + + query.type = security; + strcpy(query.ssid, ssid); + + return l_queue_find(networks, network_info_match, &query); +} diff --git a/src/network.h b/src/network.h @@ -85,3 +85,7 @@ void network_info_foreach(network_info_foreach_func_t function, void *user_data); const struct l_queue *network_info_get_known(); bool network_info_has_hidden(void); +void network_info_set_hidden(struct network *network); +bool network_info_is_hidden(struct network *network); +const struct network_info *network_info_find(const char *ssid, + enum security security);