hostapd: add association frame to taxonomy data

Extend the taxonomy subsystem to capture the complete association frame
in addition to the existing probe and association IE data.

This adds a new assoc_frame_taxonomy field to struct sta_info and exposes
it via the get_sta_ies ubus method as a base64-encoded "assoc_frame" field.

Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
John Crispin 2025-07-29 14:20:19 +02:00 committed by Felix Fietkau
parent c1492838f7
commit 79cd45ddee
4 changed files with 52 additions and 7 deletions

View file

@ -251,7 +251,15 @@ probe/assoc/auth requests via object subscribe.
/* followed by SSID and Supported rates; and HT capabilities if 802.11n
* is used */
@@ -6073,6 +6090,13 @@ static void handle_assoc(struct hostapd_
@@ -6057,6 +6074,7 @@ static void handle_assoc(struct hostapd_
#ifdef CONFIG_TAXONOMY
taxonomy_sta_info_assoc_req(hapd, sta, pos, left);
+ taxonomy_sta_info_assoc_frame(hapd, sta, mgmt, len);
#endif /* CONFIG_TAXONOMY */
sta->pending_wds_enable = 0;
@@ -6073,6 +6091,13 @@ static void handle_assoc(struct hostapd_
if (set_beacon)
ieee802_11_update_beacons(hapd->iface);
@ -265,7 +273,7 @@ probe/assoc/auth requests via object subscribe.
fail:
/*
@@ -6302,6 +6326,7 @@ static void handle_disassoc(struct hosta
@@ -6302,6 +6327,7 @@ static void handle_disassoc(struct hosta
(unsigned long) len);
return;
}
@ -273,7 +281,7 @@ probe/assoc/auth requests via object subscribe.
sta = ap_get_sta(hapd, mgmt->sa);
if (!sta) {
@@ -6333,6 +6358,8 @@ static void handle_deauth(struct hostapd
@@ -6333,6 +6359,8 @@ static void handle_deauth(struct hostapd
/* Clear the PTKSA cache entries for PASN */
ptksa_cache_flush(hapd->ptksa, mgmt->sa, WPA_CIPHER_NONE);
@ -392,7 +400,15 @@ probe/assoc/auth requests via object subscribe.
hapd->msg_ctx_parent != hapd->msg_ctx)
--- a/src/ap/sta_info.h
+++ b/src/ap/sta_info.h
@@ -302,6 +302,7 @@ struct sta_info {
@@ -255,6 +255,7 @@ struct sta_info {
#ifdef CONFIG_TAXONOMY
struct wpabuf *probe_ie_taxonomy;
struct wpabuf *assoc_ie_taxonomy;
+ struct wpabuf *assoc_frame_taxonomy;
#endif /* CONFIG_TAXONOMY */
#ifdef CONFIG_FILS
@@ -302,6 +303,7 @@ struct sta_info {
#endif /* CONFIG_TESTING_OPTIONS */
#ifdef CONFIG_AIRTIME_POLICY
unsigned int airtime_weight;
@ -657,3 +673,31 @@ probe/assoc/auth requests via object subscribe.
case 'o':
params.override_driver = optarg;
break;
--- a/src/ap/taxonomy.c
+++ b/src/ap/taxonomy.c
@@ -290,3 +290,12 @@ void taxonomy_sta_info_assoc_req(const s
wpabuf_free(sta->assoc_ie_taxonomy);
sta->assoc_ie_taxonomy = wpabuf_alloc_copy(ie, ie_len);
}
+
+void taxonomy_sta_info_assoc_frame(const struct hostapd_data *hapd,
+ struct sta_info *sta,
+ const struct ieee80211_mgmt *mgmt,
+ size_t len)
+{
+ wpabuf_free(sta->assoc_frame_taxonomy);
+ sta->assoc_frame_taxonomy = wpabuf_alloc_copy(mgmt, len);
+}
--- a/src/ap/taxonomy.h
+++ b/src/ap/taxonomy.h
@@ -18,6 +18,10 @@ void taxonomy_hostapd_sta_info_probe_req
void taxonomy_sta_info_assoc_req(const struct hostapd_data *hapd,
struct sta_info *sta,
const u8 *ie, size_t ie_len);
+void taxonomy_sta_info_assoc_frame(const struct hostapd_data *hapd,
+ struct sta_info *sta,
+ const struct ieee80211_mgmt *mgmt,
+ size_t len);
int retrieve_sta_taxonomy(const struct hostapd_data *hapd,
struct sta_info *sta, char *buf, size_t buflen);

View file

@ -393,7 +393,7 @@ Hotfix-by: Sebastian Gottschall https://github.com/mirror/dd-wrt/commit/0c3001a6
if (resp != WLAN_STATUS_SUCCESS)
return resp;
@@ -6422,6 +6425,11 @@ static void handle_beacon(struct hostapd
@@ -6423,6 +6426,11 @@ static void handle_beacon(struct hostapd
0);
ap_list_process_beacon(hapd->iface, mgmt, &elems, fi);

View file

@ -25,7 +25,7 @@
+
--- a/src/ap/sta_info.h
+++ b/src/ap/sta_info.h
@@ -412,23 +412,8 @@ int ap_sta_re_add(struct hostapd_data *h
@@ -413,23 +413,8 @@ int ap_sta_re_add(struct hostapd_data *h
void ap_free_sta_pasn(struct hostapd_data *hapd, struct sta_info *sta);

View file

@ -1623,12 +1623,13 @@ hostapd_bss_get_sta_ies(struct ubus_context *ctx, struct ubus_object *obj,
return UBUS_STATUS_INVALID_ARGUMENT;
sta = ap_get_sta(hapd, addr);
if (!sta || (!sta->probe_ie_taxonomy && !sta->assoc_ie_taxonomy))
if (!sta || (!sta->probe_ie_taxonomy && !sta->assoc_ie_taxonomy && !sta->assoc_frame_taxonomy))
return UBUS_STATUS_NOT_FOUND;
blob_buf_init(&b, 0);
hostapd_add_b64_data("probe_ie", sta->probe_ie_taxonomy);
hostapd_add_b64_data("assoc_ie", sta->assoc_ie_taxonomy);
hostapd_add_b64_data("assoc_frame", sta->assoc_frame_taxonomy);
ubus_send_reply(ctx, req, b.head);
return 0;