]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Indicate assoc vs. reassoc in association event
authorShan Palanisamy <Shan.Palanisamy@Atheros.com>
Mon, 25 Oct 2010 10:50:34 +0000 (13:50 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 6 Mar 2011 12:31:46 +0000 (14:31 +0200)
This allows driver wrappers to indicate whether the association was
done using Association Request/Response or with Reassociation
Request/Response frames.

src/ap/drv_callbacks.c
src/ap/hostapd.h
src/drivers/driver.h
src/drivers/driver_atheros.c
src/drivers/driver_bsd.c
src/drivers/driver_madwifi.c
src/drivers/driver_test.c
wpa_supplicant/events.c

index c1557a1aff548478619152669200930f07ff56e1..92b05ca340cbc70585a641f8c5d703631ce14c14 100644 (file)
@@ -38,7 +38,7 @@
 
 
 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;
        int new_assoc, res;
@@ -506,7 +506,8 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
        case EVENT_ASSOC:
                hostapd_notif_assoc(hapd, data->assoc_info.addr,
                                    data->assoc_info.req_ies,
-                                   data->assoc_info.req_ies_len);
+                                   data->assoc_info.req_ies_len,
+                                   data->assoc_info.reassoc);
                break;
        case EVENT_DISASSOC:
                if (data)
index 470bfe92f86aa03d6be1eeb13371a4b5a8bdc689..d649d60626bc35ab7c08b394dc3c87f4ac74d335 100644 (file)
@@ -249,7 +249,7 @@ void hostapd_prune_associations(struct hostapd_data *hapd, const u8 *addr);
 
 /* drv_callbacks.c (TODO: move to somewhere else?) */
 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_event_sta_low_ack(struct hostapd_data *hapd, const u8 *addr);
 int hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa,
index b8684fabf83042ff527179f2f146c6319e167245..4f487f21d94eda3efed9fd21334651e5e0d6f25c 100644 (file)
@@ -2594,6 +2594,11 @@ union wpa_event_data {
         * calls.
         */
        struct assoc_info {
+               /**
+                * reassoc - Flag to indicate association or reassociation
+                */
+               int reassoc;
+
                /**
                 * 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,
-                                  size_t ielen)
+                                  size_t ielen, int reassoc)
 {
        union wpa_event_data event;
        os_memset(&event, 0, sizeof(event));
+       event.assoc_info.reassoc = reassoc;
        event.assoc_info.req_ies = ie;
        event.assoc_info.req_ies_len = ielen;
        event.assoc_info.addr = addr;
index 869e49c1ac2b189e91f0c3e77dc0a7fdee834e77..3cb0ab316dc18656580d1af5b10eda6127ffe38e 100644 (file)
@@ -825,7 +825,7 @@ atheros_new_sta(struct atheros_driver_data *drv, u8 addr[IEEE80211_ADDR_LEN])
                ielen += 2;
 
 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) {
                /* Cached accounting data is not valid anymore. */
index 0cc54ce29a4a692945c10bd4fe2f69a176d8bc2f..b91f5111d9e08d962fcebe3311e53de297e67c94 100644 (file)
@@ -511,7 +511,7 @@ bsd_new_sta(void *priv, void *ctx, u8 addr[IEEE80211_ADDR_LEN])
                ielen += 2;
 
 no_ie:
-       drv_event_assoc(ctx, addr, iebuf, ielen);
+       drv_event_assoc(ctx, addr, iebuf, ielen, 0);
 }
 
 static int
index 8c7ae0c98a535f369bb4d5563af11a1ab7fb7450..b485d38c2f53919632ae98e087ad8526f5860af9 100644 (file)
@@ -848,7 +848,7 @@ madwifi_new_sta(struct madwifi_driver_data *drv, u8 addr[IEEE80211_ADDR_LEN])
                ielen += 2;
 
 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) {
                /* Cached accounting data is not valid anymore. */
index babf79a075a89c8e26934616d26638597c084969..c335225ec01e1576e32b798d7405b523becc1481 100644 (file)
@@ -672,7 +672,7 @@ static void test_driver_assoc(struct wpa_driver_test_data *drv,
        sendto(drv->test_socket, cmd, strlen(cmd), 0,
               (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);
 }
 
 
index 91f187346924aa5b754848e970c9f025643ec8bd..8c635631817b014c2a7fc3d0fa38c75805869a36 100644 (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],
                                    data->assoc_info.addr,
                                    data->assoc_info.req_ies,
-                                   data->assoc_info.req_ies_len);
+                                   data->assoc_info.req_ies_len,
+                                   data->assoc_info.reassoc);
                return;
        }
 #endif /* CONFIG_AP */