1 #include <stdint.h>
2 #include "iw.h"
3 
4 static const char *reason_table[] = {
5 	[1] = "Unspecified",
6 	[2] = "Previous authentication no longer valid",
7 	[3] = "Deauthenticated because sending station is leaving (or has left) the IBSS or ESS",
8 	[4] = "Disassociated due to inactivity",
9 	[5] = "Disassociated because AP is unable to handle all currently associated STA",
10 	[6] = "Class 2 frame received from non-authenticated station",
11 	[7] = "Class 3 frame received from non-authenticated station",
12 	[8] = "Disassociated because sending station is leaving (or has left) the BSS",
13 	[9] = "Station requesting (re)association is not authenticated with responding station",
14 	[10] = "Disassociated because the information in the Power Capability element is unacceptable",
15 	[11] = "Disassociated because the information in the Supported Channels element is unacceptable",
16 	[13] = "Invalid information element",
17 	[14] = "MIC failure",
18 	[15] = "4-way handshake timeout",
19 	[16] = "Group key update timeout",
20 	[17] = "Information element in 4-way handshake different from (Re-)associate request/Probe response/Beacon",
21 	[18] = "Multicast cipher is not valid",
22 	[19] = "Unicast cipher is not valid",
23 	[20] = "AKMP is not valid",
24 	[21] = "Unsupported RSNE version",
25 	[22] = "Invalid RSNE capabilities",
26 	[23] = "IEEE 802.1X authentication failed",
27 	[24] = "Cipher Suite rejected per security policy",
28 	[31] = "TS deleted because QoS AP lacks sufficient bandwidth for this QoS STA due to a change in BSS service characteristics or operational mode",
29 	[32] = "Disassociated for unspecified QoS-related reason",
30 	[33] = "Disassociated because QAP lacks sufficient bandwidth for this STA",
31 	[34] = "Disassociated because of excessive frame losses and/or poor channel conditions",
32 	[35] = "Disassociated because QSTA is transmitting outside the limits of its polled TXOPs",
33 	[36] = "Requested from peer QSTA as the QSTA is leaving the QBSS (or resetting)",
34 	[37] = "Requested from peer QSTA as it does not want to use Traffic Stream",
35 	[38] = "Requested from peer QSTA as the QSTA received frames indicated Traffic Stream for which it has not set up",
36 	[39] = "Requested from peer QSTA due to time out",
37 	[40] = "Requested from peer QSTA as the QSTA is leaving the QBSS (or resetting)",
38 	[41] = "Requested from peer QSTA as it does not want to receive frames directly from the QSTA",
39 	[42] = "Requested from peer QSTA as the QSTA received DLP frames for which it has not set up",
40 	[43] = "Requested from peer QSTA as it does not want to use Block Ack",
41 	[44] = "Requested from peer QSTA as the QSTA received frames indicated Block Acknowledgement policy for which it has not set up",
42 	[45] = "Peer QSTA does not support the requested cipher suite",
43 };
44 
get_reason_str(uint16_t reason)45 const char *get_reason_str(uint16_t reason)
46 {
47 	if (reason < ARRAY_SIZE(reason_table) && reason_table[reason])
48 		return reason_table[reason];
49 	return "<unknown>";
50 }
51