eiwd

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

commit 0f3f0086ae2635cf366ea516b067bef58a135783
parent 59cc1e27c211d79f6134904895467c5514bab09a
Author: Andrew Zaborowski <andrew.zaborowski@intel.com>
Date:   Thu, 23 Apr 2020 18:24:34 +0200

nl80211util: Parse NL80211_ATTR_REG_ALPHA2 attrs

Diffstat:
Msrc/nl80211util.c | 15+++++++++++++++
1 file changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/nl80211util.c b/src/nl80211util.c @@ -63,6 +63,19 @@ static bool extract_name(const void *data, uint16_t len, void *o) return true; } +static bool extract_2_chars(const void *data, uint16_t len, void *o) +{ + char *out = o; + const char *in = data; + + if (len != 3 || in[2] != 0) + return false; + + out[0] = in[0]; + out[1] = in[1]; + return true; +} + static bool extract_mac(const void *data, uint16_t len, void *o) { const uint8_t **out = o; @@ -118,6 +131,8 @@ static attr_handler handler_for_type(enum nl80211_attrs type) case NL80211_ATTR_IFNAME: case NL80211_ATTR_WIPHY_NAME: return extract_name; + case NL80211_ATTR_REG_ALPHA2: + return extract_2_chars; case NL80211_ATTR_MAC: return extract_mac; case NL80211_ATTR_ACK: