Indicate assoc vs. reassoc in association event

This allows driver wrappers to indicate whether the association was
done using Association Request/Response or with Reassociation
Request/Response frames.
This commit is contained in:
Shan Palanisamy 2010-10-25 13:50:34 +03:00 committed by Jouni Malinen
parent d7956add9c
commit 39b08b5fc0
8 changed files with 17 additions and 9 deletions

View file

@ -38,7 +38,7 @@
int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr, int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
const u8 *ie, size_t ielen) const u8 *ie, size_t ielen, int reassoc)
{ {
struct sta_info *sta; struct sta_info *sta;
int new_assoc, res; int new_assoc, res;
@ -506,7 +506,8 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
case EVENT_ASSOC: case EVENT_ASSOC:
hostapd_notif_assoc(hapd, data->assoc_info.addr, hostapd_notif_assoc(hapd, data->assoc_info.addr,
data->assoc_info.req_ies, data->assoc_info.req_ies,
data->assoc_info.req_ies_len); data->assoc_info.req_ies_len,
data->assoc_info.reassoc);
break; break;
case EVENT_DISASSOC: case EVENT_DISASSOC:
if (data) if (data)

View file

@ -249,7 +249,7 @@ void hostapd_prune_associations(struct hostapd_data *hapd, const u8 *addr);
/* drv_callbacks.c (TODO: move to somewhere else?) */ /* drv_callbacks.c (TODO: move to somewhere else?) */
int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr, int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
const u8 *ie, size_t ielen); const u8 *ie, size_t ielen, int reassoc);
void hostapd_notif_disassoc(struct hostapd_data *hapd, const u8 *addr); void hostapd_notif_disassoc(struct hostapd_data *hapd, const u8 *addr);
void hostapd_event_sta_low_ack(struct hostapd_data *hapd, const u8 *addr); void hostapd_event_sta_low_ack(struct hostapd_data *hapd, const u8 *addr);
int hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa, int hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa,

View file

@ -2594,6 +2594,11 @@ union wpa_event_data {
* calls. * calls.
*/ */
struct assoc_info { struct assoc_info {
/**
* reassoc - Flag to indicate association or reassociation
*/
int reassoc;
/** /**
* req_ies - (Re)Association Request IEs * req_ies - (Re)Association Request IEs
* *
@ -3113,10 +3118,11 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
*/ */
static inline void drv_event_assoc(void *ctx, const u8 *addr, const u8 *ie, static inline void drv_event_assoc(void *ctx, const u8 *addr, const u8 *ie,
size_t ielen) size_t ielen, int reassoc)
{ {
union wpa_event_data event; union wpa_event_data event;
os_memset(&event, 0, sizeof(event)); os_memset(&event, 0, sizeof(event));
event.assoc_info.reassoc = reassoc;
event.assoc_info.req_ies = ie; event.assoc_info.req_ies = ie;
event.assoc_info.req_ies_len = ielen; event.assoc_info.req_ies_len = ielen;
event.assoc_info.addr = addr; event.assoc_info.addr = addr;

View file

@ -825,7 +825,7 @@ atheros_new_sta(struct atheros_driver_data *drv, u8 addr[IEEE80211_ADDR_LEN])
ielen += 2; ielen += 2;
no_ie: no_ie:
drv_event_assoc(hapd, addr, iebuf, ielen); drv_event_assoc(hapd, addr, iebuf, ielen, 0);
if (memcmp(addr, drv->acct_mac, ETH_ALEN) == 0) { if (memcmp(addr, drv->acct_mac, ETH_ALEN) == 0) {
/* Cached accounting data is not valid anymore. */ /* Cached accounting data is not valid anymore. */

View file

@ -511,7 +511,7 @@ bsd_new_sta(void *priv, void *ctx, u8 addr[IEEE80211_ADDR_LEN])
ielen += 2; ielen += 2;
no_ie: no_ie:
drv_event_assoc(ctx, addr, iebuf, ielen); drv_event_assoc(ctx, addr, iebuf, ielen, 0);
} }
static int static int

View file

@ -848,7 +848,7 @@ madwifi_new_sta(struct madwifi_driver_data *drv, u8 addr[IEEE80211_ADDR_LEN])
ielen += 2; ielen += 2;
no_ie: no_ie:
drv_event_assoc(hapd, addr, iebuf, ielen); drv_event_assoc(hapd, addr, iebuf, ielen, 0);
if (memcmp(addr, drv->acct_mac, ETH_ALEN) == 0) { if (memcmp(addr, drv->acct_mac, ETH_ALEN) == 0) {
/* Cached accounting data is not valid anymore. */ /* Cached accounting data is not valid anymore. */

View file

@ -672,7 +672,7 @@ static void test_driver_assoc(struct wpa_driver_test_data *drv,
sendto(drv->test_socket, cmd, strlen(cmd), 0, sendto(drv->test_socket, cmd, strlen(cmd), 0,
(struct sockaddr *) from, fromlen); (struct sockaddr *) from, fromlen);
drv_event_assoc(bss->bss_ctx, cli->addr, ie, ielen); drv_event_assoc(bss->bss_ctx, cli->addr, ie, ielen, 0);
} }

View file

@ -1183,7 +1183,8 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
hostapd_notif_assoc(wpa_s->ap_iface->bss[0], hostapd_notif_assoc(wpa_s->ap_iface->bss[0],
data->assoc_info.addr, data->assoc_info.addr,
data->assoc_info.req_ies, data->assoc_info.req_ies,
data->assoc_info.req_ies_len); data->assoc_info.req_ies_len,
data->assoc_info.reassoc);
return; return;
} }
#endif /* CONFIG_AP */ #endif /* CONFIG_AP */