2 * Copyright (C) 2009 Martin Willi
3 * Hochschule fuer Technik Rapperswil
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 * @defgroup radius_client radius_client
18 * @{ @ingroup libradius
21 #ifndef RADIUS_CLIENT_H_
22 #define RADIUS_CLIENT_H_
24 #include "radius_message.h"
25 #include "radius_server.h"
27 typedef struct radius_client_t radius_client_t
;
30 * RADIUS client functionality.
32 * To communicate with a RADIUS server, create a client and send messages over
33 * it. The client allocates a socket from the best RADIUS server abailable.
35 struct radius_client_t
{
38 * Send a RADIUS request and wait for the response.
40 * The client fills in NAS-Identifier nad NAS-Port-Type
42 * @param msg RADIUS request message to send
43 * @return response, NULL if timed out/verification failed
45 radius_message_t
* (*request
)(radius_client_t
*this, radius_message_t
*msg
);
48 * Get the EAP MSK after successful RADIUS authentication.
50 * @return MSK, allocated
52 chunk_t (*get_msk
)(radius_client_t
*this);
55 * Destroy the client, release the socket.
57 void (*destroy
)(radius_client_t
*this);
61 * Create a RADIUS client.
63 * @param server reference to a server configuration, gets owned
64 * @return radius_client_t object
66 radius_client_t
*radius_client_create(radius_server_t
*server
);
68 #endif /** RADIUS_CLIENT_H_ @}*/