code_structure.doxygen 8.8 KB

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