• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/OpenLDAP-499.27/OpenLDAP/libraries/libldap/

Lines Matching defs:ld

47 int ldap_open_defconn( LDAP *ld )
49 ld->ld_defconn = ldap_new_connection( ld,
50 &ld->ld_options.ldo_defludp, 1, 1, NULL, 0, 0 );
52 if( ld->ld_defconn == NULL ) {
53 ld->ld_errno = LDAP_SERVER_DOWN;
57 ++ld->ld_defconn->lconn_refcnt; /* so it never gets closed/freed */
67 * LDAP *ld;
68 * ld = ldap_open( hostname, port );
75 LDAP *ld;
80 ld = ldap_init( host, port );
81 if ( ld == NULL ) {
85 LDAP_MUTEX_LOCK( &ld->ld_conn_mutex );
86 rc = ldap_open_defconn( ld );
87 LDAP_MUTEX_UNLOCK( &ld->ld_conn_mutex );
90 ldap_ld_free( ld, 0, NULL, NULL );
91 ld = NULL;
95 ld != NULL ? "succeeded" : "failed", 0, 0 );
97 return ld;
103 LDAP *ld;
133 if ( (ld = (LDAP *) LDAP_CALLOC( 1, sizeof(LDAP) )) == NULL ) {
137 if ( (ld->ldc = (struct ldap_common *) LDAP_CALLOC( 1,
139 LDAP_FREE( (char *)ld );
144 AC_MEMCPY(&ld->ld_options, gopts, sizeof(ld->ld_options));
147 ldap_pvt_thread_mutex_init( &(ld->ld_ldopts_mutex) );
151 ld->ld_valid = LDAP_VALID_SESSION;
154 ld->ld_options.ldo_sctrls = NULL;
155 ld->ld_options.ldo_cctrls = NULL;
156 ld->ld_options.ldo_defludp = NULL;
157 ld->ld_options.ldo_conn_cbs = NULL;
159 ld->ld_options.ldo_noaddr_option = 0;
160 ld->ld_options.ldo_sasl_fqdn = NULL;
163 ld->ld_options.ldo_def_sasl_mech = gopts->ldo_def_sasl_mech
165 ld->ld_options.ldo_def_sasl_realm = gopts->ldo_def_sasl_realm
167 ld->ld_options.ldo_def_sasl_authcid = gopts->ldo_def_sasl_authcid
169 ld->ld_options.ldo_def_sasl_authzid = gopts->ldo_def_sasl_authzid
177 memset( &ld->ld_options.ldo_tls_info, 0,
178 sizeof( ld->ld_options.ldo_tls_info ));
179 ld->ld_options.ldo_tls_ctx = NULL;
183 ld->ld_options.ldo_defludp = ldap_url_duplist(gopts->ldo_defludp);
185 if ( ld->ld_options.ldo_defludp == NULL ) goto nomem;
188 if (( ld->ld_selectinfo = ldap_new_select_info()) == NULL ) goto nomem;
190 ld->ld_lberoptions = LBER_USE_DER;
192 ld->ld_sb = ber_sockbuf_alloc( );
193 if ( ld->ld_sb == NULL ) goto nomem;
196 ldap_resp_rbt_create( ld );
197 if ( ld->ld_rbt_responses == NULL ) {
203 ldap_pvt_thread_mutex_init( &ld->ld_msgid_mutex );
204 ldap_pvt_thread_mutex_init( &ld->ld_conn_mutex );
205 ldap_pvt_thread_mutex_init( &ld->ld_req_mutex );
206 ldap_pvt_thread_mutex_init( &ld->ld_res_mutex );
207 ldap_pvt_thread_mutex_init( &ld->ld_abandon_mutex );
208 ldap_pvt_thread_mutex_init( &ld->ld_ldcmutex );
210 ld->ld_ldcrefcnt = 1;
211 *ldp = ld;
215 ldap_free_select_info( ld->ld_selectinfo );
216 ldap_free_urllist( ld->ld_options.ldo_defludp );
218 LDAP_FREE( ld->ld_options.ldo_def_sasl_authzid );
219 LDAP_FREE( ld->ld_options.ldo_def_sasl_authcid );
220 LDAP_FREE( ld->ld_options.ldo_def_sasl_realm );
221 LDAP_FREE( ld->ld_options.ldo_def_sasl_mech );
223 LDAP_FREE( (char *)ld );
233 * LDAP *ld;
234 * ld = ldap_init( host, port );
239 LDAP *ld;
242 rc = ldap_create(&ld);
247 ld->ld_options.ldo_defport = defport;
250 rc = ldap_set_option(ld, LDAP_OPT_HOST_NAME, defhost);
252 ldap_ld_free(ld, 1, NULL, NULL);
257 return( ld );
265 LDAP *ld;
268 rc = ldap_create(&ld);
273 rc = ldap_set_option(ld, LDAP_OPT_URI, url);
275 ldap_ld_free(ld, 1, NULL, NULL);
280 LDAP_IS_UDP(ld) = 1;
284 *ldp = ld;
297 LDAP *ld;
301 rc = ldap_create( &ld );
306 rc = ldap_set_option(ld, LDAP_OPT_URI, url);
308 ldap_ld_free(ld, 1, NULL, NULL);
313 LDAP_MUTEX_LOCK( &ld->ld_conn_mutex );
315 conn = ldap_new_connection( ld, NULL, 1, 0, NULL, 0, 0 );
317 ldap_unbind_ext( ld, NULL, NULL );
321 conn->lconn_server = ldap_url_dup( ld->ld_options.ldo_defludp );
323 ld->ld_defconn = conn;
324 ++ld->ld_defconn->lconn_refcnt; /* so it never gets closed/freed */
325 LDAP_MUTEX_UNLOCK( &ld->ld_conn_mutex );
364 ldap_unbind_ext( ld, NULL, NULL );
374 ldap_mark_select_read( ld, conn->lconn_sb );
375 ldap_mark_select_write( ld, conn->lconn_sb );
377 *ldp = ld;
384 LDAP *ld,
396 rc = ldap_connect_to_host( ld, conn->lconn_sb,
411 LDAP_IS_UDP(ld) = 1;
412 rc = ldap_connect_to_host( ld, conn->lconn_sb,
431 rc = ldap_connect_to_path( ld, conn->lconn_sb,
460 if (rc == 0 && ( ld->ld_options.ldo_tls_mode == LDAP_OPT_X_TLS_HARD ||
465 rc = ldap_int_tls_start( ld, conn, srv );
490 LDAP *ld;
492 rc = ldap_create( &ld );
501 ldap_unbind_ext( ld, NULL, NULL );
509 /* no mutex lock needed, we just created this ld here */
510 ld->ld_requests = lr;
512 LDAP_MUTEX_LOCK( &ld->ld_conn_mutex );
514 c = ldap_new_connection( ld, NULL, 1, 0, NULL, 0, 0 );
516 ldap_unbind_ext( ld, NULL, NULL );
518 LDAP_MUTEX_UNLOCK( &ld->ld_conn_mutex );
528 ld->ld_defconn = c;
529 LDAP_MUTEX_UNLOCK( &ld->ld_conn_mutex );
532 ldap_mark_select_read( ld, c->lconn_sb );
533 ldap_mark_select_write( ld, c->lconn_sb );
537 ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &rc );
538 *ldp = ld;
540 ++ld->ld_defconn->lconn_refcnt; /* so it never gets closed/freed */
548 LDAP *ld;
556 if ( (ld = (LDAP *) LDAP_CALLOC( 1, sizeof(LDAP) )) == NULL ) {
561 ld->ldc = old->ldc;
564 return ( ld );
568 ldap_int_check_async_open( LDAP *ld, ber_socket_t sd )
573 rc = ldap_int_poll( ld, sd, &tv );
577 ld->ld_defconn->lconn_status = LDAP_CONNST_CONNECTED;
581 ld->ld_errno = LDAP_CONNECT_ERROR;
586 ld->ld_errno = LDAP_X_CONNECTING;
591 if ( ld->ld_options.ldo_tls_mode == LDAP_OPT_X_TLS_HARD ||
592 !strcmp( ld->ld_defconn->lconn_server->lud_scheme, "ldaps" )) {
594 ++ld->ld_defconn->lconn_refcnt; /* avoid premature free */
596 rc = ldap_int_tls_start( ld, ld->ld_defconn, ld->ld_defconn->lconn_server );
598 --ld->ld_defconn->lconn_refcnt;