2 * Example application showing how EAP peer and server code from
3 * wpa_supplicant/hostapd can be used as a library. This example program
4 * initializes both an EAP server and an EAP peer entities and then runs
5 * through an EAP-PEAP/MSCHAPv2 authentication.
6 * Copyright (c) 2007, Jouni Malinen <j@w1.fi>
8 * This software may be distributed under the terms of the BSD license.
9 * See README for more details.
17 int eap_example_peer_init(void);
18 void eap_example_peer_deinit(void);
19 int eap_example_peer_step(void);
21 int eap_example_server_init(void);
22 void eap_example_server_deinit(void);
23 int eap_example_server_step(void);
26 extern int wpa_debug_level;
28 int main(int argc, char *argv[])
34 if (eap_example_peer_init() < 0 ||
35 eap_example_server_init() < 0)
39 printf("---[ server ]--------------------------------\n");
40 res_s = eap_example_server_step();
41 printf("---[ peer ]----------------------------------\n");
42 res_p = eap_example_peer_step();
43 } while (res_s || res_p);
45 eap_example_peer_deinit();
46 eap_example_server_deinit();