network: Move network_info_match to knownnetworks.c

This commit is contained in:
Denis Kenzior 2019-08-09 02:37:37 -05:00
parent 0d7f591d4f
commit 67eeb0386d
3 changed files with 14 additions and 15 deletions

View File

@ -214,6 +214,20 @@ bool known_networks_has_hidden(void)
return num_known_hidden_networks ? true : false;
}
static bool network_info_match(const void *a, const void *b)
{
const struct network_info *ni_a = a;
const struct network_info *ni_b = b;
if (ni_a->type != ni_b->type)
return false;
if (strcmp(ni_a->ssid, ni_b->ssid))
return false;
return true;
}
struct network_info *known_networks_find(const char *ssid,
enum security security)
{

View File

@ -131,20 +131,6 @@ static void network_settings_close(struct network *network)
network->settings = NULL;
}
bool network_info_match(const void *a, const void *b)
{
const struct network_info *ni_a = a;
const struct network_info *ni_b = b;
if (ni_a->type != ni_b->type)
return false;
if (strcmp(ni_a->ssid, ni_b->ssid))
return false;
return true;
}
static bool network_secret_check_cacheable(void *data, void *user_data)
{
struct eap_secret_info *secret = data;

View File

@ -89,4 +89,3 @@ struct network_info {
struct network_info *network_info_add_known(const char *ssid,
enum security security);
void network_info_forget_known(struct network_info *network);
bool network_info_match(const void *a, const void *b);