aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/hostapd/src
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2022-09-22 14:01:52 +0200
committerFelix Fietkau <nbd@nbd.name>2022-09-22 15:26:58 +0200
commit8cb995445a26ee124e40b8ef97cc0ddd9d10f82a (patch)
treeadabd7a67b580b1930e8fba4cad12aff1c15939b /package/network/services/hostapd/src
parentf613c1368b5c4a5cdd9fb04607faa20ace2b7b74 (diff)
downloadupstream-8cb995445a26ee124e40b8ef97cc0ddd9d10f82a.tar.gz
upstream-8cb995445a26ee124e40b8ef97cc0ddd9d10f82a.tar.bz2
upstream-8cb995445a26ee124e40b8ef97cc0ddd9d10f82a.zip
hostapd: add ubus notification on sta authorized
Also include the station auth_type in the ubus and log message in order to detect, if clients used FT or FILS to associate Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package/network/services/hostapd/src')
-rw-r--r--package/network/services/hostapd/src/src/ap/ubus.c14
-rw-r--r--package/network/services/hostapd/src/src/ap/ubus.h9
2 files changed, 23 insertions, 0 deletions
diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c
index 622eab8838..85281f4197 100644
--- a/package/network/services/hostapd/src/src/ap/ubus.c
+++ b/package/network/services/hostapd/src/src/ap/ubus.c
@@ -1983,6 +1983,20 @@ void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 *
ubus_notify(ctx, &hapd->ubus.obj, type, b.head, -1);
}
+void hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info *sta,
+ const char *auth_alg)
+{
+ if (!hapd->ubus.obj.has_subscribers)
+ return;
+
+ blob_buf_init(&b, 0);
+ blobmsg_add_macaddr(&b, "address", sta->addr);
+ if (auth_alg)
+ blobmsg_add_string(&b, "auth-alg", auth_alg);
+
+ ubus_notify(ctx, &hapd->ubus.obj, "sta-authorized", b.head, -1);
+}
+
void hostapd_ubus_notify_beacon_report(
struct hostapd_data *hapd, const u8 *addr, u8 token, u8 rep_mode,
struct rrm_measurement_beacon_report *rep, size_t len)
diff --git a/package/network/services/hostapd/src/src/ap/ubus.h b/package/network/services/hostapd/src/src/ap/ubus.h
index 5a33b624d0..b0f7c44ab5 100644
--- a/package/network/services/hostapd/src/src/ap/ubus.h
+++ b/package/network/services/hostapd/src/src/ap/ubus.h
@@ -65,6 +65,8 @@ void hostapd_ubus_free(struct hapd_interfaces *interfaces);
int hostapd_ubus_notify_bss_transition_query(
struct hostapd_data *hapd, const u8 *addr, u8 dialog_token, u8 reason,
const u8 *candidate_list, u16 candidate_list_len);
+void hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info *sta,
+ const char *auth_alg);
#else
@@ -140,6 +142,13 @@ static inline int hostapd_ubus_notify_bss_transition_query(
{
return 0;
}
+
+static inline void
+hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info *sta,
+ const char *auth_alg)
+{
+}
+
#endif
#endif