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