00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00021 #ifndef __V2L_CONN_H
00022 #define __V2L_CONN_H
00023
00024 #include <ldap.h>
00025 #include <time.h>
00026
00027 #include <v2l_config.h>
00028
00030 typedef struct v2l_LdapConn
00031 {
00032 pool poolref;
00033 LDAP *ld;
00034 time_t creation_time;
00035 char *binddn;
00036 char *entry;
00037 char *user;
00038 struct v2l_LdapConn *next;
00039 } v2l_LdapConn;
00040
00042 typedef struct v2l_LdapRequest
00043 {
00044 LDAPMod *attr;
00045 struct v2l_LdapRequest *next;
00046 } v2l_LdapRequest;
00047
00052 typedef struct v2l_LdapEvt
00053 {
00054 LDAP *ld;
00055 int msgid;
00056 int rc;
00057 LDAPMessage *result;
00058 } v2l_LdapEvt;
00059
00069 typedef int (*v2l_AttrMatchFunction) (const char *attr, void **shrdata);
00070
00080 typedef void (*v2l_AttrValueFunction) (const char *attr, const char **vals,
00081 void *pointer, void *shrdata);
00082
00093 extern v2l_LdapConn *v2l_get_conn (v2l_Config *self, const char *user);
00094
00101 extern v2l_LdapConn *v2l_get_master_conn (v2l_Config *self);
00102
00107 extern void v2l_free_allconn (void);
00108
00115 extern v2l_LdapEvt *v2l_ldap_get_entry (v2l_Config *self,
00116 v2l_LdapConn *curr_conn);
00117
00125 extern int v2l_request_record (v2l_Config *self, v2l_LdapConn *curr_conn,
00126 v2l_LdapRequest *req);
00127
00134 extern v2l_LdapRequest *v2l_add_attr_str (v2l_LdapRequest *req,
00135 const char *attr, const char *str);
00136
00144 extern void v2l_ldap_for_all_attrs (v2l_AttrValueFunction value_func,
00145 v2l_AttrMatchFunction match_func, void *pointer, v2l_LdapEvt *evt_res);
00146 #endif