1Example application using RADIUS client as a library
2Copyright (c) 2007, Jouni Malinen <j@w1.fi>
3
4This software may be distributed under the terms of the BSD license.
5See the parent directory README for more details.
6
7
8This directory contains an example showing how the RADIUS client
9functionality from hostapd can be used as a library in another
10program. The example program initializes the RADIUS client and send a
11Access-Request using User-Name and User-Password attributes. A reply
12from the RADIUS authentication server will be processed and it is used
13as a trigger to terminate the example program.
14
15The RADIUS library links in couple of helper functions from src/utils and
16src/crypto directories. Most of these are suitable as-is, but it may
17be desirable to replace the debug output code in src/utils/wpa_debug.c
18by dropping this file from the library and re-implementing the
19functions there in a way that better fits in with the main
20application.
21
22RADIUS client implementation takes care of receiving messages,
23timeouts, and retransmissions of packets. Consequently, it requires
24functionality for registering timeouts and received packet
25notifications. This is implemented using the generic event loop
26implementation (see src/utils/eloop.h).
27
28The main application may either use the included event loop
29implementation or alternatively, implement eloop_* wrapper functions
30to use whatever event loop design is used in the main program. This
31would involve removing src/utils/eloop.o from the library and
32implementing following functions defines in src/utils/eloop.h:
33eloop_register_timeout(), eloop_cancel_timeout(),
34eloop_register_read_sock(), eloop_unregister_read_sock(), and
35eloop_terminated().
36