hotspot: add API to get a matching roaming consortium

This API will attempt to find a matching roaming consortium OI
if present in the config file. A single matching OI is returned
or NULL if one was not found.
This commit is contained in:
James Prestwood 2019-07-12 10:30:30 -07:00 committed by Denis Kenzior
parent 27d670f432
commit 79a9fdf123
2 changed files with 21 additions and 0 deletions

View File

@ -271,6 +271,24 @@ try_roaming_consortium:
return NULL;
}
const uint8_t *hs20_get_roaming_consortium(struct network *network,
size_t *len)
{
struct hs20_config *config;
const uint8_t *rc_ie = network_get_roaming_consortium(network);
if (!rc_ie)
return NULL;
config = l_queue_find(hs20_settings, match_rc, rc_ie);
if (config) {
*len = config->rc_len;
return config->rc;
}
return NULL;
}
static int hotspot_init(void)
{
DIR *dir;

View File

@ -23,3 +23,6 @@
struct network;
const char *hs20_find_settings_file(struct network *network);
const uint8_t *hs20_get_roaming_consortium(struct network *network,
size_t *len);