Fix driver_bsd.c build for FreeBSD
[wpasupplicant] / hostapd / driver_bsd.c
index f200d15..134894e 100644 (file)
 
 #include "hostapd.h"
 #include "driver.h"
-#include "ieee802_1x.h"
 #include "eloop.h"
-#include "sta_info.h"
 #include "l2_packet/l2_packet.h"
 
 #include "eapol_sm.h"
-#include "wpa.h"
-#include "radius/radius.h"
-#include "ieee802_11.h"
 #include "common.h"
 
 struct bsd_driver_data {
@@ -505,33 +500,11 @@ bsd_sta_disassoc(void *priv, const u8 *addr, int reason_code)
 }
 
 static int
-bsd_del_sta(struct bsd_driver_data *drv, u8 addr[IEEE80211_ADDR_LEN])
-{
-       struct hostapd_data *hapd = drv->hapd;
-       struct hostapd_bss_config *conf = hapd->conf;
-       struct sta_info *sta;
-
-       hostapd_logger(hapd, addr, HOSTAPD_MODULE_IEEE80211,
-               HOSTAPD_LEVEL_INFO, "deassociated");
-
-       sta = ap_get_sta(hapd, addr);
-       if (sta != NULL) {
-               sta->flags &= ~(WLAN_STA_AUTH | WLAN_STA_ASSOC);
-               if (conf->wpa)
-                       wpa_auth_sm_event(sta->wpa_sm, WPA_DISASSOC);
-               sta->acct_terminate_cause = RADIUS_ACCT_TERMINATE_CAUSE_USER_REQUEST;
-               ieee802_1x_notify_port_enabled(sta->eapol_sm, 0);
-               ap_free_sta(hapd, sta);
-       }
-       return 0;
-}
-
-static int
 bsd_new_sta(struct bsd_driver_data *drv, u8 addr[IEEE80211_ADDR_LEN])
 {
        struct hostapd_data *hapd = drv->hapd;
        struct ieee80211req_wpaie ie;
-       int new_assoc, ielen = 0, res;
+       int ielen = 0;
        u8 *iebuf = NULL;
 
        /*
@@ -550,6 +523,7 @@ bsd_new_sta(struct bsd_driver_data *drv, u8 addr[IEEE80211_ADDR_LEN])
        else
                ielen += 2;
 
+no_ie:
        return hostapd_notif_assoc(hapd, addr, iebuf, ielen);
 }
 
@@ -593,7 +567,7 @@ bsd_wireless_event_receive(int sock, void *ctx, void *sock_ctx)
                        break;
                case RTM_IEEE80211_LEAVE:
                        leave = (struct ieee80211_leave_event *) &ifan[1];
-                       bsd_del_sta(drv, leave->iev_addr);
+                       hostapd_notif_disassoc(drv->hapd, leave->iev_addr);
                        break;
                case RTM_IEEE80211_JOIN:
 #ifdef RTM_IEEE80211_REJOIN
@@ -611,7 +585,7 @@ bsd_wireless_event_receive(int sock, void *ctx, void *sock_ctx)
                                "Michael MIC failure wireless event: "
                                "keyix=%u src_addr=" MACSTR, mic->iev_keyix,
                                MAC2STR(mic->iev_src));
-                       ieee80211_michael_mic_failure(hapd, mic->iev_src, 1);
+                       hostapd_michael_mic_failure(hapd, mic->iev_src);
                        break;
                }
                break;
@@ -696,10 +670,9 @@ static void
 handle_read(void *ctx, const u8 *src_addr, const u8 *buf, size_t len)
 {
        struct bsd_driver_data *drv = ctx;
-       struct hostapd_data *hapd = drv->hapd;
-
-       ieee802_1x_receive(hapd, src_addr, buf + sizeof(struct l2_ethhdr),
-                          len - sizeof(struct l2_ethhdr));
+       hostapd_eapol_receive(drv->hapd, src_addr,
+                             buf + sizeof(struct l2_ethhdr),
+                             len - sizeof(struct l2_ethhdr));
 }
 
 static int