Lines Matching refs:info

456 sync_current_with_update_copy(server_info_t *info)  in sync_current_with_update_copy()  argument
462 (void) mutex_lock(&info->mutex[1]); in sync_current_with_update_copy()
463 (void) mutex_lock(&info->mutex[0]); in sync_current_with_update_copy()
465 if (info->sinfo[1].server_status == INFO_SERVER_UP && in sync_current_with_update_copy()
466 info->sinfo[0].server_status != INFO_SERVER_UP) in sync_current_with_update_copy()
467 info->sinfo[1].change = NS_SERVER_UP; in sync_current_with_update_copy()
468 else if (info->sinfo[1].server_status != INFO_SERVER_UP && in sync_current_with_update_copy()
469 info->sinfo[0].server_status == INFO_SERVER_UP) in sync_current_with_update_copy()
470 info->sinfo[1].change = NS_SERVER_DOWN; in sync_current_with_update_copy()
472 info->sinfo[1].change = 0; in sync_current_with_update_copy()
476 if (info->sinfo[0].addr) in sync_current_with_update_copy()
477 free(info->sinfo[0].addr); in sync_current_with_update_copy()
478 info->sinfo[0].addr = NULL; in sync_current_with_update_copy()
480 if (info->sinfo[0].hostname) in sync_current_with_update_copy()
481 free(info->sinfo[0].hostname); in sync_current_with_update_copy()
482 info->sinfo[0].hostname = NULL; in sync_current_with_update_copy()
484 if (info->sinfo[0].rootDSE_data) in sync_current_with_update_copy()
485 free(info->sinfo[0].rootDSE_data); in sync_current_with_update_copy()
486 info->sinfo[0].rootDSE_data = NULL; in sync_current_with_update_copy()
488 if (info->sinfo[0].errormsg) in sync_current_with_update_copy()
489 free(info->sinfo[0].errormsg); in sync_current_with_update_copy()
490 info->sinfo[0].errormsg = NULL; in sync_current_with_update_copy()
495 info->sinfo[0] = info->sinfo[1]; in sync_current_with_update_copy()
508 if (info->sinfo[1].addr) in sync_current_with_update_copy()
509 info->sinfo[0].addr = strdup(info->sinfo[1].addr); in sync_current_with_update_copy()
510 if (info->sinfo[1].hostname) in sync_current_with_update_copy()
511 info->sinfo[0].hostname = strdup(info->sinfo[1].hostname); in sync_current_with_update_copy()
512 if (info->sinfo[1].rootDSE_data) in sync_current_with_update_copy()
513 info->sinfo[0].rootDSE_data = in sync_current_with_update_copy()
514 strdup(info->sinfo[1].rootDSE_data); in sync_current_with_update_copy()
515 if (info->sinfo[1].errormsg) in sync_current_with_update_copy()
516 info->sinfo[0].errormsg = strdup(info->sinfo[1].errormsg); in sync_current_with_update_copy()
518 (void) mutex_unlock(&info->mutex[0]); in sync_current_with_update_copy()
519 (void) mutex_unlock(&info->mutex[1]); in sync_current_with_update_copy()
659 server_info_t *info, *tail = NULL; in getldap_init_serverInfo() local
675 info = (server_info_t *)calloc(1, sizeof (server_info_t)); in getldap_init_serverInfo()
676 if (info == NULL) { in getldap_init_serverInfo()
683 *head = info; in getldap_init_serverInfo()
684 tail = info; in getldap_init_serverInfo()
686 tail->next = info; in getldap_init_serverInfo()
687 tail = info; in getldap_init_serverInfo()
690 info->sinfo[0].addr = strdup(servers[i]); in getldap_init_serverInfo()
691 if (info->sinfo[0].addr == NULL) { in getldap_init_serverInfo()
697 info->sinfo[1].addr = strdup(servers[i]); in getldap_init_serverInfo()
698 if (info->sinfo[1].addr == NULL) { in getldap_init_serverInfo()
705 info->sinfo[0].type = INFO_RW_UNKNOWN; in getldap_init_serverInfo()
706 info->sinfo[1].type = INFO_RW_UNKNOWN; in getldap_init_serverInfo()
707 info->sinfo[0].info_status = INFO_STATUS_UNKNOWN; in getldap_init_serverInfo()
708 info->sinfo[1].info_status = INFO_STATUS_UNKNOWN; in getldap_init_serverInfo()
709 info->sinfo[0].server_status = INFO_SERVER_UNKNOWN; in getldap_init_serverInfo()
710 info->sinfo[1].server_status = INFO_SERVER_UNKNOWN; in getldap_init_serverInfo()
716 info->sinfo[0].prev_server_status = in getldap_init_serverInfo()
718 info->sinfo[1].prev_server_status = in getldap_init_serverInfo()
720 info->sinfo[0].hostname = NULL; in getldap_init_serverInfo()
721 info->sinfo[1].hostname = NULL; in getldap_init_serverInfo()
722 info->sinfo[0].rootDSE_data = NULL; in getldap_init_serverInfo()
723 info->sinfo[1].rootDSE_data = NULL; in getldap_init_serverInfo()
724 info->sinfo[0].errormsg = NULL; in getldap_init_serverInfo()
725 info->sinfo[1].errormsg = NULL; in getldap_init_serverInfo()
726 info->next = NULL; in getldap_init_serverInfo()
741 server_info_t *info, *next; in getldap_destroy_serverInfo() local
753 for (info = head; info; info = next) { in getldap_destroy_serverInfo()
754 if (info->sinfo[0].addr) in getldap_destroy_serverInfo()
755 free(info->sinfo[0].addr); in getldap_destroy_serverInfo()
756 if (info->sinfo[1].addr) in getldap_destroy_serverInfo()
757 free(info->sinfo[1].addr); in getldap_destroy_serverInfo()
758 if (info->sinfo[0].hostname) in getldap_destroy_serverInfo()
759 free(info->sinfo[0].hostname); in getldap_destroy_serverInfo()
760 if (info->sinfo[1].hostname) in getldap_destroy_serverInfo()
761 free(info->sinfo[1].hostname); in getldap_destroy_serverInfo()
762 if (info->sinfo[0].rootDSE_data) in getldap_destroy_serverInfo()
763 free(info->sinfo[0].rootDSE_data); in getldap_destroy_serverInfo()
764 if (info->sinfo[1].rootDSE_data) in getldap_destroy_serverInfo()
765 free(info->sinfo[1].rootDSE_data); in getldap_destroy_serverInfo()
766 if (info->sinfo[0].errormsg) in getldap_destroy_serverInfo()
767 free(info->sinfo[0].errormsg); in getldap_destroy_serverInfo()
768 if (info->sinfo[1].errormsg) in getldap_destroy_serverInfo()
769 free(info->sinfo[1].errormsg); in getldap_destroy_serverInfo()
770 next = info->next; in getldap_destroy_serverInfo()
771 free(info); in getldap_destroy_serverInfo()
779 server_info_t *info; in getldap_set_serverInfo() local
812 for (info = head; info; info = info->next) in getldap_set_serverInfo()
828 for (info = head, i = 0; info; info = info->next, i++) { in getldap_set_serverInfo()
831 (void *)info, 0, &tid[i])) { in getldap_set_serverInfo()
893 server_info_t *info = NULL; in getldap_get_serverInfo() local
946 for (info = head; info; info = info->next) { in getldap_get_serverInfo()
958 (void) mutex_lock(&info->mutex[0]); in getldap_get_serverInfo()
961 strcmp(info->sinfo[0].addr, addr) == 0) { in getldap_get_serverInfo()
966 (void) mutex_unlock(&info->mutex[0]); in getldap_get_serverInfo()
978 if (info->sinfo[0].info_status == in getldap_get_serverInfo()
980 info->sinfo[0].server_status == in getldap_get_serverInfo()
982 server = info; in getldap_get_serverInfo()
1006 new_addr = strdup(info->sinfo[0].addr); in getldap_get_serverInfo()
1010 (void) mutex_unlock(&info->mutex[0]); in getldap_get_serverInfo()
1017 (void) mutex_unlock(&info->mutex[0]); in getldap_get_serverInfo()
1024 if (info->sinfo[0].type == in getldap_get_serverInfo()
1026 info->sinfo[0].server_status == in getldap_get_serverInfo()
1028 server = info; in getldap_get_serverInfo()
1031 } else if (info->sinfo[0].server_status == in getldap_get_serverInfo()
1033 server = info; in getldap_get_serverInfo()
1038 (void) mutex_unlock(&info->mutex[0]); in getldap_get_serverInfo()
1053 (void) mutex_unlock(&info->mutex[0]); in getldap_get_serverInfo()
1077 (void) mutex_unlock(&info->mutex[0]); in getldap_get_serverInfo()
1090 (void) mutex_unlock(&info->mutex[0]); in getldap_get_serverInfo()
1167 server_info_t *info = NULL; in getldap_get_server_stat() local
1204 for (info = head; info; info = info->next) { in getldap_get_server_stat()
1210 (void) mutex_lock(&info->mutex[1]); in getldap_get_server_stat()
1224 switch (info->sinfo[1].server_status) { in getldap_get_server_stat()
1243 strlen(info->sinfo[1].addr) + in getldap_get_server_stat()
1245 if (info->sinfo[1].errormsg != NULL) in getldap_get_server_stat()
1247 strlen(info->sinfo[1].errormsg) + in getldap_get_server_stat()
1255 (void) mutex_unlock(&info->mutex[1]); in getldap_get_server_stat()
1263 gettext(S_FORMAT), info->sinfo[1].addr, in getldap_get_server_stat()
1267 if (info->sinfo[1].errormsg != NULL) in getldap_get_server_stat()
1270 info->sinfo[1].errormsg, in getldap_get_server_stat()
1273 (void) mutex_unlock(&info->mutex[1]); in getldap_get_server_stat()
1461 server_info_t *info; in getldap_set_refresh_ttl() local
1538 for (info = head; info; info = info->next) { in getldap_set_refresh_ttl()
1540 (void) mutex_lock(&info->mutex[0]); in getldap_set_refresh_ttl()
1541 if (info->sinfo[0].server_status == INFO_SERVER_UP) in getldap_set_refresh_ttl()
1548 if (info->sinfo[0].prev_server_status in getldap_set_refresh_ttl()
1550 info->sinfo[0].prev_server_status in getldap_set_refresh_ttl()
1553 (void) mutex_unlock(&info->mutex[0]); in getldap_set_refresh_ttl()
2749 server_info_t *info; in test_server_change() local
2756 for (info = head; info; info = info->next) { in test_server_change()
2757 (void) mutex_lock(&info->mutex[0]); in test_server_change()
2758 if (info->sinfo[0].change != 0) { in test_server_change()
2760 len += 2 * ds_len + strlen(info->sinfo[0].addr) + in test_server_change()
2764 (void) mutex_unlock(&info->mutex[0]); in test_server_change()
2785 for (info = head; info; info = info->next) { in test_server_change()
2786 (void) mutex_lock(&info->mutex[0]); in test_server_change()
2787 if (info->sinfo[0].change == 0) { in test_server_change()
2788 (void) mutex_unlock(&info->mutex[0]); in test_server_change()
2792 if (info->sinfo[0].change == NS_SERVER_UP) in test_server_change()
2794 else if (info->sinfo[0].change == NS_SERVER_DOWN) in test_server_change()
2798 info->sinfo[0].change); in test_server_change()
2799 (void) mutex_unlock(&info->mutex[0]); in test_server_change()
2805 info->sinfo[0].addr, DOORLINESEP, in test_server_change()
2807 (void) mutex_unlock(&info->mutex[0]); in test_server_change()
2813 (void) mutex_unlock(&info->mutex[0]); in test_server_change()
2938 server_info_t *info; in set_server_status() local
2940 for (info = head; info != NULL; info = info->next) { in set_server_status()
2941 (void) mutex_lock(&info->mutex[0]); in set_server_status()
2942 if (strcmp(info->sinfo[0].addr, rms->addr) == 0) { in set_server_status()
2943 if (info->sinfo[0].server_status == INFO_SERVER_UP && in set_server_status()
2945 info->sinfo[0].prev_server_status = in set_server_status()
2946 info->sinfo[0].server_status; in set_server_status()
2947 info->sinfo[0].server_status = in set_server_status()
2949 info->sinfo[0].change = NS_SERVER_DOWN; in set_server_status()
2952 } else if (info->sinfo[0].server_status == in set_server_status()
2957 info->sinfo[0].prev_server_status = in set_server_status()
2958 info->sinfo[0].server_status; in set_server_status()
2959 info->sinfo[0].server_status = in set_server_status()
2961 info->sinfo[0].change = NS_SERVER_UP; in set_server_status()
2964 (void) mutex_unlock(&info->mutex[0]); in set_server_status()
2967 (void) mutex_unlock(&info->mutex[0]); in set_server_status()
2971 (void) mutex_lock(&info->mutex[1]); in set_server_status()
2972 info->sinfo[1].prev_server_status = in set_server_status()
2973 info->sinfo[1].server_status; in set_server_status()
2975 info->sinfo[1].server_status = INFO_SERVER_ERROR; in set_server_status()
2977 info->sinfo[1].server_status = INFO_SERVER_UP; in set_server_status()
2978 (void) mutex_unlock(&info->mutex[1]); in set_server_status()