]>
Commit | Line | Data |
---|---|---|
30c28971 JM |
1 | /** |
2 | \page code_structure Structure of the source code | |
3 | ||
7c4e9211 | 4 | [ \ref _wpa_supplicant_core "wpa_supplicant core functionality" | |
30c28971 JM |
5 | \ref generic_helper_func "Generic helper functions" | |
6 | \ref crypto_func "Cryptographic functions" | | |
7 | \ref tls_func "TLS library" | | |
8 | \ref configuration "Configuration" | | |
9 | \ref ctrl_iface "Control interface" | | |
10 | \ref wpa_code "WPA supplicant" | | |
11 | \ref eap_peer "EAP peer" | | |
12 | \ref eapol_supp "EAPOL supplicant" | | |
13 | \ref win_port "Windows port" | | |
14 | \ref test_programs "Test programs" ] | |
15 | ||
5eb513c3 | 16 | wpa_supplicant implementation is divided into number of independent |
30c28971 JM |
17 | modules. Core code includes functionality for controlling the network |
18 | selection, association, and configuration. Independent modules include | |
19 | WPA code (key handshake, PMKSA caching, pre-authentication), EAPOL | |
20 | state machine, and EAP state machine and methods. In addition, there | |
21 | are number of separate files for generic helper functions. | |
22 | ||
23 | Both WPA and EAPOL/EAP state machines can be used separately in other | |
5eb513c3 | 24 | programs than wpa_supplicant. As an example, the included test |
30c28971 JM |
25 | programs eapol_test and preauth_test are using these modules. |
26 | ||
5eb513c3 | 27 | \ref driver_wrapper "Driver interface API" is defined in \ref driver.h and |
30c28971 JM |
28 | all hardware/driver dependent functionality is implemented in |
29 | driver_*.c. | |
30 | ||
31 | ||
7c4e9211 | 32 | \section _wpa_supplicant_core wpa_supplicant core functionality |
30c28971 | 33 | |
5eb513c3 | 34 | \ref wpa_supplicant.c |
30c28971 JM |
35 | Program initialization, main control loop |
36 | ||
5eb513c3 | 37 | \ref wpa_supplicant/main.c |
30c28971 JM |
38 | main() for UNIX-like operating systems and MinGW (Windows); this |
39 | uses command line arguments to configure wpa_supplicant | |
40 | ||
5eb513c3 JM |
41 | \ref events.c |
42 | Driver event processing; \ref wpa_supplicant_event() and related functions | |
30c28971 | 43 | |
5eb513c3 JM |
44 | \ref wpa_supplicant_i.h |
45 | Internal definitions for wpa_supplicant core; should not be | |
30c28971 JM |
46 | included into independent modules |
47 | ||
48 | ||
49 | \section generic_helper_func Generic helper functions | |
50 | ||
5eb513c3 | 51 | wpa_supplicant uses generic helper functions some of which are shared |
30c28971 JM |
52 | with with hostapd. The following C files are currently used: |
53 | ||
5eb513c3 | 54 | \ref eloop.c and \ref eloop.h |
30c28971 JM |
55 | Event loop (select() loop with registerable timeouts, socket read |
56 | callbacks, and signal callbacks) | |
57 | ||
5eb513c3 | 58 | \ref common.c and \ref common.h |
30c28971 JM |
59 | Common helper functions |
60 | ||
5eb513c3 | 61 | \ref defs.h |
30c28971 JM |
62 | Definitions shared by multiple files |
63 | ||
5eb513c3 | 64 | \ref l2_packet.h, \ref l2_packet_linux.c, and \ref l2_packet_pcap.c |
30c28971 JM |
65 | Layer 2 (link) access wrapper (includes native Linux implementation |
66 | and wrappers for libdnet/libpcap). A new l2_packet implementation | |
67 | may need to be added when porting to new operating systems that are | |
68 | not supported by libdnet/libpcap. Makefile can be used to select which | |
5eb513c3 JM |
69 | l2_packet implementation is included. \ref l2_packet_linux.c uses Linux |
70 | packet sockets and \ref l2_packet_pcap.c has a more portable version using | |
30c28971 JM |
71 | libpcap and libdnet. |
72 | ||
5eb513c3 | 73 | \ref pcsc_funcs.c and \ref pcsc_funcs.h |
30c28971 JM |
74 | Wrapper for PC/SC lite SIM and smart card readers |
75 | ||
5eb513c3 | 76 | \ref priv_netlink.h |
30c28971 JM |
77 | Private version of netlink definitions from Linux kernel header files; |
78 | this could be replaced with C library header file once suitable | |
79 | version becomes commonly available | |
80 | ||
5eb513c3 | 81 | \ref version.h |
30c28971 JM |
82 | Version number definitions |
83 | ||
30c28971 JM |
84 | |
85 | \section crypto_func Cryptographic functions | |
86 | ||
5eb513c3 | 87 | \ref md5.c and \ref md5.h |
30c28971 JM |
88 | MD5 (replaced with a crypto library if TLS support is included) |
89 | HMAC-MD5 (keyed checksum for message authenticity validation) | |
90 | ||
5eb513c3 | 91 | \ref rc4.c and \ref rc4.h |
30c28971 JM |
92 | RC4 (broadcast/default key encryption) |
93 | ||
5eb513c3 | 94 | \ref sha1.c and \ref sha1.h |
30c28971 JM |
95 | SHA-1 (replaced with a crypto library if TLS support is included) |
96 | HMAC-SHA-1 (keyed checksum for message authenticity validation) | |
97 | PRF-SHA-1 (pseudorandom (key/nonce generation) function) | |
98 | PBKDF2-SHA-1 (ASCII passphrase to shared secret) | |
99 | T-PRF (for EAP-FAST) | |
100 | TLS-PRF (RFC 2246) | |
101 | ||
5eb513c3 | 102 | \ref sha256.c and \ref sha256.h |
30c28971 JM |
103 | SHA-256 (replaced with a crypto library if TLS support is included) |
104 | ||
5eb513c3 | 105 | \ref aes-wrap.c, \ref aes_wrap.h, \ref aes.c |
30c28971 JM |
106 | AES (replaced with a crypto library if TLS support is included), |
107 | AES Key Wrap Algorithm with 128-bit KEK, RFC3394 (broadcast/default | |
108 | key encryption), | |
109 | One-Key CBC MAC (OMAC1) hash with AES-128, | |
110 | AES-128 CTR mode encryption, | |
111 | AES-128 EAX mode encryption/decryption, | |
112 | AES-128 CBC | |
113 | ||
5eb513c3 | 114 | \ref crypto.h |
30c28971 JM |
115 | Definition of crypto library wrapper |
116 | ||
5eb513c3 | 117 | \ref crypto_openssl.c |
30c28971 JM |
118 | Wrapper functions for libcrypto (OpenSSL) |
119 | ||
5eb513c3 | 120 | \ref crypto_internal.c |
30c28971 JM |
121 | Wrapper functions for internal crypto implementation |
122 | ||
5eb513c3 | 123 | \ref crypto_gnutls.c |
30c28971 JM |
124 | Wrapper functions for libgcrypt (used by GnuTLS) |
125 | ||
5eb513c3 | 126 | \ref ms_funcs.c and \ref ms_funcs.h |
30c28971 JM |
127 | Helper functions for MSCHAPV2 and LEAP |
128 | ||
5eb513c3 | 129 | \ref tls.h |
30c28971 JM |
130 | Definition of TLS library wrapper |
131 | ||
5eb513c3 | 132 | \ref tls_none.c |
30c28971 JM |
133 | Dummy implementation of TLS library wrapper for cases where TLS |
134 | functionality is not included. | |
135 | ||
5eb513c3 | 136 | \ref tls_openssl.c |
30c28971 JM |
137 | TLS library wrapper for openssl |
138 | ||
5eb513c3 | 139 | \ref tls_internal.c |
30c28971 JM |
140 | TLS library for internal TLS implementation |
141 | ||
5eb513c3 | 142 | \ref tls_gnutls.c |
30c28971 JM |
143 | TLS library wrapper for GnuTLS |
144 | ||
145 | ||
146 | \section tls_func TLS library | |
147 | ||
5eb513c3 | 148 | \ref asn1.c and \ref asn1.h |
30c28971 JM |
149 | ASN.1 DER parsing |
150 | ||
5eb513c3 | 151 | \ref bignum.c and \ref bignum.h |
30c28971 JM |
152 | Big number math |
153 | ||
5eb513c3 | 154 | \ref rsa.c and \ref rsa.h |
30c28971 JM |
155 | RSA |
156 | ||
5eb513c3 | 157 | \ref x509v3.c and \ref x509v3.h |
30c28971 JM |
158 | X.509v3 certificate parsing and processing |
159 | ||
5eb513c3 | 160 | \ref tlsv1_client.c, \ref tlsv1_client.h |
30c28971 JM |
161 | TLSv1 client (RFC 2246) |
162 | ||
5eb513c3 | 163 | \ref tlsv1_client_i.h |
30c28971 JM |
164 | Internal structures for TLSv1 client |
165 | ||
5eb513c3 | 166 | \ref tlsv1_client_read.c |
30c28971 JM |
167 | TLSv1 client: read handshake messages |
168 | ||
5eb513c3 | 169 | \ref tlsv1_client_write.c |
30c28971 JM |
170 | TLSv1 client: write handshake messages |
171 | ||
5eb513c3 | 172 | \ref tlsv1_common.c and \ref tlsv1_common.h |
30c28971 JM |
173 | Common TLSv1 routines and definitions |
174 | ||
5eb513c3 | 175 | \ref tlsv1_cred.c and \ref tlsv1_cred.h |
30c28971 JM |
176 | TLSv1 credentials |
177 | ||
5eb513c3 | 178 | \ref tlsv1_record.c and \ref tlsv1_record.h |
30c28971 JM |
179 | TLSv1 record protocol |
180 | ||
181 | ||
182 | \section configuration Configuration | |
183 | ||
5eb513c3 | 184 | \ref config_ssid.h |
30c28971 JM |
185 | Definition of per network configuration items |
186 | ||
5eb513c3 JM |
187 | \ref config.h |
188 | Definition of the wpa_supplicant configuration | |
30c28971 | 189 | |
5eb513c3 | 190 | \ref config.c |
30c28971 JM |
191 | Configuration parser and common functions |
192 | ||
5eb513c3 | 193 | \ref wpa_supplicant/config_file.c |
30c28971 JM |
194 | Configuration backend for text files (e.g., wpa_supplicant.conf) |
195 | ||
5eb513c3 | 196 | \ref config_winreg.c |
30c28971 JM |
197 | Configuration backend for Windows registry |
198 | ||
199 | ||
200 | \section ctrl_iface Control interface | |
201 | ||
5eb513c3 | 202 | wpa_supplicant has a \ref ctrl_iface_page "control interface" |
30c28971 JM |
203 | that can be used to get status |
204 | information and manage operations from external programs. An example | |
205 | command line interface (wpa_cli) and GUI (wpa_gui) for this interface | |
5eb513c3 | 206 | are included in the wpa_supplicant distribution. |
30c28971 | 207 | |
5eb513c3 JM |
208 | \ref wpa_supplicant/ctrl_iface.c and \ref wpa_supplicant/ctrl_iface.h |
209 | wpa_supplicant-side of the control interface | |
30c28971 | 210 | |
5eb513c3 | 211 | \ref ctrl_iface_unix.c |
30c28971 JM |
212 | UNIX domain sockets -based control interface backend |
213 | ||
5eb513c3 | 214 | \ref ctrl_iface_udp.c |
30c28971 JM |
215 | UDP sockets -based control interface backend |
216 | ||
5eb513c3 | 217 | \ref ctrl_iface_named_pipe.c |
30c28971 JM |
218 | Windows named pipes -based control interface backend |
219 | ||
5eb513c3 | 220 | \ref wpa_ctrl.c and \ref wpa_ctrl.h |
30c28971 | 221 | Library functions for external programs to provide access to the |
5eb513c3 | 222 | wpa_supplicant control interface |
30c28971 | 223 | |
5eb513c3 JM |
224 | \ref wpa_cli.c |
225 | Example program for using wpa_supplicant control interface | |
30c28971 JM |
226 | |
227 | ||
228 | \section wpa_code WPA supplicant | |
229 | ||
5eb513c3 | 230 | \ref wpa.c and \ref wpa.h |
30c28971 JM |
231 | WPA state machine and 4-Way/Group Key Handshake processing |
232 | ||
5eb513c3 | 233 | \ref preauth.c and \ref preauth.h |
30c28971 JM |
234 | PMKSA caching and pre-authentication (RSN/WPA2) |
235 | ||
5eb513c3 | 236 | \ref wpa_i.h |
30c28971 JM |
237 | Internal definitions for WPA code; not to be included to other modules. |
238 | ||
239 | \section eap_peer EAP peer | |
240 | ||
84a690ed | 241 | \ref eap_peer_module "EAP peer implementation" is a separate module that |
5eb513c3 | 242 | can be used by other programs than just wpa_supplicant. |
30c28971 | 243 | |
5eb513c3 | 244 | \ref eap.c and \ref eap.h |
30c28971 JM |
245 | EAP state machine and method interface |
246 | ||
5eb513c3 | 247 | \ref eap_defs.h |
30c28971 JM |
248 | Common EAP definitions |
249 | ||
5eb513c3 | 250 | \ref eap_i.h |
30c28971 JM |
251 | Internal definitions for EAP state machine and EAP methods; not to be |
252 | included in other modules | |
253 | ||
5eb513c3 | 254 | \ref eap_sim_common.c and \ref eap_sim_common.h |
30c28971 JM |
255 | Common code for EAP-SIM and EAP-AKA |
256 | ||
5eb513c3 | 257 | \ref eap_tls_common.c and \ref eap_tls_common.h |
30c28971 JM |
258 | Common code for EAP-PEAP, EAP-TTLS, and EAP-FAST |
259 | ||
5eb513c3 | 260 | \ref eap_ttls.c and \ref eap_ttls.h |
30c28971 JM |
261 | EAP-TTLS |
262 | ||
5eb513c3 | 263 | \ref eap_pax.c, \ref eap_pax_common.h, \ref eap_pax_common.c |
30c28971 JM |
264 | EAP-PAX |
265 | ||
5eb513c3 | 266 | \ref eap_psk.c, \ref eap_psk_common.h, \ref eap_psk_common.c |
30c28971 JM |
267 | EAP-PSK (note: this is not needed for WPA-PSK) |
268 | ||
5eb513c3 | 269 | \ref eap_sake.c, \ref eap_sake_common.h, \ref eap_sake_common.c |
30c28971 JM |
270 | EAP-SAKE |
271 | ||
5eb513c3 | 272 | \ref eap_gpsk.c, \ref eap_gpsk_common.h, \ref eap_gpsk_common.c |
30c28971 JM |
273 | EAP-GPSK |
274 | ||
5eb513c3 JM |
275 | \ref eap_aka.c, \ref eap_fast.c, \ref eap_gtc.c, \ref eap_leap.c, |
276 | \ref eap_md5.c, \ref eap_mschapv2.c, \ref eap_otp.c, \ref eap_peap.c, | |
277 | \ref eap_sim.c, \ref eap_tls.c | |
30c28971 JM |
278 | Other EAP method implementations |
279 | ||
280 | ||
281 | \section eapol_supp EAPOL supplicant | |
282 | ||
5eb513c3 | 283 | \ref eapol_supp_sm.c and \ref eapol_supp_sm.h |
30c28971 JM |
284 | EAPOL supplicant state machine and IEEE 802.1X processing |
285 | ||
286 | ||
287 | \section win_port Windows port | |
288 | ||
5eb513c3 | 289 | \ref ndis_events.c |
30c28971 | 290 | Code for receiving NdisMIndicateStatus() events and delivering them to |
5eb513c3 | 291 | wpa_supplicant \ref driver_ndis.c in more easier to use form |
30c28971 | 292 | |
5eb513c3 | 293 | \ref win_if_list.c |
30c28971 JM |
294 | External program for listing current network interface |
295 | ||
296 | ||
297 | \section test_programs Test programs | |
298 | ||
5eb513c3 | 299 | \ref radius_client.c and \ref radius_client.h |
30c28971 JM |
300 | RADIUS authentication client implementation for eapol_test |
301 | ||
5eb513c3 | 302 | \ref radius.c and \ref radius.h |
30c28971 JM |
303 | RADIUS message processing for eapol_test |
304 | ||
5eb513c3 | 305 | \ref eapol_test.c |
30c28971 JM |
306 | Standalone EAP testing tool with integrated RADIUS authentication |
307 | client | |
308 | ||
5eb513c3 | 309 | \ref preauth_test.c |
30c28971 JM |
310 | Standalone RSN pre-authentication tool |
311 | ||
5eb513c3 | 312 | \ref wpa_passphrase.c |
30c28971 JM |
313 | WPA ASCII passphrase to PSK conversion |
314 | ||
315 | */ |