Blame include/util_ldap.h

Packit 90a5c9
/* Licensed to the Apache Software Foundation (ASF) under one or more
Packit 90a5c9
 * contributor license agreements.  See the NOTICE file distributed with
Packit 90a5c9
 * this work for additional information regarding copyright ownership.
Packit 90a5c9
 * The ASF licenses this file to You under the Apache License, Version 2.0
Packit 90a5c9
 * (the "License"); you may not use this file except in compliance with
Packit 90a5c9
 * the License.  You may obtain a copy of the License at
Packit 90a5c9
 *
Packit 90a5c9
 *     http://www.apache.org/licenses/LICENSE-2.0
Packit 90a5c9
 *
Packit 90a5c9
 * Unless required by applicable law or agreed to in writing, software
Packit 90a5c9
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit 90a5c9
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 90a5c9
 * See the License for the specific language governing permissions and
Packit 90a5c9
 * limitations under the License.
Packit 90a5c9
 */
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * @file util_ldap.h
Packit 90a5c9
 * @brief Apache LDAP library
Packit 90a5c9
 */
Packit 90a5c9
Packit 90a5c9
#ifndef UTIL_LDAP_H
Packit 90a5c9
#define UTIL_LDAP_H
Packit 90a5c9
Packit 90a5c9
/* APR header files */
Packit 90a5c9
#include "apr.h"
Packit 90a5c9
#include "apr_thread_mutex.h"
Packit 90a5c9
#include "apr_thread_rwlock.h"
Packit 90a5c9
#include "apr_tables.h"
Packit 90a5c9
#include "apr_time.h"
Packit 90a5c9
#include "apr_version.h"
Packit 90a5c9
#if APR_MAJOR_VERSION < 2
Packit 90a5c9
/* The LDAP API is currently only present in APR 1.x */
Packit 90a5c9
#include "apr_ldap.h"
Packit 90a5c9
#include "apr_ldap_rebind.h"
Packit 90a5c9
#else
Packit 90a5c9
#define APR_HAS_LDAP 0
Packit 90a5c9
#endif
Packit 90a5c9
Packit 90a5c9
#if APR_HAS_SHARED_MEMORY
Packit 90a5c9
#include "apr_rmm.h"
Packit 90a5c9
#include "apr_shm.h"
Packit 90a5c9
#endif
Packit 90a5c9
Packit 90a5c9
/* this whole thing disappears if LDAP is not enabled */
Packit 90a5c9
#if APR_HAS_LDAP
Packit 90a5c9
Packit 90a5c9
#if defined(LDAP_UNAVAILABLE) || APR_HAS_MICROSOFT_LDAPSDK
Packit 90a5c9
#define AP_LDAP_IS_SERVER_DOWN(s)                ((s) == LDAP_SERVER_DOWN \
Packit 90a5c9
                ||(s) == LDAP_UNAVAILABLE)
Packit 90a5c9
#else
Packit 90a5c9
#define AP_LDAP_IS_SERVER_DOWN(s)                ((s) == LDAP_SERVER_DOWN)
Packit 90a5c9
#endif
Packit 90a5c9
Packit 90a5c9
/* Apache header files */
Packit 90a5c9
#include "ap_config.h"
Packit 90a5c9
#include "httpd.h"
Packit 90a5c9
#include "http_config.h"
Packit 90a5c9
#include "http_core.h"
Packit 90a5c9
#include "http_log.h"
Packit 90a5c9
#include "http_protocol.h"
Packit 90a5c9
#include "http_request.h"
Packit 90a5c9
#include "apr_optional.h"
Packit 90a5c9
Packit 90a5c9
/* Create a set of LDAP_DECLARE macros with appropriate export
Packit 90a5c9
 * and import tags for the platform
Packit 90a5c9
 */
Packit 90a5c9
#if !defined(WIN32)
Packit 90a5c9
#define LDAP_DECLARE(type)            type
Packit 90a5c9
#define LDAP_DECLARE_NONSTD(type)     type
Packit 90a5c9
#define LDAP_DECLARE_DATA
Packit 90a5c9
#elif defined(LDAP_DECLARE_STATIC)
Packit 90a5c9
#define LDAP_DECLARE(type)            type __stdcall
Packit 90a5c9
#define LDAP_DECLARE_NONSTD(type)     type
Packit 90a5c9
#define LDAP_DECLARE_DATA
Packit 90a5c9
#elif defined(LDAP_DECLARE_EXPORT)
Packit 90a5c9
#define LDAP_DECLARE(type)            __declspec(dllexport) type __stdcall
Packit 90a5c9
#define LDAP_DECLARE_NONSTD(type)     __declspec(dllexport) type
Packit 90a5c9
#define LDAP_DECLARE_DATA             __declspec(dllexport)
Packit 90a5c9
#else
Packit 90a5c9
#define LDAP_DECLARE(type)            __declspec(dllimport) type __stdcall
Packit 90a5c9
#define LDAP_DECLARE_NONSTD(type)     __declspec(dllimport) type
Packit 90a5c9
#define LDAP_DECLARE_DATA             __declspec(dllimport)
Packit 90a5c9
#endif
Packit 90a5c9
Packit 90a5c9
#if APR_HAS_MICROSOFT_LDAPSDK
Packit 90a5c9
#define timeval l_timeval
Packit 90a5c9
#endif
Packit 90a5c9
Packit 90a5c9
#ifdef __cplusplus
Packit 90a5c9
extern "C" {
Packit 90a5c9
#endif
Packit 90a5c9
Packit 90a5c9
/*
Packit 90a5c9
 * LDAP Connections
Packit 90a5c9
 */
Packit 90a5c9
Packit 90a5c9
/* Values that the deref member can have */
Packit 90a5c9
typedef enum {
Packit 90a5c9
    never=LDAP_DEREF_NEVER,
Packit 90a5c9
    searching=LDAP_DEREF_SEARCHING,
Packit 90a5c9
    finding=LDAP_DEREF_FINDING,
Packit 90a5c9
    always=LDAP_DEREF_ALWAYS
Packit 90a5c9
} deref_options;
Packit 90a5c9
Packit 90a5c9
/* Structure representing an LDAP connection */
Packit 90a5c9
typedef struct util_ldap_connection_t {
Packit 90a5c9
    LDAP *ldap;
Packit 90a5c9
    apr_pool_t *pool;                   /* Pool from which this connection is created */
Packit 90a5c9
#if APR_HAS_THREADS
Packit 90a5c9
    apr_thread_mutex_t *lock;           /* Lock to indicate this connection is in use */
Packit 90a5c9
#endif
Packit 90a5c9
Packit 90a5c9
    const char *host;                   /* Name of the LDAP server (or space separated list) */
Packit 90a5c9
    int port;                           /* Port of the LDAP server */
Packit 90a5c9
    deref_options deref;                /* how to handle alias dereferening */
Packit 90a5c9
Packit 90a5c9
    const char *binddn;                 /* DN to bind to server (can be NULL) */
Packit 90a5c9
    const char *bindpw;                 /* Password to bind to server (can be NULL) */
Packit 90a5c9
Packit 90a5c9
    int bound;                          /* Flag to indicate whether this connection is bound yet */
Packit 90a5c9
Packit 90a5c9
    int secure;                         /* SSL/TLS mode of the connection */
Packit 90a5c9
    apr_array_header_t *client_certs;   /* Client certificates on this connection */
Packit 90a5c9
Packit 90a5c9
    const char *reason;                 /* Reason for an error failure */
Packit 90a5c9
Packit 90a5c9
    struct util_ldap_connection_t *next;
Packit 90a5c9
    struct util_ldap_state_t *st;        /* The LDAP vhost config this connection belongs to */
Packit 90a5c9
    int keep;                            /* Will this connection be kept when it's unlocked */
Packit 90a5c9
Packit 90a5c9
    int ChaseReferrals;                 /* [on|off] (default = AP_LDAP_CHASEREFERRALS_ON)*/
Packit 90a5c9
    int ReferralHopLimit;               /* # of referral hops to follow (default = AP_LDAP_DEFAULT_HOPLIMIT) */
Packit 90a5c9
    apr_time_t freed;                   /* the time this conn was placed back in the pool */
Packit 90a5c9
    apr_pool_t *rebind_pool;            /* frequently cleared pool for rebind data */
Packit 90a5c9
    int must_rebind;                    /* The connection was last bound with other then binddn/bindpw */
Packit 90a5c9
    request_rec *r;                     /* request_rec used to find this util_ldap_connection_t */
Packit 90a5c9
    apr_time_t last_backend_conn;       /* the approximate time of the last backend LDAP requst */
Packit 90a5c9
} util_ldap_connection_t;
Packit 90a5c9
Packit 90a5c9
typedef struct util_ldap_config_t {
Packit 90a5c9
    int ChaseReferrals;
Packit 90a5c9
    int ReferralHopLimit;
Packit 90a5c9
    apr_array_header_t *client_certs;  /* Client certificates */
Packit 90a5c9
} util_ldap_config_t;
Packit 90a5c9
Packit 90a5c9
/* LDAP cache state information */
Packit 90a5c9
typedef struct util_ldap_state_t {
Packit 90a5c9
    apr_pool_t *pool;           /* pool from which this state is allocated */
Packit 90a5c9
#if APR_HAS_THREADS
Packit 90a5c9
    apr_thread_mutex_t *mutex;          /* mutex lock for the connection list */
Packit 90a5c9
#endif
Packit 90a5c9
    apr_global_mutex_t *util_ldap_cache_lock;
Packit 90a5c9
Packit 90a5c9
    apr_size_t cache_bytes;     /* Size (in bytes) of shared memory cache */
Packit 90a5c9
    char *cache_file;           /* filename for shm */
Packit 90a5c9
    long search_cache_ttl;      /* TTL for search cache */
Packit 90a5c9
    long search_cache_size;     /* Size (in entries) of search cache */
Packit 90a5c9
    long compare_cache_ttl;     /* TTL for compare cache */
Packit 90a5c9
    long compare_cache_size;    /* Size (in entries) of compare cache */
Packit 90a5c9
Packit 90a5c9
    struct util_ldap_connection_t *connections;
Packit 90a5c9
    apr_array_header_t *global_certs;  /* Global CA certificates */
Packit 90a5c9
    int   ssl_supported;
Packit 90a5c9
    int   secure;
Packit 90a5c9
    int   secure_set;
Packit 90a5c9
    int   verify_svr_cert;
Packit 90a5c9
Packit 90a5c9
#if APR_HAS_SHARED_MEMORY
Packit 90a5c9
    apr_shm_t *cache_shm;
Packit 90a5c9
    apr_rmm_t *cache_rmm;
Packit 90a5c9
#endif
Packit 90a5c9
Packit 90a5c9
    /* cache ald */
Packit 90a5c9
    void *util_ldap_cache;
Packit 90a5c9
Packit 90a5c9
    long  connectionTimeout;
Packit 90a5c9
    struct timeval *opTimeout;
Packit 90a5c9
Packit 90a5c9
    int debug_level;                    /* SDK debug level */
Packit 90a5c9
    apr_interval_time_t connection_pool_ttl;
Packit 90a5c9
    int retries;                        /* number of retries for failed bind/search/compare */
Packit 90a5c9
    apr_interval_time_t retry_delay;    /* delay between retries of failed bind/search/compare */
Packit 90a5c9
} util_ldap_state_t;
Packit 90a5c9
Packit 90a5c9
/* Used to store arrays of attribute labels/values. */
Packit 90a5c9
struct mod_auth_ldap_groupattr_entry_t {
Packit 90a5c9
    char *name;
Packit 90a5c9
};
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Open a connection to an LDAP server
Packit 90a5c9
 * @param ldc A structure containing the expanded details of the server
Packit 90a5c9
 *            to connect to. The handle to the LDAP connection is returned
Packit 90a5c9
 *            as ldc->ldap.
Packit 90a5c9
 * @tip This function connects to the LDAP server and binds. It does not
Packit 90a5c9
 *      connect if already connected (ldc->ldap != NULL). Does not bind
Packit 90a5c9
 *      if already bound.
Packit 90a5c9
 * @return If successful LDAP_SUCCESS is returned.
Packit 90a5c9
 * @fn int util_ldap_connection_open(request_rec *r,
Packit 90a5c9
 *                                        util_ldap_connection_t *ldc)
Packit 90a5c9
 */
Packit 90a5c9
APR_DECLARE_OPTIONAL_FN(int,uldap_connection_open,(request_rec *r,
Packit 90a5c9
                                            util_ldap_connection_t *ldc));
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Close a connection to an LDAP server
Packit 90a5c9
 * @param ldc A structure containing the expanded details of the server
Packit 90a5c9
 *            that was connected.
Packit 90a5c9
 * @tip This function unbinds from the LDAP server, and clears ldc->ldap.
Packit 90a5c9
 *      It is possible to rebind to this server again using the same ldc
Packit 90a5c9
 *      structure, using apr_ldap_open_connection().
Packit 90a5c9
 * @fn util_ldap_close_connection(util_ldap_connection_t *ldc)
Packit 90a5c9
 */
Packit 90a5c9
APR_DECLARE_OPTIONAL_FN(void,uldap_connection_close,(util_ldap_connection_t *ldc));
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Unbind a connection to an LDAP server
Packit 90a5c9
 * @param ldc A structure containing the expanded details of the server
Packit 90a5c9
 *            that was connected.
Packit 90a5c9
 * @tip This function unbinds the LDAP connection, and disconnects from
Packit 90a5c9
 *      the server. It is used during error conditions, to bring the LDAP
Packit 90a5c9
 *      connection back to a known state.
Packit 90a5c9
 * @fn apr_status_t util_ldap_connection_unbind(util_ldap_connection_t *ldc)
Packit 90a5c9
 */
Packit 90a5c9
APR_DECLARE_OPTIONAL_FN(apr_status_t,uldap_connection_unbind,(void *param));
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Find a connection in a list of connections
Packit 90a5c9
 * @param r The request record
Packit 90a5c9
 * @param host The hostname to connect to (multiple hosts space separated)
Packit 90a5c9
 * @param port The port to connect to
Packit 90a5c9
 * @param binddn The DN to bind with
Packit 90a5c9
 * @param bindpw The password to bind with
Packit 90a5c9
 * @param deref The dereferencing behavior
Packit 90a5c9
 * @param secure use SSL on the connection
Packit 90a5c9
 * @tip Once a connection is found and returned, a lock will be acquired to
Packit 90a5c9
 *      lock that particular connection, so that another thread does not try and
Packit 90a5c9
 *      use this connection while it is busy. Once you are finished with a connection,
Packit 90a5c9
 *      apr_ldap_connection_close() must be called to release this connection.
Packit 90a5c9
 * @fn util_ldap_connection_t *util_ldap_connection_find(request_rec *r, const char *host, int port,
Packit 90a5c9
 *                                                           const char *binddn, const char *bindpw, deref_options deref,
Packit 90a5c9
 *                                                           int netscapessl, int starttls)
Packit 90a5c9
 */
Packit 90a5c9
APR_DECLARE_OPTIONAL_FN(util_ldap_connection_t *,uldap_connection_find,(request_rec *r, const char *host, int port,
Packit 90a5c9
                                                  const char *binddn, const char *bindpw, deref_options deref,
Packit 90a5c9
                                                  int secure));
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Compare two DNs for sameness
Packit 90a5c9
 * @param r The request record
Packit 90a5c9
 * @param ldc The LDAP connection being used.
Packit 90a5c9
 * @param url The URL of the LDAP connection - used for deciding which cache to use.
Packit 90a5c9
 * @param dn The first DN to compare.
Packit 90a5c9
 * @param reqdn The DN to compare the first DN to.
Packit 90a5c9
 * @param compare_dn_on_server Flag to determine whether the DNs should be checked using
Packit 90a5c9
 *                             LDAP calls or with a direct string comparison. A direct
Packit 90a5c9
 *                             string comparison is faster, but not as accurate - false
Packit 90a5c9
 *                             negative comparisons are possible.
Packit 90a5c9
 * @tip Two DNs can be equal and still fail a string comparison. Eg "dc=example,dc=com"
Packit 90a5c9
 *      and "dc=example, dc=com". Use the compare_dn_on_server unless there are serious
Packit 90a5c9
 *      performance issues.
Packit 90a5c9
 * @fn int util_ldap_cache_comparedn(request_rec *r, util_ldap_connection_t *ldc,
Packit 90a5c9
 *                                        const char *url, const char *dn, const char *reqdn,
Packit 90a5c9
 *                                        int compare_dn_on_server)
Packit 90a5c9
 */
Packit 90a5c9
APR_DECLARE_OPTIONAL_FN(int,uldap_cache_comparedn,(request_rec *r, util_ldap_connection_t *ldc,
Packit 90a5c9
                              const char *url, const char *dn, const char *reqdn,
Packit 90a5c9
                              int compare_dn_on_server));
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * A generic LDAP compare function
Packit 90a5c9
 * @param r The request record
Packit 90a5c9
 * @param ldc The LDAP connection being used.
Packit 90a5c9
 * @param url The URL of the LDAP connection - used for deciding which cache to use.
Packit 90a5c9
 * @param dn The DN of the object in which we do the compare.
Packit 90a5c9
 * @param attrib The attribute within the object we are comparing for.
Packit 90a5c9
 * @param value The value of the attribute we are trying to compare for.
Packit 90a5c9
 * @tip Use this function to determine whether an attribute/value pair exists within an
Packit 90a5c9
 *      object. Typically this would be used to determine LDAP top-level group
Packit 90a5c9
 *      membership.
Packit 90a5c9
 * @fn int util_ldap_cache_compare(request_rec *r, util_ldap_connection_t *ldc,
Packit 90a5c9
 *                                      const char *url, const char *dn, const char *attrib, const char *value)
Packit 90a5c9
 */
Packit 90a5c9
APR_DECLARE_OPTIONAL_FN(int,uldap_cache_compare,(request_rec *r, util_ldap_connection_t *ldc,
Packit 90a5c9
                            const char *url, const char *dn, const char *attrib, const char *value));
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * An LDAP function that checks if the specified user is a member of a subgroup.
Packit 90a5c9
 * @param r The request record
Packit 90a5c9
 * @param ldc The LDAP connection being used.
Packit 90a5c9
 * @param url The URL of the LDAP connection - used for deciding which cache to use.
Packit 90a5c9
 * @param dn The DN of the object in which we find subgroups to search within.
Packit 90a5c9
 * @param attrib The attribute within group objects that identify users.
Packit 90a5c9
 * @param value The user attribute value we are trying to compare for.
Packit 90a5c9
 * @param subgroupAttrs The attributes within group objects that identify subgroups.
Packit 90a5c9
 *                      Array of strings.
Packit 90a5c9
 * @param subgroupclasses The objectClass values used to identify groups (and
Packit 90a5c9
 *                      subgroups). apr_array_header_t *.
Packit 90a5c9
 * @param cur_subgroup_depth Current recursive depth during subgroup processing.
Packit 90a5c9
 * @param max_subgroup_depth Maximum depth of recursion allowed during subgroup
Packit 90a5c9
 *                           processing.
Packit 90a5c9
 * @tip Use this function to determine whether an attribute/value pair exists within a
Packit 90a5c9
 *      starting group object or one of its nested subgroups. Typically this would be
Packit 90a5c9
 *      used to determine LDAP nested group membership.
Packit 90a5c9
 * @deffunc int util_ldap_cache_check_subgroups(request_rec *r, util_ldap_connection_t
Packit 90a5c9
 *                                      *ldc, const char *url, const char *dn,
Packit 90a5c9
 *                                      const char *attrib, const char value,
Packit 90a5c9
 *                                      char **subgroupAttrs, apr_array_header_t
Packit 90a5c9
 *                                      *subgroupclasses, int cur_subgroup_depth, int
Packit 90a5c9
 *                                      max_subgroup_depth )
Packit 90a5c9
 */
Packit 90a5c9
APR_DECLARE_OPTIONAL_FN(int,uldap_cache_check_subgroups,(request_rec *r, util_ldap_connection_t *ldc,
Packit 90a5c9
                                       const char *url, const char *dn, const char *attrib, const char *value,
Packit 90a5c9
                                       char **subgroupAttrs, apr_array_header_t *subgroupclasses,
Packit 90a5c9
                                       int cur_subgroup_depth, int max_subgroup_depth));
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Checks a username/password combination by binding to the LDAP server
Packit 90a5c9
 * @param r The request record
Packit 90a5c9
 * @param ldc The LDAP connection being used.
Packit 90a5c9
 * @param url The URL of the LDAP connection - used for deciding which cache to use.
Packit 90a5c9
 * @param basedn The Base DN to search for the user in.
Packit 90a5c9
 * @param scope LDAP scope of the search.
Packit 90a5c9
 * @param attrs LDAP attributes to return in search.
Packit 90a5c9
 * @param filter The user to search for in the form of an LDAP filter. This filter must return
Packit 90a5c9
 *               exactly one user for the check to be successful.
Packit 90a5c9
 * @param bindpw The user password to bind as.
Packit 90a5c9
 * @param binddn The DN of the user will be returned in this variable.
Packit 90a5c9
 * @param retvals The values corresponding to the attributes requested in the attrs array.
Packit 90a5c9
 * @tip The filter supplied will be searched for. If a single entry is returned, an attempt
Packit 90a5c9
 *      is made to bind as that user. If this bind succeeds, the user is not validated.
Packit 90a5c9
 * @fn int util_ldap_cache_checkuserid(request_rec *r, util_ldap_connection_t *ldc,
Packit 90a5c9
 *                                          char *url, const char *basedn, int scope, char **attrs,
Packit 90a5c9
 *                                          char *filter, char *bindpw, char **binddn, char ***retvals)
Packit 90a5c9
 */
Packit 90a5c9
APR_DECLARE_OPTIONAL_FN(int,uldap_cache_checkuserid,(request_rec *r, util_ldap_connection_t *ldc,
Packit 90a5c9
                              const char *url, const char *basedn, int scope, char **attrs,
Packit 90a5c9
                              const char *filter, const char *bindpw, const char **binddn, const char ***retvals));
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Searches for a specified user object in an LDAP directory
Packit 90a5c9
 * @param r The request record
Packit 90a5c9
 * @param ldc The LDAP connection being used.
Packit 90a5c9
 * @param url The URL of the LDAP connection - used for deciding which cache to use.
Packit 90a5c9
 * @param basedn The Base DN to search for the user in.
Packit 90a5c9
 * @param scope LDAP scope of the search.
Packit 90a5c9
 * @param attrs LDAP attributes to return in search.
Packit 90a5c9
 * @param filter The user to search for in the form of an LDAP filter. This filter must return
Packit 90a5c9
 *               exactly one user for the check to be successful.
Packit 90a5c9
 * @param binddn The DN of the user will be returned in this variable.
Packit 90a5c9
 * @param retvals The values corresponding to the attributes requested in the attrs array.
Packit 90a5c9
 * @tip The filter supplied will be searched for. If a single entry is returned, an attempt
Packit 90a5c9
 *      is made to bind as that user. If this bind succeeds, the user is not validated.
Packit 90a5c9
 * @fn int util_ldap_cache_getuserdn(request_rec *r, util_ldap_connection_t *ldc,
Packit 90a5c9
 *                                          char *url, const char *basedn, int scope, char **attrs,
Packit 90a5c9
 *                                          char *filter, char **binddn, char ***retvals)
Packit 90a5c9
 */
Packit 90a5c9
APR_DECLARE_OPTIONAL_FN(int,uldap_cache_getuserdn,(request_rec *r, util_ldap_connection_t *ldc,
Packit 90a5c9
                              const char *url, const char *basedn, int scope, char **attrs,
Packit 90a5c9
                              const char *filter, const char **binddn, const char ***retvals));
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Checks if SSL support is available in mod_ldap
Packit 90a5c9
 * @fn int util_ldap_ssl_supported(request_rec *r)
Packit 90a5c9
 */
Packit 90a5c9
APR_DECLARE_OPTIONAL_FN(int,uldap_ssl_supported,(request_rec *r));
Packit 90a5c9
Packit 90a5c9
/* from apr_ldap_cache.c */
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Init the LDAP cache
Packit 90a5c9
 * @param pool The pool to use to initialise the cache
Packit 90a5c9
 * @param reqsize The size of the shared memory segment to request. A size
Packit 90a5c9
 *                of zero requests the max size possible from
Packit 90a5c9
 *                apr_shmem_init()
Packit 90a5c9
 * @fn void util_ldap_cache_init(apr_pool_t *p, util_ldap_state_t *st)
Packit 90a5c9
 * @return The status code returned is the status code of the
Packit 90a5c9
 *         apr_smmem_init() call. Regardless of the status, the cache
Packit 90a5c9
 *         will be set up at least for in-process or in-thread operation.
Packit 90a5c9
 */
Packit 90a5c9
apr_status_t util_ldap_cache_init(apr_pool_t *pool, util_ldap_state_t *st);
Packit 90a5c9
Packit 90a5c9
/* from apr_ldap_cache_mgr.c */
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Display formatted stats for cache
Packit 90a5c9
 * @param The pool to allocate the returned string from
Packit 90a5c9
 * @tip This function returns a string allocated from the provided pool that describes
Packit 90a5c9
 *      various stats about the cache.
Packit 90a5c9
 * @fn char *util_ald_cache_display(apr_pool_t *pool, util_ldap_state_t *st)
Packit 90a5c9
 */
Packit 90a5c9
char *util_ald_cache_display(request_rec *r, util_ldap_state_t *st);
Packit 90a5c9
#ifdef __cplusplus
Packit 90a5c9
}
Packit 90a5c9
#endif
Packit 90a5c9
#endif /* APR_HAS_LDAP */
Packit 90a5c9
#endif /* UTIL_LDAP_H */