Lines Matching refs:cp

122 nssad_cfg_refresh(nssad_cfg_t *cp)
126 (void) ad_disc_SubnetChanged(cp->ad_ctx);
128 if (nssad_cfg_discover_props(cp->props.domain_name, cp->ad_ctx,
131 if (update_dirs(&cp->props.domain_controller,
133 if (cp->props.domain_controller != NULL &&
134 cp->props.domain_controller[0].host[0] != '\0')
135 (void) nssad_cfg_reload_ad(&cp->props, &cp->ad);
141 nssad_cfg_destroy(nssad_cfg_t *cp)
143 if (cp != NULL) {
144 (void) pthread_rwlock_destroy(&cp->lock);
145 ad_disc_fini(cp->ad_ctx);
146 nssad_cfg_free_props(&cp->props);
147 adutils_ad_free(&cp->ad);
148 free(cp);
155 nssad_cfg_t *cp;
157 if ((cp = calloc(1, sizeof (*cp))) == NULL)
159 if (pthread_rwlock_init(&cp->lock, NULL) != 0) {
160 free(cp);
163 if ((cp->ad_ctx = ad_disc_init()) == NULL)
165 if ((cp->props.domain_name = strdup(domain)) == NULL)
167 if (nssad_cfg_discover_props(domain, cp->ad_ctx, &cp->props) < 0)
169 if (nssad_cfg_reload_ad(&cp->props, &cp->ad) < 0)
171 return (cp);
173 nssad_cfg_destroy(cp);
280 nssad_cfg_t *cp, *lru, *prev;
297 for (cp = state.qtail, prev = NULL; cp != NULL;
298 prev = cp, cp = cp->qnext) {
299 if (cp->props.domain_name == NULL ||
300 strcasecmp(cp->props.domain_name, domain) != 0)
305 if (state.qtail != cp) {
311 prev->qnext = cp->qnext;
312 if (state.qhead == cp)
314 cp->qnext = state.qtail;
315 state.qtail = cp;
318 if (ad_disc_get_TTL(cp->ad_ctx) == 0) {
324 (void) pthread_rwlock_wrlock(&cp->lock);
325 if (nssad_cfg_refresh(cp) < 0) {
326 (void) pthread_rwlock_unlock(&cp->lock);
330 (void) pthread_rwlock_unlock(&cp->lock);
334 (void) pthread_rwlock_rdlock(&cp->lock);
336 return (cp);
340 if ((cp = nssad_cfg_create(domain)) == NULL) {
348 state.qtail = state.qhead = cp;
349 (void) pthread_rwlock_rdlock(&cp->lock);
351 return (cp);
353 cp->qnext = state.qtail;
354 state.qtail = cp;
376 (void) pthread_rwlock_rdlock(&cp->lock);
378 return (cp);
391 nssad_cfg_t *cp;
394 if ((cp = get_cfg(domain)) == NULL)
397 rc = adutils_lookup_batch_start(cp->ad, 1, NULL, NULL, &qs);
398 (void) pthread_rwlock_unlock(&cp->lock);
453 nssad_cfg_t *cp, *curr;
456 for (cp = state.qtail; cp != NULL; ) {
457 curr = cp;
458 cp = cp->qnext;