From 0265d5c1eb04eeb354d89d638758b84fd458b267 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Fri, 25 Jun 2010 13:52:16 -0500 Subject: [PATCH] Use unsigned IP addresses in bu* Use unsigned IP addresss in bubasics, bucoord, and butc code. This alters the public tcdata.p.h, but stays away from wire RPCs or variables used directly with those RPCs. Change-Id: Ica96172399cafbc2c347f725a966cf1db7ff1128 Reviewed-on: http://gerrit.openafs.org/2255 Tested-by: Andrew Deason Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/bubasics/tcdata.p.h | 2 +- src/bucoord/bucoord_internal.h | 2 +- src/bucoord/dsvs.c | 2 +- src/bucoord/restore.c | 4 ++-- src/bucoord/volstub.c | 2 +- src/butc/dump.c | 4 ++-- src/butc/test.c | 19 ++++++++++--------- 7 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/bubasics/tcdata.p.h b/src/bubasics/tcdata.p.h index c5fd013b8..fd7fd6835 100644 --- a/src/bubasics/tcdata.p.h +++ b/src/bubasics/tcdata.p.h @@ -103,7 +103,7 @@ struct volumeHeader { char volumeName[TC_MAXVOLNAME]; char pad[2]; afs_int32 volumeID; - afs_int32 server; /* which server */ + afs_uint32 server; /* which server */ afs_int32 part; /* partition vol. was on */ afs_int32 from; /* clone date of vol ?? */ int frag; diff --git a/src/bucoord/bucoord_internal.h b/src/bucoord/bucoord_internal.h index 8ee832d74..5f31fccf4 100644 --- a/src/bucoord/bucoord_internal.h +++ b/src/bucoord/bucoord_internal.h @@ -174,7 +174,7 @@ extern int bc_SaveVolumeSet(void); /* volstub.c */ -extern afs_int32 volImageTime(afs_int32 serv, afs_int32 part, afs_int32 volid, +extern afs_int32 volImageTime(afs_uint32 serv, afs_int32 part, afs_uint32 volid, afs_int32 voltype, afs_int32 *clDatePtr); #endif diff --git a/src/bucoord/dsvs.c b/src/bucoord/dsvs.c index 379f54c0e..67daf4da5 100644 --- a/src/bucoord/dsvs.c +++ b/src/bucoord/dsvs.c @@ -128,7 +128,7 @@ bc_ParseHost(char *aname, struct sockaddr_in *asockaddr) { /*bc_ParseHost */ register struct hostent *th; /*Host entry */ - afs_int32 addr; /*Converted address */ + afs_uint32 addr; /*Converted address */ afs_int32 b1, b2, b3, b4; /*Byte-sized address chunks */ register afs_int32 code; /*Return code from sscanf() */ afs_int32 tmp1, tmp2; diff --git a/src/bucoord/restore.c b/src/bucoord/restore.c index 210471eb6..34a3c24fc 100644 --- a/src/bucoord/restore.c +++ b/src/bucoord/restore.c @@ -60,7 +60,7 @@ struct dumpinfo { struct volinfo { struct volinfo *next; char *volname; - afs_int32 server; + afs_uint32 server; afs_int32 partition; }; @@ -185,7 +185,7 @@ bc_Restorer(afs_int32 aindex) afs_int32 lvl, lv; int num_dlevels = 20; - afs_int32 serverAll; /* The server to which all volumes are to be restore to */ + afs_uint32 serverAll; /* The server to which all volumes are to be restore to */ afs_int32 partitionAll; /* Likewise for partition */ struct hostent *hostPtr; long haddr; diff --git a/src/bucoord/volstub.c b/src/bucoord/volstub.c index 31218ab9e..bdd59f2cd 100644 --- a/src/bucoord/volstub.c +++ b/src/bucoord/volstub.c @@ -57,7 +57,7 @@ bc_GetEntryByID(struct ubik_client *uclient, afs_int32 volID, */ afs_int32 -volImageTime(afs_int32 serv, afs_int32 part, afs_int32 volid, +volImageTime(afs_uint32 serv, afs_int32 part, afs_uint32 volid, afs_int32 voltype, afs_int32 *clDatePtr) { afs_int32 code = 0; diff --git a/src/butc/dump.c b/src/butc/dump.c index 863270c26..536494936 100644 --- a/src/butc/dump.c +++ b/src/butc/dump.c @@ -179,11 +179,11 @@ calcExpirationDate(afs_int32 expType, afs_int32 expDate, afs_int32 createTime) } } -afs_int32 curr_bserver = 0; +afs_uint32 curr_bserver = 0; struct rx_connection *curr_fromconn = (struct rx_connection *)0; struct rx_connection * -Bind(afs_int32 server) +Bind(afs_uint32 server) { if (curr_fromconn) { if (curr_bserver == server) /* Keep connection if have it */ diff --git a/src/butc/test.c b/src/butc/test.c index 1c09a6d45..14195bf2b 100644 --- a/src/butc/test.c +++ b/src/butc/test.c @@ -46,7 +46,8 @@ int rxInitDone = 0; struct rx_connection * UV_Bind(aserver, port) - afs_int32 aserver, port; + afs_uint32 aserver; + afs_int32 port; { register struct rx_connection *tc; struct rx_securityClass *uvclass; @@ -58,12 +59,12 @@ UV_Bind(aserver, port) /* return host address in network byte order */ -afs_int32 +afs_uint32 GetServer(aname) char *aname; { register struct hostent *th; - afs_int32 addr; + afs_uint32 addr; char b1, b2, b3, b4; register afs_int32 code; @@ -84,7 +85,7 @@ static int PerformDump(register struct cmd_syndesc *as, void *arock) { struct rx_connection *aconn; - afs_int32 server; + afs_uint32 server; FILE *fopen(), *fp; struct tc_dumpDesc *ptr; int i; @@ -134,7 +135,7 @@ static int PerformRestore(register struct cmd_syndesc *as, void *arock) { struct rx_connection *aconn; - afs_int32 server; + afs_uint32 server; int i; FILE *fopen(), *fp; struct tc_restoreDesc *ptr; @@ -176,7 +177,7 @@ static int CheckDump(register struct cmd_syndesc *as, void *arock) { struct rx_connection *aconn; - afs_int32 server; + afs_uint32 server; server = GetServer(SERVERNAME); if (!server) { printf("cant get server id \n"); @@ -196,7 +197,7 @@ static int AbortDump(register struct cmd_syndesc *as, void *arock) { struct rx_connection *aconn; - afs_int32 server; + afs_uint32 server; server = GetServer(SERVERNAME); if (!server) { printf("cant get server id \n"); @@ -216,7 +217,7 @@ static int WaitForDump(register struct cmd_syndesc *as, void *arock) { struct rx_connection *aconn; - afs_int32 server; + afs_uint32 server; server = GetServer(SERVERNAME); if (!server) { printf("cant get server id \n"); @@ -236,7 +237,7 @@ static int EndDump(register struct cmd_syndesc *as, void *arock) { struct rx_connection *aconn; - afs_int32 server; + afs_uint32 server; server = GetServer(SERVERNAME); if (!server) { printf("cant get server id \n"); -- 2.39.5