mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 21:22:37 +01:00
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.
This commit is contained in:
parent
d2feb535a5
commit
72c6862255
@ -1306,3 +1306,28 @@ bool network_info_has_hidden(void)
|
|||||||
{
|
{
|
||||||
return num_known_hidden_networks ? true : false;
|
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);
|
||||||
|
}
|
||||||
|
@ -85,3 +85,7 @@ void network_info_foreach(network_info_foreach_func_t function,
|
|||||||
void *user_data);
|
void *user_data);
|
||||||
const struct l_queue *network_info_get_known();
|
const struct l_queue *network_info_get_known();
|
||||||
bool network_info_has_hidden(void);
|
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user