2023年12月13日發(作者:拍賣會流程)

Wpa_supplicant_8 是什么
中文直譯受保護的wifi接入客戶端。它Ur mode的最底層,直接和kernel的驅動接口,一個完整的開源項目。
其中的wpa:Supplicant –是客戶端
Wi-Fi Protected Access (WPA) and Wi-Fi Protected Access II (WPA2) are two curity protocols
and curity certification programs developed by the Wi-Fi Alliance to cure wireless computer
networks. The Alliance defined the in respon to rious weakness rearchers had found
in the previous system, WEP (Wired Equivalent Privacy).[1]
Wpa_supplicant 在wiki上看到的內容
wpa_supplicant is a free software implementation of an IEEE 802.11i supplicant for Linux,
FreeBSD, NetBSD, AROS, Microsoft Windows and Haiku. In addition to being a full-featured
WPA2 supplicant, it also implements WPA and older wireless LAN curity protocols. Features
include:
WPA and full IEEE 802.11i/RSN/WPA2
WPA-PSK and WPA2-PSK (pre-shared key) ("WPA-Personal")
WPA with EAP (e.g., with RADIUS authentication rver) ("WPA-Enterpri")
key management for CCMP, TKIP, WEP (both 104/128 and 40/64 bit)
RSN: PMKSA caching, pre-authentication
Included with the supplicant are a graphical ur interface and a command line interface utility
for interacting with the running supplicant. From either of the interfaces it is possible to
review a list of currently visible networks, lect one of them, provide any additional curity
information needed to authenticate with the network (e.g. a passphra or urname and
password) and add it to the preference list to enable automatic reconnection in the future.
The graphical ur interface is built on top of the Qt library.
//WPA_supplicant
這個wpa_supplicant就是一個實現,一個很具體的內容??!
使用man -8 wpa_supplicant 就知道一些內容,
而且在adb shell wpa_supplicant 就看到了好多的選項了,
因此,它就是wifi 的完整底層實現。
官方網頁
/wpa_supplicant/
wpa_supplicant is a cross-platform WPA supplicant with support for WEP, WPA and WPA2 (IEEE
802.11i / RSN (Robust Secure Network)). It is suitable for both desktop and laptop computers
and even embedded systems.
wpa_supplicant is the IEEE 802.1X/WPA component that is ud in the client stations. It
implements key negotiation with a WPA Authenticator and it controls the roaming and IEEE
802.11 authentication/association of the wireless driver.
還是要看官方的文檔?。?
/wpa_supplicant/devel/
這里有完全的說明,從開發者角度的,所有的內容,數據結構、函數結構API、每個文件的簡單說明、目錄說明、全局變量說明、變量索引說明等等,就是一個開發者完全手冊。
wpa_
調用stack簡述
從framework到wpa_supplicant的適配層(wifi.c)網上介紹的帖子很多,而且本身也并不復雜,其中framework部分需要注意的是wifiService和wifiMoniter兩部分,這兩快一個是轉發AP的CMD另一個是接收來自wpa_supplicant的CMD。他們與本地庫的連接都是通過JNI方法,具體實現方法在android_net_wifi_ ,修改名字了
android_net_wifi_中。在這個文件中可以大致看出AP會給wpa_supplicant下哪些命令。
1. /*
2. * JNI registration.
3. */
4. static JNINativeMethod gWifiMethods[] = {
5. /* name, signature, funcPtr */
6.
7. { "loadDriver", "()Z", (void *)android_net_wifi_loadDriver },
8. { "isDriverLoaded", "()Z", (void *)android_net_wifi_isDriverLoaded },
9. { "unloadDriver", "()Z", (void *)android_net_wifi_unloadDriver },
10. { "startSupplicant", "(Z)Z", (void *)android_net_wifi_startSupplicant },
11. { "killSupplicant", "(Z)Z", (void *)android_net_wifi_killSupplicant }, 12. { "connectToSupplicantNative", "()Z", (void *)android_net_wifi_connectToSupplicant },
13. { "cloSupplicantConnectionNative", "()V",
14. (void *)android_net_wifi_cloSupplicantConnection },
15. { "waitForEventNative", "()Ljava/lang/String;", (void*)android_net_wifi_waitForEvent },
16. { "doBooleanCommandNative", "(Ljava/lang/String;)Z", (void*)android_net_wifi_doBooleanCommand },
17. { "doIntCommandNative", "(Ljava/lang/String;)I", (void*)android_net_wifi_doIntCommand },
18. { "doStringCommandNative", "(Ljava/lang/String;)Ljava/lang/String;",
19. (void*) android_net_wifi_doStringCommand },
20. };
這些命令通過wifi.c的wifi_command發送給wpa_supplicant,在發送命令的過程中實際是調用wpa_ctrl_request來完成命令發送的,wpa_ctrl_request是通過socket的方式,還有一種是writefile方式,兩種方式都有,與wpa_supplicant進行通信的,然后通過wpa_ctrl_recv來接收來自wpa_supplicant的命令,并返回標識給wifi_wait_for_event。
層級簡圖
源代碼目錄
Diagram explains WLAN event flow from application to h/w with respect to
rowboat android source tree.
Application
?
Settings/Connection Manager:
Application Framework
?
WiFi manager:
JNI Implementation:
?
?
Service :
Libraries
?
libhardware_legacy:
wpa_supplicant (Daemon):
?
從源代碼看callStack
眾所周知,Android 是基于Linux內核的,所以直接支持Linux的WLAN接口。WLAN的內核驅動是根據用戶在UI上的設定動態加載的,通過ctrl_interface和openssl來實現WLAN的控制和安全性,TCPIP則基于WLAN的標準實現。
WLAN 在Android上的體系構架如下:
Application Framework : ba/wifi/java/android/net/wifi
WifiManager/WifiMonitor/WifiConfiguration …
Service Framework: ba/rvices/java/com/android/rver/
WifiService / WifiWatchdogService
JNI (Java Native Interface)
jni/android_net_wifi_
HAL (Hardware Abstract Layer)
hardware/libhardware/wifi/wifi.c
wpa_supplicant / ctrl_interface
Kernel driver
在Android手機上打開WIFI的流程如下: 1)Application Framework: WifiManager
tWifiEnabled()
2)Service: WifiService
tWifiEnabled()
handleMessage() : MESSAGE_ENABLE_WIFI
3)JNI: android_net_wifi_ :
JNINativeMethod: loadDriver
android_net_wifi_loadDriver()
4)HAL : hardware/libhardware/wifi/wifi.c
wifi_load_driver()
5)Kernel : 加載內核驅動
WLAN的搜索流程如下:
1)Application Framework: WifiManager
startScan()
2)Service:
WifiService::startScan()
WifiNative::scanCommand();
3)JNI: android_net_wifi_ :
JNINativeMethod: scanCommand / scanResultsCommand
android_net_wifi_scanCommand /
android_net_wifi_scanResultsCommand 4)HAL : hardware/libhardware/wifi/wifi.c
wifi_nd_command : SCAN / SCAN_RESULTS
wpa_supplicant/driver_wext.c
wpa_driver_wext_scan() : SIOCSIWSCAN
5)Kernel : WLAN 驅動處理相關接口的命令
WAPI是我國WLAN的國家標準----- GB 15629.11,并予以802.11i兼容,在Android上的實現只需增加相應的鑒權即可。
本文發布于:2023-12-13 06:59:03,感謝您對本站的認可!
本文鏈接:http://m.newhan.cn/zhishi/a/1702421943241596.html
版權聲明:本站內容均來自互聯網,僅供演示用,請勿用于商業和其他非法用途。如果侵犯了您的權益請與我們聯系,我們將在24小時內刪除。
本文word下載地址:十分鐘讓你明白Wpa supplicant是什么.doc
本文 PDF 下載地址:十分鐘讓你明白Wpa supplicant是什么.pdf
| 留言與評論(共有 0 條評論) |