/* Licensed to the Apache Software Foundation (ASF) under one or more *contributorlicenseagreements.SeetheNOTICEfiledistributedwith *thisworkforadditionalinformationregardingcopyrightownership. *TheASFlicensesthisfiletoYouundertheApacheLicense,Version2.0 *(the"License");youmaynotusethisfileexceptincompliancewith *theLicense.YoumayobtainacopyoftheLicenseat * *http://www.apache.org/licenses/LICENSE-2.0 * *Unlessrequiredbyapplicablelaworagreedtoinwriting,software *distributedundertheLicenseisdistributedonan"ASIS"BASIS, *WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied. *SeetheLicenseforthespecificlanguagegoverningpermissionsand *limitationsundertheLicense.
*/
/** *@fileutil_ldap.h *@briefApacheLDAPlibrary
*/
#ifndef UTIL_LDAP_H #define UTIL_LDAP_H
/* APR header files */ #include"apr.h" #include"apr_thread_mutex.h" #include"apr_thread_rwlock.h" #include"apr_tables.h" #include"apr_time.h" #include"apr_version.h" #if APR_MAJOR_VERSION < 2 /* The LDAP API is currently only present in APR 1.x */ #include"apr_ldap.h" #else #define APR_HAS_LDAP 0 #endif
/* Create a set of LDAP_DECLARE macros with appropriate export *andimporttagsfortheplatform
*/ #if !defined(WIN32) #define LDAP_DECLARE(type) type #define LDAP_DECLARE_NONSTD(type) type #define LDAP_DECLARE_DATA #elifdefined(LDAP_DECLARE_STATIC) #define LDAP_DECLARE(type) type __stdcall #define LDAP_DECLARE_NONSTD(type) type #define LDAP_DECLARE_DATA #elifdefined(LDAP_DECLARE_EXPORT) #define LDAP_DECLARE(type) __declspec(dllexport) type __stdcall #define LDAP_DECLARE_NONSTD(type) __declspec(dllexport) type #define LDAP_DECLARE_DATA __declspec(dllexport) #else #define LDAP_DECLARE(type) __declspec(dllimport) type __stdcall #define LDAP_DECLARE_NONSTD(type) __declspec(dllimport) type #define LDAP_DECLARE_DATA __declspec(dllimport) #endif
/* Values that the deref member can have */ typedefenum {
never=LDAP_DEREF_NEVER,
searching=LDAP_DEREF_SEARCHING,
finding=LDAP_DEREF_FINDING,
always=LDAP_DEREF_ALWAYS
} deref_options;
/* Structure representing an LDAP connection */ typedefstruct util_ldap_connection_t {
LDAP *ldap;
apr_pool_t *pool; /* Pool from which this connection is created */ #if APR_HAS_THREADS
apr_thread_mutex_t *lock; /* Lock to indicate this connection is in use */ #endif
constchar *host; /* Name of the LDAP server (or space separated list) */ int port; /* Port of the LDAP server */
deref_options deref; /* how to handle alias dereferening */
constchar *binddn; /* DN to bind to server (can be NULL) */ constchar *bindpw; /* Password to bind to server (can be NULL) */
int bound; /* Flag to indicate whether this connection is bound yet */
int secure; /* SSL/TLS mode of the connection */
apr_array_header_t *client_certs; /* Client certificates on this connection */
constchar *reason; /* Reason for an error failure */
struct util_ldap_connection_t *next; struct util_ldap_state_t *st; /* The LDAP vhost config this connection belongs to */ int keep; /* Will this connection be kept when it's unlocked */
int ChaseReferrals; /* [on|off] (default = AP_LDAP_CHASEREFERRALS_ON)*/ int ReferralHopLimit; /* # of referral hops to follow (default = AP_LDAP_DEFAULT_HOPLIMIT) */
apr_time_t freed; /* the time this conn was placed back in the pool */
apr_pool_t *rebind_pool; /* frequently cleared pool for rebind data */ int must_rebind; /* The connection was last bound with other then binddn/bindpw */
request_rec *r; /* request_rec used to find this util_ldap_connection_t */
apr_time_t last_backend_conn; /* the approximate time of the last backend LDAP request */
} util_ldap_connection_t;
typedefstruct util_ldap_config_t { int ChaseReferrals; int ReferralHopLimit;
apr_array_header_t *client_certs; /* Client certificates */
} util_ldap_config_t;
/* LDAP cache state information */ typedefstruct util_ldap_state_t {
apr_pool_t *pool; /* pool from which this state is allocated */ #if APR_HAS_THREADS
apr_thread_mutex_t *mutex; /* mutex lock for the connection list */ #endif
apr_global_mutex_t *util_ldap_cache_lock;
apr_size_t cache_bytes; /* Size (in bytes) of shared memory cache */ char *cache_file; /* filename for shm */ long search_cache_ttl; /* TTL for search cache */ long search_cache_size; /* Size (in entries) of search cache */ long compare_cache_ttl; /* TTL for compare cache */ long compare_cache_size; /* Size (in entries) of compare cache */
struct util_ldap_connection_t *connections;
apr_array_header_t *global_certs; /* Global CA certificates */ int ssl_supported; int secure; int secure_set; int verify_svr_cert;
long connectionTimeout; struct timeval *opTimeout;
int debug_level; /* SDK debug level */
apr_interval_time_t connection_pool_ttl; int retries; /* number of retries for failed bind/search/compare */
apr_interval_time_t retry_delay; /* delay between retries of failed bind/search/compare */
} util_ldap_state_t;
/* Used to store arrays of attribute labels/values. */ struct mod_auth_ldap_groupattr_entry_t { char *name;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.