📄 code_structure.doxygen
字号:
/**\page code_structure Structure of the source code[ \ref wpa_supplicant_core "wpa_supplicant core functionality" |\ref generic_helper_func "Generic helper functions" |\ref crypto_func "Cryptographic functions" |\ref configuration "Configuration" |\ref ctrl_iface "Control interface" |\ref wpa_code "WPA supplicant" |\ref eap_peer "EAP peer" |\ref eapol_supp "EAPOL supplicant" |\ref win_port "Windows port" |\ref test_programs "Test programs" ]%wpa_supplicant implementation is divided into number of independentmodules. Core code includes functionality for controlling the networkselection, association, and configuration. Independent modules includeWPA code (key handshake, PMKSA caching, pre-authentication), EAPOLstate machine, and EAP state machine and methods. In addition, thereare number of separate files for generic helper functions.Both WPA and EAPOL/EAP state machines can be used separately in otherprograms than %wpa_supplicant. As an example, the included testprograms eapol_test and preauth_test are using these modules.\ref driver_wrapper "Driver interface API" is defined in driver.h andall hardware/driver dependent functionality is implemented indriver_*.c.\section wpa_supplicant_core wpa_supplicant core functionalitywpa_supplicant.c Program initialization, main control loopmain.c main() for UNIX-like operating systems and MinGW (Windows); this uses command line arguments to configure wpa_supplicantevents.c Driver event processing; wpa_supplicant_event() and related functionswpa_supplicant_i.h Internal definitions for %wpa_supplicant core; should not be included into independent moduleswpa_supplicant.h Definitions for driver event data and message logging\section generic_helper_func Generic helper functions%wpa_supplicant uses generic helper functions some of which are sharedwith with hostapd. The following C files are currently used:eloop.c and eloop.h Event loop (select() loop with registerable timeouts, socket read callbacks, and signal callbacks)common.c and common.h Common helper functionsdefs.h Definitions shared by multiple filesl2_packet.h, l2_packet_linux.c, and l2_packet_pcap.c Layer 2 (link) access wrapper (includes native Linux implementation and wrappers for libdnet/libpcap). A new l2_packet implementation may need to be added when porting to new operating systems that are not supported by libdnet/libpcap. Makefile can be used to select which l2_packet implementation is included. l2_packet_linux.c uses Linux packet sockets and l2_packet_pcap.c has a more portable version using libpcap and libdnet.pcsc_funcs.c and pcsc_funcs.h Wrapper for PC/SC lite SIM and smart card readerspriv_netlink.h Private version of netlink definitions from Linux kernel header files; this could be replaced with C library header file once suitable version becomes commonly availableversion.h Version number definitionswireless_copy.h Private version of Linux wireless extensions definitions from kernel header files; this could be replaced with C library header file once suitable version becomes commonly available\section crypto_func Cryptographic functionsmd5.c and md5.h MD5 (replaced with a crypto library if TLS support is included) HMAC-MD5 (keyed checksum for message authenticity validation)rc4.c and rc4.h RC4 (broadcast/default key encryption)sha1.c and sha1.h SHA-1 (replaced with a crypto library if TLS support is included) HMAC-SHA-1 (keyed checksum for message authenticity validation) PRF-SHA-1 (pseudorandom (key/nonce generation) function) PBKDF2-SHA-1 (ASCII passphrase to shared secret) T-PRF (for EAP-FAST) TLS-PRF (RFC 2246)aes_wrap.c, aes_wrap.h, aes.c AES (replaced with a crypto library if TLS support is included), AES Key Wrap Algorithm with 128-bit KEK, RFC3394 (broadcast/default key encryption), One-Key CBC MAC (OMAC1) hash with AES-128, AES-128 CTR mode encryption, AES-128 EAX mode encryption/decryption, AES-128 CBCcrypto.h Definition of crypto library wrappercrypto.c Wrapper functions for libcrypto (OpenSSL)crypto_gnutls.c Wrapper functions for libgcrypt (used by GnuTLS)ms_funcs.c and ms_funcs.h Helper functions for MSCHAPV2 and LEAPtls.h Definition of TLS library wrappertls_none.c Dummy implementation of TLS library wrapper for cases where TLS functionality is not included.tls_openssl.c TLS library wrapper for openssltls_gnutls.c TLS library wrapper for GnuTLS\section configuration Configurationconfig_ssid.h Definition of per network configuration itemsconfig.h Definition of the %wpa_supplicant configurationconfig.c Configuration parser and common functionsconfig_file.c Configuration backend for text files (e.g., wpa_supplicant.conf)\section ctrl_iface Control interface%wpa_supplicant has a \ref ctrl_iface_page "control interface"that can be used to get statusinformation and manage operations from external programs. An examplecommand line interface (wpa_cli) and GUI (wpa_gui) for this interfaceare included in the %wpa_supplicant distribution.ctrl_iface.c and ctrl_iface.h %wpa_supplicant-side of the control interfacewpa_ctrl.c and wpa_ctrl.h Library functions for external programs to provide access to the %wpa_supplicant control interfacewpa_cli.c Example program for using %wpa_supplicant control interface\section wpa_code WPA supplicantwpa.c and wpa.h WPA state machine and 4-Way/Group Key Handshake processingpreauth.c and preauth.h PMKSA caching and pre-authentication (RSN/WPA2)wpa_i.h Internal definitions for WPA code; not to be included to other modules.\section eap_peer EAP peer\ref eap_module "EAP peer implementation" is a separate module thatcan be used by other programs than just %wpa_supplicant.eap.c and eap.h EAP state machine and method interfaceeap_defs.h Common EAP definitionseap_i.h Internal definitions for EAP state machine and EAP methods; not to be included in other moduleseap_sim_common.c and eap_sim_common.h Common code for EAP-SIM and EAP-AKAeap_tls_common.c and eap_tls_common.h Common code for EAP-PEAP, EAP-TTLS, and EAP-FASTeap_tlv.c and eap_tlv.h EAP-TLV code for EAP-PEAP and EAP-FASTeap_ttls.c and eap_ttls.h EAP-TTLSeap_pax.c, eap_pax_common.h, eap_pax_common.c EAP-PAXeap_psk.c, eap_psk_common.h, eap_psk_common.c EAP-PSK (note: this is not needed for WPA-PSK)eap_aka.c, eap_fast.c, eap_gtc.c, eap_leap.c, eap_md5.c, eap_mschapv2.c,eap_otp.c, eap_peap.c, eap_sim.c, eap_tls.c Other EAP method implementations\section eapol_supp EAPOL supplicanteapol_sm.c and eapol_sm.h EAPOL supplicant state machine and IEEE 802.1X processing\section win_port Windows portndis_events.cpp External program for receiving NdisMIndicateStatus() events and delivering them to %wpa_supplicant in more easier to use formwin_if_list.c External program for listing current network interface\section test_programs Test programsradius_client.c and radius_client.h RADIUS authentication client implementation for eapol_testradius.c and radius.h RADIUS message processing for eapol_testconfig_types.h and hostapd.h Minimal version of hostapd header files for eapol_testeapol_test.c Standalone EAP testing tool with integrated RADIUS authentication clientpreauth_test.c Standalone RSN pre-authentication toolwpa_passphrase.c WPA ASCII passphrase to PSK conversion*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -