2 \page code_structure Structure of the source code
4 [ \ref _wpa_supplicant_core "wpa_supplicant core functionality" |
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" ]
16 wpa_supplicant implementation is divided into number of independent
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.
23 Both WPA and EAPOL/EAP state machines can be used separately in other
24 programs than wpa_supplicant. As an example, the included test
25 programs eapol_test and preauth_test are using these modules.
27 \ref driver_wrapper "Driver interface API" is defined in \ref driver.h and
28 all hardware/driver dependent functionality is implemented in
32 \section _wpa_supplicant_core wpa_supplicant core functionality
35 Program initialization, main control loop
37 \ref wpa_supplicant/main.c
38 main() for UNIX-like operating systems and MinGW (Windows); this
39 uses command line arguments to configure wpa_supplicant
42 Driver event processing; \ref wpa_supplicant_event() and related functions
44 \ref wpa_supplicant_i.h
45 Internal definitions for wpa_supplicant core; should not be
46 included into independent modules
49 \section generic_helper_func Generic helper functions
51 wpa_supplicant uses generic helper functions some of which are shared
52 with with hostapd. The following C files are currently used:
54 \ref eloop.c and \ref eloop.h
55 Event loop (select() loop with registerable timeouts, socket read
56 callbacks, and signal callbacks)
58 \ref common.c and \ref common.h
59 Common helper functions
62 Definitions shared by multiple files
64 \ref l2_packet.h, \ref l2_packet_linux.c, and \ref l2_packet_pcap.c
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
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
73 \ref pcsc_funcs.c and \ref pcsc_funcs.h
74 Wrapper for PC/SC lite SIM and smart card readers
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
82 Version number definitions
85 \section crypto_func Cryptographic functions
87 \ref md5.c and \ref md5.h
88 MD5 (replaced with a crypto library if TLS support is included)
89 HMAC-MD5 (keyed checksum for message authenticity validation)
91 \ref rc4.c and \ref rc4.h
92 RC4 (broadcast/default key encryption)
94 \ref sha1.c and \ref sha1.h
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)
102 \ref sha256.c and \ref sha256.h
103 SHA-256 (replaced with a crypto library if TLS support is included)
105 \ref aes-wrap.c, \ref aes_wrap.h, \ref aes.c
106 AES (replaced with a crypto library if TLS support is included),
107 AES Key Wrap Algorithm with 128-bit KEK, RFC3394 (broadcast/default
109 One-Key CBC MAC (OMAC1) hash with AES-128,
110 AES-128 CTR mode encryption,
111 AES-128 EAX mode encryption/decryption,
115 Definition of crypto library wrapper
117 \ref crypto_openssl.c
118 Wrapper functions for libcrypto (OpenSSL)
120 \ref crypto_internal.c
121 Wrapper functions for internal crypto implementation
124 Wrapper functions for libgcrypt (used by GnuTLS)
126 \ref ms_funcs.c and \ref ms_funcs.h
127 Helper functions for MSCHAPV2 and LEAP
130 Definition of TLS library wrapper
133 Dummy implementation of TLS library wrapper for cases where TLS
134 functionality is not included.
137 TLS library wrapper for openssl
140 TLS library for internal TLS implementation
143 TLS library wrapper for GnuTLS
146 \section tls_func TLS library
148 \ref asn1.c and \ref asn1.h
151 \ref bignum.c and \ref bignum.h
154 \ref rsa.c and \ref rsa.h
157 \ref x509v3.c and \ref x509v3.h
158 X.509v3 certificate parsing and processing
160 \ref tlsv1_client.c, \ref tlsv1_client.h
161 TLSv1 client (RFC 2246)
163 \ref tlsv1_client_i.h
164 Internal structures for TLSv1 client
166 \ref tlsv1_client_read.c
167 TLSv1 client: read handshake messages
169 \ref tlsv1_client_write.c
170 TLSv1 client: write handshake messages
172 \ref tlsv1_common.c and \ref tlsv1_common.h
173 Common TLSv1 routines and definitions
175 \ref tlsv1_cred.c and \ref tlsv1_cred.h
178 \ref tlsv1_record.c and \ref tlsv1_record.h
179 TLSv1 record protocol
182 \section configuration Configuration
185 Definition of per network configuration items
188 Definition of the wpa_supplicant configuration
191 Configuration parser and common functions
193 \ref wpa_supplicant/config_file.c
194 Configuration backend for text files (e.g., wpa_supplicant.conf)
197 Configuration backend for Windows registry
200 \section ctrl_iface Control interface
202 wpa_supplicant has a \ref ctrl_iface_page "control interface"
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
206 are included in the wpa_supplicant distribution.
208 \ref wpa_supplicant/ctrl_iface.c and \ref wpa_supplicant/ctrl_iface.h
209 wpa_supplicant-side of the control interface
211 \ref ctrl_iface_unix.c
212 UNIX domain sockets -based control interface backend
214 \ref ctrl_iface_udp.c
215 UDP sockets -based control interface backend
217 \ref ctrl_iface_named_pipe.c
218 Windows named pipes -based control interface backend
220 \ref wpa_ctrl.c and \ref wpa_ctrl.h
221 Library functions for external programs to provide access to the
222 wpa_supplicant control interface
225 Example program for using wpa_supplicant control interface
228 \section wpa_code WPA supplicant
230 \ref wpa.c and \ref wpa.h
231 WPA state machine and 4-Way/Group Key Handshake processing
233 \ref preauth.c and \ref preauth.h
234 PMKSA caching and pre-authentication (RSN/WPA2)
237 Internal definitions for WPA code; not to be included to other modules.
239 \section eap_peer EAP peer
241 \ref eap_peer_module "EAP peer implementation" is a separate module that
242 can be used by other programs than just wpa_supplicant.
244 \ref eap.c and \ref eap.h
245 EAP state machine and method interface
248 Common EAP definitions
251 Internal definitions for EAP state machine and EAP methods; not to be
252 included in other modules
254 \ref eap_sim_common.c and \ref eap_sim_common.h
255 Common code for EAP-SIM and EAP-AKA
257 \ref eap_tls_common.c and \ref eap_tls_common.h
258 Common code for EAP-PEAP, EAP-TTLS, and EAP-FAST
260 \ref eap_ttls.c and \ref eap_ttls.h
263 \ref eap_pax.c, \ref eap_pax_common.h, \ref eap_pax_common.c
266 \ref eap_psk.c, \ref eap_psk_common.h, \ref eap_psk_common.c
267 EAP-PSK (note: this is not needed for WPA-PSK)
269 \ref eap_sake.c, \ref eap_sake_common.h, \ref eap_sake_common.c
272 \ref eap_gpsk.c, \ref eap_gpsk_common.h, \ref eap_gpsk_common.c
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
278 Other EAP method implementations
281 \section eapol_supp EAPOL supplicant
283 \ref eapol_supp_sm.c and \ref eapol_supp_sm.h
284 EAPOL supplicant state machine and IEEE 802.1X processing
287 \section win_port Windows port
290 Code for receiving NdisMIndicateStatus() events and delivering them to
291 wpa_supplicant \ref driver_ndis.c in more easier to use form
294 External program for listing current network interface
297 \section test_programs Test programs
299 \ref radius_client.c and \ref radius_client.h
300 RADIUS authentication client implementation for eapol_test
302 \ref radius.c and \ref radius.h
303 RADIUS message processing for eapol_test
306 Standalone EAP testing tool with integrated RADIUS authentication
310 Standalone RSN pre-authentication tool
312 \ref wpa_passphrase.c
313 WPA ASCII passphrase to PSK conversion