* directory or online at http://www.openafs.org/dl/license10.html
*/
+#include <afsconfig.h>
#include <afs/param.h>
+
+RCSID("$Header$");
+
#include <sys/types.h>
#ifdef AFS_NT40_ENV
#include <winsock2.h>
now = FT_ApproxTime();
if (BIGTIME + ubik_lastYesTime < now) return 1; /* no valid guy even trying */
- if (lastYesState && lastYerHost != ubik_host[0]) return 0; /* other guy is sync site, leave him alone */
+ if (lastYesState && lastYesHost != ubik_host[0]) return 0; /* other guy is sync site, leave him alone */
if (ntohl((afs_uint32) lastYesHost) < ntohl((afs_uint32) ubik_host[0]))
return 0; /* if someone is valid and better than us, don't run */
/* otherwise we should run */
he's lowest, these loops don't occur. because if someone knows he's
lowest, he will send out beacons telling others to vote for him. */
if (!amIClone &&
- (ntohl((afs_uint32) ubik_host) <= ntohl((afs_uint32) lowestHost)
+ (ntohl((afs_uint32) ubik_host[0]) <= ntohl((afs_uint32) lowestHost)
|| lowestTime + BIGTIME < now)) {
lowestTime = now;
lowestHost = ubik_host[0];
(otherHost != lastYesHost) ||
(lastYesState != astate)) {
/* A new vote or a change in the vote or changed quorum */
- ubik_dprint("Ubik: vote 'yes' for %d.%d.%d.%d %s\n",
- ((otherHost>>24)&0xff), ((otherHost>>16)&0xff),
- ((otherHost>> 8)&0xff), (otherHost &0xff),
+ ubik_dprint("Ubik: vote 'yes' for %s %s\n",
+ afs_inet_ntoa(otherHost),
(astate?"(in quorum)":"(NOT in quorum)"));
}
aparm->altAddr[i] = ntohl(ts->addr[i+1]);
aparm->lastVoteTime = ts->lastVoteTime;
aparm->lastBeaconSent = ts->lastBeaconSent;
- bcopy(&ts->version, &aparm->remoteVersion, sizeof(struct ubik_version));
+ memcpy(&aparm->remoteVersion, &ts->version, sizeof(struct ubik_version));
aparm->lastVote = ts->lastVote;
aparm->up = ts->up;
aparm->beaconSinceDown = ts->beaconSinceDown;
(urecovery_state & UBIK_RECHAVEDB ) ) {
aparm->recoveryState |= UBIK_RECLABELDB;
}
- bcopy(&ubik_dbVersion, &aparm->syncVersion, sizeof(struct ubik_version));
- bcopy(&ubik_dbTid, &aparm->syncTid, sizeof(struct ubik_tid));
+ memcpy(&aparm->syncVersion, &ubik_dbVersion, sizeof(struct ubik_version));
+ memcpy(&aparm->syncTid, &ubik_dbTid, sizeof(struct ubik_tid));
aparm->activeWrite = (ubik_dbase->flags & DBWRITING);
aparm->tidCounter = ubik_dbase->tidCounter;
afs_int32 awhich;
register struct ubik_sdebug_old *aparm; {
register struct ubik_server *ts;
- register int i;
+
for(ts=ubik_servers; ts; ts=ts->next) {
if (awhich-- == 0) {
/* we're done */
aparm->addr = ntohl(ts->addr[0]); /* primary interface */
aparm->lastVoteTime = ts->lastVoteTime;
aparm->lastBeaconSent = ts->lastBeaconSent;
- bcopy(&ts->version, &aparm->remoteVersion, sizeof(struct ubik_version));
+ memcpy(&aparm->remoteVersion, &ts->version, sizeof(struct ubik_version));
aparm->lastVote = ts->lastVote;
aparm->up = ts->up;
aparm->beaconSinceDown = ts->beaconSinceDown;
SVOTE_DebugOld(rxcall, aparm)
struct rx_call *rxcall;
register struct ubik_debug_old *aparm; {
- int i;
+
/* fill in the basic debug structure. Note the the RPC protocol transfers,
* integers in host order. */
(urecovery_state & UBIK_RECHAVEDB ) ) {
aparm->recoveryState |= UBIK_RECLABELDB;
}
- bcopy(&ubik_dbVersion, &aparm->syncVersion, sizeof(struct ubik_version));
- bcopy(&ubik_dbTid, &aparm->syncTid, sizeof(struct ubik_tid));
+ memcpy(&aparm->syncVersion, &ubik_dbVersion, sizeof(struct ubik_version));
+ memcpy(&aparm->syncTid, &ubik_dbTid, sizeof(struct ubik_tid));
aparm->activeWrite = (ubik_dbase->flags & DBWRITING);
aparm->tidCounter = ubik_dbase->tidCounter;