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 program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
12 * Alternatively, this software may be distributed under the terms of BSD
15 * See README and COPYING for more details.
23 int eap_example_peer_init(void);
24 void eap_example_peer_deinit(void);
25 int eap_example_peer_step(void);
27 int eap_example_server_init(void);
28 void eap_example_server_deinit(void);
29 int eap_example_server_step(void);
32 extern int wpa_debug_level
;
34 int main(int argc
, char *argv
[])
40 if (eap_example_peer_init() < 0 ||
41 eap_example_server_init() < 0)
45 printf("---[ server ]--------------------------------\n");
46 res_s
= eap_example_server_step();
47 printf("---[ peer ]----------------------------------\n");
48 res_p
= eap_example_peer_step();
49 } while (res_s
|| res_p
);
51 eap_example_peer_deinit();
52 eap_example_server_deinit();