code_structure.doxygen 8.4 KB

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