Lines Matching defs:dbi
193 ldap_connect(ldap_instance_t *dbi, dbinstance_t *dbc) {
206 dbc->dbconn = ldap_init(dbi->hosts, LDAP_PORT);
213 &(dbi->protocol));
220 ldap_result = ldap_bind_s((LDAP *) dbc->dbconn, dbi->user,
221 dbi->cred, dbi->method);
249 dbinstance_t *dbi = NULL;
256 dbi = ndbi;
258 ndbi = DLZ_LIST_NEXT(dbi, link);
260 if (dbi->dbconn != NULL)
261 ldap_unbind_s((LDAP *) dbi->dbconn);
263 destroy_dbinstance(dbi);
281 dbinstance_t *dbi = NULL;
286 head = dbi = DLZ_LIST_HEAD(*ldap->db);
291 if (dlz_mutex_trylock(&dbi->lock) == 0)
292 return (dbi); /* success, return the DBI for use. */
295 dbi = DLZ_LIST_NEXT(dbi, link);
298 if (dbi == NULL) {
300 dbi = head;
538 dbinstance_t *dbi = NULL;
549 dbi = ldap_find_avail_conn(db);
555 dbi = (dbinstance_t *)(db->db);
559 if (dbi == NULL)
564 dbi->zone = strdup(zone);
565 if (dbi->zone == NULL) {
570 dbi->zone = NULL;
573 dbi->record = strdup(record);
574 if (dbi->record == NULL) {
579 dbi->record = NULL;
582 dbi->client = strdup(client);
583 if (dbi->client == NULL) {
588 dbi->client = NULL;
600 if (dbi->allnodes_q == NULL) {
604 querystring = build_querystring(dbi->allnodes_q);
608 if (dbi->allowxfr_q == NULL) {
612 querystring = build_querystring(dbi->allowxfr_q);
616 if (dbi->authority_q == NULL) {
620 querystring = build_querystring(dbi->authority_q);
624 if (dbi->findzone_q == NULL) {
631 querystring = build_querystring(dbi->findzone_q);
635 if (dbi->lookup_q == NULL) {
642 querystring = build_querystring(dbi->lookup_q);
676 * dbi->dbconn may be null if trying to reconnect on a
679 if (dbi->dbconn == NULL) {
683 result = ldap_connect((ldap_instance_t *) dbdata, dbi);
691 ldap_result = ldap_search_s((LDAP *) dbi->dbconn,
715 result = ldap_connect((ldap_instance_t *) dbdata, dbi);
737 result = ldap_process_results(db, (LDAP *) dbi->dbconn,
743 result = ldap_process_results(db, (LDAP *) dbi->dbconn,
748 entries = ldap_count_entries((LDAP *) dbi->dbconn, ldap_msg);
757 entries = ldap_count_entries((LDAP *) dbi->dbconn, ldap_msg);
786 if (dbi->zone != NULL)
787 free(dbi->zone);
788 if (dbi->record != NULL)
789 free(dbi->record);
790 if (dbi->client != NULL)
791 free(dbi->client);
792 dbi->zone = dbi->record = dbi->client = NULL;
794 /* release the lock so another thread can use this dbi */
795 (void) dlz_mutex_unlock(&dbi->lock);
888 dbinstance_t *dbi = NULL;
1044 argv[8], NULL, &dbi,
1050 NULL, &dbi, ldap->log);
1055 NULL, &dbi, ldap->log);
1060 argv[8], NULL, &dbi,
1081 DLZ_LINK_INIT(dbi, link);
1082 DLZ_LIST_APPEND(*(ldap->db), dbi, link);
1088 ldap->db = dbi;
1091 result = ldap_connect(ldap, dbi);
1151 dbi = NULL;