Merge from vendor branch OPENSSL:
[dragonfly.git] / contrib / hostapd-0.4.9 / developer.txt
1 Developer notes for hostapd
2 ===========================
3
4 hostapd daemon setup, operations, and shutdown
5 ----------------------------------------------
6
7 Files: hostapd.[ch]
8
9 Externally called functions:
10   hostapd_new_assoc_sta() is called when a station associates with the AP
11
12 Event loop functions:
13   handle_term() is called on SIGINT and SIGTERM to terminate hostapd process
14   handle_reload() is called on SIGHUP to reload configuration
15   handle_dump_state() is called on SIGUSR1 to dump station state data to a
16         text file
17   hostapd_rotate_wep() is called to periodically change WEP keys
18
19
20 Configuration parsing
21 ---------------------
22
23 Configuration file parsing and data structure definition.
24
25 Files: config.[ch]
26
27 Externally called functions:
28   hostapd_config_read() is called to read and parse a configuration file;
29         allocates and returns configuration data structure
30   hostapd_config_free() is called to free configuration data structure
31   hostapd_maclist_found() is called to check whether a given address is found
32         in a list of MAC addresses
33
34
35 Kernel driver access
36 --------------------
37
38 Helper functions for configuring the Host AP kernel driver and
39 accessing data from it.
40
41 Files: driver.[ch]
42
43
44 IEEE 802.11 frame handling (netdevice wlan#ap)
45 ----------------------------------------------
46
47 Receive all incoming IEEE 802.11 frames from the kernel driver via
48 wlan#ap interface.
49
50 Files: receive.c
51
52 Externally called functions:
53   hostapd_init_sockets() is called to initialize sockets for receiving and
54         sending IEEE 802.11 frames via wlan#ap interface
55
56 Event loop functions:
57   handle_read() is called for each incoming packet from wlan#ap net device
58
59
60 Station table
61 -------------
62
63 Files: sta_info.[ch], ap.h
64
65 Event loop functions:
66   ap_handle_timer() is called to check station activity and to remove
67         inactive stations
68
69
70 IEEE 802.11 management
71 ----------------------
72
73 IEEE 802.11 management frame sending and processing (mainly,
74 authentication and association). IEEE 802.11 station functionality
75 (authenticate and associate with another AP as an station).
76
77 Files: ieee802_11.[ch]
78
79 Externally called functions:
80   ieee802_11_mgmt() is called for each received IEEE 802.11 management frame
81         (from handle_frame() in hostapd.c)
82   ieee802_11_mgmt_cb() is called for each received TX callback of IEEE 802.11
83         management frame (from handle_tx_callback() in hostapd.c)
84   ieee802_11_send_deauth() is called to send deauthentication frame
85   ieee802_11_send_disassoc() is called to send disassociation frame
86   ieee802_11_parse_elems() is used to parse information elements in
87         IEEE 802.11 management frames
88
89 Event loop functions:
90   ieee802_11_sta_authenticate() called to retry authentication (with another
91         AP)
92   ieee802_11_sta_associate() called to retry association (with another AP)
93
94
95 IEEE 802.11 authentication
96 --------------------------
97
98 Access control list for IEEE 802.11 authentication. Uses staticly
99 configured ACL from configuration files or an external RADIUS
100 server. Results from external RADIUS queries are cached to allow
101 faster authentication frame processing.
102
103 Files: ieee802_11_auth.[ch]
104
105 Externally called functions:
106   hostapd_acl_init() called once during hostapd startup
107   hostapd_acl_deinit() called once during hostapd shutdown
108   hostapd_acl_recv_radius() called by IEEE 802.1X code for incoming RADIUS
109         Authentication messages (returns 0 if message was processed)
110   hostapd_allowed_address() called to check whether a specified station can be
111         authenticated
112
113 Event loop functions:
114   hostapd_acl_expire() is called to expire ACL cache entries
115
116
117 IEEE 802.1X Authenticator
118 -------------------------
119
120 Files: ieee802_1x.[ch]
121
122
123 Externally called functions:
124   ieee802_1x_receive() is called for each incoming EAPOL frame from the
125         wireless interface
126   ieee802_1x_new_station() is called to start IEEE 802.1X authentication when
127         a new station completes IEEE 802.11 association
128
129 Event loop functions:
130   ieee802_1x_receive_auth() called for each incoming RADIUS Authentication
131         message
132
133
134 EAPOL state machine
135 -------------------
136
137 IEEE 802.1X state machine for EAPOL.
138
139 Files: eapol_sm.[ch]
140
141 Externally called functions:
142   eapol_sm_step() is called to advance EAPOL state machines after any change
143         that could affect their state
144
145 Event loop functions:
146   eapol_port_timers_tick() called once per second to advance Port Timers state
147         machine
148
149
150 IEEE 802.11f (IAPP)
151 -------------------
152
153 Files: iapp.[ch]
154
155 Externally called functions:
156   iapp_new_station() is called to start accounting session when a new station
157         completes IEEE 802.11 association or IEEE 802.1X authentication
158
159 Event loop functions:
160   iapp_receive_udp() is called for incoming IAPP frames over UDP
161
162
163 Per station accounting
164 ----------------------
165
166 Send RADIUS Accounting start and stop messages to a RADIUS Accounting
167 server. Process incoming RADIUS Accounting messages.
168
169 Files: accounting.[ch]
170
171 Externally called functions:
172   accounting_init() called once during hostapd startup
173   accounting_deinit() called once during hostapd shutdown
174   accounting_sta_start() called when a station starts new session
175   accounting_sta_stop() called when a station session is terminated
176
177 Event loop functions:
178   accounting_receive() called for each incoming RADIUS Accounting message
179   accounting_list_timer() called to retransmit accounting messages and to
180         remove expired entries
181
182
183 RADIUS messages
184 ---------------
185
186 RADIUS message generation and parsing functions.
187
188 Files: radius.[ch]
189
190
191 Event loop
192 ----------
193
194 Event loop for registering timeout calls, signal handlers, and socket
195 read events.
196
197 Files: eloop.[ch]
198
199
200 RC4
201 ---
202
203 RC4 encryption
204
205 Files: rc4.[ch]
206
207
208 MD5
209 ---
210
211 MD5 hash and HMAC-MD5.
212
213 Files: md5.[ch]
214
215
216 Miscellaneous helper functions
217 ------------------------------
218
219 Files: common.[ch]