Lines Matching refs:cp

120 nssad_cfg_refresh(nssad_cfg_t *cp)
124 (void) ad_disc_SubnetChanged(cp->ad_ctx);
126 if (nssad_cfg_discover_props(cp->props.domain_name, cp->ad_ctx,
129 if (update_dirs(&cp->props.domain_controller,
131 if (cp->props.domain_controller != NULL &&
132 cp->props.domain_controller[0].host[0] != '\0')
133 (void) nssad_cfg_reload_ad(&cp->props, &cp->ad);
139 nssad_cfg_destroy(nssad_cfg_t *cp)
141 if (cp != NULL) {
142 (void) pthread_rwlock_destroy(&cp->lock);
143 ad_disc_fini(cp->ad_ctx);
144 nssad_cfg_free_props(&cp->props);
145 adutils_ad_free(&cp->ad);
146 free(cp);
153 nssad_cfg_t *cp;
155 if ((cp = calloc(1, sizeof (*cp))) == NULL)
157 if (pthread_rwlock_init(&cp->lock, NULL) != 0) {
158 free(cp);
161 if ((cp->ad_ctx = ad_disc_init()) == NULL)
163 if ((cp->props.domain_name = strdup(domain)) == NULL)
165 if (nssad_cfg_discover_props(domain, cp->ad_ctx, &cp->props) < 0)
167 if (nssad_cfg_reload_ad(&cp->props, &cp->ad) < 0)
169 return (cp);
171 nssad_cfg_destroy(cp);
278 nssad_cfg_t *cp, *lru, *prev;
295 for (cp = state.qtail, prev = NULL; cp != NULL;
296 prev = cp, cp = cp->qnext) {
297 if (cp->props.domain_name == NULL ||
298 strcasecmp(cp->props.domain_name, domain) != 0)
303 if (state.qtail != cp) {
309 prev->qnext = cp->qnext;
310 if (state.qhead == cp)
312 cp->qnext = state.qtail;
313 state.qtail = cp;
316 if (ad_disc_get_TTL(cp->ad_ctx) == 0) {
322 (void) pthread_rwlock_wrlock(&cp->lock);
323 if (nssad_cfg_refresh(cp) < 0) {
324 (void) pthread_rwlock_unlock(&cp->lock);
328 (void) pthread_rwlock_unlock(&cp->lock);
332 (void) pthread_rwlock_rdlock(&cp->lock);
334 return (cp);
338 if ((cp = nssad_cfg_create(domain)) == NULL) {
346 state.qtail = state.qhead = cp;
347 (void) pthread_rwlock_rdlock(&cp->lock);
349 return (cp);
351 cp->qnext = state.qtail;
352 state.qtail = cp;
374 (void) pthread_rwlock_rdlock(&cp->lock);
376 return (cp);
389 nssad_cfg_t *cp;
392 if ((cp = get_cfg(domain)) == NULL)
395 rc = adutils_lookup_batch_start(cp->ad, 1, NULL, NULL, &qs);
396 (void) pthread_rwlock_unlock(&cp->lock);
451 nssad_cfg_t *cp, *curr;
454 for (cp = state.qtail; cp != NULL; ) {
455 curr = cp;
456 cp = cp->qnext;