/*
* hostapd / RADIUS Accounting
- * Copyright (c) 2002-2008, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2002-2009, Jouni Malinen <j@w1.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
#include "common.h"
#include "hostapd.h"
+#include "drivers/driver.h"
#include "radius/radius.h"
#include "radius/radius_client.h"
#include "eloop.h"
#include "accounting.h"
#include "ieee802_1x.h"
-#include "driver_i.h"
+#include "config.h"
#include "sta_info.h"
struct sta_info *sta,
struct hostap_sta_driver_data *data)
{
- if (hostapd_read_sta_data(hapd, data, sta->addr))
+ if (hapd->drv.read_sta_data(hapd, data, sta->addr))
return -1;
if (sta->last_rx_bytes > data->rx_bytes)
time(&sta->acct_session_start);
sta->last_rx_bytes = sta->last_tx_bytes = 0;
sta->acct_input_gigawords = sta->acct_output_gigawords = 0;
- hostapd_sta_clear_stats(hapd, sta->addr);
+ hapd->drv.sta_clear_stats(hapd, sta->addr);
if (!hapd->conf->radius->acct_server)
return;
}
+static int hostapd_read_sta_data(struct hostapd_data *hapd,
+ struct hostap_sta_driver_data *data,
+ const u8 *addr)
+{
+ if (hapd->driver == NULL || hapd->driver->read_sta_data == NULL)
+ return -1;
+ return hapd->driver->read_sta_data(hapd->drv_priv, data, addr);
+}
+
+
+static int hostapd_sta_clear_stats(struct hostapd_data *hapd, const u8 *addr)
+{
+ if (hapd->driver == NULL || hapd->driver->sta_clear_stats == NULL)
+ return 0;
+ return hapd->driver->sta_clear_stats(hapd->drv_priv, addr);
+}
+
+
void hostapd_set_driver_ops(struct hostapd_driver_ops *ops)
{
ops->set_ap_wps_ie = hostapd_set_ap_wps_ie;
ops->send_eapol = hostapd_send_eapol;
ops->set_authorized = hostapd_set_authorized;
ops->set_key = hostapd_set_key;
+ ops->read_sta_data = hostapd_read_sta_data;
+ ops->sta_clear_stats = hostapd_sta_clear_stats;
}
}
static inline int
-hostapd_read_sta_data(struct hostapd_data *hapd,
- struct hostap_sta_driver_data *data, const u8 *addr)
-{
- if (hapd->driver == NULL || hapd->driver->read_sta_data == NULL)
- return -1;
- return hapd->driver->read_sta_data(hapd->drv_priv, data, addr);
-}
-
-static inline int
hostapd_sta_deauth(struct hostapd_data *hapd, const u8 *addr, int reason)
{
if (hapd->driver == NULL || hapd->driver->sta_deauth == NULL)
}
static inline int
-hostapd_sta_clear_stats(struct hostapd_data *hapd, const u8 *addr)
-{
- if (hapd->driver == NULL || hapd->driver->sta_clear_stats == NULL)
- return 0;
- return hapd->driver->sta_clear_stats(hapd->drv_priv, addr);
-}
-
-static inline int
hostapd_set_beacon(const char *ifname, struct hostapd_data *hapd,
const u8 *head, size_t head_len,
const u8 *tail, size_t tail_len, int dtim_period,
struct hapd_interfaces;
struct hostapd_data;
struct sta_info;
+struct hostap_sta_driver_data;
#ifdef CONFIG_FULL_DYNAMIC_VLAN
struct full_dynamic_vlan;
wpa_alg alg, const u8 *addr, int key_idx,
int set_tx, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len);
+ int (*read_sta_data)(struct hostapd_data *hapd,
+ struct hostap_sta_driver_data *data,
+ const u8 *addr);
+ int (*sta_clear_stats)(struct hostapd_data *hapd, const u8 *addr);
};
/**