Remove ap_config.h dependency from driver_i.h

This adds explicit #include line for ap_config.h into the src/ap/*.c
files that actually use the definitions from there.
This commit is contained in:
Jouni Malinen 2009-12-26 00:12:25 +02:00
parent 6226e38d00
commit 8b06c1ed0d
6 changed files with 76 additions and 63 deletions

View file

@ -12,12 +12,13 @@
* See README and COPYING for more details.
*/
#include "includes.h"
#include "utils/includes.h"
#include "common.h"
#include "ap/hostapd.h"
#include "ap/ieee802_11.h"
#include "ap/sta_info.h"
#include "utils/common.h"
#include "hostapd.h"
#include "ieee802_11.h"
#include "sta_info.h"
#include "ap_config.h"
#include "driver_i.h"
#include "ap_drv_ops.h"
@ -366,3 +367,59 @@ void hostapd_set_driver_ops(struct hostapd_driver_ops *ops)
ops->sta_remove = hostapd_sta_remove;
ops->set_countermeasures = hostapd_set_countermeasures;
}
int hostapd_set_privacy(struct hostapd_data *hapd, int enabled)
{
if (hapd->driver == NULL || hapd->driver->set_privacy == NULL)
return 0;
return hapd->driver->set_privacy(hapd->conf->iface, hapd->drv_priv,
enabled);
}
int hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem,
size_t elem_len)
{
if (hapd->driver == NULL || hapd->driver->set_generic_elem == NULL)
return 0;
return hapd->driver->set_generic_elem(hapd->conf->iface,
hapd->drv_priv, elem, elem_len);
}
int hostapd_get_ssid(struct hostapd_data *hapd, u8 *buf, size_t len)
{
if (hapd->driver == NULL || hapd->driver->hapd_get_ssid == NULL)
return 0;
return hapd->driver->hapd_get_ssid(hapd->conf->iface, hapd->drv_priv,
buf, len);
}
int hostapd_set_ssid(struct hostapd_data *hapd, const u8 *buf, size_t len)
{
if (hapd->driver == NULL || hapd->driver->hapd_set_ssid == NULL)
return 0;
return hapd->driver->hapd_set_ssid(hapd->conf->iface, hapd->drv_priv,
buf, len);
}
int hostapd_if_add(struct hostapd_data *hapd, enum wpa_driver_if_type type,
const char *ifname, const u8 *addr, void *bss_ctx)
{
if (hapd->driver == NULL || hapd->driver->if_add == NULL)
return -1;
return hapd->driver->if_add(hapd->conf->iface, hapd->drv_priv, type,
ifname, addr, bss_ctx);
}
int hostapd_if_remove(struct hostapd_data *hapd, enum wpa_driver_if_type type,
const char *ifname)
{
if (hapd->driver == NULL || hapd->driver->if_remove == NULL)
return -1;
return hapd->driver->if_remove(hapd->drv_priv, type, ifname);
}

View file

@ -16,5 +16,14 @@
#define AP_DRV_OPS
void hostapd_set_driver_ops(struct hostapd_driver_ops *ops);
int hostapd_set_privacy(struct hostapd_data *hapd, int enabled);
int hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem,
size_t elem_len);
int hostapd_get_ssid(struct hostapd_data *hapd, u8 *buf, size_t len);
int hostapd_set_ssid(struct hostapd_data *hapd, const u8 *buf, size_t len);
int hostapd_if_add(struct hostapd_data *hapd, enum wpa_driver_if_type type,
const char *ifname, const u8 *addr, void *bss_ctx);
int hostapd_if_remove(struct hostapd_data *hapd, enum wpa_driver_if_type type,
const char *ifname);
#endif /* AP_DRV_OPS */

View file

@ -16,7 +16,6 @@
#define DRIVER_I_H
#include "drivers/driver.h"
#include "ap/ap_config.h"
static inline int
hostapd_set_ieee8021x(struct hostapd_data *hapd, struct wpa_bss_params *params)
@ -26,15 +25,6 @@ hostapd_set_ieee8021x(struct hostapd_data *hapd, struct wpa_bss_params *params)
return hapd->driver->set_ieee8021x(hapd->drv_priv, params);
}
static inline int
hostapd_set_privacy(struct hostapd_data *hapd, int enabled)
{
if (hapd->driver == NULL || hapd->driver->set_privacy == NULL)
return 0;
return hapd->driver->set_privacy(hapd->conf->iface, hapd->drv_priv,
enabled);
}
static inline int
hostapd_get_seqnum(const char *ifname, struct hostapd_data *hapd,
const u8 *addr, int idx, u8 *seq)
@ -53,34 +43,6 @@ hostapd_flush(struct hostapd_data *hapd)
return hapd->driver->flush(hapd->drv_priv);
}
static inline int
hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem,
size_t elem_len)
{
if (hapd->driver == NULL || hapd->driver->set_generic_elem == NULL)
return 0;
return hapd->driver->set_generic_elem(hapd->conf->iface,
hapd->drv_priv, elem, elem_len);
}
static inline int
hostapd_get_ssid(struct hostapd_data *hapd, u8 *buf, size_t len)
{
if (hapd->driver == NULL || hapd->driver->hapd_get_ssid == NULL)
return 0;
return hapd->driver->hapd_get_ssid(hapd->conf->iface, hapd->drv_priv,
buf, len);
}
static inline int
hostapd_set_ssid(struct hostapd_data *hapd, const u8 *buf, size_t len)
{
if (hapd->driver == NULL || hapd->driver->hapd_set_ssid == NULL)
return 0;
return hapd->driver->hapd_set_ssid(hapd->conf->iface, hapd->drv_priv,
buf, len);
}
static inline int
hostapd_set_freq(struct hostapd_data *hapd, int mode, int freq, int channel,
int ht_enabled, int sec_channel_offset)
@ -187,25 +149,6 @@ hostapd_valid_bss_mask(struct hostapd_data *hapd, const u8 *addr,
return hapd->driver->valid_bss_mask(hapd->drv_priv, addr, mask);
}
static inline int
hostapd_if_add(struct hostapd_data *hapd, enum wpa_driver_if_type type,
const char *ifname, const u8 *addr, void *bss_ctx)
{
if (hapd->driver == NULL || hapd->driver->if_add == NULL)
return -1;
return hapd->driver->if_add(hapd->conf->iface, hapd->drv_priv, type,
ifname, addr, bss_ctx);
}
static inline int
hostapd_if_remove(struct hostapd_data *hapd, enum wpa_driver_if_type type,
const char *ifname)
{
if (hapd->driver == NULL || hapd->driver->if_remove == NULL)
return -1;
return hapd->driver->if_remove(hapd->drv_priv, type, ifname);
}
static inline struct hostapd_hw_modes *
hostapd_get_hw_feature_data(struct hostapd_data *hapd, u16 *num_modes,
u16 *flags)

View file

@ -26,6 +26,7 @@
#include "wpa_auth.h"
#include "wmm.h"
#include "wps_hostapd.h"
#include "ap_config.h"
#include "driver_i.h"

View file

@ -34,6 +34,7 @@
#include "driver_i.h"
#include "wpa_auth_glue.h"
#include "ap_drv_ops.h"
#include "ap_config.h"
static int hostapd_flush_old_stations(struct hostapd_data *hapd);

View file

@ -25,8 +25,10 @@
#include "preauth_auth.h"
#include "sta_info.h"
#include "tkip_countermeasures.h"
#include "wpa_auth.h"
#include "driver_i.h"
#include "ap_drv_ops.h"
#include "ap_config.h"
#include "wpa_auth.h"
static void hostapd_wpa_auth_conf(struct hostapd_bss_config *conf,