2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #include <v2l_config.h>
25 typedef struct v2l_LdapConn
30 char *binddn
; /* complete dn */
31 char *entry
; /* short dn */
32 char *user
; /* username */
34 struct v2l_LdapConn
*next
;
37 /* to store LDAP request to be executed after having retrieved vCard data */
38 typedef struct v2l_LdapRequest
41 struct v2l_LdapRequest
*next
;
44 /* For retrieve results from asynchronous requests */
45 typedef struct v2l_LdapEvt
53 extern v2l_LdapConn
*v2l_get_conn (v2l_Config
*self
, const char *user
);
54 extern v2l_LdapConn
*v2l_get_master_conn (v2l_Config
*self
);
55 extern void v2l_free_allconn ();
56 extern void v2l_ldap_sync (v2l_LdapEvt
*evt_res
); /* wait for LDAP results */
57 extern int v2l_ldap_search (char *dn
, char *suffix
, char **attrs
, int subtree
,
58 v2l_LdapEvt
*evt_res
);
59 extern int v2l_ldap_modify (char *dn
, LDAPMod
**attrs
, v2l_LdapEvt
*evt_res
);
60 extern int v2l_request_record (v2l_Config
*self
, v2l_LdapConn
* curr_conn
,
61 v2l_LdapRequest
*req
);
62 extern v2l_LdapRequest
*v2l_add_attr_str (v2l_LdapRequest
*req
,
63 const char *attr
, const char *str
);