Browse Source

Replace hostapd_wps_probe_req_rx() with more generic ProbeReq notifier

The driver wrappers should not need to include wps_hostapd.h, so let's
make this easier by introducing a driver callback for reporting Probe
Request frames.
Jouni Malinen 15 years ago
parent
commit
3fed6f2504

+ 8 - 0
hostapd/drv_callbacks.c

@@ -25,6 +25,7 @@
 #include "wpa.h"
 #include "iapp.h"
 #include "wme.h"
+#include "wps_hostapd.h"
 
 
 struct prune_data {
@@ -431,3 +432,10 @@ void wpa_supplicant_event(void *ctx, wpa_event_type event,
 	}
 }
 #endif /* CONFIG_AP */
+
+
+void hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa,
+			 const u8 *ie, size_t ie_len)
+{
+	hostapd_wps_probe_req_rx(hapd, sa, ie, ie_len);
+}

+ 2 - 0
src/drivers/driver.h

@@ -1766,5 +1766,7 @@ void hostapd_mgmt_tx_cb(struct hostapd_data *hapd, u8 *buf, size_t len,
 void hostapd_michael_mic_failure(struct hostapd_data *hapd, const u8 *addr);
 struct hostapd_data * hostapd_sta_get_bss(struct hostapd_data *hapd,
 					  const u8 *addr);
+void hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa,
+			  const u8 *ie, size_t ie_len);
 
 #endif /* DRIVER_H */

+ 1 - 1
src/drivers/driver_atheros.c

@@ -685,7 +685,7 @@ static void madwifi_raw_receive(void *ctx, const u8 *src_addr, const u8 *buf,
 	ie = mgmt->u.probe_req.variable;
 	ie_len = len - (IEEE80211_HDRLEN + sizeof(mgmt->u.probe_req));
 
-	hostapd_wps_probe_req_rx(drv->hapd, mgmt->sa, ie, ie_len);
+	hostapd_probe_req_rx(drv->hapd, mgmt->sa, ie, ie_len);
 }
 #endif /* CONFIG_WPS */
 

+ 1 - 2
src/drivers/driver_madwifi.c

@@ -71,7 +71,6 @@
 #include "l2_packet/l2_packet.h"
 #include "../../hostapd/hostapd.h"
 #include "../../hostapd/config.h"
-#include "../../hostapd/wps_hostapd.h"
 #include "../../hostapd/sta_flags.h"
 
 
@@ -778,7 +777,7 @@ static void madwifi_raw_receive(void *ctx, const u8 *src_addr, const u8 *buf,
 	ie = mgmt->u.probe_req.variable;
 	ie_len = len - (IEEE80211_HDRLEN + sizeof(mgmt->u.probe_req));
 
-	hostapd_wps_probe_req_rx(drv->hapd, mgmt->sa, ie, ie_len);
+	hostapd_probe_req_rx(drv->hapd, mgmt->sa, ie, ie_len);
 }
 #endif /* IEEE80211_IOCTL_FILTERFRAME */
 #endif /* CONFIG_WPS */

+ 1 - 2
src/drivers/driver_test.c

@@ -40,7 +40,6 @@
 #include "../../hostapd/hostapd.h"
 #include "../../hostapd/wpa.h"
 #include "../../hostapd/hw_features.h"
-#include "../../hostapd/wps_hostapd.h"
 
 
 struct test_client_socket {
@@ -415,7 +414,7 @@ static void test_driver_scan(struct test_driver_data *drv,
 			   MAC2STR(sa));
 		wpa_hexdump(MSG_MSGDUMP, "test_driver: scan IEs", ie, ielen);
 
-		hostapd_wps_probe_req_rx(drv->hapd, sa, ie, ielen);
+		hostapd_probe_req_rx(drv->hapd, sa, ie, ielen);
 	}
 
 	for (bss = drv->bss; bss; bss = bss->next) {