3 @@ -28,6 +28,7 @@ CFLAGS += -I$(abspath ../src/utils)
4 export BINDIR ?= /usr/local/bin/
7 +-include $(if $(MULTICALL), ../wpa_supplicant/.config)
9 ifndef CONFIG_NO_GITVER
10 # Add VERSION_STR postfix for builds from a git repository
11 @@ -315,10 +316,14 @@ CFLAGS += -DCONFIG_MBO
12 OBJS += ../src/ap/mbo_ap.o
16 +CFLAGS += -DNO_SUPPLICANT
19 include ../src/drivers/drivers.mak
20 -OBJS += $(DRV_AP_OBJS)
21 -CFLAGS += $(DRV_AP_CFLAGS)
22 -LDFLAGS += $(DRV_AP_LDFLAGS)
23 +OBJS += $(sort $(DRV_AP_OBJS) $(if $(MULTICALL),$(DRV_WPA_OBJS)))
24 +CFLAGS += $(DRV_AP_CFLAGS) $(if $(MULTICALL),$(DRV_WPA_CFLAGS))
25 +LDFLAGS += $(DRV_AP_LDFLAGS) $(if $(MULTICALL),$(DRV_WPA_LDFLAGS))
26 LIBS += $(DRV_AP_LIBS)
28 ifdef CONFIG_L2_PACKET
29 @@ -1051,6 +1056,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR)
31 BCHECK=../src/drivers/build.hostapd
33 +hostapd_multi.a: $(BCHECK) $(OBJS)
34 + $(Q)$(CC) -c -o hostapd_multi.o -Dmain=hostapd_main $(CFLAGS) main.c
37 + @$(AR) cr $@ hostapd_multi.o $(OBJS)
39 hostapd: $(BCHECK) $(OBJS)
40 $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
42 @@ -1092,6 +1103,12 @@ HOBJS += ../src/crypto/aes-internal.o
43 HOBJS += ../src/crypto/aes-internal-enc.o
47 + @echo -n $(CFLAGS) " "
50 + @echo -n $(LDFLAGS) $(LIBS) $(EXTRALIBS) " "
52 nt_password_hash: $(NOBJS)
53 $(Q)$(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n)
55 --- a/wpa_supplicant/Makefile
56 +++ b/wpa_supplicant/Makefile
57 @@ -27,6 +27,7 @@ CFLAGS += -I$(abspath ../src)
58 CFLAGS += -I$(abspath ../src/utils)
61 +-include $(if $(MULTICALL),../hostapd/.config)
63 ifndef CONFIG_NO_GITVER
64 # Add VERSION_STR postfix for builds from a git repository
65 @@ -803,6 +804,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
66 CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
67 LIBS += -ldl -rdynamic
71 + OBJS += ../src/eap_common/eap_common.o
76 @@ -823,9 +828,11 @@ NEED_EAP_COMMON=y
77 NEED_RSN_AUTHENTICATOR=y
81 CFLAGS += -DCONFIG_NO_RADIUS
82 CFLAGS += -DCONFIG_NO_ACCOUNTING
83 CFLAGS += -DCONFIG_NO_VLAN
85 OBJS += ../src/ap/hostapd.o
86 OBJS += ../src/ap/wpa_auth_glue.o
87 OBJS += ../src/ap/utils.o
88 @@ -898,10 +905,18 @@ endif
90 OBJS += ../src/ap/hs20.o
94 + OBJS += ../src/eap_server/eap_server.o
95 + OBJS += ../src/eap_server/eap_server_identity.o
96 + OBJS += ../src/eap_server/eap_server_methods.o
100 ifdef NEED_RSN_AUTHENTICATOR
102 CFLAGS += -DCONFIG_NO_RADIUS
105 OBJS += ../src/ap/wpa_auth.o
106 OBJS += ../src/ap/wpa_auth_ie.o
107 @@ -1680,6 +1695,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
109 $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config
111 +wpa_supplicant_multi.a: .config $(BCHECK) $(OBJS) $(EXTRA_progs)
112 + $(Q)$(CC) -c -o wpa_supplicant_multi.o -Dmain=wpa_supplicant_main $(CFLAGS) main.c
115 + @$(AR) cr $@ wpa_supplicant_multi.o $(OBJS)
117 wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
118 $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
120 @@ -1782,6 +1803,12 @@ endif
121 -e 's|\@DBUS_INTERFACE\@|$(DBUS_INTERFACE)|g' $< >$@
125 + @echo -n $(CFLAGS) " "
128 + @echo -n $(LDFLAGS) $(LIBS) $(EXTRALIBS) " "
130 wpa_supplicant.exe: wpa_supplicant
133 --- a/src/drivers/driver.h
134 +++ b/src/drivers/driver.h
135 @@ -4775,8 +4775,8 @@ union wpa_event_data {
136 * Driver wrapper code should call this function whenever an event is received
139 -void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
140 - union wpa_event_data *data);
141 +extern void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
142 + union wpa_event_data *data);
145 * wpa_supplicant_event_global - Report a driver event for wpa_supplicant
146 @@ -4788,7 +4788,7 @@ void wpa_supplicant_event(void *ctx, enu
147 * Same as wpa_supplicant_event(), but we search for the interface in
150 -void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
151 +extern void (*wpa_supplicant_event_global)(void *ctx, enum wpa_event_type event,
152 union wpa_event_data *data);
155 --- a/src/ap/drv_callbacks.c
156 +++ b/src/ap/drv_callbacks.c
157 @@ -1144,8 +1144,8 @@ static void hostapd_event_dfs_cac_starte
158 #endif /* NEED_AP_MLME */
161 -void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
162 - union wpa_event_data *data)
163 +void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
164 + union wpa_event_data *data)
166 struct hostapd_data *hapd = ctx;
167 #ifndef CONFIG_NO_STDOUT_DEBUG
168 @@ -1354,7 +1354,7 @@ void wpa_supplicant_event(void *ctx, enu
172 -void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
173 +void hostapd_wpa_event_global(void *ctx, enum wpa_event_type event,
174 union wpa_event_data *data)
176 struct hapd_interfaces *interfaces = ctx;
177 --- a/wpa_supplicant/wpa_priv.c
178 +++ b/wpa_supplicant/wpa_priv.c
179 @@ -940,8 +940,8 @@ static void wpa_priv_send_ft_response(st
183 -void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
184 - union wpa_event_data *data)
185 +static void supplicant_event(void *ctx, enum wpa_event_type event,
186 + union wpa_event_data *data)
188 struct wpa_priv_interface *iface = ctx;
190 @@ -1010,7 +1010,7 @@ void wpa_supplicant_event(void *ctx, enu
194 -void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
195 +void supplicant_event_global(void *ctx, enum wpa_event_type event,
196 union wpa_event_data *data)
198 struct wpa_priv_global *global = ctx;
199 @@ -1122,6 +1122,8 @@ int main(int argc, char *argv[])
200 if (os_program_init())
203 + wpa_supplicant_event = supplicant_event;
204 + wpa_supplicant_event_global = supplicant_event_global;
205 wpa_priv_fd_workaround();
207 os_memset(&global, 0, sizeof(global));
208 --- a/wpa_supplicant/events.c
209 +++ b/wpa_supplicant/events.c
210 @@ -3375,8 +3375,8 @@ static void wpa_supplicant_event_assoc_a
214 -void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
215 - union wpa_event_data *data)
216 +void supplicant_event(void *ctx, enum wpa_event_type event,
217 + union wpa_event_data *data)
219 struct wpa_supplicant *wpa_s = ctx;
221 @@ -4037,7 +4037,7 @@ void wpa_supplicant_event(void *ctx, enu
222 #endif /* CONFIG_AP */
224 case EVENT_ACS_CHANNEL_SELECTED:
226 +#if defined(CONFIG_ACS) && defined(CONFIG_AP)
227 if (!wpa_s->ap_iface)
229 hostapd_acs_channel_selected(wpa_s->ap_iface->bss[0],
230 @@ -4051,7 +4051,7 @@ void wpa_supplicant_event(void *ctx, enu
234 -void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
235 +void supplicant_event_global(void *ctx, enum wpa_event_type event,
236 union wpa_event_data *data)
238 struct wpa_supplicant *wpa_s;
239 --- a/wpa_supplicant/wpa_supplicant.c
240 +++ b/wpa_supplicant/wpa_supplicant.c
241 @@ -4967,7 +4967,6 @@ struct wpa_interface * wpa_supplicant_ma
247 * wpa_supplicant_match_existing - Match existing interfaces
248 * @global: Pointer to global data from wpa_supplicant_init()
249 @@ -5004,6 +5003,11 @@ static int wpa_supplicant_match_existing
251 #endif /* CONFIG_MATCH_IFACE */
253 +extern void supplicant_event(void *ctx, enum wpa_event_type event,
254 + union wpa_event_data *data);
256 +extern void supplicant_event_global(void *ctx, enum wpa_event_type event,
257 + union wpa_event_data *data);
260 * wpa_supplicant_add_iface - Add a new network interface
261 @@ -5259,6 +5263,8 @@ struct wpa_global * wpa_supplicant_init(
262 #ifndef CONFIG_NO_WPA_MSG
263 wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
264 #endif /* CONFIG_NO_WPA_MSG */
265 + wpa_supplicant_event = supplicant_event;
266 + wpa_supplicant_event_global = supplicant_event_global;
268 if (params->wpa_debug_file_path)
269 wpa_debug_open_file(params->wpa_debug_file_path);
272 @@ -526,6 +526,11 @@ static int hostapd_get_ctrl_iface_group(
276 +void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
277 + union wpa_event_data *data);
279 +void hostapd_wpa_event_global(void *ctx, enum wpa_event_type event,
280 + union wpa_event_data *data);
283 static int gen_uuid(const char *txt_addr)
284 @@ -601,6 +606,8 @@ int main(int argc, char *argv[])
285 interfaces.global_ctrl_sock = -1;
286 dl_list_init(&interfaces.global_ctrl_dst);
288 + wpa_supplicant_event = hostapd_wpa_event;
289 + wpa_supplicant_event_global = hostapd_wpa_event_global;
291 c = getopt(argc, argv, "b:Bde:f:hKP:STtu:vg:G:");
293 --- a/src/drivers/drivers.c
294 +++ b/src/drivers/drivers.c
296 #include "utils/common.h"
299 +void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
300 + union wpa_event_data *data);
301 +void (*wpa_supplicant_event_global)(void *ctx, enum wpa_event_type event,
302 + union wpa_event_data *data);
304 #ifdef CONFIG_DRIVER_WEXT
305 extern struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
306 #endif /* CONFIG_DRIVER_WEXT */
307 --- a/wpa_supplicant/eapol_test.c
308 +++ b/wpa_supplicant/eapol_test.c
310 #include "ctrl_iface.h"
311 #include "pcsc_funcs.h"
312 #include "wpas_glue.h"
313 +#include "drivers/driver.h"
315 +void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
316 + union wpa_event_data *data);
317 +void (*wpa_supplicant_event_global)(void *ctx, enum wpa_event_type event,
318 + union wpa_event_data *data);
320 const struct wpa_driver_ops *const wpa_drivers[] = { NULL };
322 @@ -1295,6 +1300,10 @@ static void usage(void)
323 "option several times.\n");
326 +extern void supplicant_event(void *ctx, enum wpa_event_type event,
327 + union wpa_event_data *data);
328 +extern void supplicant_event_global(void *ctx, enum wpa_event_type event,
329 + union wpa_event_data *data);
331 int main(int argc, char *argv[])
333 @@ -1315,6 +1324,8 @@ int main(int argc, char *argv[])
334 if (os_program_init())
337 + wpa_supplicant_event = supplicant_event;
338 + wpa_supplicant_event_global = supplicant_event_global;
339 hostapd_logger_register_cb(hostapd_logger_cb);
341 os_memset(&eapol_test, 0, sizeof(eapol_test));