diff --git a/src/knownnetworks.c b/src/knownnetworks.c index 4634f500..d2def4cd 100644 --- a/src/knownnetworks.c +++ b/src/knownnetworks.c @@ -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) { diff --git a/src/knownnetworks.h b/src/knownnetworks.h index be4854b5..b4f672f1 100644 --- a/src/knownnetworks.h +++ b/src/knownnetworks.h @@ -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);