include/v2l_conn.h

Go to the documentation of this file.
00001 /*
00002  *  This program is free software; you can redistribute it and/or modify
00003  *  it under the terms of the GNU General Public License as published by
00004  *  the Free Software Foundation; either version 2 of the License, or
00005  *  (at your option) any later version.
00006  *
00007  *  This program is distributed in the hope that it will be useful,
00008  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00009  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010  *  GNU General Public License for more details.
00011  *
00012  *  You should have received a copy of the GNU General Public License
00013  *  along with this program; if not, write to the Free Software
00014  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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

Generated on Sun Oct 7 14:38:12 2007 for vCard2LDAP by  doxygen 1.5.1