nl80211: Fix a typo
[hostap-gosc2009.git] / eap_example / eap_example.c
blobb8917c8c351307e6a8265d12794df40b9e423636
1 /*
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
13 * license.
15 * See README and COPYING for more details.
18 #include "includes.h"
20 #include "common.h"
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[])
36 int res_s, res_p;
38 wpa_debug_level = 0;
40 if (eap_example_peer_init() < 0 ||
41 eap_example_server_init() < 0)
42 return -1;
44 do {
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();
54 return 0;