3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-26 02:19:26 +01:00

knownnetworks: add get_name and get_type ops

This commit is contained in:
James Prestwood 2019-08-21 12:06:13 -07:00 committed by Denis Kenzior
parent 894cde987d
commit a6a77ddc07
2 changed files with 26 additions and 0 deletions

View File

@ -166,6 +166,16 @@ static void known_network_free(struct network_info *info)
l_free(info);
}
static const char *known_network_get_name(const struct network_info *info)
{
return info->ssid;
}
static const char *known_network_get_type(const struct network_info *info)
{
return security_to_str(info->type);
}
static struct network_info_ops known_network_ops = {
.open = known_network_open,
.touch = known_network_touch,
@ -173,6 +183,8 @@ static struct network_info_ops known_network_ops = {
.remove = known_network_remove,
.free = known_network_free,
.get_path = known_network_get_path,
.get_name = known_network_get_name,
.get_type = known_network_get_type,
};
struct l_settings *network_info_open_settings(struct network_info *info)
@ -190,6 +202,16 @@ const char *network_info_get_path(const struct network_info *info)
return info->ops->get_path(info);
}
const char *network_info_get_name(const struct network_info *info)
{
return info->ops->get_name(info);
}
const char *network_info_get_type(const struct network_info *info)
{
return info->ops->get_type(info);
}
bool network_info_match_hessid(const struct network_info *info,
const uint8_t *hessid)
{

View File

@ -36,6 +36,8 @@ struct network_info_ops {
void (*remove)(struct network_info *info);
void (*free)(struct network_info *info);
const char *(*get_path)(const struct network_info *info);
const char *(*get_name)(const struct network_info *info);
const char *(*get_type)(const struct network_info *info);
bool (*match_hessid)(const struct network_info *info,
const uint8_t *hessid);
@ -89,6 +91,8 @@ void known_networks_watch_remove(uint32_t id);
struct l_settings *network_info_open_settings(struct network_info *info);
int network_info_touch(struct network_info *info);
const char *network_info_get_path(const struct network_info *info);
const char *network_info_get_name(const struct network_info *info);
const char *network_info_get_type(const struct network_info *info);
bool network_info_match_hessid(const struct network_info *info,
const uint8_t *hessid);