Re: /proc/net/hostap/wlan0 and disassociated MACs?


From: Jouni Malinen (jkmaline_at_cc.hut.fi)
Date: 2002-09-02 20:05:07 UTC



On Mon, Sep 02, 2002 at 12:42:37PM -0700, David L. Sifry wrote:

> Great driver, great work! I have a question about the individual
> station statistics that are provided in /proc/net/hostap/wlan*/ -
> when is a disassociated station removed from the list? It doesn't
> appear to occur right at disassociation. I'm using the driver out of
> CVS as of a few days ago.

I'm assuming you are talking about the kernel driver implementation of the AP auth/assoc handling and not the hostapd daemon, in which these would be somewhat different (but similar).

Disassociated station remains authenticated, so it should be kept in the list until inactivity timeout has occurred (default value in hostap_ap.h is 5 minutes. Actually, even deauthentication leaves the information in the kernel list until the inactivity timeout has occurred. This might be changed so that deauth would remove the station data immediately.

> Is there a userland trigger for this? It would be very cool to pass
> this information up to userspace so that you can do something useful
> with it, like remove the entry from the arp cache or do other
> processing...

Jean Tourrilhes added new wireless events (IWEVREGISTERED and IWEVEXPIRED) for this (in wireless ext v15), but I haven't yet implemented support for these. This shouldn't add many lines of code to hostap_ap.c, so I will probably add these soon.

As far as hostapd is concerned, I will probably add some kind of easy to use hooks for running external code for various events--including possibility to run a script or whatever for new and expired stations.

> Where in the code is this happening? Perhaps I can do it myself and
> send you a patch.

For the kernel side management (i.e., !PRISM2_HOSTAPD), these are
handled in driver/modules/hostap_ap.c (ap_handle_timer,
handle_{auth,assoc,deauth,disassoc}.

For hostapd (PRISM2_HOSTAPD), the functions are named identically (although deauth and disassoc has not yet been implemented), and they are in hostapd/hostapd.c.  

-- 
Jouni Malinen                                            PGP id EFC895FA


This archive was generated by hypermail 2.1.4.