*/
#ifndef FR_CONNECTION_H
#define FR_CONNECTION_H
-/**
+/*
+ * $Id$
+ *
* @file connection.h
* @brief Structures, prototypes and global variables for server connection pools.
*
- * @version $Id$
- * @copyright 1999,2000,2002,2003,2004,2005,2006,2007,2008 The FreeRADIUS server project
+ * @copyright 2012 The FreeRADIUS server project
+ * @copyright 2012 Alan DeKok <aland@deployingradius.com>
*/
#include <freeradius-devel/ident.h>
typedef struct fr_connection_pool_t fr_connection_pool_t;
+/** Create a new connection handle
+ *
+ * This function will be called whenever the connection pool manager needs
+ * to spawn a new connection, and on reconnect.
+ *
+ * @note A function pointer matching this prototype must be passed
+ * to fr_connection_pool.
+ * @param[in] ctx pointer passed to fr_connection_pool_init.
+ * @return NULL on error, else a connection handle.
+ */
typedef void *(*fr_connection_create_t)(void *ctx);
+
+/** Check a connection handle is still viable
+ *
+ * Should check the state of a connection handle.
+ *
+ * @note NULL may be passed to fr_connection_init, if there is no way to check
+ * the state of a connection handle.
+ * @note Not currently use by connection pool manager.
+ * @param[in] ctx pointer passed to fr_connection_pool_init.
+ * @param[in] connection handle returned by fr_connection_create_t.
+ * @return < 0 on error or if the connection is unusable, else 0.
+ */
typedef int (*fr_connection_alive_t)(void *ctx, void *connection);
+
+/** Delete a connection and free allocated memory
+ *
+ * Should close any sockets associated with the passed connection handle,
+ * and free any memory allocated to it.
+ *
+ * @param[in] ctx pointer passed to fr_connection_pool_init.
+ * @param[in,out] connection handle returned by fr_connection_create_t.
+ * @return < 0 on error else 0 if connection was closed successfully.
+ */
typedef int (*fr_connection_delete_t)(void *ctx, void *connection);
fr_connection_pool_t *fr_connection_pool_init(CONF_SECTION *cs,
#ifndef LIBRADIUS_H
#define LIBRADIUS_H
/*
+ * $Id$
+ *
* @file libradius.h
* @brief Structures and prototypes for the radius library.
*
- * @version $Id$
- * @copyright 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008 The FreeRADIUS server project
+ * @copyright 1999-2008 The FreeRADIUS server project
*/
#include <freeradius-devel/ident.h>
/*
+ * $Id$
+ *
* @file md5.h
* @brief Structures and prototypes for md5.
*
- * @version $Id$
* @license LGPL, but largely derived from a public domain source.
*/
/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * $Id$
+ *
* @file modules.h
* @brief Interface to the RADIUS module system.
*
- * @version $Id$
* @copyright 2013 The FreeRADIUS server project
*/
#ifndef RADIUSD_H
#define RADIUSD_H
/*
+ * $Id$
+ *
* @file radiusd.h
* @brief Structures, prototypes and global variables for the FreeRADIUS server.
*
- * @version $Id$
- * @copyright 1999,2000,2002,2003,2004,2005,2006,2007,2008 The FreeRADIUS server project
+ * @copyright 1999-2000,2002-2008 The FreeRADIUS server project
*/
#include <freeradius-devel/ident.h>
#ifndef FR_SOH_H
#define FR_SOH_H
/*
+ * $Id$
+ *
* @file soh.h
* @brief Microsoft SoH support
*
- * @version $Id$
* @copyright 2010 Phil Mayers <p.mayers@imperial.ac.uk>
*/
#ifndef FR_TCP_H
#define FR_TCP_H
/*
+ * $Id$
+ *
* @file tcp.h
* @brief RADIUS over TCP
*
- * @version $Id$
* @copyright 2009 Dante http://dante.net
*/
#ifdef WITH_TLS
/*
+ * $Id$
+ *
* @file tls.h
* @brief Structures and prototypes for TLS wrappers
*
- * @version $Id$
* @copyright 2010 Network RADIUS SARL <info@networkradius.com>
*/
#define FR_TOKEN_H
/*
+ * $Id$
+ *
* @file token.h
* @brief Tokenisation code and constants.
*
- * @version $Id$
* @copyright 2001,2006 The FreeRADIUS server project
*/
#ifndef UDPFROMTO_H
#define UDPFROMTO_H
/*
- * @file udpfromto.h
+ * $Id$
*
- * @version $Id$
- * @copyright 2013 The FreeRADIUS server project
+ * @file udpfromto.h
*/
#include <freeradius-devel/ident.h>
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
#ifndef VMPS_H
#define VMPS_H
/*
+ * $Id$
+ *
* @file vmps.h
* @brief Routines to handle VMPS sockets.
*
- * @version $Id$
- * @copyright 2013 The FreeRADIUS server project
+ * @copyright 2013 The FreeRADIUS server project
*/
#include <freeradius-devel/ident.h>
#define FR_VQP_H
/*
+ * $Id$
+ *
* @file vqp.h
* @brief Structures and prototypes for Cisco's VLAN Query Protocol
*
- * @version $Id$
* @copyright 2007 The FreeRADIUS server project
* @copyright 2007 Alan DeKok <aland@deployingradius.com>
*/
*/
/*
+ * $Id$
+ *
* @file radius.c
* @brief Functions to send/receive radius packets.
*
- * @version $Id$
* @copyright 2000-2003,2006 The FreeRADIUS server project
*/
//!< and maintain.
int cleanup_delay; //!< How long a connection can go unused
//!< for before it's closed
- //!< (0 is infinite)
+ //!< (0 is infinite).
int max_uses; //!< Maximum number of times a
//!< connection can be used before being
//!< closed.
//!< configuration parameters.
time_t last_throttled; //!< Last time we refused to spawn a
//!< connection because the last
- //!< connection failed.
+ //!< connection failed, or we were
+ //!< already spawning a connection.
time_t last_at_max; //!< Last time we hit the maximum number
- //!< of allowed connections
+ //!< of allowed connections.
unsigned int count; //!< Number of connections spawned over
//!< the lifetime of the pool.
/** Find a connection handle in the connection list
*
* Walks over the list of connections searching for a specified connection
- * handle, and returns the first connection that contains that pointer.
+ * handle and returns the first connection that contains that pointer.
*
* @note Will lock mutex and only release mutex if connection handle
* is not found, so will usually return will mutex held.
*/
/*
+ * $Id$
+ *
* @file exec.c
* @brief Execute external programs.
*
- * @version $Id$
* @copyright 2000-2004,2006 The FreeRADIUS server project
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
+/*
+ * $Id$
+ *
* @file process.c
* @brief Defines the state machines that control how requests are processed.
*
- * @version $Id$
* @copyright 2012 The FreeRADIUS server project
* @copyright 2012 Alan DeKok <aland@deployingradius.com>
*/
*/
/*
+ * $Id$
+ *
* @file soh.c
* @brief Implements the MS-SOH parsing code. This is called from rlm_eap_peap
*
- * @version $Id$
* @copyright 2010 Phil Mayers <p.mayers@imperial.ac.uk>
*/
*/
/*
+ * $Id$
+ *
* @brief Valuepair functions that are radiusd-specific and as such do not
* belong in the library.
* @file main/valuepair.c
*
* @ingroup AVP
*
- * @version $Id$
* @copyright 2000,2006 The FreeRADIUS server project
* @copyright 2000 Alan DeKok <aland@ox.org>
*/
*/
/*
+ * $Id$
+ *
* @file xlat.c
* @brief String expansion ("translation"). Implements %Attribute -> value
*
- * @version $Id$
* @copyright 2000,2006 The FreeRADIUS server project
* @copyright 2000 Alan DeKok <aland@ox.org>
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
+/*
+ * $Id$
+ *
* @brief Functions and datatypes for the REST (HTTP) transport.
* @file rest.c
*
- * @version $Id$
* @copyright 2012-2013 Arran Cudbard-Bell <a.cudbard-bell@freeradius.org>
*/
*/
/*
- * @brief Function prototypes datatypes for the REST (HTTP) transport.
+ * $Id$
+ *
+ * @brief Function prototypes and datatypes for the REST (HTTP) transport.
* @file rest.h
*
- * @version $Id$
* @copyright 2012-2013 Arran Cudbard-Bell <a.cudbard-bell@freeradius.org>
*/
+
#include <freeradius-devel/ident.h>
-#include <freeradius-devel/connection.h>
-
RCSIDH(other_h, "$Id$")
+#include <freeradius-devel/connection.h>
#include "config.h"
#ifdef HAVE_JSON_JSONH