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