* See README and COPYING for more details.
*/
-#include "includes.h"
+#include "utils/includes.h"
-#include "common.h"
+#include "utils/common.h"
#include "radius/radius.h"
-#include "ap/hostapd.h"
-#include "ap/ieee802_11.h"
-#include "ap/sta_info.h"
-#include "ap/accounting.h"
-#include "ap/tkip_countermeasures.h"
-#include "ap/iapp.h"
-#include "ap/ieee802_1x.h"
-#include "ap/wpa.h"
-#include "ap/wmm.h"
-#include "ap/wps_hostapd.h"
-#include "driver_i.h"
+#include "drivers/driver.h"
+#include "common/ieee802_11_defs.h"
+#include "hostapd.h"
+#include "ieee802_11.h"
+#include "sta_info.h"
+#include "accounting.h"
+#include "tkip_countermeasures.h"
+#include "iapp.h"
+#include "ieee802_1x.h"
+#include "wpa_auth.h"
+#include "wmm.h"
+#include "wps_hostapd.h"
+#include "ap_config.h"
int hostapd_notif_new_sta(struct hostapd_data *hapd, const u8 *addr)
static void hostapd_rx_from_unknown_sta(struct hostapd_data *hapd,
- const struct ieee80211_hdr *hdr,
- size_t len)
+ const u8 *frame, size_t len)
{
+ const struct ieee80211_hdr *hdr = (const struct ieee80211_hdr *) frame;
u16 fc = le_to_host16(hdr->frame_control);
hapd = get_hapd_bssid(hapd->iface, get_hdr_bssid(hdr, len));
if (hapd == NULL || hapd == HAPD_BROADCAST)
#endif /* NEED_AP_MLME */
+static int hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa,
+ const u8 *ie, size_t ie_len)
+{
+ size_t i;
+ int ret = 0;
+
+ for (i = 0; hapd->probereq_cb && i < hapd->num_probereq_cb; i++) {
+ if (hapd->probereq_cb[i].cb(hapd->probereq_cb[i].ctx,
+ sa, ie, ie_len) > 0) {
+ ret = 1;
+ break;
+ }
+ }
+ return ret;
+}
+
+
void wpa_supplicant_event(void *ctx, wpa_event_type event,
union wpa_event_data *data)
{
}
break;
case EVENT_RX_FROM_UNKNOWN:
- hostapd_rx_from_unknown_sta(hapd, data->rx_from_unknown.hdr,
+ hostapd_rx_from_unknown_sta(hapd, data->rx_from_unknown.frame,
data->rx_from_unknown.len);
break;
case EVENT_RX_MGMT:
data->rx_mgmt.frame_len, data->rx_mgmt.fi);
break;
#endif /* NEED_AP_MLME */
+ case EVENT_RX_PROBE_REQ:
+ hostapd_probe_req_rx(hapd, data->rx_probe_req.sa,
+ data->rx_probe_req.ie,
+ data->rx_probe_req.ie_len);
+ break;
default:
wpa_printf(MSG_DEBUG, "Unknown event %d", event);
break;
}
#endif /* HOSTAPD */
-
-
-void hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa,
- const u8 *ie, size_t ie_len)
-{
- size_t i;
-
- for (i = 0; hapd->probereq_cb && i < hapd->num_probereq_cb; i++)
- hapd->probereq_cb[i].cb(hapd->probereq_cb[i].ctx,
- sa, ie, ie_len);
-}