踏实做事,认真做人
分类: 嵌入式
2013-06-14 12:41:08
wpa_supplicant main.c
wpa_supplicant usage:
example1:wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf
example2:wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf
1)wpa_supplicant start with a lot of param,wpa_supplicant use linux getopt to get cmd args from user input.
2)android use wpa_supplicant as WIFI STA/SoftAP/P2P stack,so in os_program_init,define supplementary group (AID_INET, AID_WIFI, AID_KEYSTORE),
wpa_supplicant need to permission create sockets for netlink(communication with kernel) and socket with Android WIFI framework and keystore for keys and etc.
3)wpa_supplicant_init initialize debug,EAP method,wpa_global (drivers ops,ctrl_interface,debug relative) and eloop ,wpa driver (wext,nl80211 ...) init(such as driver_nls80211 nl80211_global_init)
comment:
1)setgroups can get example in Richard Stevense Book (APUE)