commit b64ba2ba0eda94e3829de68e42d75af9c2907538 parent 8fd8852bf1b331d564d49ed4823fb575f896c775 Author: Denis Kenzior <denkenz@gmail.com> Date: Fri, 14 Sep 2018 21:44:22 -0500 client: Add network_get_type Diffstat:
| M | client/network.c | | | 11 | +++++++++++ |
| M | client/network.h | | | 1 | + |
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/client/network.c b/client/network.c @@ -55,6 +55,17 @@ bool network_is_connected(const char *path) return network->connected; } +const char *network_get_type(const char *path) +{ + const struct network *network; + const struct proxy_interface *proxy = + proxy_interface_find(IWD_NETWORK_INTERFACE, path); + + network = proxy_interface_get_data(proxy); + + return network->type; +} + void network_connect(const struct proxy_interface *proxy) { if (!proxy) diff --git a/client/network.h b/client/network.h @@ -26,6 +26,7 @@ struct network_args { }; bool network_is_connected(const char *path); +const char *network_get_type(const char *path); void network_connect(const struct proxy_interface *proxy); char *network_name_completion(const struct proxy_interface *device,