@@ -4587,6 +4587,49 @@ static int hostapd_mld_ctrl_iface_detach(struct hostapd_mld *mld,
}
+int hostapd_ctrl_mld_iface_status(struct hostapd_mld *mld, char *buf,
+ size_t buflen)
+{
+ struct hostapd_data *link_hapd;
+ int len = 0, ret;
+
+ ret = os_snprintf(buf + len, buflen - len,
+ "name=%s\n"
+ "mld_address=" MACSTR "\n"
+ "num_links=%d\n",
+ mld->name, MAC2STR(mld->mld_addr), mld->num_links);
+ if (os_snprintf_error(buflen - len, ret))
+ return len;
+ len += ret;
+
+ if (!mld->fbss) {
+ ret = os_snprintf(buf + len, buflen - len,
+ "\n No Link information present\n");
+ if (os_snprintf_error(buflen - len, ret))
+ return len;
+ len += ret;
+ }
+
+ ret = os_snprintf(buf + len, buflen - len,
+ "LINK INFORMATION\n");
+ if (os_snprintf_error(buflen - len, ret))
+ return len;
+ len += ret;
+
+ dl_list_for_each(link_hapd, &mld->links, struct hostapd_data, link) {
+ ret = os_snprintf(buf + len, buflen - len,
+ "link_id=%d\n"
+ "link_addr=" MACSTR "\n",
+ link_hapd->mld_link_id, MAC2STR(link_hapd->own_addr));
+ if (os_snprintf_error(buflen - len, ret))
+ return len;
+ len += ret;
+ }
+
+ return len;
+}
+
+
static int hostapd_mld_ctrl_iface_receive_process(struct hostapd_mld *mld,
char *buf, char *reply,
int reply_size,
@@ -4653,6 +4696,9 @@ static int hostapd_mld_ctrl_iface_receive_process(struct hostapd_mld *mld,
} else if (os_strcmp(buf, "DETACH") == 0) {
if (hostapd_mld_ctrl_iface_detach(mld, from, fromlen))
reply_len = -1;
+ } else if (os_strcmp(buf, "STATUS") == 0 && link_id == -1){
+ reply_len = hostapd_ctrl_mld_iface_status(mld, reply,
+ reply_size);
} else {
if (link_id == -1)
wpa_printf(MSG_DEBUG, "Link ID not provided, using first link BSS (if available)");