Use a wrapper function for ieee802_1x_receive() to avoid ieee802_1x.h

Driver wrappers should not need to include ieee802_1x.h, so use a
wrapper function declared in driver.h.
This commit is contained in:
Jouni Malinen 2009-01-09 16:33:59 +02:00 committed by Jouni Malinen
parent 33eb3c4ec4
commit b83cbb3b3b
9 changed files with 21 additions and 20 deletions

View 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 */

View 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

View 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:

View 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 *

View 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);
}

View 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);
}

View 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");

View 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:

View 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)