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