1 #ifndef FR_CONNECTION_H
2 #define FR_CONNECTION_H
5 * @brief Structures, prototypes and global variables
6 * for server connection pools.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 * Copyright 1999,2000,2002,2003,2004,2005,2006,2007,2008 The FreeRADIUS server project
28 #include <freeradius-devel/ident.h>
29 RCSIDH(connection_h, "$Id$")
31 #include <freeradius-devel/radiusd.h>
32 #include <freeradius-devel/conffile.h>
38 typedef struct fr_connection_pool_t fr_connection_pool_t;
40 typedef void *(*fr_connection_create_t)(void *ctx);
41 typedef int (*fr_connection_alive_t)(void *ctx, void *connection);
42 typedef int (*fr_connection_delete_t)(void *ctx, void *connection);
44 fr_connection_pool_t *fr_connection_pool_init(CONF_SECTION *cs,
46 fr_connection_create_t c,
47 fr_connection_alive_t a,
48 fr_connection_delete_t d);
49 void fr_connection_pool_delete(fr_connection_pool_t *fc);
51 int fr_connection_check(fr_connection_pool_t *fc, void *conn);
52 void *fr_connection_get(fr_connection_pool_t *fc);
53 void fr_connection_release(fr_connection_pool_t *fc, void *conn);
54 void *fr_connection_reconnect(fr_connection_pool_t *fc, void *conn);
60 #endif /* FR_CONNECTION_H*/