diff mbox series

[3/3] radius: report taxonomy assoc/probe IEs

Message ID 20210416061345.16493-4-michael-dev@fami-braun.de
State Superseded
Headers show
Series report taxonomy IEs to RADIUS | expand

Commit Message

michael-dev April 16, 2021, 6:13 a.m. UTC
From: Michael Braun <michael-dev@fami-braun.de>

Use FreeRADIUS dictionary definition:

VENDOR  HostAP  39068
BEGIN-VENDOR    HostAP  parent=Extended-Vendor-Specific-5
ATTRIBUTE       HostAP-Probe-IES        0       octets
ATTRIBUTE       HostAP-Assoc-IES        1       octets
END-VENDOR      HostAP

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
---
 src/ap/ieee802_1x.c | 22 ++++++++++++++++++++++
 src/radius/radius.h |  8 ++++++++
 2 files changed, 30 insertions(+)
diff mbox series

Patch

diff --git a/src/ap/ieee802_1x.c b/src/ap/ieee802_1x.c
index 753c88335..af0f41837 100644
--- a/src/ap/ieee802_1x.c
+++ b/src/ap/ieee802_1x.c
@@ -522,6 +522,28 @@  static int add_common_radius_sta_attr(struct hostapd_data *hapd,
 	    add_common_radius_sta_attr_rsn(hapd, req_attr, sta, msg) < 0)
 		return -1;
 
+#ifdef CONFIG_TAXONOMY
+	if (sta->probe_ie_taxonomy &&
+	    !radius_msg_add_extended_vsa(msg, RADIUS_ATTR_EXTENDED_5,
+					 RADIUS_VENDOR_ATTR_HOSTAP_PROBE_IES,
+					 wpabuf_head(sta->probe_ie_taxonomy),
+					 wpabuf_len(sta->probe_ie_taxonomy),
+					 RADIUS_VENDOR_ID_HOSTAP)) {
+		wpa_printf(MSG_INFO, "Could not add HostAP-Probe-IES");
+		return -1;
+	}
+
+	if (sta->assoc_ie_taxonomy &&
+	    !radius_msg_add_extended_vsa(msg, RADIUS_ATTR_EXTENDED_5,
+					 RADIUS_VENDOR_ATTR_HOSTAP_ASSOC_IES,
+					 wpabuf_head(sta->assoc_ie_taxonomy),
+					 wpabuf_len(sta->assoc_ie_taxonomy),
+					 RADIUS_VENDOR_ID_HOSTAP)) {
+		wpa_printf(MSG_INFO, "Could not add HostAP-Assoc-IES");
+		return -1;
+	}
+#endif /* CONFIG_TAXONOMY */
+
 	return 0;
 }
 
diff --git a/src/radius/radius.h b/src/radius/radius.h
index 0f2420567..a8baa4f0e 100644
--- a/src/radius/radius.h
+++ b/src/radius/radius.h
@@ -212,6 +212,14 @@  enum {
 	RADIUS_VENDOR_ATTR_WFA_HS20_T_C_URL = 10,
 };
 
+/* HostAP */
+#define RADIUS_VENDOR_ID_HOSTAP 39068
+
+enum {
+	RADIUS_VENDOR_ATTR_HOSTAP_PROBE_IES = 0,
+	RADIUS_VENDOR_ATTR_HOSTAP_ASSOC_IES = 1,
+};
+
 #ifdef _MSC_VER
 #pragma pack(pop)
 #endif /* _MSC_VER */