]>
git.ipfire.org Git - thirdparty/hostap.git/blob - eap_example/eap_example.c
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 int main(int argc
, char *argv
[])
32 if (eap_example_peer_init() < 0 ||
33 eap_example_server_init() < 0)
37 printf("---[ server ]--------------------------------\n");
38 res_s
= eap_example_server_step();
39 printf("---[ peer ]----------------------------------\n");
40 res_p
= eap_example_peer_step();
41 } while (res_s
|| res_p
);
43 eap_example_peer_deinit();
44 eap_example_server_deinit();