Lines Matching refs:info

454 sync_current_with_update_copy(server_info_t *info)  in sync_current_with_update_copy()  argument
460 (void) mutex_lock(&info->mutex[1]); in sync_current_with_update_copy()
461 (void) mutex_lock(&info->mutex[0]); in sync_current_with_update_copy()
463 if (info->sinfo[1].server_status == INFO_SERVER_UP && in sync_current_with_update_copy()
464 info->sinfo[0].server_status != INFO_SERVER_UP) in sync_current_with_update_copy()
465 info->sinfo[1].change = NS_SERVER_UP; in sync_current_with_update_copy()
466 else if (info->sinfo[1].server_status != INFO_SERVER_UP && in sync_current_with_update_copy()
467 info->sinfo[0].server_status == INFO_SERVER_UP) in sync_current_with_update_copy()
468 info->sinfo[1].change = NS_SERVER_DOWN; in sync_current_with_update_copy()
470 info->sinfo[1].change = 0; in sync_current_with_update_copy()
474 if (info->sinfo[0].addr) in sync_current_with_update_copy()
475 free(info->sinfo[0].addr); in sync_current_with_update_copy()
476 info->sinfo[0].addr = NULL; in sync_current_with_update_copy()
478 if (info->sinfo[0].hostname) in sync_current_with_update_copy()
479 free(info->sinfo[0].hostname); in sync_current_with_update_copy()
480 info->sinfo[0].hostname = NULL; in sync_current_with_update_copy()
482 if (info->sinfo[0].rootDSE_data) in sync_current_with_update_copy()
483 free(info->sinfo[0].rootDSE_data); in sync_current_with_update_copy()
484 info->sinfo[0].rootDSE_data = NULL; in sync_current_with_update_copy()
486 if (info->sinfo[0].errormsg) in sync_current_with_update_copy()
487 free(info->sinfo[0].errormsg); in sync_current_with_update_copy()
488 info->sinfo[0].errormsg = NULL; in sync_current_with_update_copy()
493 info->sinfo[0] = info->sinfo[1]; in sync_current_with_update_copy()
506 if (info->sinfo[1].addr) in sync_current_with_update_copy()
507 info->sinfo[0].addr = strdup(info->sinfo[1].addr); in sync_current_with_update_copy()
508 if (info->sinfo[1].hostname) in sync_current_with_update_copy()
509 info->sinfo[0].hostname = strdup(info->sinfo[1].hostname); in sync_current_with_update_copy()
510 if (info->sinfo[1].rootDSE_data) in sync_current_with_update_copy()
511 info->sinfo[0].rootDSE_data = in sync_current_with_update_copy()
512 strdup(info->sinfo[1].rootDSE_data); in sync_current_with_update_copy()
513 if (info->sinfo[1].errormsg) in sync_current_with_update_copy()
514 info->sinfo[0].errormsg = strdup(info->sinfo[1].errormsg); in sync_current_with_update_copy()
516 (void) mutex_unlock(&info->mutex[0]); in sync_current_with_update_copy()
517 (void) mutex_unlock(&info->mutex[1]); in sync_current_with_update_copy()
657 server_info_t *info, *tail = NULL; in getldap_init_serverInfo() local
673 info = (server_info_t *)calloc(1, sizeof (server_info_t)); in getldap_init_serverInfo()
674 if (info == NULL) { in getldap_init_serverInfo()
681 *head = info; in getldap_init_serverInfo()
682 tail = info; in getldap_init_serverInfo()
684 tail->next = info; in getldap_init_serverInfo()
685 tail = info; in getldap_init_serverInfo()
688 info->sinfo[0].addr = strdup(servers[i]); in getldap_init_serverInfo()
689 if (info->sinfo[0].addr == NULL) { in getldap_init_serverInfo()
695 info->sinfo[1].addr = strdup(servers[i]); in getldap_init_serverInfo()
696 if (info->sinfo[1].addr == NULL) { in getldap_init_serverInfo()
703 info->sinfo[0].type = INFO_RW_UNKNOWN; in getldap_init_serverInfo()
704 info->sinfo[1].type = INFO_RW_UNKNOWN; in getldap_init_serverInfo()
705 info->sinfo[0].info_status = INFO_STATUS_UNKNOWN; in getldap_init_serverInfo()
706 info->sinfo[1].info_status = INFO_STATUS_UNKNOWN; in getldap_init_serverInfo()
707 info->sinfo[0].server_status = INFO_SERVER_UNKNOWN; in getldap_init_serverInfo()
708 info->sinfo[1].server_status = INFO_SERVER_UNKNOWN; in getldap_init_serverInfo()
714 info->sinfo[0].prev_server_status = in getldap_init_serverInfo()
716 info->sinfo[1].prev_server_status = in getldap_init_serverInfo()
718 info->sinfo[0].hostname = NULL; in getldap_init_serverInfo()
719 info->sinfo[1].hostname = NULL; in getldap_init_serverInfo()
720 info->sinfo[0].rootDSE_data = NULL; in getldap_init_serverInfo()
721 info->sinfo[1].rootDSE_data = NULL; in getldap_init_serverInfo()
722 info->sinfo[0].errormsg = NULL; in getldap_init_serverInfo()
723 info->sinfo[1].errormsg = NULL; in getldap_init_serverInfo()
724 info->next = NULL; in getldap_init_serverInfo()
739 server_info_t *info, *next; in getldap_destroy_serverInfo() local
751 for (info = head; info; info = next) { in getldap_destroy_serverInfo()
752 if (info->sinfo[0].addr) in getldap_destroy_serverInfo()
753 free(info->sinfo[0].addr); in getldap_destroy_serverInfo()
754 if (info->sinfo[1].addr) in getldap_destroy_serverInfo()
755 free(info->sinfo[1].addr); in getldap_destroy_serverInfo()
756 if (info->sinfo[0].hostname) in getldap_destroy_serverInfo()
757 free(info->sinfo[0].hostname); in getldap_destroy_serverInfo()
758 if (info->sinfo[1].hostname) in getldap_destroy_serverInfo()
759 free(info->sinfo[1].hostname); in getldap_destroy_serverInfo()
760 if (info->sinfo[0].rootDSE_data) in getldap_destroy_serverInfo()
761 free(info->sinfo[0].rootDSE_data); in getldap_destroy_serverInfo()
762 if (info->sinfo[1].rootDSE_data) in getldap_destroy_serverInfo()
763 free(info->sinfo[1].rootDSE_data); in getldap_destroy_serverInfo()
764 if (info->sinfo[0].errormsg) in getldap_destroy_serverInfo()
765 free(info->sinfo[0].errormsg); in getldap_destroy_serverInfo()
766 if (info->sinfo[1].errormsg) in getldap_destroy_serverInfo()
767 free(info->sinfo[1].errormsg); in getldap_destroy_serverInfo()
768 next = info->next; in getldap_destroy_serverInfo()
769 free(info); in getldap_destroy_serverInfo()
777 server_info_t *info; in getldap_set_serverInfo() local
810 for (info = head; info; info = info->next) in getldap_set_serverInfo()
826 for (info = head, i = 0; info; info = info->next, i++) { in getldap_set_serverInfo()
829 (void *)info, 0, &tid[i])) { in getldap_set_serverInfo()
891 server_info_t *info = NULL; in getldap_get_serverInfo() local
944 for (info = head; info; info = info->next) { in getldap_get_serverInfo()
956 (void) mutex_lock(&info->mutex[0]); in getldap_get_serverInfo()
959 strcmp(info->sinfo[0].addr, addr) == 0) { in getldap_get_serverInfo()
964 (void) mutex_unlock(&info->mutex[0]); in getldap_get_serverInfo()
976 if (info->sinfo[0].info_status == in getldap_get_serverInfo()
978 info->sinfo[0].server_status == in getldap_get_serverInfo()
980 server = info; in getldap_get_serverInfo()
1004 new_addr = strdup(info->sinfo[0].addr); in getldap_get_serverInfo()
1008 (void) mutex_unlock(&info->mutex[0]); in getldap_get_serverInfo()
1015 (void) mutex_unlock(&info->mutex[0]); in getldap_get_serverInfo()
1022 if (info->sinfo[0].type == in getldap_get_serverInfo()
1024 info->sinfo[0].server_status == in getldap_get_serverInfo()
1026 server = info; in getldap_get_serverInfo()
1029 } else if (info->sinfo[0].server_status == in getldap_get_serverInfo()
1031 server = info; in getldap_get_serverInfo()
1036 (void) mutex_unlock(&info->mutex[0]); in getldap_get_serverInfo()
1051 (void) mutex_unlock(&info->mutex[0]); in getldap_get_serverInfo()
1075 (void) mutex_unlock(&info->mutex[0]); in getldap_get_serverInfo()
1088 (void) mutex_unlock(&info->mutex[0]); in getldap_get_serverInfo()
1165 server_info_t *info = NULL; in getldap_get_server_stat() local
1202 for (info = head; info; info = info->next) { in getldap_get_server_stat()
1208 (void) mutex_lock(&info->mutex[1]); in getldap_get_server_stat()
1222 switch (info->sinfo[1].server_status) { in getldap_get_server_stat()
1241 strlen(info->sinfo[1].addr) + in getldap_get_server_stat()
1243 if (info->sinfo[1].errormsg != NULL) in getldap_get_server_stat()
1245 strlen(info->sinfo[1].errormsg) + in getldap_get_server_stat()
1253 (void) mutex_unlock(&info->mutex[1]); in getldap_get_server_stat()
1261 gettext(S_FORMAT), info->sinfo[1].addr, in getldap_get_server_stat()
1265 if (info->sinfo[1].errormsg != NULL) in getldap_get_server_stat()
1268 info->sinfo[1].errormsg, in getldap_get_server_stat()
1271 (void) mutex_unlock(&info->mutex[1]); in getldap_get_server_stat()
1459 server_info_t *info; in getldap_set_refresh_ttl() local
1536 for (info = head; info; info = info->next) { in getldap_set_refresh_ttl()
1538 (void) mutex_lock(&info->mutex[0]); in getldap_set_refresh_ttl()
1539 if (info->sinfo[0].server_status == INFO_SERVER_UP) in getldap_set_refresh_ttl()
1546 if (info->sinfo[0].prev_server_status in getldap_set_refresh_ttl()
1548 info->sinfo[0].prev_server_status in getldap_set_refresh_ttl()
1551 (void) mutex_unlock(&info->mutex[0]); in getldap_set_refresh_ttl()
2743 server_info_t *info; in test_server_change() local
2750 for (info = head; info; info = info->next) { in test_server_change()
2751 (void) mutex_lock(&info->mutex[0]); in test_server_change()
2752 if (info->sinfo[0].change != 0) { in test_server_change()
2754 len += 2 * ds_len + strlen(info->sinfo[0].addr) + in test_server_change()
2758 (void) mutex_unlock(&info->mutex[0]); in test_server_change()
2779 for (info = head; info; info = info->next) { in test_server_change()
2780 (void) mutex_lock(&info->mutex[0]); in test_server_change()
2781 if (info->sinfo[0].change == 0) { in test_server_change()
2782 (void) mutex_unlock(&info->mutex[0]); in test_server_change()
2786 if (info->sinfo[0].change == NS_SERVER_UP) in test_server_change()
2788 else if (info->sinfo[0].change == NS_SERVER_DOWN) in test_server_change()
2792 info->sinfo[0].change); in test_server_change()
2793 (void) mutex_unlock(&info->mutex[0]); in test_server_change()
2799 info->sinfo[0].addr, DOORLINESEP, in test_server_change()
2801 (void) mutex_unlock(&info->mutex[0]); in test_server_change()
2807 (void) mutex_unlock(&info->mutex[0]); in test_server_change()
2930 server_info_t *info; in set_server_status() local
2932 for (info = head; info != NULL; info = info->next) { in set_server_status()
2933 (void) mutex_lock(&info->mutex[0]); in set_server_status()
2934 if (strcmp(info->sinfo[0].addr, rms->addr) == 0) { in set_server_status()
2935 if (info->sinfo[0].server_status == INFO_SERVER_UP && in set_server_status()
2937 info->sinfo[0].prev_server_status = in set_server_status()
2938 info->sinfo[0].server_status; in set_server_status()
2939 info->sinfo[0].server_status = in set_server_status()
2941 info->sinfo[0].change = NS_SERVER_DOWN; in set_server_status()
2944 } else if (info->sinfo[0].server_status == in set_server_status()
2949 info->sinfo[0].prev_server_status = in set_server_status()
2950 info->sinfo[0].server_status; in set_server_status()
2951 info->sinfo[0].server_status = in set_server_status()
2953 info->sinfo[0].change = NS_SERVER_UP; in set_server_status()
2956 (void) mutex_unlock(&info->mutex[0]); in set_server_status()
2959 (void) mutex_unlock(&info->mutex[0]); in set_server_status()
2963 (void) mutex_lock(&info->mutex[1]); in set_server_status()
2964 info->sinfo[1].prev_server_status = in set_server_status()
2965 info->sinfo[1].server_status; in set_server_status()
2967 info->sinfo[1].server_status = INFO_SERVER_ERROR; in set_server_status()
2969 info->sinfo[1].server_status = INFO_SERVER_UP; in set_server_status()
2970 (void) mutex_unlock(&info->mutex[1]); in set_server_status()