Use a wrapper function for ieee802_1x_receive() to avoid ieee802_1x.h
authorJouni Malinen <jouni.malinen@atheros.com>
Fri, 9 Jan 2009 14:33:59 +0000 (16:33 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 9 Jan 2009 14:33:59 +0000 (16:33 +0200)
Driver wrappers should not need to include ieee802_1x.h, so use a
wrapper function declared in driver.h.

hostapd/driver.h
hostapd/driver_bsd.c
hostapd/driver_hostap.c
hostapd/driver_madwifi.c
hostapd/driver_nl80211.c
hostapd/driver_prism54.c
hostapd/driver_test.c
hostapd/driver_wired.c
hostapd/hostapd.c

index 5d21463..55dace5 100644 (file)
@@ -219,5 +219,7 @@ void hostapd_rx_from_unknown_sta(struct hostapd_data *hapd, const u8 *addr);
 int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
                        const u8 *ie, size_t ielen);
 void hostapd_notif_disassoc(struct hostapd_data *hapd, const u8 *addr);
+void hostapd_eapol_receive(struct hostapd_data *hapd, const u8 *sa,
+                          const u8 *buf, size_t len);
 
 #endif /* DRIVER_H */
index 05210b7..3cca934 100644 (file)
@@ -32,7 +32,6 @@
 
 #include "hostapd.h"
 #include "driver.h"
-#include "ieee802_1x.h"
 #include "eloop.h"
 #include "l2_packet/l2_packet.h"
 
@@ -671,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
index fcc8e9f..cf8b9ba 100644 (file)
@@ -34,7 +34,6 @@
 
 #include "hostapd.h"
 #include "driver.h"
-#include "ieee802_1x.h"
 #include "eloop.h"
 #include "priv_netlink.h"
 #include "ieee802_11.h"
@@ -113,7 +112,7 @@ static void handle_data(struct hostap_driver_data *drv, u8 *buf, size_t len,
        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:
index 8ea7037..ab143f5 100644 (file)
@@ -57,7 +57,6 @@
 
 #include "hostapd.h"
 #include "driver.h"
-#include "ieee802_1x.h"
 #include "eloop.h"
 #include "priv_netlink.h"
 #include "l2_packet/l2_packet.h"
@@ -1217,10 +1216,9 @@ static void
 handle_read(void *ctx, const u8 *src_addr, const u8 *buf, size_t len)
 {
        struct madwifi_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 void *
index 6d29095..c697337 100644 (file)
@@ -31,7 +31,6 @@
 
 #include "hostapd.h"
 #include "driver.h"
-#include "ieee802_1x.h"
 #include "eloop.h"
 #include "ieee802_11.h"
 #include "hw_features.h"
@@ -1802,7 +1801,7 @@ static void handle_eapol(int sock, void *eloop_ctx, void *sock_ctx)
        }
 
        if (have_ifidx(drv, lladdr.sll_ifindex))
-               ieee802_1x_receive(hapd, lladdr.sll_addr, buf, len);
+               hostapd_eapol_receive(hapd, lladdr.sll_addr, buf, len);
 }
 
 
index 4e2189a..02c18af 100644 (file)
@@ -933,8 +933,8 @@ static void handle_802_3(int sock, void *eloop_ctx, void *sock_ctx)
                 return;
         }
         if (hdr->type == htons(ETH_P_PAE)) {
-                ieee802_1x_receive(hapd, (u8 *) &hdr->sa[0], (u8 *) &hdr[1],
-                                  len - sizeof(*hdr));
+                hostapd_eapol_receive(hapd, (u8 *) &hdr->sa[0], (u8 *) &hdr[1],
+                                     len - sizeof(*hdr));
         }
        free(hdr);
 }
index d5879d5..248d5d2 100644 (file)
@@ -20,7 +20,6 @@
 #include "driver.h"
 #include "sha1.h"
 #include "eloop.h"
-#include "ieee802_1x.h"
 #include "wpa.h"
 #include "l2_packet/l2_packet.h"
 #include "ieee802_11.h"
@@ -549,7 +548,7 @@ static void test_driver_eapol(struct test_driver_data *drv,
                hapd = test_driver_get_hapd(drv, cli->bss);
                if (hapd == NULL)
                        return;
-               ieee802_1x_receive(hapd, cli->addr, data, datalen);
+               hostapd_eapol_receive(hapd, cli->addr, data, datalen);
        } else {
                wpa_printf(MSG_DEBUG, "test_socket: EAPOL from unknown "
                           "client");
index 60b036e..0a1d733 100644 (file)
@@ -29,7 +29,6 @@
 #endif /* USE_KERNEL_HEADERS */
 
 #include "hostapd.h"
-#include "ieee802_1x.h"
 #include "eloop.h"
 #include "sta_info.h"
 #include "driver.h"
@@ -119,7 +118,7 @@ static void handle_data(struct hostapd_data *hapd, unsigned char *buf,
                        pos = (u8 *) (hdr + 1);
                        left = len - sizeof(*hdr);
 
-                       ieee802_1x_receive(hapd, sa, pos, left);
+                       hostapd_eapol_receive(hapd, sa, pos, left);
                break;
 
        default:
index d5c2648..581a415 100644 (file)
@@ -390,6 +390,13 @@ void hostapd_notif_disassoc(struct hostapd_data *hapd, const u8 *addr)
 }
 
 
+void hostapd_eapol_receive(struct hostapd_data *hapd, const u8 *sa,
+                          const u8 *buf, size_t len)
+{
+       ieee802_1x_receive(hapd, sa, buf, len);
+}
+
+
 #ifdef EAP_SERVER
 static int hostapd_sim_db_cb_sta(struct hostapd_data *hapd,
                                 struct sta_info *sta, void *ctx)