Add wpa_supplicant AP mode events for Public Action frames

This commit is contained in:
Jouni Malinen 2010-04-11 20:33:33 +03:00 committed by Jouni Malinen
parent 195420b8d1
commit c706d5aa17
6 changed files with 52 additions and 4 deletions

View file

@ -689,7 +689,6 @@ static int setup_interface(struct hostapd_iface *iface)
int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err)
{
struct hostapd_data *hapd = iface->bss[0];
int freq;
size_t j;
u8 *prev_addr;
@ -701,13 +700,13 @@ int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err)
wpa_printf(MSG_DEBUG, "Completing interface initialization");
if (hapd->iconf->channel) {
freq = hostapd_hw_get_freq(hapd, hapd->iconf->channel);
iface->freq = hostapd_hw_get_freq(hapd, hapd->iconf->channel);
wpa_printf(MSG_DEBUG, "Mode: %s Channel: %d "
"Frequency: %d MHz",
hostapd_hw_mode_txt(hapd->iconf->hw_mode),
hapd->iconf->channel, freq);
hapd->iconf->channel, iface->freq);
if (hostapd_set_freq(hapd, hapd->iconf->hw_mode, freq,
if (hostapd_set_freq(hapd, hapd->iconf->hw_mode, iface->freq,
hapd->iconf->channel,
hapd->iconf->ieee80211n,
hapd->iconf->secondary_channel)) {

View file

@ -172,6 +172,10 @@ struct hostapd_data {
struct hostapd_probereq_cb *probereq_cb;
size_t num_probereq_cb;
void (*public_action_cb)(void *ctx, const u8 *buf, size_t len,
int freq);
void *public_action_cb_ctx;
void (*wps_reg_success_cb)(void *ctx, const u8 *mac_addr,
const u8 *uuid_e);
void *wps_reg_success_cb_ctx;
@ -204,6 +208,7 @@ struct hostapd_iface {
* current_mode->channels */
int num_rates;
struct hostapd_rate_data *current_rates;
int freq;
u16 hw_flags;

View file

@ -1355,6 +1355,14 @@ static void handle_action(struct hostapd_data *hapd,
hostapd_sa_query_action(hapd, mgmt, len);
return;
#endif /* CONFIG_IEEE80211W */
case WLAN_ACTION_PUBLIC:
if (hapd->public_action_cb) {
hapd->public_action_cb(hapd->public_action_cb_ctx,
(u8 *) mgmt, len,
hapd->iface->freq);
return;
}
break;
}
hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211,