| Hai Shalom | 74f70d4 | 2019-02-11 14:42:39 -0800 | [diff] [blame] | 1 | wpa_supplicant | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 2 | ============== | 
 | 3 |  | 
| Sunil Ravi | 7f76929 | 2024-07-23 22:21:32 +0000 | [diff] [blame^] | 4 | Copyright (c) 2003-2024, Jouni Malinen <j@w1.fi> and contributors | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 5 | All Rights Reserved. | 
 | 6 |  | 
| Dmitry Shmidt | c5ec7f5 | 2012-03-06 16:33:24 -0800 | [diff] [blame] | 7 | This program is licensed under the BSD license (the one with | 
 | 8 | advertisement clause removed). | 
 | 9 |  | 
 | 10 | If you are submitting changes to the project, please see CONTRIBUTIONS | 
 | 11 | file for more instructions. | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 12 |  | 
 | 13 |  | 
 | 14 |  | 
 | 15 | License | 
 | 16 | ------- | 
 | 17 |  | 
| Dmitry Shmidt | c5ec7f5 | 2012-03-06 16:33:24 -0800 | [diff] [blame] | 18 | This software may be distributed, used, and modified under the terms of | 
 | 19 | BSD license: | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 20 |  | 
 | 21 | Redistribution and use in source and binary forms, with or without | 
 | 22 | modification, are permitted provided that the following conditions are | 
 | 23 | met: | 
 | 24 |  | 
 | 25 | 1. Redistributions of source code must retain the above copyright | 
 | 26 |    notice, this list of conditions and the following disclaimer. | 
 | 27 |  | 
 | 28 | 2. Redistributions in binary form must reproduce the above copyright | 
 | 29 |    notice, this list of conditions and the following disclaimer in the | 
 | 30 |    documentation and/or other materials provided with the distribution. | 
 | 31 |  | 
 | 32 | 3. Neither the name(s) of the above-listed copyright holder(s) nor the | 
 | 33 |    names of its contributors may be used to endorse or promote products | 
 | 34 |    derived from this software without specific prior written permission. | 
 | 35 |  | 
 | 36 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 
 | 37 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 
 | 38 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 
 | 39 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 
 | 40 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 
 | 41 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 
 | 42 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 
 | 43 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 
 | 44 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 
 | 45 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 
 | 46 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 
 | 47 |  | 
 | 48 |  | 
 | 49 |  | 
 | 50 | Features | 
 | 51 | -------- | 
 | 52 |  | 
 | 53 | Supported WPA/IEEE 802.11i features: | 
 | 54 | - WPA-PSK ("WPA-Personal") | 
 | 55 | - WPA with EAP (e.g., with RADIUS authentication server) ("WPA-Enterprise") | 
 | 56 |   Following authentication methods are supported with an integrate IEEE 802.1X | 
 | 57 |   Supplicant: | 
 | 58 |   * EAP-TLS | 
 | 59 |   * EAP-PEAP/MSCHAPv2 (both PEAPv0 and PEAPv1) | 
 | 60 |   * EAP-PEAP/TLS (both PEAPv0 and PEAPv1) | 
 | 61 |   * EAP-PEAP/GTC (both PEAPv0 and PEAPv1) | 
 | 62 |   * EAP-PEAP/OTP (both PEAPv0 and PEAPv1) | 
 | 63 |   * EAP-PEAP/MD5-Challenge (both PEAPv0 and PEAPv1) | 
 | 64 |   * EAP-TTLS/EAP-MD5-Challenge | 
 | 65 |   * EAP-TTLS/EAP-GTC | 
 | 66 |   * EAP-TTLS/EAP-OTP | 
 | 67 |   * EAP-TTLS/EAP-MSCHAPv2 | 
 | 68 |   * EAP-TTLS/EAP-TLS | 
 | 69 |   * EAP-TTLS/MSCHAPv2 | 
 | 70 |   * EAP-TTLS/MSCHAP | 
 | 71 |   * EAP-TTLS/PAP | 
 | 72 |   * EAP-TTLS/CHAP | 
 | 73 |   * EAP-SIM | 
 | 74 |   * EAP-AKA | 
| Dmitry Shmidt | 9c17526 | 2016-03-03 10:20:07 -0800 | [diff] [blame] | 75 |   * EAP-AKA' | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 76 |   * EAP-PSK | 
 | 77 |   * EAP-PAX | 
 | 78 |   * EAP-SAKE | 
 | 79 |   * EAP-IKEv2 | 
 | 80 |   * EAP-GPSK | 
| Dmitry Shmidt | 9c17526 | 2016-03-03 10:20:07 -0800 | [diff] [blame] | 81 |   * EAP-pwd | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 82 |   * LEAP (note: requires special support from the driver for IEEE 802.11 | 
 | 83 | 	  authentication) | 
 | 84 |   (following methods are supported, but since they do not generate keying | 
 | 85 |    material, they cannot be used with WPA or IEEE 802.1X WEP keying) | 
| Dmitry Shmidt | 2933359 | 2017-01-09 12:27:11 -0800 | [diff] [blame] | 86 |   * EAP-MD5-Challenge | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 87 |   * EAP-MSCHAPv2 | 
 | 88 |   * EAP-GTC | 
 | 89 |   * EAP-OTP | 
 | 90 | - key management for CCMP, TKIP, WEP104, WEP40 | 
 | 91 | - RSN/WPA2 (IEEE 802.11i) | 
 | 92 |   * pre-authentication | 
 | 93 |   * PMKSA caching | 
 | 94 |  | 
 | 95 | Supported TLS/crypto libraries: | 
 | 96 | - OpenSSL (default) | 
 | 97 | - GnuTLS | 
 | 98 |  | 
 | 99 | Internal TLS/crypto implementation (optional): | 
 | 100 | - can be used in place of an external TLS/crypto library | 
 | 101 | - TLSv1 | 
 | 102 | - X.509 certificate processing | 
 | 103 | - PKCS #1 | 
 | 104 | - ASN.1 | 
 | 105 | - RSA | 
 | 106 | - bignum | 
 | 107 | - minimal size (ca. 50 kB binary, parts of which are already needed for WPA; | 
 | 108 |   TLSv1/X.509/ASN.1/RSA/bignum parts are about 25 kB on x86) | 
 | 109 |  | 
 | 110 |  | 
 | 111 | Requirements | 
 | 112 | ------------ | 
 | 113 |  | 
 | 114 | Current hardware/software requirements: | 
 | 115 | - Linux kernel 2.4.x or 2.6.x with Linux Wireless Extensions v15 or newer | 
 | 116 | - FreeBSD 6-CURRENT | 
 | 117 | - NetBSD-current | 
 | 118 | - Microsoft Windows with WinPcap (at least WinXP, may work with other versions) | 
 | 119 | - drivers: | 
| Dmitry Shmidt | 4b06059 | 2013-04-29 16:42:49 -0700 | [diff] [blame] | 120 | 	Linux drivers that support cfg80211/nl80211. Even though there are | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 121 | 	number of driver specific interface included in wpa_supplicant, please | 
| Dmitry Shmidt | 4b06059 | 2013-04-29 16:42:49 -0700 | [diff] [blame] | 122 | 	note that Linux drivers are moving to use generic wireless configuration | 
 | 123 | 	interface driver_nl80211 (-Dnl80211 on wpa_supplicant command line) | 
 | 124 | 	should be the default option to start with before falling back to driver | 
 | 125 | 	specific interface. | 
 | 126 |  | 
 | 127 | 	Linux drivers that support WPA/WPA2 configuration with the generic | 
 | 128 | 	Linux wireless extensions (WE-18 or newer). Obsoleted by nl80211. | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 129 |  | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 130 | 	In theory, any driver that supports Linux wireless extensions can be | 
 | 131 | 	used with IEEE 802.1X (i.e., not WPA) when using ap_scan=0 option in | 
 | 132 | 	configuration file. | 
 | 133 |  | 
 | 134 | 	Wired Ethernet drivers (with ap_scan=0) | 
 | 135 |  | 
 | 136 | 	BSD net80211 layer (e.g., Atheros driver) | 
 | 137 | 	At the moment, this is for FreeBSD 6-CURRENT branch and NetBSD-current. | 
 | 138 |  | 
 | 139 | 	Windows NDIS | 
 | 140 | 	The current Windows port requires WinPcap (http://winpcap.polito.it/). | 
 | 141 | 	See README-Windows.txt for more information. | 
 | 142 |  | 
 | 143 | wpa_supplicant was designed to be portable for different drivers and | 
 | 144 | operating systems. Hopefully, support for more wlan cards and OSes will be | 
 | 145 | added in the future. See developer's documentation | 
 | 146 | (http://hostap.epitest.fi/wpa_supplicant/devel/) for more information about the | 
 | 147 | design of wpa_supplicant and porting to other drivers. One main goal | 
 | 148 | is to add full WPA/WPA2 support to Linux wireless extensions to allow | 
 | 149 | new drivers to be supported without having to implement new | 
 | 150 | driver-specific interface code in wpa_supplicant. | 
 | 151 |  | 
 | 152 | Optional libraries for layer2 packet processing: | 
 | 153 | - libpcap (tested with 0.7.2, most relatively recent versions assumed to work, | 
 | 154 | 	this is likely to be available with most distributions, | 
 | 155 | 	http://tcpdump.org/) | 
 | 156 | - libdnet (tested with v1.4, most versions assumed to work, | 
 | 157 | 	http://libdnet.sourceforge.net/) | 
 | 158 |  | 
 | 159 | These libraries are _not_ used in the default Linux build. Instead, | 
 | 160 | internal Linux specific implementation is used. libpcap/libdnet are | 
 | 161 | more portable and they can be used by adding CONFIG_L2_PACKET=pcap into | 
 | 162 | .config. They may also be selected automatically for other operating | 
 | 163 | systems. In case of Windows builds, WinPcap is used by default | 
 | 164 | (CONFIG_L2_PACKET=winpcap). | 
 | 165 |  | 
 | 166 |  | 
 | 167 | Optional libraries for EAP-TLS, EAP-PEAP, and EAP-TTLS: | 
| Dmitry Shmidt | 9c17526 | 2016-03-03 10:20:07 -0800 | [diff] [blame] | 168 | - OpenSSL (tested with 1.0.1 and 1.0.2 versions; assumed to | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 169 |   work with most relatively recent versions; this is likely to be | 
 | 170 |   available with most distributions, http://www.openssl.org/) | 
 | 171 | - GnuTLS | 
 | 172 | - internal TLSv1 implementation | 
 | 173 |  | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 174 | One of these libraries is needed when EAP-TLS, EAP-PEAP, EAP-TTLS, or | 
 | 175 | EAP-FAST support is enabled. WPA-PSK mode does not require this or EAPOL/EAP | 
 | 176 | implementation. A configuration file, .config, for compilation is | 
 | 177 | needed to enable IEEE 802.1X/EAPOL and EAP methods. Note that EAP-MD5, | 
 | 178 | EAP-GTC, EAP-OTP, and EAP-MSCHAPV2 cannot be used alone with WPA, so | 
 | 179 | they should only be enabled if testing the EAPOL/EAP state | 
 | 180 | machines. However, there can be used as inner authentication | 
 | 181 | algorithms with EAP-PEAP and EAP-TTLS. | 
 | 182 |  | 
 | 183 | See Building and installing section below for more detailed | 
 | 184 | information about the wpa_supplicant build time configuration. | 
 | 185 |  | 
 | 186 |  | 
 | 187 |  | 
 | 188 | WPA | 
 | 189 | --- | 
 | 190 |  | 
 | 191 | The original security mechanism of IEEE 802.11 standard was not | 
 | 192 | designed to be strong and has proven to be insufficient for most | 
 | 193 | networks that require some kind of security. Task group I (Security) | 
 | 194 | of IEEE 802.11 working group (http://www.ieee802.org/11/) has worked | 
 | 195 | to address the flaws of the base standard and has in practice | 
 | 196 | completed its work in May 2004. The IEEE 802.11i amendment to the IEEE | 
 | 197 | 802.11 standard was approved in June 2004 and published in July 2004. | 
 | 198 |  | 
 | 199 | Wi-Fi Alliance (http://www.wi-fi.org/) used a draft version of the | 
 | 200 | IEEE 802.11i work (draft 3.0) to define a subset of the security | 
 | 201 | enhancements that can be implemented with existing wlan hardware. This | 
 | 202 | is called Wi-Fi Protected Access<TM> (WPA). This has now become a | 
 | 203 | mandatory component of interoperability testing and certification done | 
 | 204 | by Wi-Fi Alliance. Wi-Fi provides information about WPA at its web | 
 | 205 | site (http://www.wi-fi.org/OpenSection/protected_access.asp). | 
 | 206 |  | 
 | 207 | IEEE 802.11 standard defined wired equivalent privacy (WEP) algorithm | 
 | 208 | for protecting wireless networks. WEP uses RC4 with 40-bit keys, | 
 | 209 | 24-bit initialization vector (IV), and CRC32 to protect against packet | 
 | 210 | forgery. All these choices have proven to be insufficient: key space is | 
 | 211 | too small against current attacks, RC4 key scheduling is insufficient | 
 | 212 | (beginning of the pseudorandom stream should be skipped), IV space is | 
 | 213 | too small and IV reuse makes attacks easier, there is no replay | 
 | 214 | protection, and non-keyed authentication does not protect against bit | 
 | 215 | flipping packet data. | 
 | 216 |  | 
 | 217 | WPA is an intermediate solution for the security issues. It uses | 
 | 218 | Temporal Key Integrity Protocol (TKIP) to replace WEP. TKIP is a | 
 | 219 | compromise on strong security and possibility to use existing | 
 | 220 | hardware. It still uses RC4 for the encryption like WEP, but with | 
 | 221 | per-packet RC4 keys. In addition, it implements replay protection, | 
 | 222 | keyed packet authentication mechanism (Michael MIC). | 
 | 223 |  | 
 | 224 | Keys can be managed using two different mechanisms. WPA can either use | 
 | 225 | an external authentication server (e.g., RADIUS) and EAP just like | 
 | 226 | IEEE 802.1X is using or pre-shared keys without need for additional | 
 | 227 | servers. Wi-Fi calls these "WPA-Enterprise" and "WPA-Personal", | 
 | 228 | respectively. Both mechanisms will generate a master session key for | 
 | 229 | the Authenticator (AP) and Supplicant (client station). | 
 | 230 |  | 
 | 231 | WPA implements a new key handshake (4-Way Handshake and Group Key | 
 | 232 | Handshake) for generating and exchanging data encryption keys between | 
 | 233 | the Authenticator and Supplicant. This handshake is also used to | 
 | 234 | verify that both Authenticator and Supplicant know the master session | 
 | 235 | key. These handshakes are identical regardless of the selected key | 
 | 236 | management mechanism (only the method for generating master session | 
 | 237 | key changes). | 
 | 238 |  | 
 | 239 |  | 
 | 240 |  | 
 | 241 | IEEE 802.11i / WPA2 | 
 | 242 | ------------------- | 
 | 243 |  | 
 | 244 | The design for parts of IEEE 802.11i that were not included in WPA has | 
 | 245 | finished (May 2004) and this amendment to IEEE 802.11 was approved in | 
 | 246 | June 2004. Wi-Fi Alliance is using the final IEEE 802.11i as a new | 
 | 247 | version of WPA called WPA2. This includes, e.g., support for more | 
 | 248 | robust encryption algorithm (CCMP: AES in Counter mode with CBC-MAC) | 
 | 249 | to replace TKIP and optimizations for handoff (reduced number of | 
 | 250 | messages in initial key handshake, pre-authentication, and PMKSA caching). | 
 | 251 |  | 
 | 252 |  | 
 | 253 |  | 
 | 254 | wpa_supplicant | 
 | 255 | -------------- | 
 | 256 |  | 
 | 257 | wpa_supplicant is an implementation of the WPA Supplicant component, | 
 | 258 | i.e., the part that runs in the client stations. It implements WPA key | 
 | 259 | negotiation with a WPA Authenticator and EAP authentication with | 
 | 260 | Authentication Server. In addition, it controls the roaming and IEEE | 
 | 261 | 802.11 authentication/association of the wlan driver. | 
 | 262 |  | 
 | 263 | wpa_supplicant is designed to be a "daemon" program that runs in the | 
 | 264 | background and acts as the backend component controlling the wireless | 
 | 265 | connection. wpa_supplicant supports separate frontend programs and an | 
 | 266 | example text-based frontend, wpa_cli, is included with wpa_supplicant. | 
 | 267 |  | 
 | 268 | Following steps are used when associating with an AP using WPA: | 
 | 269 |  | 
 | 270 | - wpa_supplicant requests the kernel driver to scan neighboring BSSes | 
 | 271 | - wpa_supplicant selects a BSS based on its configuration | 
 | 272 | - wpa_supplicant requests the kernel driver to associate with the chosen | 
 | 273 |   BSS | 
 | 274 | - If WPA-EAP: integrated IEEE 802.1X Supplicant completes EAP | 
 | 275 |   authentication with the authentication server (proxied by the | 
 | 276 |   Authenticator in the AP) | 
 | 277 | - If WPA-EAP: master key is received from the IEEE 802.1X Supplicant | 
 | 278 | - If WPA-PSK: wpa_supplicant uses PSK as the master session key | 
 | 279 | - wpa_supplicant completes WPA 4-Way Handshake and Group Key Handshake | 
 | 280 |   with the Authenticator (AP) | 
 | 281 | - wpa_supplicant configures encryption keys for unicast and broadcast | 
 | 282 | - normal data packets can be transmitted and received | 
 | 283 |  | 
 | 284 |  | 
 | 285 |  | 
 | 286 | Building and installing | 
 | 287 | ----------------------- | 
 | 288 |  | 
 | 289 | In order to be able to build wpa_supplicant, you will first need to | 
 | 290 | select which parts of it will be included. This is done by creating a | 
 | 291 | build time configuration file, .config, in the wpa_supplicant root | 
 | 292 | directory. Configuration options are text lines using following | 
 | 293 | format: CONFIG_<option>=y. Lines starting with # are considered | 
 | 294 | comments and are ignored. See defconfig file for an example configuration | 
 | 295 | and a list of available options and additional notes. | 
 | 296 |  | 
 | 297 | The build time configuration can be used to select only the needed | 
 | 298 | features and limit the binary size and requirements for external | 
 | 299 | libraries. The main configuration parts are the selection of which | 
| Dmitry Shmidt | 1f69aa5 | 2012-01-24 16:10:04 -0800 | [diff] [blame] | 300 | driver interfaces (e.g., nl80211, wext, ..) and which authentication | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 301 | methods (e.g., EAP-TLS, EAP-PEAP, ..) are included. | 
 | 302 |  | 
 | 303 | Following build time configuration options are used to control IEEE | 
 | 304 | 802.1X/EAPOL and EAP state machines and all EAP methods. Including | 
 | 305 | TLS, PEAP, or TTLS will require linking wpa_supplicant with OpenSSL | 
 | 306 | library for TLS implementation. Alternatively, GnuTLS or the internal | 
| Dmitry Shmidt | 9c17526 | 2016-03-03 10:20:07 -0800 | [diff] [blame] | 307 | TLSv1 implementation can be used for TLS functionality. | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 308 |  | 
 | 309 | CONFIG_IEEE8021X_EAPOL=y | 
 | 310 | CONFIG_EAP_MD5=y | 
 | 311 | CONFIG_EAP_MSCHAPV2=y | 
 | 312 | CONFIG_EAP_TLS=y | 
 | 313 | CONFIG_EAP_PEAP=y | 
 | 314 | CONFIG_EAP_TTLS=y | 
 | 315 | CONFIG_EAP_GTC=y | 
 | 316 | CONFIG_EAP_OTP=y | 
 | 317 | CONFIG_EAP_SIM=y | 
 | 318 | CONFIG_EAP_AKA=y | 
| Dmitry Shmidt | 9c17526 | 2016-03-03 10:20:07 -0800 | [diff] [blame] | 319 | CONFIG_EAP_AKA_PRIME=y | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 320 | CONFIG_EAP_PSK=y | 
 | 321 | CONFIG_EAP_SAKE=y | 
 | 322 | CONFIG_EAP_GPSK=y | 
 | 323 | CONFIG_EAP_PAX=y | 
 | 324 | CONFIG_EAP_LEAP=y | 
 | 325 | CONFIG_EAP_IKEV2=y | 
| Dmitry Shmidt | 9c17526 | 2016-03-03 10:20:07 -0800 | [diff] [blame] | 326 | CONFIG_EAP_PWD=y | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 327 |  | 
 | 328 | Following option can be used to include GSM SIM/USIM interface for GSM/UMTS | 
| Dmitry Shmidt | 9c17526 | 2016-03-03 10:20:07 -0800 | [diff] [blame] | 329 | authentication algorithm (for EAP-SIM/EAP-AKA/EAP-AKA'). This requires pcsc-lite | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 330 | (http://www.linuxnet.com/) for smart card access. | 
 | 331 |  | 
 | 332 | CONFIG_PCSC=y | 
 | 333 |  | 
 | 334 | Following options can be added to .config to select which driver | 
 | 335 | interfaces are included. | 
 | 336 |  | 
| Dmitry Shmidt | 1f69aa5 | 2012-01-24 16:10:04 -0800 | [diff] [blame] | 337 | CONFIG_DRIVER_NL80211=y | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 338 | CONFIG_DRIVER_WEXT=y | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 339 | CONFIG_DRIVER_BSD=y | 
 | 340 | CONFIG_DRIVER_NDIS=y | 
 | 341 |  | 
| Dmitry Shmidt | 1f69aa5 | 2012-01-24 16:10:04 -0800 | [diff] [blame] | 342 | Following example includes some more features and driver interfaces that | 
 | 343 | are included in the wpa_supplicant package: | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 344 |  | 
| Dmitry Shmidt | 1f69aa5 | 2012-01-24 16:10:04 -0800 | [diff] [blame] | 345 | CONFIG_DRIVER_NL80211=y | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 346 | CONFIG_DRIVER_WEXT=y | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 347 | CONFIG_DRIVER_BSD=y | 
 | 348 | CONFIG_DRIVER_NDIS=y | 
 | 349 | CONFIG_IEEE8021X_EAPOL=y | 
 | 350 | CONFIG_EAP_MD5=y | 
 | 351 | CONFIG_EAP_MSCHAPV2=y | 
 | 352 | CONFIG_EAP_TLS=y | 
 | 353 | CONFIG_EAP_PEAP=y | 
 | 354 | CONFIG_EAP_TTLS=y | 
 | 355 | CONFIG_EAP_GTC=y | 
 | 356 | CONFIG_EAP_OTP=y | 
 | 357 | CONFIG_EAP_SIM=y | 
 | 358 | CONFIG_EAP_AKA=y | 
 | 359 | CONFIG_EAP_PSK=y | 
 | 360 | CONFIG_EAP_SAKE=y | 
 | 361 | CONFIG_EAP_GPSK=y | 
 | 362 | CONFIG_EAP_PAX=y | 
 | 363 | CONFIG_EAP_LEAP=y | 
 | 364 | CONFIG_EAP_IKEV2=y | 
 | 365 | CONFIG_PCSC=y | 
 | 366 |  | 
 | 367 | EAP-PEAP and EAP-TTLS will automatically include configured EAP | 
 | 368 | methods (MD5, OTP, GTC, MSCHAPV2) for inner authentication selection. | 
 | 369 |  | 
 | 370 |  | 
 | 371 | After you have created a configuration file, you can build | 
 | 372 | wpa_supplicant and wpa_cli with 'make' command. You may then install | 
 | 373 | the binaries to a suitable system directory, e.g., /usr/local/bin. | 
 | 374 |  | 
 | 375 | Example commands: | 
 | 376 |  | 
 | 377 | # build wpa_supplicant and wpa_cli | 
 | 378 | make | 
 | 379 | # install binaries (this may need root privileges) | 
 | 380 | cp wpa_cli wpa_supplicant /usr/local/bin | 
 | 381 |  | 
 | 382 |  | 
 | 383 | You will need to make a configuration file, e.g., | 
 | 384 | /etc/wpa_supplicant.conf, with network configuration for the networks | 
 | 385 | you are going to use. Configuration file section below includes | 
| Hai Shalom | 6084025 | 2021-02-19 19:02:11 -0800 | [diff] [blame] | 386 | explanation of the configuration file format and includes various | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 387 | examples. Once the configuration is ready, you can test whether the | 
 | 388 | configuration work by first running wpa_supplicant with following | 
 | 389 | command to start it on foreground with debugging enabled: | 
 | 390 |  | 
 | 391 | wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -d | 
 | 392 |  | 
 | 393 | Assuming everything goes fine, you can start using following command | 
 | 394 | to start wpa_supplicant on background without debugging: | 
 | 395 |  | 
 | 396 | wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -B | 
 | 397 |  | 
 | 398 | Please note that if you included more than one driver interface in the | 
 | 399 | build time configuration (.config), you may need to specify which | 
 | 400 | interface to use by including -D<driver name> option on the command | 
 | 401 | line. See following section for more details on command line options | 
 | 402 | for wpa_supplicant. | 
 | 403 |  | 
 | 404 |  | 
 | 405 |  | 
 | 406 | Command line options | 
 | 407 | -------------------- | 
 | 408 |  | 
 | 409 | usage: | 
| Dmitry Shmidt | b97e428 | 2016-02-08 10:16:07 -0800 | [diff] [blame] | 410 |   wpa_supplicant [-BddfhKLqqtuvW] [-P<pid file>] [-g<global ctrl>] \ | 
| Dmitry Shmidt | b6e9aaf | 2013-05-20 14:49:44 -0700 | [diff] [blame] | 411 |         [-G<group>] \ | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 412 |         -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] [-p<driver_param>] \ | 
| Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 413 |         [-b<br_ifname> [-MN -i<ifname> -c<conf> [-C<ctrl>] [-D<driver>] \ | 
| Dmitry Shmidt | 2ac5f60 | 2014-03-07 10:08:21 -0800 | [diff] [blame] | 414 |         [-p<driver_param>] [-b<br_ifname>] [-m<P2P Device config file>] ... | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 415 |  | 
 | 416 | options: | 
 | 417 |   -b = optional bridge interface name | 
 | 418 |   -B = run daemon in the background | 
 | 419 |   -c = Configuration file | 
 | 420 |   -C = ctrl_interface parameter (only used if -c is not) | 
 | 421 |   -i = interface name | 
 | 422 |   -d = increase debugging verbosity (-dd even more) | 
 | 423 |   -D = driver name (can be multiple drivers: nl80211,wext) | 
 | 424 |   -f = Log output to default log location (normally /tmp) | 
 | 425 |   -g = global ctrl_interface | 
| Dmitry Shmidt | b6e9aaf | 2013-05-20 14:49:44 -0700 | [diff] [blame] | 426 |   -G = global ctrl_interface group | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 427 |   -K = include keys (passwords, etc.) in debug output | 
 | 428 |   -t = include timestamp in debug messages | 
 | 429 |   -h = show this help text | 
| Dmitry Shmidt | 0494959 | 2012-07-19 12:16:46 -0700 | [diff] [blame] | 430 |   -L = show license (BSD) | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 431 |   -p = driver parameters | 
 | 432 |   -P = PID file | 
 | 433 |   -q = decrease debugging verbosity (-qq even less) | 
 | 434 |   -u = enable DBus control interface | 
 | 435 |   -v = show version | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 436 |   -W = wait for a control interface monitor before starting | 
| Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 437 |   -M = start describing matching interface | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 438 |   -N = start describing new interface | 
| Dmitry Shmidt | 2ac5f60 | 2014-03-07 10:08:21 -0800 | [diff] [blame] | 439 |   -m = Configuration file for the P2P Device | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 440 |  | 
 | 441 | drivers: | 
| Dmitry Shmidt | 4b06059 | 2013-04-29 16:42:49 -0700 | [diff] [blame] | 442 |   nl80211 = Linux nl80211/cfg80211 | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 443 |   wext = Linux wireless extensions (generic) | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 444 |   wired = wpa_supplicant wired Ethernet driver | 
| Sunil Ravi | 640215c | 2023-06-28 23:08:09 +0000 | [diff] [blame] | 445 |   macsec_linux = MACsec Ethernet driver for Linux | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 446 |   roboswitch = wpa_supplicant Broadcom switch driver | 
| Sunil Ravi | 640215c | 2023-06-28 23:08:09 +0000 | [diff] [blame] | 447 |   none = no driver (RADIUS server/WPS ER only) | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 448 |   bsd = BSD 802.11 support (Atheros, etc.) | 
 | 449 |   ndis = Windows NDIS driver | 
 | 450 |  | 
 | 451 | In most common cases, wpa_supplicant is started with | 
 | 452 |  | 
 | 453 | wpa_supplicant -B -c/etc/wpa_supplicant.conf -iwlan0 | 
 | 454 |  | 
 | 455 | This makes the process fork into background. | 
 | 456 |  | 
 | 457 | The easiest way to debug problems, and to get debug log for bug | 
 | 458 | reports, is to start wpa_supplicant on foreground with debugging | 
 | 459 | enabled: | 
 | 460 |  | 
 | 461 | wpa_supplicant -c/etc/wpa_supplicant.conf -iwlan0 -d | 
 | 462 |  | 
 | 463 | If the specific driver wrapper is not known beforehand, it is possible | 
 | 464 | to specify multiple comma separated driver wrappers on the command | 
 | 465 | line. wpa_supplicant will use the first driver wrapper that is able to | 
 | 466 | initialize the interface. | 
 | 467 |  | 
 | 468 | wpa_supplicant -Dnl80211,wext -c/etc/wpa_supplicant.conf -iwlan0 | 
 | 469 |  | 
 | 470 |  | 
 | 471 | wpa_supplicant can control multiple interfaces (radios) either by | 
 | 472 | running one process for each interface separately or by running just | 
 | 473 | one process and list of options at command line. Each interface is | 
 | 474 | separated with -N argument. As an example, following command would | 
 | 475 | start wpa_supplicant for two interfaces: | 
 | 476 |  | 
 | 477 | wpa_supplicant \ | 
| Dmitry Shmidt | 1f69aa5 | 2012-01-24 16:10:04 -0800 | [diff] [blame] | 478 | 	-c wpa1.conf -i wlan0 -D nl80211 -N \ | 
 | 479 | 	-c wpa2.conf -i wlan1 -D wext | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 480 |  | 
 | 481 |  | 
| Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 482 | If the interfaces on which wpa_supplicant is to run are not known or do | 
 | 483 | not exist, wpa_supplicant can match an interface when it arrives. Each | 
 | 484 | matched interface is separated with -M argument and the -i argument now | 
 | 485 | allows for pattern matching. | 
 | 486 |  | 
 | 487 | As an example, the following command would start wpa_supplicant for a | 
 | 488 | specific wired interface called lan0, any interface starting with wlan | 
 | 489 | and lastly any other interface. Each match has its own configuration | 
 | 490 | file, and for the wired interface a specific driver has also been given. | 
 | 491 |  | 
 | 492 | wpa_supplicant \ | 
 | 493 | 	-M -c wpa_wired.conf -ilan0 -D wired \ | 
 | 494 | 	-M -c wpa1.conf -iwlan* \ | 
 | 495 | 	-M -c wpa2.conf | 
 | 496 |  | 
 | 497 |  | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 498 | If the interface is added in a Linux bridge (e.g., br0), the bridge | 
 | 499 | interface needs to be configured to wpa_supplicant in addition to the | 
 | 500 | main interface: | 
 | 501 |  | 
| Dmitry Shmidt | 4b06059 | 2013-04-29 16:42:49 -0700 | [diff] [blame] | 502 | wpa_supplicant -cw.conf -Dnl80211 -iwlan0 -bbr0 | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 503 |  | 
 | 504 |  | 
 | 505 | Configuration file | 
 | 506 | ------------------ | 
 | 507 |  | 
 | 508 | wpa_supplicant is configured using a text file that lists all accepted | 
 | 509 | networks and security policies, including pre-shared keys. See | 
 | 510 | example configuration file, wpa_supplicant.conf, for detailed | 
 | 511 | information about the configuration format and supported fields. | 
 | 512 |  | 
 | 513 | Changes to configuration file can be reloaded be sending SIGHUP signal | 
 | 514 | to wpa_supplicant ('killall -HUP wpa_supplicant'). Similarly, | 
 | 515 | reloading can be triggered with 'wpa_cli reconfigure' command. | 
 | 516 |  | 
 | 517 | Configuration file can include one or more network blocks, e.g., one | 
 | 518 | for each used SSID. wpa_supplicant will automatically select the best | 
| Dmitry Shmidt | 9c17526 | 2016-03-03 10:20:07 -0800 | [diff] [blame] | 519 | network based on the order of network blocks in the configuration | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 520 | file, network security level (WPA/WPA2 is preferred), and signal | 
 | 521 | strength. | 
 | 522 |  | 
 | 523 | Example configuration files for some common configurations: | 
 | 524 |  | 
 | 525 | 1) WPA-Personal (PSK) as home network and WPA-Enterprise with EAP-TLS as work | 
 | 526 |    network | 
 | 527 |  | 
 | 528 | # allow frontend (e.g., wpa_cli) to be used by all users in 'wheel' group | 
 | 529 | ctrl_interface=/var/run/wpa_supplicant | 
 | 530 | ctrl_interface_group=wheel | 
 | 531 | # | 
 | 532 | # home network; allow all valid ciphers | 
 | 533 | network={ | 
 | 534 | 	ssid="home" | 
 | 535 | 	scan_ssid=1 | 
 | 536 | 	key_mgmt=WPA-PSK | 
 | 537 | 	psk="very secret passphrase" | 
 | 538 | } | 
 | 539 | # | 
 | 540 | # work network; use EAP-TLS with WPA; allow only CCMP and TKIP ciphers | 
 | 541 | network={ | 
 | 542 | 	ssid="work" | 
 | 543 | 	scan_ssid=1 | 
 | 544 | 	key_mgmt=WPA-EAP | 
 | 545 | 	pairwise=CCMP TKIP | 
 | 546 | 	group=CCMP TKIP | 
 | 547 | 	eap=TLS | 
 | 548 | 	identity="user@example.com" | 
 | 549 | 	ca_cert="/etc/cert/ca.pem" | 
 | 550 | 	client_cert="/etc/cert/user.pem" | 
 | 551 | 	private_key="/etc/cert/user.prv" | 
 | 552 | 	private_key_passwd="password" | 
 | 553 | } | 
 | 554 |  | 
 | 555 |  | 
 | 556 | 2) WPA-RADIUS/EAP-PEAP/MSCHAPv2 with RADIUS servers that use old peaplabel | 
 | 557 |    (e.g., Funk Odyssey and SBR, Meetinghouse Aegis, Interlink RAD-Series) | 
 | 558 |  | 
 | 559 | ctrl_interface=/var/run/wpa_supplicant | 
 | 560 | ctrl_interface_group=wheel | 
 | 561 | network={ | 
 | 562 | 	ssid="example" | 
 | 563 | 	scan_ssid=1 | 
 | 564 | 	key_mgmt=WPA-EAP | 
 | 565 | 	eap=PEAP | 
 | 566 | 	identity="user@example.com" | 
 | 567 | 	password="foobar" | 
 | 568 | 	ca_cert="/etc/cert/ca.pem" | 
 | 569 | 	phase1="peaplabel=0" | 
 | 570 | 	phase2="auth=MSCHAPV2" | 
 | 571 | } | 
 | 572 |  | 
 | 573 |  | 
 | 574 | 3) EAP-TTLS/EAP-MD5-Challenge configuration with anonymous identity for the | 
 | 575 |    unencrypted use. Real identity is sent only within an encrypted TLS tunnel. | 
 | 576 |  | 
 | 577 | ctrl_interface=/var/run/wpa_supplicant | 
 | 578 | ctrl_interface_group=wheel | 
 | 579 | network={ | 
 | 580 | 	ssid="example" | 
 | 581 | 	scan_ssid=1 | 
 | 582 | 	key_mgmt=WPA-EAP | 
 | 583 | 	eap=TTLS | 
 | 584 | 	identity="user@example.com" | 
 | 585 | 	anonymous_identity="anonymous@example.com" | 
 | 586 | 	password="foobar" | 
 | 587 | 	ca_cert="/etc/cert/ca.pem" | 
 | 588 | 	phase2="auth=MD5" | 
 | 589 | } | 
 | 590 |  | 
 | 591 |  | 
 | 592 | 4) IEEE 802.1X (i.e., no WPA) with dynamic WEP keys (require both unicast and | 
 | 593 |    broadcast); use EAP-TLS for authentication | 
 | 594 |  | 
 | 595 | ctrl_interface=/var/run/wpa_supplicant | 
 | 596 | ctrl_interface_group=wheel | 
 | 597 | network={ | 
 | 598 | 	ssid="1x-test" | 
 | 599 | 	scan_ssid=1 | 
 | 600 | 	key_mgmt=IEEE8021X | 
 | 601 | 	eap=TLS | 
 | 602 | 	identity="user@example.com" | 
 | 603 | 	ca_cert="/etc/cert/ca.pem" | 
 | 604 | 	client_cert="/etc/cert/user.pem" | 
 | 605 | 	private_key="/etc/cert/user.prv" | 
 | 606 | 	private_key_passwd="password" | 
 | 607 | 	eapol_flags=3 | 
 | 608 | } | 
 | 609 |  | 
 | 610 |  | 
 | 611 | 5) Catch all example that allows more or less all configuration modes. The | 
 | 612 |    configuration options are used based on what security policy is used in the | 
 | 613 |    selected SSID. This is mostly for testing and is not recommended for normal | 
 | 614 |    use. | 
 | 615 |  | 
 | 616 | ctrl_interface=/var/run/wpa_supplicant | 
 | 617 | ctrl_interface_group=wheel | 
 | 618 | network={ | 
 | 619 | 	ssid="example" | 
 | 620 | 	scan_ssid=1 | 
 | 621 | 	key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE | 
 | 622 | 	pairwise=CCMP TKIP | 
 | 623 | 	group=CCMP TKIP WEP104 WEP40 | 
 | 624 | 	psk="very secret passphrase" | 
 | 625 | 	eap=TTLS PEAP TLS | 
 | 626 | 	identity="user@example.com" | 
 | 627 | 	password="foobar" | 
 | 628 | 	ca_cert="/etc/cert/ca.pem" | 
 | 629 | 	client_cert="/etc/cert/user.pem" | 
 | 630 | 	private_key="/etc/cert/user.prv" | 
 | 631 | 	private_key_passwd="password" | 
 | 632 | 	phase1="peaplabel=0" | 
 | 633 | 	ca_cert2="/etc/cert/ca2.pem" | 
 | 634 | 	client_cert2="/etc/cer/user.pem" | 
 | 635 | 	private_key2="/etc/cer/user.prv" | 
 | 636 | 	private_key2_passwd="password" | 
 | 637 | } | 
 | 638 |  | 
 | 639 |  | 
 | 640 | 6) Authentication for wired Ethernet. This can be used with 'wired' or | 
 | 641 |    'roboswitch' interface (-Dwired or -Droboswitch on command line). | 
 | 642 |  | 
 | 643 | ctrl_interface=/var/run/wpa_supplicant | 
 | 644 | ctrl_interface_group=wheel | 
 | 645 | ap_scan=0 | 
 | 646 | network={ | 
 | 647 | 	key_mgmt=IEEE8021X | 
 | 648 | 	eap=MD5 | 
 | 649 | 	identity="user" | 
 | 650 | 	password="password" | 
 | 651 | 	eapol_flags=0 | 
 | 652 | } | 
 | 653 |  | 
 | 654 |  | 
 | 655 |  | 
 | 656 | Certificates | 
 | 657 | ------------ | 
 | 658 |  | 
 | 659 | Some EAP authentication methods require use of certificates. EAP-TLS | 
 | 660 | uses both server side and client certificates whereas EAP-PEAP and | 
 | 661 | EAP-TTLS only require the server side certificate. When client | 
 | 662 | certificate is used, a matching private key file has to also be | 
 | 663 | included in configuration. If the private key uses a passphrase, this | 
 | 664 | has to be configured in wpa_supplicant.conf ("private_key_passwd"). | 
 | 665 |  | 
 | 666 | wpa_supplicant supports X.509 certificates in PEM and DER | 
 | 667 | formats. User certificate and private key can be included in the same | 
 | 668 | file. | 
 | 669 |  | 
 | 670 | If the user certificate and private key is received in PKCS#12/PFX | 
 | 671 | format, they need to be converted to suitable PEM/DER format for | 
 | 672 | wpa_supplicant. This can be done, e.g., with following commands: | 
 | 673 |  | 
 | 674 | # convert client certificate and private key to PEM format | 
 | 675 | openssl pkcs12 -in example.pfx -out user.pem -clcerts | 
 | 676 | # convert CA certificate (if included in PFX file) to PEM format | 
 | 677 | openssl pkcs12 -in example.pfx -out ca.pem -cacerts -nokeys | 
 | 678 |  | 
 | 679 |  | 
 | 680 |  | 
 | 681 | wpa_cli | 
 | 682 | ------- | 
 | 683 |  | 
 | 684 | wpa_cli is a text-based frontend program for interacting with | 
 | 685 | wpa_supplicant. It is used to query current status, change | 
 | 686 | configuration, trigger events, and request interactive user input. | 
 | 687 |  | 
 | 688 | wpa_cli can show the current authentication status, selected security | 
 | 689 | mode, dot11 and dot1x MIBs, etc. In addition, it can configure some | 
 | 690 | variables like EAPOL state machine parameters and trigger events like | 
 | 691 | reassociation and IEEE 802.1X logoff/logon. wpa_cli provides a user | 
 | 692 | interface to request authentication information, like username and | 
 | 693 | password, if these are not included in the configuration. This can be | 
 | 694 | used to implement, e.g., one-time-passwords or generic token card | 
 | 695 | authentication where the authentication is based on a | 
 | 696 | challenge-response that uses an external device for generating the | 
 | 697 | response. | 
 | 698 |  | 
 | 699 | The control interface of wpa_supplicant can be configured to allow | 
 | 700 | non-root user access (ctrl_interface_group in the configuration | 
 | 701 | file). This makes it possible to run wpa_cli with a normal user | 
 | 702 | account. | 
 | 703 |  | 
 | 704 | wpa_cli supports two modes: interactive and command line. Both modes | 
 | 705 | share the same command set and the main difference is in interactive | 
 | 706 | mode providing access to unsolicited messages (event messages, | 
 | 707 | username/password requests). | 
 | 708 |  | 
 | 709 | Interactive mode is started when wpa_cli is executed without including | 
 | 710 | the command as a command line parameter. Commands are then entered on | 
 | 711 | the wpa_cli prompt. In command line mode, the same commands are | 
 | 712 | entered as command line arguments for wpa_cli. | 
 | 713 |  | 
 | 714 |  | 
 | 715 | Interactive authentication parameters request | 
 | 716 |  | 
 | 717 | When wpa_supplicant need authentication parameters, like username and | 
 | 718 | password, which are not present in the configuration file, it sends a | 
 | 719 | request message to all attached frontend programs, e.g., wpa_cli in | 
 | 720 | interactive mode. wpa_cli shows these requests with | 
 | 721 | "CTRL-REQ-<type>-<id>:<text>" prefix. <type> is IDENTITY, PASSWORD, or | 
 | 722 | OTP (one-time-password). <id> is a unique identifier for the current | 
 | 723 | network. <text> is description of the request. In case of OTP request, | 
 | 724 | it includes the challenge from the authentication server. | 
 | 725 |  | 
 | 726 | The reply to these requests can be given with 'identity', 'password', | 
 | 727 | and 'otp' commands. <id> needs to be copied from the the matching | 
 | 728 | request. 'password' and 'otp' commands can be used regardless of | 
 | 729 | whether the request was for PASSWORD or OTP. The main difference | 
 | 730 | between these two commands is that values given with 'password' are | 
 | 731 | remembered as long as wpa_supplicant is running whereas values given | 
 | 732 | with 'otp' are used only once and then forgotten, i.e., wpa_supplicant | 
 | 733 | will ask frontend for a new value for every use. This can be used to | 
 | 734 | implement one-time-password lists and generic token card -based | 
 | 735 | authentication. | 
 | 736 |  | 
 | 737 | Example request for password and a matching reply: | 
 | 738 |  | 
 | 739 | CTRL-REQ-PASSWORD-1:Password needed for SSID foobar | 
 | 740 | > password 1 mysecretpassword | 
 | 741 |  | 
 | 742 | Example request for generic token card challenge-response: | 
 | 743 |  | 
 | 744 | CTRL-REQ-OTP-2:Challenge 1235663 needed for SSID foobar | 
 | 745 | > otp 2 9876 | 
 | 746 |  | 
 | 747 |  | 
 | 748 | wpa_cli commands | 
 | 749 |  | 
 | 750 |   status = get current WPA/EAPOL/EAP status | 
 | 751 |   mib = get MIB variables (dot1x, dot11) | 
 | 752 |   help = show this usage help | 
 | 753 |   interface [ifname] = show interfaces/select interface | 
 | 754 |   level <debug level> = change debug level | 
 | 755 |   license = show full wpa_cli license | 
 | 756 |   logoff = IEEE 802.1X EAPOL state machine logoff | 
 | 757 |   logon = IEEE 802.1X EAPOL state machine logon | 
 | 758 |   set = set variables (shows list of variables when run without arguments) | 
 | 759 |   pmksa = show PMKSA cache | 
 | 760 |   reassociate = force reassociation | 
 | 761 |   reconfigure = force wpa_supplicant to re-read its configuration file | 
 | 762 |   preauthenticate <BSSID> = force preauthentication | 
 | 763 |   identity <network id> <identity> = configure identity for an SSID | 
 | 764 |   password <network id> <password> = configure password for an SSID | 
 | 765 |   pin <network id> <pin> = configure pin for an SSID | 
 | 766 |   otp <network id> <password> = configure one-time-password for an SSID | 
 | 767 |   passphrase <network id> <passphrase> = configure private key passphrase | 
 | 768 |     for an SSID | 
 | 769 |   bssid <network id> <BSSID> = set preferred BSSID for an SSID | 
 | 770 |   list_networks = list configured networks | 
 | 771 |   select_network <network id> = select a network (disable others) | 
 | 772 |   enable_network <network id> = enable a network | 
 | 773 |   disable_network <network id> = disable a network | 
 | 774 |   add_network = add a network | 
 | 775 |   remove_network <network id> = remove a network | 
 | 776 |   set_network <network id> <variable> <value> = set network variables (shows | 
 | 777 |     list of variables when run without arguments) | 
 | 778 |   get_network <network id> <variable> = get network variables | 
 | 779 |   save_config = save the current configuration | 
 | 780 |   disconnect = disconnect and wait for reassociate command before connecting | 
 | 781 |   scan = request new BSS scan | 
 | 782 |   scan_results = get latest scan results | 
| Hai Shalom | 6084025 | 2021-02-19 19:02:11 -0800 | [diff] [blame] | 783 |   get_capability <eap/pairwise/group/key_mgmt/proto/auth_alg> = get capabilities | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 784 |   terminate = terminate wpa_supplicant | 
 | 785 |   quit = exit wpa_cli | 
 | 786 |  | 
 | 787 |  | 
 | 788 | wpa_cli command line options | 
 | 789 |  | 
 | 790 | wpa_cli [-p<path to ctrl sockets>] [-i<ifname>] [-hvB] [-a<action file>] \ | 
 | 791 |         [-P<pid file>] [-g<global ctrl>]  [command..] | 
 | 792 |   -h = help (show this usage text) | 
 | 793 |   -v = shown version information | 
 | 794 |   -a = run in daemon mode executing the action file based on events from | 
 | 795 |        wpa_supplicant | 
 | 796 |   -B = run a daemon in the background | 
 | 797 |   default path: /var/run/wpa_supplicant | 
 | 798 |   default interface: first interface found in socket path | 
 | 799 |  | 
 | 800 |  | 
 | 801 | Using wpa_cli to run external program on connect/disconnect | 
 | 802 | ----------------------------------------------------------- | 
 | 803 |  | 
 | 804 | wpa_cli can used to run external programs whenever wpa_supplicant | 
 | 805 | connects or disconnects from a network. This can be used, e.g., to | 
 | 806 | update network configuration and/or trigget DHCP client to update IP | 
 | 807 | addresses, etc. | 
 | 808 |  | 
 | 809 | One wpa_cli process in "action" mode needs to be started for each | 
 | 810 | interface. For example, the following command starts wpa_cli for the | 
| Dmitry Shmidt | 9c17526 | 2016-03-03 10:20:07 -0800 | [diff] [blame] | 811 | default interface (-i can be used to select the interface in case of | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 812 | more than one interface being used at the same time): | 
 | 813 |  | 
 | 814 | wpa_cli -a/sbin/wpa_action.sh -B | 
 | 815 |  | 
 | 816 | The action file (-a option, /sbin/wpa_action.sh in this example) will | 
 | 817 | be executed whenever wpa_supplicant completes authentication (connect | 
 | 818 | event) or detects disconnection). The action script will be called | 
 | 819 | with two command line arguments: interface name and event (CONNECTED | 
 | 820 | or DISCONNECTED). If the action script needs to get more information | 
 | 821 | about the current network, it can use 'wpa_cli status' to query | 
 | 822 | wpa_supplicant for more information. | 
 | 823 |  | 
 | 824 | Following example can be used as a simple template for an action | 
 | 825 | script: | 
 | 826 |  | 
 | 827 | #!/bin/sh | 
 | 828 |  | 
 | 829 | IFNAME=$1 | 
 | 830 | CMD=$2 | 
 | 831 |  | 
 | 832 | if [ "$CMD" = "CONNECTED" ]; then | 
 | 833 |     SSID=`wpa_cli -i$IFNAME status | grep ^ssid= | cut -f2- -d=` | 
 | 834 |     # configure network, signal DHCP client, etc. | 
 | 835 | fi | 
 | 836 |  | 
 | 837 | if [ "$CMD" = "DISCONNECTED" ]; then | 
 | 838 |     # remove network configuration, if needed | 
 | 839 |     SSID= | 
 | 840 | fi | 
 | 841 |  | 
 | 842 |  | 
 | 843 |  | 
 | 844 | Integrating with pcmcia-cs/cardmgr scripts | 
 | 845 | ------------------------------------------ | 
 | 846 |  | 
 | 847 | wpa_supplicant needs to be running when using a wireless network with | 
 | 848 | WPA. It can be started either from system startup scripts or from | 
 | 849 | pcmcia-cs/cardmgr scripts (when using PC Cards). WPA handshake must be | 
 | 850 | completed before data frames can be exchanged, so wpa_supplicant | 
 | 851 | should be started before DHCP client. | 
 | 852 |  | 
 | 853 | For example, following small changes to pcmcia-cs scripts can be used | 
 | 854 | to enable WPA support: | 
 | 855 |  | 
 | 856 | Add MODE="Managed" and WPA="y" to the network scheme in | 
 | 857 | /etc/pcmcia/wireless.opts. | 
 | 858 |  | 
 | 859 | Add the following block to the end of 'start' action handler in | 
 | 860 | /etc/pcmcia/wireless: | 
 | 861 |  | 
 | 862 |     if [ "$WPA" = "y" -a -x /usr/local/bin/wpa_supplicant ]; then | 
 | 863 | 	/usr/local/bin/wpa_supplicant -B -c/etc/wpa_supplicant.conf \ | 
 | 864 | 		-i$DEVICE | 
 | 865 |     fi | 
 | 866 |  | 
 | 867 | Add the following block to the end of 'stop' action handler (may need | 
 | 868 | to be separated from other actions) in /etc/pcmcia/wireless: | 
 | 869 |  | 
 | 870 |     if [ "$WPA" = "y" -a -x /usr/local/bin/wpa_supplicant ]; then | 
 | 871 | 	killall wpa_supplicant | 
 | 872 |     fi | 
 | 873 |  | 
 | 874 | This will make cardmgr start wpa_supplicant when the card is plugged | 
 | 875 | in. | 
 | 876 |  | 
 | 877 |  | 
 | 878 |  | 
 | 879 | Dynamic interface add and operation without configuration files | 
 | 880 | --------------------------------------------------------------- | 
 | 881 |  | 
 | 882 | wpa_supplicant can be started without any configuration files or | 
 | 883 | network interfaces. When used in this way, a global (i.e., per | 
 | 884 | wpa_supplicant process) control interface is used to add and remove | 
 | 885 | network interfaces. Each network interface can then be configured | 
 | 886 | through a per-network interface control interface. For example, | 
 | 887 | following commands show how to start wpa_supplicant without any | 
 | 888 | network interfaces and then add a network interface and configure a | 
 | 889 | network (SSID): | 
 | 890 |  | 
 | 891 | # Start wpa_supplicant in the background | 
 | 892 | wpa_supplicant -g/var/run/wpa_supplicant-global -B | 
 | 893 |  | 
| Dmitry Shmidt | 4b06059 | 2013-04-29 16:42:49 -0700 | [diff] [blame] | 894 | # Add a new interface (wlan0, no configuration file, driver=nl80211, and | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 895 | # enable control interface) | 
 | 896 | wpa_cli -g/var/run/wpa_supplicant-global interface_add wlan0 \ | 
| Dmitry Shmidt | 4b06059 | 2013-04-29 16:42:49 -0700 | [diff] [blame] | 897 | 	"" nl80211 /var/run/wpa_supplicant | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 898 |  | 
 | 899 | # Configure a network using the newly added network interface: | 
 | 900 | wpa_cli -iwlan0 add_network | 
 | 901 | wpa_cli -iwlan0 set_network 0 ssid '"test"' | 
 | 902 | wpa_cli -iwlan0 set_network 0 key_mgmt WPA-PSK | 
 | 903 | wpa_cli -iwlan0 set_network 0 psk '"12345678"' | 
 | 904 | wpa_cli -iwlan0 set_network 0 pairwise TKIP | 
 | 905 | wpa_cli -iwlan0 set_network 0 group TKIP | 
 | 906 | wpa_cli -iwlan0 set_network 0 proto WPA | 
 | 907 | wpa_cli -iwlan0 enable_network 0 | 
 | 908 |  | 
 | 909 | # At this point, the new network interface should start trying to associate | 
 | 910 | # with the WPA-PSK network using SSID test. | 
 | 911 |  | 
 | 912 | # Remove network interface | 
 | 913 | wpa_cli -g/var/run/wpa_supplicant-global interface_remove wlan0 | 
 | 914 |  | 
 | 915 |  | 
 | 916 | Privilege separation | 
 | 917 | -------------------- | 
 | 918 |  | 
 | 919 | To minimize the size of code that needs to be run with root privileges | 
 | 920 | (e.g., to control wireless interface operation), wpa_supplicant | 
 | 921 | supports optional privilege separation. If enabled, this separates the | 
 | 922 | privileged operations into a separate process (wpa_priv) while leaving | 
 | 923 | rest of the code (e.g., EAP authentication and WPA handshakes) into an | 
 | 924 | unprivileged process (wpa_supplicant) that can be run as non-root | 
 | 925 | user. Privilege separation restricts the effects of potential software | 
 | 926 | errors by containing the majority of the code in an unprivileged | 
 | 927 | process to avoid full system compromise. | 
 | 928 |  | 
 | 929 | Privilege separation is not enabled by default and it can be enabled | 
 | 930 | by adding CONFIG_PRIVSEP=y to the build configuration (.config). When | 
 | 931 | enabled, the privileged operations (driver wrapper and l2_packet) are | 
 | 932 | linked into a separate daemon program, wpa_priv. The unprivileged | 
 | 933 | program, wpa_supplicant, will be built with a special driver/l2_packet | 
 | 934 | wrappers that communicate with the privileged wpa_priv process to | 
 | 935 | perform the needed operations. wpa_priv can control what privileged | 
 | 936 | are allowed. | 
 | 937 |  | 
 | 938 | wpa_priv needs to be run with network admin privileges (usually, root | 
 | 939 | user). It opens a UNIX domain socket for each interface that is | 
 | 940 | included on the command line; any other interface will be off limits | 
 | 941 | for wpa_supplicant in this kind of configuration. After this, | 
 | 942 | wpa_supplicant can be run as a non-root user (e.g., all standard users | 
 | 943 | on a laptop or as a special non-privileged user account created just | 
 | 944 | for this purpose to limit access to user files even further). | 
 | 945 |  | 
 | 946 |  | 
 | 947 | Example configuration: | 
 | 948 | - create user group for users that are allowed to use wpa_supplicant | 
 | 949 |   ('wpapriv' in this example) and assign users that should be able to | 
 | 950 |   use wpa_supplicant into that group | 
 | 951 | - create /var/run/wpa_priv directory for UNIX domain sockets and control | 
 | 952 |   user access by setting it accessible only for the wpapriv group: | 
 | 953 |   mkdir /var/run/wpa_priv | 
 | 954 |   chown root:wpapriv /var/run/wpa_priv | 
 | 955 |   chmod 0750 /var/run/wpa_priv | 
 | 956 | - start wpa_priv as root (e.g., from system startup scripts) with the | 
 | 957 |   enabled interfaces configured on the command line: | 
| Dmitry Shmidt | 4b06059 | 2013-04-29 16:42:49 -0700 | [diff] [blame] | 958 |   wpa_priv -B -P /var/run/wpa_priv.pid nl80211:wlan0 | 
| Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 959 | - run wpa_supplicant as non-root with a user that is in wpapriv group: | 
 | 960 |   wpa_supplicant -i ath0 -c wpa_supplicant.conf | 
 | 961 |  | 
 | 962 | wpa_priv does not use the network interface before wpa_supplicant is | 
 | 963 | started, so it is fine to include network interfaces that are not | 
 | 964 | available at the time wpa_priv is started. As an alternative, wpa_priv | 
 | 965 | can be started when an interface is added (hotplug/udev/etc. scripts). | 
 | 966 | wpa_priv can control multiple interface with one process, but it is | 
 | 967 | also possible to run multiple wpa_priv processes at the same time, if | 
 | 968 | desired. | 
| Dmitry Shmidt | 5605286 | 2013-10-04 10:23:25 -0700 | [diff] [blame] | 969 |  | 
| Dmitry Shmidt | abb90a3 | 2016-12-05 15:34:39 -0800 | [diff] [blame] | 970 | It should be noted that the interface used between wpa_supplicant and | 
 | 971 | wpa_priv does not include all the capabilities of the wpa_supplicant | 
 | 972 | driver interface and at times, this interface lacks update especially | 
 | 973 | for recent addition. Consequently, use of wpa_priv does come with the | 
 | 974 | price of somewhat reduced available functionality. The next section | 
 | 975 | describing how wpa_supplicant can be used with reduced privileges | 
 | 976 | without having to handle the complexity of separate wpa_priv. While that | 
 | 977 | approve does not provide separation for network admin capabilities, it | 
 | 978 | does allow other root privileges to be dropped without the drawbacks of | 
 | 979 | the wpa_priv process. | 
 | 980 |  | 
| Dmitry Shmidt | 5605286 | 2013-10-04 10:23:25 -0700 | [diff] [blame] | 981 |  | 
 | 982 | Linux capabilities instead of privileged process | 
 | 983 | ------------------------------------------------ | 
 | 984 |  | 
 | 985 | wpa_supplicant performs operations that need special permissions, e.g., | 
 | 986 | to control the network connection. Traditionally this has been achieved | 
 | 987 | by running wpa_supplicant as a privileged process with effective user id | 
 | 988 | 0 (root). Linux capabilities can be used to provide restricted set of | 
 | 989 | capabilities to match the functions needed by wpa_supplicant. The | 
 | 990 | minimum set of capabilities needed for the operations is CAP_NET_ADMIN | 
 | 991 | and CAP_NET_RAW. | 
 | 992 |  | 
 | 993 | setcap(8) can be used to set file capabilities. For example: | 
 | 994 |  | 
 | 995 | sudo setcap cap_net_raw,cap_net_admin+ep wpa_supplicant | 
 | 996 |  | 
 | 997 | Please note that this would give anyone being able to run that | 
 | 998 | wpa_supplicant binary access to the additional capabilities. This can | 
 | 999 | further be limited by file owner/group and mode bits. For example: | 
 | 1000 |  | 
 | 1001 | sudo chown wpas wpa_supplicant | 
 | 1002 | sudo chmod 0100 wpa_supplicant | 
 | 1003 |  | 
 | 1004 | This combination of setcap, chown, and chmod commands would allow wpas | 
 | 1005 | user to execute wpa_supplicant with additional network admin/raw | 
 | 1006 | capabilities. | 
 | 1007 |  | 
 | 1008 | Common way style of creating a control interface socket in | 
 | 1009 | /var/run/wpa_supplicant could not be done by this user, but this | 
 | 1010 | directory could be created before starting the wpa_supplicant and set to | 
 | 1011 | suitable mode to allow wpa_supplicant to create sockets | 
 | 1012 | there. Alternatively, other directory or abstract socket namespace could | 
 | 1013 | be used for the control interface. | 
| Dmitry Shmidt | fb79edc | 2014-01-10 10:45:54 -0800 | [diff] [blame] | 1014 |  | 
 | 1015 |  | 
 | 1016 | External requests for radio control | 
 | 1017 | ----------------------------------- | 
 | 1018 |  | 
 | 1019 | External programs can request wpa_supplicant to not start offchannel | 
 | 1020 | operations during other tasks that may need exclusive control of the | 
 | 1021 | radio. The RADIO_WORK control interface command can be used for this. | 
 | 1022 |  | 
 | 1023 | "RADIO_WORK add <name> [freq=<MHz>] [timeout=<seconds>]" command can be | 
 | 1024 | used to reserve a slot for radio access. If freq is specified, other | 
 | 1025 | radio work items on the same channel may be completed in | 
 | 1026 | parallel. Otherwise, all other radio work items are blocked during | 
 | 1027 | execution. Timeout is set to 10 seconds by default to avoid blocking | 
 | 1028 | wpa_supplicant operations for excessive time. If a longer (or shorter) | 
 | 1029 | safety timeout is needed, that can be specified with the optional | 
 | 1030 | timeout parameter. This command returns an identifier for the radio work | 
 | 1031 | item. | 
 | 1032 |  | 
 | 1033 | Once the radio work item has been started, "EXT-RADIO-WORK-START <id>" | 
 | 1034 | event message is indicated that the external processing can start. Once | 
 | 1035 | the operation has been completed, "RADIO_WORK done <id>" is used to | 
 | 1036 | indicate that to wpa_supplicant. This allows other radio works to be | 
 | 1037 | performed. If this command is forgotten (e.g., due to the external | 
| Dmitry Shmidt | 9c17526 | 2016-03-03 10:20:07 -0800 | [diff] [blame] | 1038 | program terminating), wpa_supplicant will time out the radio work item | 
 | 1039 | and send "EXT-RADIO-WORK-TIMEOUT <id>" event to indicate that this has | 
| Dmitry Shmidt | fb79edc | 2014-01-10 10:45:54 -0800 | [diff] [blame] | 1040 | happened. "RADIO_WORK done <id>" can also be used to cancel items that | 
 | 1041 | have not yet been started. | 
 | 1042 |  | 
 | 1043 | For example, in wpa_cli interactive mode: | 
 | 1044 |  | 
 | 1045 | > radio_work add test | 
 | 1046 | 1 | 
 | 1047 | <3>EXT-RADIO-WORK-START 1 | 
 | 1048 | > radio_work show | 
 | 1049 | ext:test@wlan0:0:1:2.487797 | 
 | 1050 | > radio_work done 1 | 
 | 1051 | OK | 
 | 1052 | > radio_work show | 
 | 1053 |  | 
 | 1054 |  | 
 | 1055 | > radio_work done 3 | 
 | 1056 | OK | 
 | 1057 | > radio_work show | 
 | 1058 | ext:test freq=2412 timeout=30@wlan0:2412:1:28.583483 | 
 | 1059 | <3>EXT-RADIO-WORK-TIMEOUT 2 | 
 | 1060 |  | 
 | 1061 |  | 
 | 1062 | > radio_work add test2 freq=2412 timeout=60 | 
 | 1063 | 5 | 
 | 1064 | <3>EXT-RADIO-WORK-START 5 | 
 | 1065 | > radio_work add test3 | 
 | 1066 | 6 | 
 | 1067 | > radio_work add test4 | 
 | 1068 | 7 | 
 | 1069 | > radio_work show | 
 | 1070 | ext:test2 freq=2412 timeout=60@wlan0:2412:1:9.751844 | 
 | 1071 | ext:test3@wlan0:0:0:5.071812 | 
 | 1072 | ext:test4@wlan0:0:0:3.143870 | 
 | 1073 | > radio_work done 6 | 
 | 1074 | OK | 
 | 1075 | > radio_work show | 
 | 1076 | ext:test2 freq=2412 timeout=60@wlan0:2412:1:16.287869 | 
 | 1077 | ext:test4@wlan0:0:0:9.679895 | 
 | 1078 | > radio_work done 5 | 
 | 1079 | OK | 
 | 1080 | <3>EXT-RADIO-WORK-START 7 | 
 | 1081 | <3>EXT-RADIO-WORK-TIMEOUT 7 | 
| Hai Shalom | a20dcd7 | 2022-02-04 13:43:00 -0800 | [diff] [blame] | 1082 |  | 
 | 1083 |  | 
 | 1084 | DSCP policy procedures | 
 | 1085 | ---------------------- | 
 | 1086 |  | 
 | 1087 | DSCP policy procedures defined in WFA QoS Management-R2 program | 
 | 1088 | facilitates AP devices to configure DSCP settings for specific uplink | 
 | 1089 | data streams. | 
 | 1090 |  | 
 | 1091 | An AP may transmit a DSCP Policy Request frame containing zero or more | 
 | 1092 | QoS Management IEs to an associated STA which supports DSCP policy | 
 | 1093 | procedures. Each QoS Management element in a DSCP Policy Request frame | 
 | 1094 | represents one DSCP policy, and shall include one DSCP Policy attribute | 
 | 1095 | including a DSCP Policy ID, Request type, and a DSCP value. | 
 | 1096 |  | 
 | 1097 | wpa_supplicant sends control interface event messages consisting details | 
 | 1098 | of DSCP policies requested by the AP through a DSCP Policy Request frame | 
 | 1099 | to external programs. The format of the control interface event messages | 
 | 1100 | is as shown below: | 
 | 1101 |  | 
 | 1102 | - Control interface event message format to indicate DSCP request start | 
 | 1103 |  | 
 | 1104 |   <3>CTRL-EVENT-DSCP-POLICY request_start [clear_all] [more] | 
 | 1105 |  | 
 | 1106 |   clear_all - AP requested to clear all DSCP policies configured earlier | 
 | 1107 |   more      - AP may request to configure more DSCP policies with new DSCP | 
 | 1108 |               request | 
 | 1109 |  | 
 | 1110 | - Control interface event message format to add new policy | 
 | 1111 |  | 
 | 1112 |   <3>CTRL-EVENT-DSCP-POLICY add <policy_id> <dscp_value> <ip_version=0|4|6> | 
 | 1113 |   [protocol] [source ip] [destination_ip]/[domain name] [source port] | 
 | 1114 |   [[<start_port> <end_port>]/destination port] | 
 | 1115 |  | 
 | 1116 |   ip_version = 0: Both IPv4 and IPv6 | 
 | 1117 |              = 4: IPv4 | 
 | 1118 |              = 6: IPv6 | 
 | 1119 |   protocol: Internet Protocol Numbers as per IETF RFCs | 
 | 1120 | 	 = 6: TCP | 
 | 1121 | 	 = 17: UDP | 
 | 1122 | 	 = 50: ESP | 
 | 1123 |  | 
 | 1124 | - Control interface event message format to remove a particular policy, | 
 | 1125 |   identified by the policy_id attribute. | 
 | 1126 |  | 
 | 1127 |   <3>CTRL-EVENT-DSCP-POLICY remove <policy_id> | 
 | 1128 |  | 
 | 1129 | - DSCP policy may get rejected due to invalid policy parameters. Ccontrol | 
 | 1130 |   interface event message format for rejected policy. | 
 | 1131 |  | 
 | 1132 |   <3>CTRL-EVENT-DSCP-POLICY reject <policy_id> | 
 | 1133 |  | 
 | 1134 | - Control interface event message format to indicate end of DSCP request. | 
 | 1135 |  | 
 | 1136 |   <3>CTRL-EVENT-DSCP-POLICY request_end | 
 | 1137 |  | 
 | 1138 | - External applications shall clear active DSCP policies upon receiving | 
 | 1139 |   "CTRL-EVENT-DISCONNECTED" or "CTRL-EVENT-DSCP-POLICY clear_all" events. | 
 | 1140 |  | 
 | 1141 | - Control interface event message format to indicate wpa_supplicant started | 
 | 1142 |   a timer to wait until the unsolicited DSCP request from the AP. | 
 | 1143 |  | 
 | 1144 |   <3>CTRL-EVENT-DSCP-POLICY request_wait start | 
 | 1145 |  | 
 | 1146 | - Control interface event message format to indicate timeout to receive the | 
 | 1147 |   unsolicited DSCP request. This event is expected only when an unsolicited | 
 | 1148 |   DSCP request is not received from the AP before timeout. | 
 | 1149 |  | 
 | 1150 |   <3>CTRL-EVENT-DSCP-POLICY request_wait end | 
 | 1151 |  | 
 | 1152 | DSCP Response: | 
 | 1153 | A QoS Management STA that enables DSCP Policy capability shall respond | 
 | 1154 | with DSCP response on receipt of a successful DSCP request from its | 
 | 1155 | associated AP.  wpa_supplicant sends DSCP policy response based on the | 
 | 1156 | control interface command received from the user is as below: | 
 | 1157 |  | 
 | 1158 | DSCP_RESP <[reset]>/<[solicited] [policy_id=1 status=0...]> [more] | 
 | 1159 |  | 
 | 1160 | DSCP Query: | 
 | 1161 | DSCP Policy Query enables a STA to query its associated AP for DSCP | 
 | 1162 | policies applicable to the STA. Currently, this includes support to send | 
 | 1163 | a wildcard DSCP query or a DSCP query with a single domain name | 
 | 1164 | attribute. The command format for the DSCP query command is as follows: | 
 | 1165 | DSCP_QUERY <wildcard>/<domain_name=<string>> |