wpa_supplicant--EVENT 分析
最新推荐文章于 2024-01-19 10:11:56 发布
郁闷表格怎么显示不全啊~~~~ 前面的章节已经大致介绍了wifiMonitor的作用,在wifi工作过程中,会产生一些交换的消息,这个时候在wifiMonitor里面会有一个线程运行: String eventStr = WifiNative.waitForEvent();轮询一直等到消息的到来。下面是所有的事件: /** All eventscoming from the supplicant start with this prefix */ private static final String EVENT_PREFIX_STR = "CTRL-EVENT-"; //supplicant 事件开始字段 /** All WPA events coming from the supplicant start with this prefix */ private static final String WPA_EVENT_PREFIX_STR = "WPA:"; private static final String PASSWORD_MAY_BE_INCORRECT_STR = / /密码出错 "pre-shared key may be incorrect"; /* WPS events */ privatestatic final String WPS_OVERLAP_STR = "WPS-OVERLAP-DETECTED"; /** * <pre> * CTRL-EVENT-CONNECTED - Connection to xx:xx:xx:xx:xx:xx completed * </pre> * <code>xx:xx:xx:xx:xx:xx</code> is the BSSID of the associatedaccess point */ private static final String CONNECTED_STR = "CONNECTED"; //连接成功 /** * <pre> * CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys * </pre> */ private static final String DISCONNECTED_STR = "DISCONNECTED"; //连接断开 /** * <pre> * CTRL-EVENT-STATE-CHANGE x * </pre> * <code>x</code> is the numerical value of the new state. */ private static final String STATE_CHANGE_STR = "STATE-CHANGE"; //状态发送改变 /** * <pre> * CTRL-EVENT-SCAN-RESULTS ready * </pre> */ private static final String SCAN_RESULTS_STR = "SCAN-RESULTS"; //扫描结果 /** * <pre> * CTRL-EVENT-LINK-SPEED x Mb/s * </pre> * {@code x} is the link speed in Mb/sec. */ private static final String LINK_SPEED_STR = "LINK-SPEED"; //连接速度 /** * <pre> * CTRL-EVENT-TERMINATING - signal x * </pre> * <code>x</code> is the signal that caused termination. */ private static final String TERMINATING_STR = "TERMINATING"; //中断 /** * <pre> * CTRL-EVENT-DRIVER-STATE state * </pre> * <code>state</code> can be HANGED */ private static final String DRIVER_STATE_STR = "DRIVER-STATE"; //驱动状态 /** * <pre> * CTRL-EVENT-EAP-FAILURE EAP authentication failed * </pre> */ private static final String EAP_FAILURE_STR = "EAP-FAILURE"; /** * This indicates an authentication failure on EAP FAILURE event */ private staticfinal String EAP_AUTH_FAILURE_STR = "EAP authentication failed"; //认证失败 上面都是wifiMonitor接收supplicant的消息,下面说下app层需要接收什么广播:
EVENT_ASSOC 当驱动完成 IEEE 802.11 association or reassociation,需要抛出此事件 EVENT_DISASSOC 断开连接事件,当ap发出disassociate frame 或者sta 收到deauthenticate frame时需要抛出此事件,sta也可以主动发出断开帧 EVENT_MICHAEL_MIC_FAILURE Michael MIC (TKIP)detected EVENT_SCAN_RESULTS 扫描完成,返回扫描结果 EVENT_ASSOCINFO 上报连接成功后,额外的数据信息 EVENT_INTERFACE_STATUS 上报interface added/removed EVENT_PMKID_CANDIDATE /*預先認証(Pre-Authentication)與PMK快取 預先認証的功能允許STA可以在相同的時間對多 個AP進行認証的動作,即使在尚未完成Association 的情況下。其目的是讓STA發生漫遊之前,就先對鄰 近AP進行完整802.1x/EAP認証,並利用PMK快取的功 能將PMK及相關資訊快取保存下來;當STA與已完成預 先認証的AP連線時,即可直接進行四手交握協定。 */ 上报 被选择的AP 预认证事件 此事件关联到ap_scan值,当ap_scan=2时,wpa_supplicant 不会对扫描结果做任何处理,这时可以加上此事件,对选定的ap进行预认证,当ap_scan=1时,wpa_supplicant 会对扫描结果进行处理,这个事件是可选的,wpa_supplicant 会主动针对选定的ap进行连接。 在预认证成功产生PMKSA cache,并更新candidate list后上报此事件。 EVENT_STKSTART RequestSTK handshake (MLME-STKSTART.request) EVENT_TDLS /*TDLS连接使两台STA设备直接跳过AP,从而不受AP的约束,采用它们支持的最快速率标准(802.11b / g / n 等)进行数据传输。同一个BSS中的STA相互间数据的传输跳过AP直接传输。这个直接传输可以是在原来信道进行,也可以切换到新的信道上进行(如图1所示,base channel在2.4G频段,而off channel在5G频段),因此能够避免了由网络拥塞而引起的数据传输延迟。这对于一些实时性要求比较高的业务,对于保证用户的业务体验具有重要的意义。 TDLS用作与同一个AP关联的两个STA间进行Wi-FiDisplay业务传输的连接模式, */ EVENT_FT_RESPONSE EVENT_IBSS_RSN_START EVENT_AUTH 认证完成事件 EVENT_DEAUTH 认证解除 EVENT_ASSOC_REJECT 连接失败,信息保存在wpa_event_data::assoc_reject EVENT_AUTH_TIMED_OUT 认证超时 EVENT_ASSOC_TIMED_OUT 连接超时 EVENT_FT_RRB_RX EVENT_WPS_BUTTON_PUSHED 硬件按下wps button时产生此事件 EVENT_TX_STATUS, EVENT_RX_FROM_UNKNOWN, EVENT_RX_MGMT, EVENT_RX_ACTION, *Actionframe received *Thisevent is used to indicate when an Action frame has been *received.Information about the received frame is included in *unionwpa_event_data::rx_action. EVENT_REMAIN_ON_CHANNEL EVENT_CANCEL_REMAIN_ON_CHANNEL EVENT_MLME_RX Reportreception of frame for MLME (test use only),This event is used only bydriver_test.c and userspace MLME EVENT_RX_PROBE_REQ 当收到Probe Request frame时,驱动需要上报此事件,wpa_event_data::rx_probe_req中保存了此帧,用于AP模式 EVENT_NEW_STA 当收到此事件,表示发现了一个可用的设备,这个时候可以开始进行认证 EVENT_EAPOL_RX Reportreceived EAPOL frame EVENT_SIGNAL_CHANGE ap信号强度改变的事件,需要开启signal_monitor() EVENT_INTERFACE_ENABLED EVENT_INTERFACE_DISABLED EVENT_CHANNEL_LIST_CHANGED EVENT_INTERFACE_UNAVAILABLE 接口不可用事件,这个事件来源于wpa_supplicant 是支持多接口,在开启dfs模式时,有可能ap模式不可用了