OpenWrt Forum Archive

Topic: Notification of the association of clients to the AP?

The content of this topic has been archived on 12 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I am not sure if this should go on the developers forum or in the general one, my apologies if this is the wrong forum. For the record, I'm running stock kamikaze 8.09.1 (brcm-2.4) on a WRT54GL.

My question is, is there a way of being notified programmatically when a client associates (or tries to associate) to my access point? I have been browsing through the forums or documentation, and could not find any (answered) reference to this particular issue. The logs on the router do not show anything when a client associates (they do show the DHCP requests and replies handled by dnsmasq, but I am looking for a more general way of handling the association). My intention is to be able to "react" (for example logging the associated client attempt, or executing some actions depending on its MAC) to that events.

On a related issue, which is the daemon or component responsible for handling the association of the clients in this case (brcm-2.4)? In other setups it seems that the handling of associating and authentication is done by hostapd, but it does not seem to be the case. It also seems that hostapd might be able to provide the "notification" feature I need, or at least the documentation on the configuration file [1] seems to hint so: in any case, any indication or comment would be much appreciated.

Best regards, and thanks in advance!

[1] http://hostap.epitest.fi/gitweb/gitweb. … stapd.conf

(Last edited by diego.misc on 11 Nov 2009, 18:53)

Hi.

There is no notification mechanism you can rely on, however there is the possibility to poll the driver and look for changes during the cycles.
The proprietary "wl" utility (opkg install wl) has a command called "assoclist" which returns a list with mac addresses of all currently associated stations.
Using the command "wl sta_info <macaddr>" you can get detailled info per client like authentication state etc.

With this knowledge you can build a cronjob or similar to implement some kind of client logging.

Edit:
To answer your second question, on brcm-2.4 the driver handles the association stuff itself and wpa is handled by the "nas" process.
The nas authenticator is propriatary as well and thus a blackbox, as far as I know it provides no notification facilities you can use and it isn't very verbose in general.

Regards,
JoW

(Last edited by jow on 12 Nov 2009, 01:01)

Thanks for the answer, JoW! I was aware of the existence of the wl utility, but was hoping for a "cleaner" way of getting notified other than polling the driver. But perhaps that is the only way to go.

Regarding the second issue, thanks for the information as well. I assume that the nas process you refer to is the same one that is described in [1], and indeed seems not very user friendly. Since it seems that hostapd is available in the repositories for 2.4, would it be possible to use hostapd instead of nas (by replacing the hotplug.d script that starts nas), or is the brcm-2.4 driver not supported by hostapd?

Thanks again!

[1] http://wiki.openwrt.org/oldwiki/openwrtdocs/nas

The discussion might have continued from here.