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,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/zhishi/a/1702421943241596.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文word下载地址:十分钟让你明白Wpa supplicant是什么.doc
本文 PDF 下载地址:十分钟让你明白Wpa supplicant是什么.pdf
| 留言与评论(共有 0 条评论) |