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 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" ]
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.
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.
26
\ref driver_wrapper "Driver interface API" is defined in driver.h and
27
all hardware/driver dependent functionality is implemented in
31
\section wpa_supplicant_core wpa_supplicant core functionality
34
Program initialization, main control loop
37
main() for UNIX-like operating systems and MinGW (Windows); this
38
uses command line arguments to configure wpa_supplicant
41
Driver event processing; wpa_supplicant_event() and related functions
44
Internal definitions for %wpa_supplicant core; should not be
45
included into independent modules
48
Definitions for driver event data and message logging
51
\section generic_helper_func Generic helper functions
53
%wpa_supplicant uses generic helper functions some of which are shared
54
with with hostapd. The following C files are currently used:
57
Event loop (select() loop with registerable timeouts, socket read
58
callbacks, and signal callbacks)
61
Common helper functions
64
Definitions shared by multiple files
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
75
pcsc_funcs.c and pcsc_funcs.h
76
Wrapper for PC/SC lite SIM and smart card readers
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
84
Version number definitions
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
92
\section crypto_func Cryptographic functions
95
MD5 (replaced with a crypto library if TLS support is included)
96
HMAC-MD5 (keyed checksum for message authenticity validation)
99
RC4 (broadcast/default key encryption)
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)
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
113
One-Key CBC MAC (OMAC1) hash with AES-128,
114
AES-128 CTR mode encryption,
115
AES-128 EAX mode encryption/decryption,
119
Definition of crypto library wrapper
122
Wrapper functions for libcrypto (OpenSSL)
125
Wrapper functions for libgcrypt (used by GnuTLS)
127
ms_funcs.c and ms_funcs.h
128
Helper functions for MSCHAPV2 and LEAP
131
Definition of TLS library wrapper
134
Dummy implementation of TLS library wrapper for cases where TLS
135
functionality is not included.
138
TLS library wrapper for openssl
141
TLS library wrapper for GnuTLS
144
\section configuration Configuration
147
Definition of per network configuration items
150
Definition of the %wpa_supplicant configuration
153
Configuration parser and common functions
156
Configuration backend for text files (e.g., wpa_supplicant.conf)
159
\section ctrl_iface Control interface
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.
167
ctrl_iface.c and ctrl_iface.h
168
%wpa_supplicant-side of the control interface
170
wpa_ctrl.c and wpa_ctrl.h
171
Library functions for external programs to provide access to the
172
%wpa_supplicant control interface
175
Example program for using %wpa_supplicant control interface
178
\section wpa_code WPA supplicant
181
WPA state machine and 4-Way/Group Key Handshake processing
183
preauth.c and preauth.h
184
PMKSA caching and pre-authentication (RSN/WPA2)
187
Internal definitions for WPA code; not to be included to other modules.
189
\section eap_peer EAP peer
191
\ref eap_module "EAP peer implementation" is a separate module that
192
can be used by other programs than just %wpa_supplicant.
195
EAP state machine and method interface
198
Common EAP definitions
201
Internal definitions for EAP state machine and EAP methods; not to be
202
included in other modules
204
eap_sim_common.c and eap_sim_common.h
205
Common code for EAP-SIM and EAP-AKA
207
eap_tls_common.c and eap_tls_common.h
208
Common code for EAP-PEAP, EAP-TTLS, and EAP-FAST
210
eap_tlv.c and eap_tlv.h
211
EAP-TLV code for EAP-PEAP and EAP-FAST
213
eap_ttls.c and eap_ttls.h
216
eap_pax.c, eap_pax_common.h, eap_pax_common.c
219
eap_psk.c, eap_psk_common.h, eap_psk_common.c
220
EAP-PSK (note: this is not needed for WPA-PSK)
222
eap_sake.c, eap_sake_common.h, eap_sake_common.c
225
eap_gpsk.c, eap_gpsk_common.h, eap_gpsk_common.c
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
233
\section eapol_supp EAPOL supplicant
235
eapol_sm.c and eapol_sm.h
236
EAPOL supplicant state machine and IEEE 802.1X processing
239
\section win_port Windows port
242
External program for receiving NdisMIndicateStatus() events and
243
delivering them to %wpa_supplicant in more easier to use form
246
External program for listing current network interface
249
\section test_programs Test programs
251
radius_client.c and radius_client.h
252
RADIUS authentication client implementation for eapol_test
254
radius.c and radius.h
255
RADIUS message processing for eapol_test
257
config_types.h and hostapd.h
258
Minimal version of hostapd header files for eapol_test
261
Standalone EAP testing tool with integrated RADIUS authentication
265
Standalone RSN pre-authentication tool
268
WPA ASCII passphrase to PSK conversion