Passive Client Taxonomy
[mech_eap.git] / src / ap / ctrl_iface_ap.c
index 17a3ea4..3680fda 100644 (file)
@@ -23,6 +23,7 @@
 #include "ctrl_iface_ap.h"
 #include "ap_drv_ops.h"
 #include "mbo_ap.h"
+#include "taxonomy.h"
 
 
 static int hostapd_get_sta_tx_rx(struct hostapd_data *hapd,
@@ -258,7 +259,7 @@ static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
        int ret;
        u8 *pos;
 
-       if (hapd->driver->send_frame == NULL)
+       if (!hapd->drv_priv || !hapd->driver->send_frame)
                return -1;
 
        mgmt = os_zalloc(sizeof(*mgmt) + 100);
@@ -325,7 +326,7 @@ int hostapd_ctrl_iface_deauthenticate(struct hostapd_data *hapd,
        if (pos) {
                struct ieee80211_mgmt mgmt;
                int encrypt;
-               if (hapd->driver->send_frame == NULL)
+               if (!hapd->drv_priv || !hapd->driver->send_frame)
                        return -1;
                pos += 6;
                encrypt = atoi(pos);
@@ -388,7 +389,7 @@ int hostapd_ctrl_iface_disassociate(struct hostapd_data *hapd,
        if (pos) {
                struct ieee80211_mgmt mgmt;
                int encrypt;
-               if (hapd->driver->send_frame == NULL)
+               if (!hapd->drv_priv || !hapd->driver->send_frame)
                        return -1;
                pos += 6;
                encrypt = atoi(pos);
@@ -429,6 +430,28 @@ int hostapd_ctrl_iface_disassociate(struct hostapd_data *hapd,
 }
 
 
+#ifdef CONFIG_TAXONOMY
+int hostapd_ctrl_iface_signature(struct hostapd_data *hapd,
+                                const char *txtaddr,
+                                char *buf, size_t buflen)
+{
+       u8 addr[ETH_ALEN];
+       struct sta_info *sta;
+
+       wpa_dbg(hapd->msg_ctx, MSG_DEBUG, "CTRL_IFACE SIGNATURE %s", txtaddr);
+
+       if (hwaddr_aton(txtaddr, addr))
+               return -1;
+
+       sta = ap_get_sta(hapd, addr);
+       if (!sta)
+               return -1;
+
+       return retrieve_sta_taxonomy(hapd, sta, buf, buflen);
+}
+#endif /* CONFIG_TAXONOMY */
+
+
 int hostapd_ctrl_iface_poll_sta(struct hostapd_data *hapd,
                                const char *txtaddr)
 {