ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/src/vendor/wpa/dist/src/common/defs.h
(Generate patch)

Comparing vendor/wpa/dist/src/common/defs.h (file contents):
Revision 9638 by laffer1, Sun Oct 22 18:04:47 2017 UTC vs.
Revision 9639 by laffer1, Sun Oct 22 18:11:47 2017 UTC

# Line 2 | Line 2
2   * WPA Supplicant - Common definitions
3   * Copyright (c) 2004-2008, Jouni Malinen <j@w1.fi>
4   *
5 < * This program is free software; you can redistribute it and/or modify
6 < * it under the terms of the GNU General Public License version 2 as
7 < * published by the Free Software Foundation.
8 < *
9 < * Alternatively, this software may be distributed under the terms of BSD
10 < * license.
11 < *
12 < * See README and COPYING for more details.
5 > * This software may be distributed under the terms of the BSD license.
6 > * See README for more details.
7   */
8  
9   #ifndef DEFS_H
# Line 32 | Line 26 | typedef enum { FALSE = 0, TRUE = 1 } Boolean;
26   #ifdef CONFIG_IEEE80211W
27   #define WPA_CIPHER_AES_128_CMAC BIT(5)
28   #endif /* CONFIG_IEEE80211W */
29 + #define WPA_CIPHER_GCMP BIT(6)
30 + #define WPA_CIPHER_SMS4 BIT(7)
31  
32   #define WPA_KEY_MGMT_IEEE8021X BIT(0)
33   #define WPA_KEY_MGMT_PSK BIT(1)
# Line 43 | Line 39 | typedef enum { FALSE = 0, TRUE = 1 } Boolean;
39   #define WPA_KEY_MGMT_IEEE8021X_SHA256 BIT(7)
40   #define WPA_KEY_MGMT_PSK_SHA256 BIT(8)
41   #define WPA_KEY_MGMT_WPS BIT(9)
42 + #define WPA_KEY_MGMT_SAE BIT(10)
43 + #define WPA_KEY_MGMT_FT_SAE BIT(11)
44 + #define WPA_KEY_MGMT_WAPI_PSK BIT(12)
45 + #define WPA_KEY_MGMT_WAPI_CERT BIT(13)
46 + #define WPA_KEY_MGMT_CCKM BIT(14)
47  
48   static inline int wpa_key_mgmt_wpa_ieee8021x(int akm)
49   {
50 <        return akm == WPA_KEY_MGMT_IEEE8021X ||
51 <                akm == WPA_KEY_MGMT_FT_IEEE8021X ||
52 <                akm == WPA_KEY_MGMT_IEEE8021X_SHA256;
50 >        return !!(akm & (WPA_KEY_MGMT_IEEE8021X |
51 >                         WPA_KEY_MGMT_FT_IEEE8021X |
52 >                         WPA_KEY_MGMT_CCKM |
53 >                         WPA_KEY_MGMT_IEEE8021X_SHA256));
54   }
55  
56   static inline int wpa_key_mgmt_wpa_psk(int akm)
57   {
58 <        return akm == WPA_KEY_MGMT_PSK ||
59 <                akm == WPA_KEY_MGMT_FT_PSK ||
60 <                akm == WPA_KEY_MGMT_PSK_SHA256;
58 >        return !!(akm & (WPA_KEY_MGMT_PSK |
59 >                         WPA_KEY_MGMT_FT_PSK |
60 >                         WPA_KEY_MGMT_PSK_SHA256 |
61 >                         WPA_KEY_MGMT_SAE));
62   }
63  
64   static inline int wpa_key_mgmt_ft(int akm)
65   {
66 <        return akm == WPA_KEY_MGMT_FT_PSK ||
67 <                akm == WPA_KEY_MGMT_FT_IEEE8021X;
66 >        return !!(akm & (WPA_KEY_MGMT_FT_PSK |
67 >                         WPA_KEY_MGMT_FT_IEEE8021X |
68 >                         WPA_KEY_MGMT_FT_SAE));
69   }
70  
71 + static inline int wpa_key_mgmt_sae(int akm)
72 + {
73 +        return !!(akm & (WPA_KEY_MGMT_SAE |
74 +                         WPA_KEY_MGMT_FT_SAE));
75 + }
76 +
77   static inline int wpa_key_mgmt_sha256(int akm)
78   {
79 <        return akm == WPA_KEY_MGMT_PSK_SHA256 ||
80 <                akm == WPA_KEY_MGMT_IEEE8021X_SHA256;
79 >        return !!(akm & (WPA_KEY_MGMT_PSK_SHA256 |
80 >                         WPA_KEY_MGMT_IEEE8021X_SHA256));
81   }
82  
83 + static inline int wpa_key_mgmt_wpa(int akm)
84 + {
85 +        return wpa_key_mgmt_wpa_ieee8021x(akm) ||
86 +                wpa_key_mgmt_wpa_psk(akm);
87 + }
88  
89 + static inline int wpa_key_mgmt_wpa_any(int akm)
90 + {
91 +        return wpa_key_mgmt_wpa(akm) || (akm & WPA_KEY_MGMT_WPA_NONE);
92 + }
93 +
94 + static inline int wpa_key_mgmt_cckm(int akm)
95 + {
96 +        return akm == WPA_KEY_MGMT_CCKM;
97 + }
98 +
99 +
100   #define WPA_PROTO_WPA BIT(0)
101   #define WPA_PROTO_RSN BIT(1)
102 + #define WPA_PROTO_WAPI BIT(2)
103  
104   #define WPA_AUTH_ALG_OPEN BIT(0)
105   #define WPA_AUTH_ALG_SHARED BIT(1)
106   #define WPA_AUTH_ALG_LEAP BIT(2)
107   #define WPA_AUTH_ALG_FT BIT(3)
108 + #define WPA_AUTH_ALG_SAE BIT(4)
109  
110  
111   enum wpa_alg {
# Line 86 | Line 114 | enum wpa_alg {
114          WPA_ALG_TKIP,
115          WPA_ALG_CCMP,
116          WPA_ALG_IGTK,
117 <        WPA_ALG_PMK
117 >        WPA_ALG_PMK,
118 >        WPA_ALG_GCMP,
119 >        WPA_ALG_SMS4,
120 >        WPA_ALG_KRK
121   };
122  
123   /**
# Line 97 | Line 128 | enum wpa_cipher {
128          CIPHER_WEP40,
129          CIPHER_TKIP,
130          CIPHER_CCMP,
131 <        CIPHER_WEP104
131 >        CIPHER_WEP104,
132 >        CIPHER_GCMP,
133 >        CIPHER_SMS4
134   };
135  
136   /**
# Line 113 | Line 146 | enum wpa_key_mgmt {
146          KEY_MGMT_FT_PSK,
147          KEY_MGMT_802_1X_SHA256,
148          KEY_MGMT_PSK_SHA256,
149 <        KEY_MGMT_WPS
149 >        KEY_MGMT_WPS,
150 >        KEY_MGMT_SAE,
151 >        KEY_MGMT_FT_SAE,
152 >        KEY_MGMT_WAPI_PSK,
153 >        KEY_MGMT_WAPI_CERT,
154 >        KEY_MGMT_CCKM
155   };
156  
157   /**
# Line 137 | Line 175 | enum wpa_states {
175          WPA_DISCONNECTED,
176  
177          /**
178 +         * WPA_INTERFACE_DISABLED - Interface disabled
179 +         *
180 +         * This stat eis entered if the network interface is disabled, e.g.,
181 +         * due to rfkill. wpa_supplicant refuses any new operations that would
182 +         * use the radio until the interface has been enabled.
183 +         */
184 +        WPA_INTERFACE_DISABLED,
185 +
186 +        /**
187           * WPA_INACTIVE - Inactive state (wpa_supplicant disabled)
188           *
189           * This state is entered if there are no enabled networks in the
# Line 239 | Line 286 | enum wpa_states {
286   enum mfp_options {
287          NO_MGMT_FRAME_PROTECTION = 0,
288          MGMT_FRAME_PROTECTION_OPTIONAL = 1,
289 <        MGMT_FRAME_PROTECTION_REQUIRED = 2
289 >        MGMT_FRAME_PROTECTION_REQUIRED = 2,
290   };
291 + #define MGMT_FRAME_PROTECTION_DEFAULT 3
292  
293   /**
294   * enum hostapd_hw_mode - Hardware mode
# Line 249 | Line 297 | enum hostapd_hw_mode {
297          HOSTAPD_MODE_IEEE80211B,
298          HOSTAPD_MODE_IEEE80211G,
299          HOSTAPD_MODE_IEEE80211A,
300 +        HOSTAPD_MODE_IEEE80211AD,
301          NUM_HOSTAPD_MODES
302   };
303 +
304 + /**
305 + * enum wpa_ctrl_req_type - Control interface request types
306 + */
307 + enum wpa_ctrl_req_type {
308 +        WPA_CTRL_REQ_UNKNOWN,
309 +        WPA_CTRL_REQ_EAP_IDENTITY,
310 +        WPA_CTRL_REQ_EAP_PASSWORD,
311 +        WPA_CTRL_REQ_EAP_NEW_PASSWORD,
312 +        WPA_CTRL_REQ_EAP_PIN,
313 +        WPA_CTRL_REQ_EAP_OTP,
314 +        WPA_CTRL_REQ_EAP_PASSPHRASE,
315 +        NUM_WPA_CTRL_REQS
316 + };
317 +
318 + /* Maximum number of EAP methods to store for EAP server user information */
319 + #define EAP_MAX_METHODS 8
320  
321   #endif /* DEFS_H */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines