Lines Matching refs:ld

70  *	LDAP	*ld;
71 * ld = ldap_open( hostname, port );
77 LDAP *ld;
80 if ((ld = ldap_init(host, port)) == NULL) {
88 LOCK_LDAP(ld);
90 if ((err = open_default_ldap_connection(ld)) != LDAP_SUCCESS) {
92 UNLOCK_LDAP(ld);
94 ldap_ld_free(ld, 0);
103 (ld->ld_host == NULL) ? "(null)" : ld->ld_host, 0, 0);
105 UNLOCK_LDAP(ld);
107 return (ld);
113 * ld->ld_defconn MUST be null when calling this function,
115 * ld should be LOCKed before calling this function
118 open_default_ldap_connection(LDAP *ld)
124 NULL || (ld->ld_defhost != NULL && (srv->lsrv_host =
125 strdup(ld->ld_defhost)) == NULL)) {
128 srv->lsrv_port = ld->ld_defport;
130 if ((ld->ld_defconn = new_connection(ld, &srv, 1, 1, 0)) ==
132 err = ld->ld_errno;
135 "opened (%d)\n"), ld->ld_defhost, err, 0);
137 if (ld->ld_defhost != NULL)
144 ++ld->ld_defconn->lconn_refcnt;
187 * LDAP *ld;
188 * ld = ldap_init( default_hostname, default_port );
193 LDAP *ld;
203 if ((ld = (LDAP *) calloc(1, sizeof (LDAP))) == NULL) {
208 pthread_mutex_init(&ld->ld_ldap_mutex, DEFAULT_TYPE);
209 pthread_mutex_init(&ld->ld_response_mutex, DEFAULT_TYPE);
210 pthread_mutex_init(&ld->ld_poll_mutex, DEFAULT_TYPE);
211 ld->ld_lockthread = 0;
214 if ((ld->ld_selectinfo = new_select_info()) == NULL) {
215 free((char *)ld);
218 ld->ld_follow_referral = 1;
226 (ld->ld_defhost = strdup(defhost)) == NULL) {
227 free_select_info(ld->ld_selectinfo);
228 free((char *)ld);
232 ld->ld_defport = (defport == 0) ? LDAP_PORT : defport;
233 ld->ld_version = LDAP_VERSION;
234 ld->ld_lberoptions = LBER_USE_DER;
235 ld->ld_refhoplimit = LDAP_DEFAULT_REFHOPLIMIT;
236 ld->ld_connect_timeout = LDAP_X_IO_TIMEOUT_NO_TIMEOUT;
239 ld->ld_lberoptions |= LBER_TRANSLATE_STRINGS;
241 ldap_set_string_translators(ld, ldap_8859_to_t61,
246 return (ld);
252 open_ldap_connection(LDAP *ld, Sockbuf *sb, char *host, int defport,
264 bindTimeout = ld->ld_connect_timeout;
332 * LDAP *ld;
333 * ld = ldap_ssl_open( hostname, port, key );
341 establish_ssl_connection(LDAP *ld)
358 if (ld->ld_ssl_key != NULL) {
359 if (SSL_set_userid(ssl, ld->ld_ssl_key, 0) == NULL) {
368 if (SSL_connect(ssl, ld->ld_sb.sb_sd) < 1) {
375 ld->ld_sb.sb_ssl = ssl;
383 LDAP *ld;
390 ld = ldap_open(host, port);
395 if (ld == NULL)
398 ld->ld_use_ssl = 1;
400 ld->ld_ssl_key = strdup(keyname);
402 if (establish_ssl_connection(ld) != 0) {
403 ldap_ld_free(ld, 1);
407 return (ld);
413 LDAP *ld;
420 ld = ldap_init(defhost, defport);
425 if (ld == NULL)
427 ld->ld_use_ssl = 1;
428 ld->ld_ssl_key = strdup(keyname);
430 return (ld);