#include "hostapd.h"
#include "driver.h"
-#include "ieee802_1x.h"
#include "eloop.h"
#include "priv_netlink.h"
-#include "ieee802_11.h"
-#include "sta_info.h"
#include "hostap_common.h"
#include "hw_features.h"
+#include "ieee802_11_defs.h"
static const u8 rfc1042_header[6] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
u16 fc, ethertype;
u8 *pos, *sa;
size_t left;
- struct sta_info *sta;
if (len < sizeof(struct ieee80211_hdr))
return;
}
sa = hdr->addr2;
- sta = ap_get_sta(drv->hapd, sa);
- if (!sta || !(sta->flags & WLAN_STA_ASSOC)) {
- printf("Data frame from not associated STA " MACSTR "\n",
- MAC2STR(sa));
- if (sta && (sta->flags & WLAN_STA_AUTH))
- hostap_sta_disassoc(
- drv, sa,
- WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
- else
- hostap_sta_deauth(
- drv, sa,
- WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
- return;
- }
+ hostapd_rx_from_unknown_sta(drv->hapd, sa);
pos = (u8 *) (hdr + 1);
left = len - sizeof(*hdr);
left -= 2;
switch (ethertype) {
case ETH_P_PAE:
- ieee802_1x_receive(drv->hapd, sa, pos, left);
+ hostapd_eapol_receive(drv->hapd, sa, pos, left);
break;
default:
{
struct ieee80211_hdr *hdr;
u16 fc, type, stype;
- struct sta_info *sta;
hdr = (struct ieee80211_hdr *) buf;
fc = le_to_host16(hdr->frame_control);
case WLAN_FC_TYPE_MGMT:
wpa_printf(MSG_DEBUG, "MGMT (TX callback) %s",
ok ? "ACK" : "fail");
- ieee802_11_mgmt_cb(drv->hapd, buf, len, stype, ok);
+ hostapd_mgmt_tx_cb(drv->hapd, buf, len, stype, ok);
break;
case WLAN_FC_TYPE_CTRL:
wpa_printf(MSG_DEBUG, "CTRL (TX callback) %s",
case WLAN_FC_TYPE_DATA:
wpa_printf(MSG_DEBUG, "DATA (TX callback) %s",
ok ? "ACK" : "fail");
- sta = ap_get_sta(drv->hapd, hdr->addr1);
- if (sta && sta->flags & WLAN_STA_PENDING_POLL) {
- wpa_printf(MSG_DEBUG, "STA " MACSTR
- " %s pending activity poll",
- MAC2STR(sta->addr),
- ok ? "ACKed" : "did not ACK");
- if (ok)
- sta->flags &= ~WLAN_STA_PENDING_POLL;
- }
- if (sta)
- ieee802_1x_tx_status(drv->hapd, sta, buf, len, ok);
+ hostapd_tx_status(drv->hapd, hdr->addr1, buf, len, ok);
break;
default:
printf("unknown TX callback frame type %d\n", type);
case WLAN_FC_TYPE_MGMT:
if (stype != WLAN_FC_STYPE_BEACON)
wpa_printf(MSG_MSGDUMP, "MGMT");
- ieee802_11_mgmt(drv->hapd, buf, data_len, stype, NULL);
+ hostapd_mgmt_rx(drv->hapd, buf, data_len, stype, NULL);
break;
case WLAN_FC_TYPE_CTRL:
wpa_printf(MSG_DEBUG, "CTRL");
}
pos += 5;
if (hwaddr_aton(pos, addr) == 0) {
- ieee80211_michael_mic_failure(drv->hapd, addr, 1);
+ hostapd_michael_mic_failure(drv->hapd, addr);
} else {
wpa_printf(MSG_DEBUG,
"MLME-MICHAELMICFAILURE.indication "