#ifdef HAVE_YKCLIENT
#include <freeradius-devel/connection.h>
+/** Frees a ykclient handle
+ *
+ * @param[in] instance configuration data.
+ * @param[in] handle rlm_yubikey_handle_t to close and free.
+ * @return returns true.
+ */
+static int mod_conn_delete(UNUSED void *instance, void *handle)
+{
+ ykclient_handle_t *yandle = handle;
+
+ ykclient_handle_done(&yandle);
+
+ return true;
+}
+
/** Creates a new connection handle for use by the FR connection API.
*
* Matches the fr_connection_create_t function prototype, is passed to
* @return connection handle or NULL if the connection failed or couldn't
* be initialised.
*/
-static void *mod_socket_create(void *instance)
+static void *mod_conn_create(void *instance)
{
rlm_yubikey_t *inst = instance;
ykclient_rc status;
return yandle;
}
-/** Frees a ykclient handle
- *
- * @param[in] instance configuration data.
- * @param[in] handle rlm_yubikey_handle_t to close and free.
- * @return returns true.
- */
-static int mod_socket_delete(UNUSED void *instance, void *handle)
-{
- ykclient_handle_t *yandle = handle;
-
- ykclient_handle_done(&yandle);
-
- return true;
-}
-
int rlm_yubikey_ykclient_init(CONF_SECTION *conf, rlm_yubikey_t *inst)
{
ykclient_rc status;
}
snprintf(prefix, sizeof(prefix), "rlm_yubikey (%s)", inst->name);
- inst->conn_pool = fr_connection_pool_init(conf, inst, mod_socket_create, NULL, mod_socket_delete, prefix);
+ inst->conn_pool = fr_connection_pool_init(conf, inst, mod_conn_create, NULL, mod_conn_delete, prefix);
if (!inst->conn_pool) {
ykclient_done(&inst->ykc);