Lines Matching defs:sinfo

149 	server_info_ext_t	sinfo[2]; /* 0: current, 1:  update copy */
428 * This function syncs up the 2 sinfo copies in info.
431 * The update copy(sinfo[1]) could be different when
448 * copy(sinfo[0]). getldap_get_rootDSE only works on the update copy(sinfo[1])
463 if (info->sinfo[1].server_status == INFO_SERVER_UP &&
464 info->sinfo[0].server_status != INFO_SERVER_UP)
465 info->sinfo[1].change = NS_SERVER_UP;
466 else if (info->sinfo[1].server_status != INFO_SERVER_UP &&
467 info->sinfo[0].server_status == INFO_SERVER_UP)
468 info->sinfo[1].change = NS_SERVER_DOWN;
470 info->sinfo[1].change = 0;
474 if (info->sinfo[0].addr)
475 free(info->sinfo[0].addr);
476 info->sinfo[0].addr = NULL;
478 if (info->sinfo[0].hostname)
479 free(info->sinfo[0].hostname);
480 info->sinfo[0].hostname = NULL;
482 if (info->sinfo[0].rootDSE_data)
483 free(info->sinfo[0].rootDSE_data);
484 info->sinfo[0].rootDSE_data = NULL;
486 if (info->sinfo[0].errormsg)
487 free(info->sinfo[0].errormsg);
488 info->sinfo[0].errormsg = NULL;
493 info->sinfo[0] = info->sinfo[1];
496 * getldap_get_server_stat() reads the update copy sinfo[1]
499 * The sinfo[0] and sinfo[1] have identical string pointers.
501 * The strings of sinfo[1] are freed in
502 * getldap_get_rootDSE() and the strings of sinfo[0]
506 if (info->sinfo[1].addr)
507 info->sinfo[0].addr = strdup(info->sinfo[1].addr);
508 if (info->sinfo[1].hostname)
509 info->sinfo[0].hostname = strdup(info->sinfo[1].hostname);
510 if (info->sinfo[1].rootDSE_data)
511 info->sinfo[0].rootDSE_data =
512 strdup(info->sinfo[1].rootDSE_data);
513 if (info->sinfo[1].errormsg)
514 info->sinfo[0].errormsg = strdup(info->sinfo[1].errormsg);
539 serverInfo->sinfo[1].type = INFO_RW_UNKNOWN;
540 serverInfo->sinfo[1].info_status =
545 * The previous server status of the update copy(sinfo[1])
549 serverInfo->sinfo[1].prev_server_status =
550 serverInfo->sinfo[0].server_status;
553 serverInfo->sinfo[1].server_status =
555 if (serverInfo->sinfo[1].rootDSE_data)
556 free(serverInfo->sinfo[1].rootDSE_data);
557 serverInfo->sinfo[1].rootDSE_data = NULL;
558 if (serverInfo->sinfo[1].errormsg)
559 free(serverInfo->sinfo[1].errormsg);
560 serverInfo->sinfo[1].errormsg = NULL;
564 serverInfo->sinfo[1].server_status = INFO_SERVER_CONNECTING;
577 if (rc = __ns_ldap_getRootDSE(serverInfo->sinfo[1].addr,
582 serverInfo->sinfo[1].server_status = INFO_SERVER_ERROR;
583 serverInfo->sinfo[1].info_status = INFO_STATUS_ERROR;
585 serverInfo->sinfo[1].errormsg = strdup(error->message);
589 " server"), serverInfo->sinfo[1].addr, rc);
590 serverInfo->sinfo[1].errormsg = strdup(errmsg);
599 serverInfo->sinfo[1].errormsg);
603 * sync sinfo copies in the serverInfo.
613 serverInfo->sinfo[1].type = INFO_RW_WRITEABLE;
614 serverInfo->sinfo[1].server_status = INFO_SERVER_UP;
615 serverInfo->sinfo[1].info_status = INFO_STATUS_NEW;
618 serverInfo->sinfo[1].rootDSE_data = rootDSE;
625 * sync sinfo copies in the serverInfo.
688 info->sinfo[0].addr = strdup(servers[i]);
689 if (info->sinfo[0].addr == NULL) {
695 info->sinfo[1].addr = strdup(servers[i]);
696 if (info->sinfo[1].addr == NULL) {
703 info->sinfo[0].type = INFO_RW_UNKNOWN;
704 info->sinfo[1].type = INFO_RW_UNKNOWN;
705 info->sinfo[0].info_status = INFO_STATUS_UNKNOWN;
706 info->sinfo[1].info_status = INFO_STATUS_UNKNOWN;
707 info->sinfo[0].server_status = INFO_SERVER_UNKNOWN;
708 info->sinfo[1].server_status = INFO_SERVER_UNKNOWN;
714 info->sinfo[0].prev_server_status =
716 info->sinfo[1].prev_server_status =
718 info->sinfo[0].hostname = NULL;
719 info->sinfo[1].hostname = NULL;
720 info->sinfo[0].rootDSE_data = NULL;
721 info->sinfo[1].rootDSE_data = NULL;
722 info->sinfo[0].errormsg = NULL;
723 info->sinfo[1].errormsg = NULL;
752 if (info->sinfo[0].addr)
753 free(info->sinfo[0].addr);
754 if (info->sinfo[1].addr)
755 free(info->sinfo[1].addr);
756 if (info->sinfo[0].hostname)
757 free(info->sinfo[0].hostname);
758 if (info->sinfo[1].hostname)
759 free(info->sinfo[1].hostname);
760 if (info->sinfo[0].rootDSE_data)
761 free(info->sinfo[0].rootDSE_data);
762 if (info->sinfo[1].rootDSE_data)
763 free(info->sinfo[1].rootDSE_data);
764 if (info->sinfo[0].errormsg)
765 free(info->sinfo[0].errormsg);
766 if (info->sinfo[1].errormsg)
767 free(info->sinfo[1].errormsg);
942 (head->sinfo[0].info_status == INFO_STATUS_NEW))
953 * Access the current copy (sinfo[0]) to get such
959 strcmp(info->sinfo[0].addr, addr) == 0) {
976 if (info->sinfo[0].info_status ==
978 info->sinfo[0].server_status ==
1004 new_addr = strdup(info->sinfo[0].addr);
1022 if (info->sinfo[0].type ==
1024 info->sinfo[0].server_status ==
1029 } else if (info->sinfo[0].server_status ==
1047 if (server->sinfo[0].hostname == NULL) {
1048 rc = __s_api_ip2hostname(server->sinfo[0].addr,
1049 &server->sinfo[0].hostname);
1057 server->sinfo[0].addr,
1058 server->sinfo[0].hostname);
1061 ret_addr = server->sinfo[0].addr;
1062 ret_addrFQDN = server->sinfo[0].hostname;
1065 ret_addr = server->sinfo[0].addr;
1069 strlen(server->sinfo[0].rootDSE_data) +
1081 server->sinfo[0].rootDSE_data);
1086 server->sinfo[0].rootDSE_data);
1087 server->sinfo[0].info_status = INFO_STATUS_OLD;
1212 * the update copy(sinfo[1] is the latest copy.
1214 * is done, the current copy (sinfo[0]) has the latest status,
1217 * Use the update copy(sinfo[1]) to show status
1222 switch (info->sinfo[1].server_status) {
1241 strlen(info->sinfo[1].addr) +
1243 if (info->sinfo[1].errormsg != NULL)
1245 strlen(info->sinfo[1].errormsg) +
1261 gettext(S_FORMAT), info->sinfo[1].addr,
1265 if (info->sinfo[1].errormsg != NULL)
1268 info->sinfo[1].errormsg,
1539 if (info->sinfo[0].server_status == INFO_SERVER_UP)
1546 if (info->sinfo[0].prev_server_status
1548 info->sinfo[0].prev_server_status
2752 if (info->sinfo[0].change != 0) {
2754 len += 2 * ds_len + strlen(info->sinfo[0].addr) +
2781 if (info->sinfo[0].change == 0) {
2786 if (info->sinfo[0].change == NS_SERVER_UP)
2788 else if (info->sinfo[0].change == NS_SERVER_DOWN)
2792 info->sinfo[0].change);
2799 info->sinfo[0].addr, DOORLINESEP,
2934 if (strcmp(info->sinfo[0].addr, rms->addr) == 0) {
2935 if (info->sinfo[0].server_status == INFO_SERVER_UP &&
2937 info->sinfo[0].prev_server_status =
2938 info->sinfo[0].server_status;
2939 info->sinfo[0].server_status =
2941 info->sinfo[0].change = NS_SERVER_DOWN;
2944 } else if (info->sinfo[0].server_status ==
2949 info->sinfo[0].prev_server_status =
2950 info->sinfo[0].server_status;
2951 info->sinfo[0].server_status =
2953 info->sinfo[0].change = NS_SERVER_UP;
2964 info->sinfo[1].prev_server_status =
2965 info->sinfo[1].server_status;
2967 info->sinfo[1].server_status = INFO_SERVER_ERROR;
2969 info->sinfo[1].server_status = INFO_SERVER_UP;