2

Given the wpa_supplicant in Linux uses nl80211, can I subscribe to one of it's multicast groups and listen for association, di-association, authentication and de-authentication events?

Toshiro
  • 345
  • 2
  • 5
  • 14

1 Answers1

1

You can specify ctrl_interface in wpa_supplicant config file, for example:

ctrl_interface=/tmp/wpa_supplicant

Аfter you run wpa_supplicant using this config file a socket will be created. If your interface is wlan0 then path to the socket will be /tmp/wpa_supplicant/wlan0.

You can connect to this socket and read events using wpa_ctrl_recv. Events are actually plain text but you can parse them.

You only need to include necessary functions to your project somehow. As for me, I've simply copied part of wpa_supplicant sources (wpa_ctrl.h, wpa_ctrl.c and some other included files) to my project. But probably there's some library which you can use.

Alexey Mukhin
  • 71
  • 1
  • 5