eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit 6e6797cbde6683817b48cdad771ffc53dcdf5d3a
parent 9c6f3ef5c0344cf63ef01ffcbc3a3260fdd3c578
Author: Denis Kenzior <denkenz@gmail.com>
Date:   Tue,  7 Aug 2018 16:19:20 -0500

dbus: Add dbus_iftype_to_string

Diffstat:
Msrc/dbus.c | 21++++++++++++++++++++-
Msrc/dbus.h | 2++
2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/src/dbus.c b/src/dbus.c @@ -30,9 +30,12 @@ #include <ell/ell.h> #include <ell/dbus-private.h> -#include "src/dbus.h" + +#include "linux/nl80211.h" + #include "src/agent.h" #include "src/iwd.h" +#include "src/dbus.h" struct l_dbus *g_dbus = 0; @@ -43,6 +46,22 @@ static void do_debug(const char *str, void *user_data) l_info("%s%s", prefix, str); } +const char *dbus_iftype_to_string(uint32_t iftype) +{ + switch (iftype) { + case NL80211_IFTYPE_ADHOC: + return "ad-hoc"; + case NL80211_IFTYPE_STATION: + return "station"; + case NL80211_IFTYPE_AP: + return "ap"; + default: + break; + } + + return NULL; +} + struct l_dbus_message *dbus_error_busy(struct l_dbus_message *msg) { return l_dbus_message_new_error(msg, IWD_SERVICE ".InProgress", diff --git a/src/dbus.h b/src/dbus.h @@ -44,6 +44,8 @@ struct l_dbus *dbus_get_bus(void); void dbus_pending_reply(struct l_dbus_message **msg, struct l_dbus_message *reply); +const char *dbus_iftype_to_string(unsigned int iftype); + struct l_dbus_message *dbus_error_busy(struct l_dbus_message *msg); struct l_dbus_message *dbus_error_failed(struct l_dbus_message *msg); struct l_dbus_message *dbus_error_aborted(struct l_dbus_message *msg);