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 @@ -198,7 +199,8 @@ endif
14 CFLAGS += -DCONFIG_NO_VLAN
17 +ifneq ($(findstring CONFIG_NO_VLAN,$(CFLAGS)), CONFIG_NO_VLAN)
18 OBJS += ../src/ap/vlan_init.o
19 OBJS += ../src/ap/vlan_ifconfig.o
20 OBJS += ../src/ap/vlan.o
21 @@ -354,10 +356,14 @@ CFLAGS += -DCONFIG_MBO
22 OBJS += ../src/ap/mbo_ap.o
26 +CFLAGS += -DNO_SUPPLICANT
29 include ../src/drivers/drivers.mak
30 -OBJS += $(DRV_AP_OBJS)
31 -CFLAGS += $(DRV_AP_CFLAGS)
32 -LDFLAGS += $(DRV_AP_LDFLAGS)
33 +OBJS += $(sort $(DRV_AP_OBJS) $(if $(MULTICALL),$(DRV_WPA_OBJS)))
34 +CFLAGS += $(DRV_AP_CFLAGS) $(if $(MULTICALL),$(DRV_WPA_CFLAGS))
35 +LDFLAGS += $(DRV_AP_LDFLAGS) $(if $(MULTICALL),$(DRV_WPA_LDFLAGS))
36 LIBS += $(DRV_AP_LIBS)
38 ifdef CONFIG_L2_PACKET
39 @@ -1204,6 +1210,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR)
41 BCHECK=../src/drivers/build.hostapd
43 +hostapd_multi.a: $(BCHECK) $(OBJS)
44 + $(Q)$(CC) -c -o hostapd_multi.o -Dmain=hostapd_main $(CFLAGS) main.c
47 + @$(AR) cr $@ hostapd_multi.o $(OBJS)
49 hostapd: $(BCHECK) $(OBJS)
50 $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
52 @@ -1248,6 +1260,12 @@ ifeq ($(CONFIG_TLS), linux)
53 HOBJS += ../src/crypto/crypto_linux.o
57 + @printf "%s " "$(CFLAGS)"
60 + @printf "%s " "$(LDFLAGS) $(LIBS) $(EXTRALIBS)"
62 nt_password_hash: $(NOBJS)
63 $(Q)$(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n)
65 --- a/wpa_supplicant/Makefile
66 +++ b/wpa_supplicant/Makefile
67 @@ -27,6 +27,7 @@ CFLAGS += -I$(abspath ../src)
68 CFLAGS += -I$(abspath ../src/utils)
71 +-include $(if $(MULTICALL),../hostapd/.config)
73 ifndef CONFIG_NO_GITVER
74 # Add VERSION_STR postfix for builds from a git repository
75 @@ -357,7 +358,9 @@ endif
77 NEED_RSN_AUTHENTICATOR=y
78 CFLAGS += -DCONFIG_IBSS_RSN
80 CFLAGS += -DCONFIG_NO_VLAN
85 @@ -861,6 +864,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
86 CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
87 LIBS += -ldl -rdynamic
91 + OBJS += ../src/eap_common/eap_common.o
96 @@ -868,9 +875,11 @@ NEED_EAP_COMMON=y
97 NEED_RSN_AUTHENTICATOR=y
101 CFLAGS += -DCONFIG_NO_RADIUS
102 CFLAGS += -DCONFIG_NO_ACCOUNTING
103 CFLAGS += -DCONFIG_NO_VLAN
105 OBJS += ../src/ap/hostapd.o
106 OBJS += ../src/ap/wpa_auth_glue.o
107 OBJS += ../src/ap/utils.o
108 @@ -952,6 +961,12 @@ endif
110 OBJS += ../src/ap/hs20.o
114 + OBJS += ../src/eap_server/eap_server.o
115 + OBJS += ../src/eap_server/eap_server_identity.o
116 + OBJS += ../src/eap_server/eap_server_methods.o
121 @@ -960,7 +975,9 @@ CFLAGS += -DCONFIG_MBO
124 ifdef NEED_RSN_AUTHENTICATOR
126 CFLAGS += -DCONFIG_NO_RADIUS
129 OBJS += ../src/ap/wpa_auth.o
130 OBJS += ../src/ap/wpa_auth_ie.o
131 @@ -1835,6 +1852,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
133 $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config
135 +wpa_supplicant_multi.a: .config $(BCHECK) $(OBJS) $(EXTRA_progs)
136 + $(Q)$(CC) -c -o wpa_supplicant_multi.o -Dmain=wpa_supplicant_main $(CFLAGS) main.c
139 + @$(AR) cr $@ wpa_supplicant_multi.o $(OBJS)
141 wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
142 $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
144 @@ -1937,6 +1960,12 @@ endif
145 -e 's|\@DBUS_INTERFACE\@|$(DBUS_INTERFACE)|g' $< >$@
149 + @printf "%s " "$(CFLAGS)"
152 + @printf "%s " "$(LDFLAGS) $(LIBS) $(EXTRALIBS)"
154 wpa_supplicant.exe: wpa_supplicant
157 --- a/src/drivers/driver.h
158 +++ b/src/drivers/driver.h
159 @@ -5317,8 +5317,8 @@ union wpa_event_data {
160 * Driver wrapper code should call this function whenever an event is received
163 -void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
164 - union wpa_event_data *data);
165 +extern void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
166 + union wpa_event_data *data);
169 * wpa_supplicant_event_global - Report a driver event for wpa_supplicant
170 @@ -5330,7 +5330,7 @@ void wpa_supplicant_event(void *ctx, enu
171 * Same as wpa_supplicant_event(), but we search for the interface in
174 -void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
175 +extern void (*wpa_supplicant_event_global)(void *ctx, enum wpa_event_type event,
176 union wpa_event_data *data);
179 --- a/src/ap/drv_callbacks.c
180 +++ b/src/ap/drv_callbacks.c
181 @@ -1375,8 +1375,8 @@ static void hostapd_event_dfs_cac_starte
182 #endif /* NEED_AP_MLME */
185 -void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
186 - union wpa_event_data *data)
187 +void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
188 + union wpa_event_data *data)
190 struct hostapd_data *hapd = ctx;
191 #ifndef CONFIG_NO_STDOUT_DEBUG
192 @@ -1590,7 +1590,7 @@ void wpa_supplicant_event(void *ctx, enu
196 -void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
197 +void hostapd_wpa_event_global(void *ctx, enum wpa_event_type event,
198 union wpa_event_data *data)
200 struct hapd_interfaces *interfaces = ctx;
201 --- a/wpa_supplicant/wpa_priv.c
202 +++ b/wpa_supplicant/wpa_priv.c
203 @@ -1031,8 +1031,8 @@ static void wpa_priv_send_ft_response(st
207 -void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
208 - union wpa_event_data *data)
209 +static void supplicant_event(void *ctx, enum wpa_event_type event,
210 + union wpa_event_data *data)
212 struct wpa_priv_interface *iface = ctx;
214 @@ -1101,7 +1101,7 @@ void wpa_supplicant_event(void *ctx, enu
218 -void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
219 +void supplicant_event_global(void *ctx, enum wpa_event_type event,
220 union wpa_event_data *data)
222 struct wpa_priv_global *global = ctx;
223 @@ -1213,6 +1213,8 @@ int main(int argc, char *argv[])
224 if (os_program_init())
227 + wpa_supplicant_event = supplicant_event;
228 + wpa_supplicant_event_global = supplicant_event_global;
229 wpa_priv_fd_workaround();
231 os_memset(&global, 0, sizeof(global));
232 --- a/wpa_supplicant/events.c
233 +++ b/wpa_supplicant/events.c
234 @@ -3709,8 +3709,8 @@ static void wpa_supplicant_event_assoc_a
238 -void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
239 - union wpa_event_data *data)
240 +void supplicant_event(void *ctx, enum wpa_event_type event,
241 + union wpa_event_data *data)
243 struct wpa_supplicant *wpa_s = ctx;
245 @@ -4466,7 +4466,7 @@ void wpa_supplicant_event(void *ctx, enu
249 -void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
250 +void supplicant_event_global(void *ctx, enum wpa_event_type event,
251 union wpa_event_data *data)
253 struct wpa_supplicant *wpa_s;
254 --- a/wpa_supplicant/wpa_supplicant.c
255 +++ b/wpa_supplicant/wpa_supplicant.c
256 @@ -5457,7 +5457,6 @@ struct wpa_interface * wpa_supplicant_ma
262 * wpa_supplicant_match_existing - Match existing interfaces
263 * @global: Pointer to global data from wpa_supplicant_init()
264 @@ -5494,6 +5493,11 @@ static int wpa_supplicant_match_existing
266 #endif /* CONFIG_MATCH_IFACE */
268 +extern void supplicant_event(void *ctx, enum wpa_event_type event,
269 + union wpa_event_data *data);
271 +extern void supplicant_event_global(void *ctx, enum wpa_event_type event,
272 + union wpa_event_data *data);
275 * wpa_supplicant_add_iface - Add a new network interface
276 @@ -5750,6 +5754,8 @@ struct wpa_global * wpa_supplicant_init(
277 #ifndef CONFIG_NO_WPA_MSG
278 wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
279 #endif /* CONFIG_NO_WPA_MSG */
280 + wpa_supplicant_event = supplicant_event;
281 + wpa_supplicant_event_global = supplicant_event_global;
283 if (params->wpa_debug_file_path)
284 wpa_debug_open_file(params->wpa_debug_file_path);
287 @@ -590,6 +590,11 @@ fail:
291 +void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
292 + union wpa_event_data *data);
294 +void hostapd_wpa_event_global(void *ctx, enum wpa_event_type event,
295 + union wpa_event_data *data);
298 static int gen_uuid(const char *txt_addr)
299 @@ -670,6 +675,8 @@ int main(int argc, char *argv[])
300 dl_list_init(&interfaces.eth_p_oui);
301 #endif /* CONFIG_ETH_P_OUI */
303 + wpa_supplicant_event = hostapd_wpa_event;
304 + wpa_supplicant_event_global = hostapd_wpa_event_global;
306 c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:");
308 --- a/src/drivers/drivers.c
309 +++ b/src/drivers/drivers.c
311 #include "utils/common.h"
314 +void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
315 + union wpa_event_data *data);
316 +void (*wpa_supplicant_event_global)(void *ctx, enum wpa_event_type event,
317 + union wpa_event_data *data);
319 const struct wpa_driver_ops *const wpa_drivers[] =
321 --- a/wpa_supplicant/eapol_test.c
322 +++ b/wpa_supplicant/eapol_test.c
324 #include "ctrl_iface.h"
325 #include "pcsc_funcs.h"
326 #include "wpas_glue.h"
327 +#include "drivers/driver.h"
329 +void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
330 + union wpa_event_data *data);
331 +void (*wpa_supplicant_event_global)(void *ctx, enum wpa_event_type event,
332 + union wpa_event_data *data);
334 const struct wpa_driver_ops *const wpa_drivers[] = { NULL };
336 @@ -1295,6 +1300,10 @@ static void usage(void)
337 "option several times.\n");
340 +extern void supplicant_event(void *ctx, enum wpa_event_type event,
341 + union wpa_event_data *data);
342 +extern void supplicant_event_global(void *ctx, enum wpa_event_type event,
343 + union wpa_event_data *data);
345 int main(int argc, char *argv[])
347 @@ -1315,6 +1324,8 @@ int main(int argc, char *argv[])
348 if (os_program_init())
351 + wpa_supplicant_event = supplicant_event;
352 + wpa_supplicant_event_global = supplicant_event_global;
353 hostapd_logger_register_cb(hostapd_logger_cb);
355 os_memset(&eapol_test, 0, sizeof(eapol_test));