ubik-call-sucks-20060703
authorDerrick Brashear <shadow@dementia.org>
Tue, 4 Jul 2006 04:50:46 +0000 (04:50 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 4 Jul 2006 04:50:46 +0000 (04:50 +0000)
ubik_Call's pseudo-varargs construction is hideous

put it out of its misery where possible

26 files changed:
src/afsweb/weblog.c
src/bucoord/dump_sched.c
src/bucoord/tape_hosts.c
src/bucoord/vol_sets.c
src/bucoord/volstub.c
src/budb/Makefile.in
src/butc/tcudbprocs.c
src/butc/test_budb.c
src/dauth/Makefile.in
src/dauth/dlog.c
src/kauth/Makefile.in
src/ptserver/Makefile.in
src/ptserver/ptclient.c
src/ptserver/ptuser.c
src/rxgen/rpc_hout.c
src/rxgen/rpc_main.c
src/rxgen/rpc_parse.c
src/rxgen/rpc_util.h
src/ubik/ubik.p.h
src/ubik/ubikclient.c
src/update/Makefile.in
src/venus/fs.c
src/viced/host.c
src/viced/viced.c
src/vlserver/Makefile.in
src/volser/vsutils.c

index f366aec..9332fb4 100644 (file)
@@ -666,7 +666,7 @@ getDFScreds(char *name, char *realm, char *passwd, afs_uint32 lifetime,
      */
     reply_p = (adk_reply_ptr) 0;
     error_p = (adk_error_ptr) 0;
-    code = ubik_Call(ADK_GetTicket, ubik_handle, 0,    /* Ubik flags */
+    code = ubik_ADK_GetTicket(ubik_handle, 0,  /* Ubik flags */
                     name,      /* IN:  Principal: must be exact DCE principal */
                     nonce,     /* IN:  Input nonce */
                     lifetime,  /* IN:  lifetime */
index bbe13d8..35fa86b 100644 (file)
@@ -579,7 +579,7 @@ bc_UpdateDumpSchedule()
 
     /* fetch the version number */
     code =
-       ubik_Call(BUDB_GetTextVersion, uhptr->uh_client, 0, ctPtr->textType,
+       ubik_BUDB_GetTextVersion(uhptr->uh_client, 0, ctPtr->textType,
                  &ctPtr->textVersion);
     if (code)
        ERROR(code);
index 3a75a3d..97576a5 100644 (file)
@@ -397,7 +397,7 @@ bc_UpdateHosts()
 
     /* fetch the version number */
     code =
-       ubik_Call(BUDB_GetTextVersion, uhptr->uh_client, 0, ctPtr->textType,
+       ubik_BUDB_GetTextVersion(uhptr->uh_client, 0, ctPtr->textType,
                  &ctPtr->textVersion);
     if (code)
        ERROR(code);
index 027633d..3ae6136 100644 (file)
@@ -708,7 +708,7 @@ bc_UpdateVolumeSet()
 
     /* fetch the version number */
     code =
-       ubik_Call(BUDB_GetTextVersion, uhptr->uh_client, 0, ctPtr->textType,
+       ubik_BUDB_GetTextVersion(uhptr->uh_client, 0, ctPtr->textType,
                  &ctPtr->textVersion);
     if (code)
        ERROR(code);
index 67f67e9..d1a4aee 100644 (file)
@@ -45,7 +45,7 @@ bc_GetEntryByID(uclient, volID, volType, vldbEntryPtr)
     afs_int32 code = 0;
 
     code =
-       ubik_Call(VL_GetEntryByID, uclient, 0, volID, volType, vldbEntryPtr);
+       ubik_VL_GetEntryByID(uclient, 0, volID, volType, vldbEntryPtr);
     return (code);
 }
 
index 7d6d4c0..7d50173 100644 (file)
@@ -74,7 +74,7 @@ budb_server: $(SERVER_OBJS) ${LIBS}
        ${CC} ${LDFLAGS} -o budb_server $(SERVER_OBJS) ${LIBS} ${XLIBS}
 
 budb.cs.c: budb.rg
-       ${RXGEN} -C -o $@ ${srcdir}/budb.rg
+       ${RXGEN} -u -C -o $@ ${srcdir}/budb.rg
 
 budb.ss.c: budb.rg
        ${RXGEN} -S -o $@ ${srcdir}/budb.rg
@@ -83,7 +83,7 @@ budb.xdr.c: budb.rg
        ${RXGEN} -c -o $@ ${srcdir}/budb.rg
 
 budb.h: budb.rg
-       ${RXGEN} -h -o $@ ${srcdir}/budb.rg
+       ${RXGEN} -u -h -o $@ ${srcdir}/budb.rg
 
 budb.cs.c: budb.h
 budb.xdr.c: budb.h
index fd5687f..7511694 100644 (file)
@@ -1168,7 +1168,7 @@ restoreDbHeader(tapeInfo, rstTapeInfoPtr, nextHeader)
 
     /* Add the database header to the database */
     code =
-       ubik_Call(BUDB_RestoreDbHeader, udbHandle.uh_client, 0,
+       ubik_BUDB_RestoreDbHeader(udbHandle.uh_client, 0,
                  &hostDbHeader);
     if (code) {
        ErrorLog(0, rstTapeInfoPtr->taskId, code, 0,
index 1efce8d..baa6af3 100644 (file)
@@ -55,7 +55,7 @@ connect_buserver()
     }
 
     /* Get the versin */
-    code = ubik_Call(BUDB_T_GetVersion, udbHandle.uh_client, 0, &version);
+    code = ubik_BUDB_T_GetVersion(udbHandle.uh_client, 0, &version);
     if (code) {
        printf("Error in ubik_Call to BUDB_T_GetVersion\n");
        ERROR(code);
@@ -73,7 +73,7 @@ verifyDb()
     afs_int32 status, orphans, host;
 
     code =
-       ubik_Call(BUDB_DbVerify, udbHandle.uh_client, 0, &status, &orphans,
+       ubik_BUDB_DbVerify(udbHandle.uh_client, 0, &status, &orphans,
                  &host);
     if (code) {
        printf("Error in ubik_Call to BUDB_DbVerify\n");
index 693c815..dd6767c 100644 (file)
@@ -46,13 +46,13 @@ adkint.cs.o:        adkint.cs.c
 adkint.xdr.o:  adkint.xdr.c adkint.h
 
 adkint.cs.c: adkint.xg
-       ${RXGEN} -C -o $@ ${srcdir}/adkint.xg
+       ${RXGEN} -C -u -o $@ ${srcdir}/adkint.xg
 
 adkint.xdr.c: adkint.xg
        ${RXGEN} -c -o $@ ${srcdir}/adkint.xg
 
 adkint.h: adkint.xg
-       ${RXGEN} -h -o $@ ${srcdir}/adkint.xg
+       ${RXGEN} -h -u -o $@ ${srcdir}/adkint.xg
 
 dlog:          dlog.o $(VERS) $(OBJS) $(LIBS)
                $(CC) ${LDFLAGS} -o dlog dlog.o $(VERS) $(OBJS) ${LIBS} \
index aff77f5..5848674 100644 (file)
  * to decode the decrypted result. As a side-effect of using the AFS/DFS
  * translator as the intermediary, this program also does not have to access
  * any KRB5 location/configuration information--it just contacts the servers
- * listed in the CellServDB in the usual manner (via ubik_Call).
+ * listed in the CellServDB in the usual manner (via ubik_.
  *
  * This works as follows:
  * 
  * 1. dlog sends a GetTickets request to the intermediary.
  *
- * 2. The intermediary reformats the request as an KRB5 AS request, asking
+ * 2. The intermediary reformats the request as an KRB5 AS request(asking
  *    for a ticket made out to the specified principal, suitable for contacting
  *    the AFS/DFS translator principal. This is determined by the server, and
  *    is by default "afs".
@@ -665,7 +665,7 @@ CommandProc(as, arock)
      */
     reply_p = (adk_reply_ptr) 0;
     error_p = (adk_error_ptr) 0;
-    code = ubik_Call(ADK_GetTicket, ubik_handle, 0,    /* Ubik flags */
+    code = ubik_ADK_GetTicket(ubik_handle, 0,  /* Ubik flags */
                     name,      /* IN:  Principal: must be exact DCE principal */
                     nonce,     /* IN:  Input nonce */
                     lifetime,  /* IN:  lifetime */
index 853eaed..af877bf 100644 (file)
@@ -96,7 +96,7 @@ kauth.xdr.o: kauth.xdr.c kauth.h
 $(UKSRCS): kauth.h
 
 kauth.cs.c: kauth.rg
-       ${RXGEN} -x -C -o $@ ${srcdir}/kauth.rg
+       ${RXGEN} -u -x -C -o $@ ${srcdir}/kauth.rg
 
 kauth.ss.c: kauth.rg
        ${RXGEN} -x -S -o $@ ${srcdir}/kauth.rg
@@ -105,7 +105,7 @@ kauth.xdr.c: kauth.rg
        ${RXGEN} -x -c -o $@ ${srcdir}/kauth.rg
 
 kauth.h: kauth.rg
-       ${RXGEN} -x -h -o $@ ${srcdir}/kauth.rg
+       ${RXGEN} -u -x -h -o $@ ${srcdir}/kauth.rg
 
 kauth.xdr.c: kauth.h
 kauth.cs.c: kauth.h
index 4802445..94cc158 100644 (file)
@@ -75,7 +75,7 @@ ptint.cs.o: ptint.cs.c ptint.xdr.c ptint.xg
 ptint.xdr.o: ptint.xdr.c ptint.h ptint.xg
 
 ptint.cs.c: ptint.xg
-       ${RXGEN} -x -C -o $@ ${srcdir}/ptint.xg
+       ${RXGEN} -x -C -u -o $@ ${srcdir}/ptint.xg
 
 ptint.ss.c: ptint.xg
        ${RXGEN} -x -S -o $@ ${srcdir}/ptint.xg
@@ -84,7 +84,7 @@ ptint.xdr.c: ptint.xg
        ${RXGEN} -x -c -o $@ ${srcdir}/ptint.xg
 
 ptint.h: ptint.xg
-       ${RXGEN} -x -h -o $@ ${srcdir}/ptint.xg
+       ${RXGEN} -x -h -u -o $@ ${srcdir}/ptint.xg
 
 ptint.cs.c: ptint.h
 ptint.ss.c: ptint.h
index 04c938b..2b2a097 100644 (file)
@@ -267,7 +267,7 @@ main(argc, argv)
            /* use ubik_Call to do the work, finding an up server and handling
             * the job of finding a sync site, if need be */
            else
-               code = ubik_Call(PR_INewEntry, pruclient, 0, name, id, oid);
+               code = ubik_PR_INewEntry(pruclient, 0, name, id, oid);
            if (CodeOk(code))
                com_err(whoami, code, "on %s %s %d %d", op, name, id, oid);
        } else if (!strcmp(op, "sf")) {
@@ -277,7 +277,7 @@ main(argc, argv)
                code = PRBADARG;
            else
                code =
-                   ubik_Call(PR_SetFieldsEntry, pruclient, 0, id, mask,
+                   ubik_PR_SetFieldsEntry(pruclient, 0, id, mask,
                              access, gq, uq, 0, 0);
            if (CodeOk(code))
                com_err(whoami, code, "on %s %d %x %x %d %d", op, id, mask,
@@ -290,7 +290,7 @@ main(argc, argv)
                code = PRBADARG;
            else
                code =
-                   ubik_Call(PR_ChangeEntry, pruclient, 0, id, newname, oid,
+                   ubik_PR_ChangeEntry(pruclient, 0, id, newname, oid,
                              newid);
            if (CodeOk(code))
                com_err(whoami, code, "on %s %d %s %d %d", op, id, newname,
@@ -300,7 +300,7 @@ main(argc, argv)
            if (GetInt32(&id))
                code = PRBADARG;
            else
-               code = ubik_Call(PR_WhereIsIt, pruclient, 0, id, &pos);
+               code = ubik_PR_WhereIsIt(pruclient, 0, id, &pos);
            if (CodeOk(code))
                printf("%s\n", pr_ErrorMsg(code));
            else
@@ -311,7 +311,7 @@ main(argc, argv)
            if (GetInt32(&pos))
                code = PRBADARG;
            else
-               code = ubik_Call(PR_DumpEntry, pruclient, 0, pos, &entry);
+               code = ubik_PR_DumpEntry(pruclient, 0, pos, &entry);
            if (CodeOk(code))
                printf("%s\n", pr_ErrorMsg(code));
            if (code == PRSUCCESS) {
@@ -332,7 +332,7 @@ main(argc, argv)
            if (GetInt32(&id) || GetInt32(&gid))
                code = PRBADARG;
            else
-               code = ubik_Call(PR_AddToGroup, pruclient, 0, id, gid);
+               code = ubik_PR_AddToGroup(pruclient, 0, id, gid);
            if (CodeOk(code))
                com_err(whoami, code, "on %s %d %d", op, id, gid);
        } else if (!strcmp(op, "iton")) {
@@ -351,7 +351,7 @@ main(argc, argv)
            }
            lnames.namelist_val = 0;
            lnames.namelist_len = 0;
-           code = ubik_Call(PR_IDToName, pruclient, 0, &lid, &lnames);
+           code = ubik_PR_IDToName(pruclient, 0, &lid, &lnames);
            if (CodeOk(code))
                printf("%s\n", pr_ErrorMsg(code));
            if (code == PRSUCCESS) {
@@ -382,7 +382,7 @@ main(argc, argv)
            }
            lid.idlist_val = 0;
            lid.idlist_len = 0;
-           code = ubik_Call(PR_NameToID, pruclient, 0, &lnames, &lid);
+           code = ubik_PR_NameToID(pruclient, 0, &lnames, &lid);
            if (CodeOk(code))
                printf("%s\n", pr_ErrorMsg(code));
            if (code == PRSUCCESS) {
@@ -399,7 +399,7 @@ main(argc, argv)
            if (GetInt32(&id))
                code = PRBADARG;
            else
-               code = ubik_Call(PR_Delete, pruclient, 0, id);
+               code = ubik_PR_Delete(pruclient, 0, id);
            if (CodeOk(code))
                printf("%s\n", pr_ErrorMsg(code));
        } else if (!strcmp(op, "dg")) {
@@ -407,7 +407,7 @@ main(argc, argv)
            if (GetInt32(&id))
                code = PRBADARG;
            else
-               code = ubik_Call(PR_Delete, pruclient, 0, id);
+               code = ubik_PR_Delete(pruclient, 0, id);
            if (CodeOk(code))
                printf("%s\n", pr_ErrorMsg(code));
        } else if (!strcmp(op, "rm")) {
@@ -415,7 +415,7 @@ main(argc, argv)
            if (GetInt32(&id) || GetInt32(&gid))
                code = PRBADARG;
            else
-               code = ubik_Call(PR_RemoveFromGroup, pruclient, 0, id, gid);
+               code = ubik_PR_RemoveFromGroup(pruclient, 0, id, gid);
            if (CodeOk(code))
                printf("%s\n", pr_ErrorMsg(code));
        }
@@ -428,7 +428,7 @@ main(argc, argv)
                code = PRBADARG;
            else
                code =
-                   ubik_Call(PR_ListSuperGroups, pruclient, 0, id, &alist,
+                   ubik_PR_ListSuperGroups(pruclient, 0, id, &alist,
                              &over);
            if (CodeOk(code))
                printf("%s\n", pr_ErrorMsg(code));
@@ -453,7 +453,7 @@ main(argc, argv)
            if (GetInt32(&id))
                code = PRBADARG;
            else
-               code = ubik_Call(PR_GetCPS, pruclient, 0, id, &alist, &over);
+               code = ubik_PR_GetCPS(pruclient, 0, id, &alist, &over);
            if (CodeOk(code))
                printf("%s\n", pr_ErrorMsg(code));
            if (code == PRSUCCESS) {
@@ -480,7 +480,7 @@ main(argc, argv)
                hostaddr = hostinfo->h_addr_list[0];
                id = ntohl(hostaddr->s_addr);
                code =
-                   ubik_Call(PR_GetHostCPS, pruclient, 0, id, &alist, &over);
+                   ubik_PR_GetHostCPS(pruclient, 0, id, &alist, &over);
            }
            if (CodeOk(code))
                printf("%s\n", pr_ErrorMsg(code));
@@ -506,7 +506,7 @@ main(argc, argv)
                code = PRBADARG;
            else
                code =
-                   ubik_Call(PR_ListElements, pruclient, 0, id, &alist,
+                   ubik_PR_ListElements(pruclient, 0, id, &alist,
                              &over);
            if (CodeOk(code))
                printf("%s\n", pr_ErrorMsg(code));
@@ -539,13 +539,13 @@ main(argc, argv)
            if (GetString(name, sizeof(name)))
                code = PRBADARG;
            else
-               code = ubik_Call(PR_NewEntry, pruclient, 0, name, 1, &id);
+               code = ubik_PR_NewEntry(pruclient, 0, name, 1, &id);
            if (CodeOk(code))
                printf("%s\n", pr_ErrorMsg(code));
            if (code == PRSUCCESS)
                printf("Id is %d.\n", id);
        } else if (!strcmp(op, "lm")) {
-           code = ubik_Call(PR_ListMax, pruclient, 0, &id, &gid);
+           code = ubik_PR_ListMax(pruclient, 0, &id, &gid);
            if (CodeOk(code))
                printf("%s\n", pr_ErrorMsg(code));
            if (code == PRSUCCESS)
@@ -556,7 +556,7 @@ main(argc, argv)
            if (GetInt32(&id))
                code = PRBADARG;
            else
-               code = ubik_Call(PR_SetMax, pruclient, 0, id, 0);
+               code = ubik_PR_SetMax(pruclient, 0, id, 0);
            if (CodeOk(code))
                printf("%s\n", pr_ErrorMsg(code));
        } else if (!strcmp(op, "smg")) {
@@ -564,7 +564,7 @@ main(argc, argv)
            if (GetInt32(&id))
                code = PRBADARG;
            else
-               code = ubik_Call(PR_SetMax, pruclient, 0, id, 1);
+               code = ubik_PR_SetMax(pruclient, 0, id, 1);
            if (CodeOk(code))
                printf("%s\n", pr_ErrorMsg(code));
        } else if (!strcmp(op, "sin")) {
@@ -609,7 +609,7 @@ main(argc, argv)
 /*             continue;*/
            }
            uentry.Mask = PRUPDATE_IDHASH;
-           code = ubik_Call(PR_UpdateEntry, pruclient, 0, 0, name, &uentry);
+           code = ubik_PR_UpdateEntry(pruclient, 0, 0, name, &uentry);
            if (code) {
                printf("Failed to update entry %s (err=%d)\n", name, code);
                continue;
@@ -637,7 +637,7 @@ main(argc, argv)
            }
            uentry.Mask = PRUPDATE_NAMEHASH;
            code =
-               ubik_Call(PR_UpdateEntry, pruclient, 0, id, "_foo_", &uentry);
+               ubik_PR_UpdateEntry(pruclient, 0, id, "_foo_", &uentry);
            if (code) {
                printf("Failed to update entry with id %d (err=%d)\n", id,
                       code);
@@ -667,7 +667,7 @@ main(argc, argv)
 /*             continue;*/
            }
            uentry.Mask = PRUPDATE_IDHASH;
-           code = ubik_Call(PR_UpdateEntry, pruclient, 0, 0, name, &uentry);
+           code = ubik_PR_UpdateEntry(pruclient, 0, 0, name, &uentry);
            if (code) {
                printf("Failed to update entry %s (err=%d)\n", name, code);
                continue;
@@ -695,7 +695,7 @@ main(argc, argv)
            }
            uentry.Mask = PRUPDATE_NAMEHASH;
            code =
-               ubik_Call(PR_UpdateEntry, pruclient, 0, id, "_foo_", &uentry);
+               ubik_PR_UpdateEntry(pruclient, 0, id, "_foo_", &uentry);
            if (code) {
                printf("Failed to update entry with id %d (err=%d)\n", id,
                       code);
index 099c498..79e895e 100644 (file)
@@ -263,10 +263,10 @@ pr_CreateUser(char name[PR_MAXNAMELEN], afs_int32 *id)
 
     stolower(name);
     if (*id) {
-       code = ubik_Call(PR_INewEntry, pruclient, 0, name, *id, 0);
+       code = ubik_PR_INewEntry(pruclient, 0, name, *id, 0);
        return code;
     } else {
-       code = ubik_Call(PR_NewEntry, pruclient, 0, name, 0, 0, id);
+       code = ubik_PR_NewEntry(pruclient, 0, name, 0, 0, id);
        return code;
     }
 
@@ -289,10 +289,10 @@ pr_CreateGroup(char name[PR_MAXNAMELEN], char owner[PR_MAXNAMELEN], afs_int32 *i
     }
     flags |= PRGRP;
     if (*id) {
-       code = ubik_Call(PR_INewEntry, pruclient, 0, name, *id, oid);
+       code = ubik_PR_INewEntry(pruclient, 0, name, *id, oid);
        return code;
     } else {
-       code = ubik_Call(PR_NewEntry, pruclient, 0, name, flags, oid, id);
+       code = ubik_PR_NewEntry(pruclient, 0, name, flags, oid, id);
        return code;
     }
 }
@@ -309,7 +309,7 @@ pr_Delete(char *name)
        return code;
     if (id == ANONYMOUSID)
        return PRNOENT;
-    code = ubik_Call(PR_Delete, pruclient, 0, id);
+    code = ubik_PR_Delete(pruclient, 0, id);
     return code;
 }
 
@@ -318,7 +318,7 @@ pr_DeleteByID(afs_int32 id)
 {
     register afs_int32 code;
 
-    code = ubik_Call(PR_Delete, pruclient, 0, id);
+    code = ubik_PR_Delete(pruclient, 0, id);
     return code;
 }
 
@@ -345,7 +345,7 @@ pr_AddToGroup(char *user, char *group)
        goto done;
     }
     code =
-       ubik_Call(PR_AddToGroup, pruclient, 0, lids.idlist_val[0],
+       ubik_PR_AddToGroup(pruclient, 0, lids.idlist_val[0],
                  lids.idlist_val[1]);
   done:
     if (lnames.namelist_val)
@@ -378,7 +378,7 @@ pr_RemoveUserFromGroup(char *user, char *group)
        goto done;
     }
     code =
-       ubik_Call(PR_RemoveFromGroup, pruclient, 0, lids.idlist_val[0],
+       ubik_PR_RemoveFromGroup(pruclient, 0, lids.idlist_val[0],
                  lids.idlist_val[1]);
   done:
     if (lnames.namelist_val)
@@ -397,7 +397,7 @@ pr_NameToId(namelist *names, idlist *ids)
 
     for (i = 0; i < names->namelist_len; i++)
        stolower(names->namelist_val[i]);
-    code = ubik_Call(PR_NameToID, pruclient, 0, names, ids);
+    code = ubik_PR_NameToID(pruclient, 0, names, ids);
     return code;
 }
 
@@ -414,7 +414,7 @@ pr_SNameToId(char name[PR_MAXNAMELEN], afs_int32 *id)
     lnames.namelist_val = (prname *) malloc(PR_MAXNAMELEN);
     stolower(name);
     strncpy(lnames.namelist_val[0], name, PR_MAXNAMELEN);
-    code = ubik_Call(PR_NameToID, pruclient, 0, &lnames, &lids);
+    code = ubik_PR_NameToID(pruclient, 0, &lnames, &lids);
     if (lids.idlist_val) {
        *id = *lids.idlist_val;
        free(lids.idlist_val);
@@ -429,7 +429,7 @@ pr_IdToName(idlist *ids, namelist *names)
 {
     register afs_int32 code;
 
-    code = ubik_Call(PR_IDToName, pruclient, 0, ids, names);
+    code = ubik_PR_IDToName(pruclient, 0, ids, names);
     return code;
 }
 
@@ -445,7 +445,7 @@ pr_SIdToName(afs_int32 id, char name[PR_MAXNAMELEN])
     *lids.idlist_val = id;
     lnames.namelist_len = 0;
     lnames.namelist_val = 0;
-    code = ubik_Call(PR_IDToName, pruclient, 0, &lids, &lnames);
+    code = ubik_PR_IDToName(pruclient, 0, &lids, &lnames);
     if (lnames.namelist_val) {
        strncpy(name, lnames.namelist_val[0], PR_MAXNAMELEN);
        free(lnames.namelist_val);
@@ -462,7 +462,7 @@ pr_GetCPS(afs_int32 id, prlist *CPS)
     afs_int32 over;
 
     over = 0;
-    code = ubik_Call(PR_GetCPS, pruclient, 0, id, CPS, &over);
+    code = ubik_PR_GetCPS(pruclient, 0, id, CPS, &over);
     if (code != PRSUCCESS)
        return code;
     if (over) {
@@ -481,7 +481,7 @@ pr_GetCPS2(afs_int32 id, afs_int32 host, prlist *CPS)
     afs_int32 over;
 
     over = 0;
-    code = ubik_Call(PR_GetCPS2, pruclient, 0, id, host, CPS, &over);
+    code = ubik_PR_GetCPS2(pruclient, 0, id, host, CPS, &over);
     if (code != PRSUCCESS)
        return code;
     if (over) {
@@ -500,7 +500,7 @@ pr_GetHostCPS(afs_int32 host, prlist *CPS)
     afs_int32 over;
 
     over = 0;
-    code = ubik_Call(PR_GetHostCPS, pruclient, 0, host, CPS, &over);
+    code = ubik_PR_GetHostCPS(pruclient, 0, host, CPS, &over);
     if (code != PRSUCCESS)
        return code;
     if (over) {
@@ -537,7 +537,7 @@ pr_ListOwned(afs_int32 oid, namelist *lnames, afs_int32 *moreP)
 
     alist.prlist_len = 0;
     alist.prlist_val = 0;
-    code = ubik_Call(PR_ListOwned, pruclient, 0, oid, &alist, moreP);
+    code = ubik_PR_ListOwned(pruclient, 0, oid, &alist, moreP);
     if (code)
        return code;
     if (*moreP == 1) {
@@ -565,7 +565,7 @@ pr_IDListMembers(afs_int32 gid, namelist *lnames)
 
     alist.prlist_len = 0;
     alist.prlist_val = 0;
-    code = ubik_Call(PR_ListElements, pruclient, 0, gid, &alist, &over);
+    code = ubik_PR_ListElements(pruclient, 0, gid, &alist, &over);
     if (code)
        return code;
     if (over) {
@@ -586,7 +586,7 @@ pr_ListEntry(afs_int32 id, struct prcheckentry *aentry)
 {
     register afs_int32 code;
 
-    code = ubik_Call(PR_ListEntry, pruclient, 0, id, aentry);
+    code = ubik_PR_ListEntry(pruclient, 0, id, aentry);
     return code;
 }
 
@@ -603,7 +603,7 @@ pr_ListEntries(int flag, afs_int32 startindex, afs_int32 *nentries, struct prlis
     bulkentries.prentries_len = 0;
 
     code =
-       ubik_Call(PR_ListEntries, pruclient, 0, flag, startindex,
+       ubik_PR_ListEntries(pruclient, 0, flag, startindex,
                  &bulkentries, nextstartindex);
     *nentries = bulkentries.prentries_len;
     *entries = bulkentries.prentries_val;
@@ -622,7 +622,8 @@ pr_CheckEntryByName(char *name, afs_int32 *id, char *owner, char *creator)
        return code;
     if (*id == ANONYMOUSID)
        return PRNOENT;
-    code = ubik_Call(PR_ListEntry, pruclient, 0, *id, &aentry);
+    code = ubik_PR_ListEntry(pruclient, 0, *id, &aentry);
+      //code = ubik_PR_ListEntry(pruclient, 0, *id, &aentry);
     if (code)
        return code;
     /* this should be done in one RPC, but I'm lazy. */
@@ -647,7 +648,7 @@ pr_CheckEntryById(char *name, afs_int32 id, char *owner, char *creator)
        return code;
     if (id == ANONYMOUSID)
        return PRNOENT;
-    code = ubik_Call(PR_ListEntry, pruclient, 0, id, &aentry);
+    code = ubik_PR_ListEntry(pruclient, 0, id, &aentry);
     if (code)
        return code;
     /* this should be done in one RPC, but I'm lazy. */
@@ -679,7 +680,7 @@ pr_ChangeEntry(char *oldname, char *newname, afs_int32 *newid, char *newowner)
        if (oid == ANONYMOUSID)
            return PRNOENT;
     }
-    code = ubik_Call(PR_ChangeEntry, pruclient, 0, id, newname, oid, newid);
+    code = ubik_PR_ChangeEntry(pruclient, 0, id, newname, oid, newid);
     return code;
 }
 
@@ -707,7 +708,7 @@ pr_IsAMemberOf(char *uname, char *gname, afs_int32 *flag)
        return code;
     }
     code =
-       ubik_Call(PR_IsAMemberOf, pruclient, 0, lids.idlist_val[0],
+       ubik_PR_IsAMemberOf(pruclient, 0, lids.idlist_val[0],
                  lids.idlist_val[1], flag);
     if (lnames.namelist_val)
        free(lnames.namelist_val);
@@ -721,7 +722,7 @@ pr_ListMaxUserId(afs_int32 *mid)
 {
     register afs_int32 code;
     afs_int32 gid;
-    code = ubik_Call(PR_ListMax, pruclient, 0, mid, &gid);
+    code = ubik_PR_ListMax(pruclient, 0, mid, &gid);
     return code;
 }
 
@@ -730,7 +731,7 @@ pr_SetMaxUserId(afs_int32 mid)
 {
     register afs_int32 code;
     afs_int32 flag = 0;
-    code = ubik_Call(PR_SetMax, pruclient, 0, mid, flag);
+    code = ubik_PR_SetMax(pruclient, 0, mid, flag);
     return code;
 }
 
@@ -739,7 +740,7 @@ pr_ListMaxGroupId(afs_int32 *mid)
 {
     register afs_int32 code;
     afs_int32 id;
-    code = ubik_Call(PR_ListMax, pruclient, 0, &id, mid);
+    code = ubik_PR_ListMax(pruclient, 0, &id, mid);
     return code;
 }
 
@@ -750,7 +751,7 @@ pr_SetMaxGroupId(afs_int32 mid)
     afs_int32 flag = 0;
 
     flag |= PRGRP;
-    code = ubik_Call(PR_SetMax, pruclient, 0, mid, flag);
+    code = ubik_PR_SetMax(pruclient, 0, mid, flag);
     return code;
 }
 
@@ -760,7 +761,7 @@ pr_SetFieldsEntry(afs_int32 id, afs_int32 mask, afs_int32 flags, afs_int32 ngrou
     register afs_int32 code;
 
     code =
-       ubik_Call(PR_SetFieldsEntry, pruclient, 0, id, mask, flags, ngroups,
+       ubik_PR_SetFieldsEntry(pruclient, 0, id, mask, flags, ngroups,
                  nusers, 0, 0);
     return code;
 }
index c908497..9204a5f 100644 (file)
@@ -223,8 +223,10 @@ psproc1(definition * defp, int callTconnF, char *type, char *prefix,
     f_print(fout, "\nextern %s %s%s%s(\n", type, prefix, defp->pc.proc_prefix,
            defp->pc.proc_name);
 
-    if (callTconnF) {
+    if (callTconnF == 1) {
        f_print(fout, "\t/*IN */ struct rx_call *z_call");
+    } else if (callTconnF == 2) {
+       f_print(fout, "\tregister struct ubik_client *aclient, afs_int32 aflags");
     } else {
        f_print(fout, "\t/*IN */ struct rx_connection *z_conn");
     }
@@ -270,6 +272,9 @@ psprocdef(definition * defp)
        psproc1(defp, 0, "int", "", 0xFFFFFFFF);
     }
 
+    if (uflag && !kflag)
+       psproc1(defp, 2, "int", "ubik_", 0xFFFFFFFF);
+
     if (*ServerPrefix)
        psproc1(defp, 1, "afs_int32", ServerPrefix, 0xFFFFFFFF);
 }
index 8a2731d..38d9b3e 100644 (file)
@@ -79,6 +79,7 @@ struct commandline {
     int dflag;
     int xflag;
     int yflag;
+    int uflag;
     char *infile;
     char *outfile;
 };
@@ -91,7 +92,7 @@ static char *IncludeDir[MAXCPPARGS];
 int nincludes = 0;
 char *OutFileFlag = "";
 char OutFile[256];
-char Sflag = 0, Cflag = 0, hflag = 0, cflag = 0, kflag = 0;
+char Sflag = 0, Cflag = 0, hflag = 0, cflag = 0, kflag = 0, uflag = 0;
 char zflag = 0;                        /* If set, abort server stub if rpc call returns non-zero */
 char xflag = 0;                        /* if set, add stats code to stubs */
 char yflag = 0;                        /* if set, only emit function name arrays to xdr file */
@@ -181,7 +182,7 @@ main(int argc, char *argv[])
     if (!parseargs(argc, argv, &cmd)) {
        f_print(stderr, "usage: %s infile\n", cmdname);
        f_print(stderr,
-               "       %s [-c | -h | -l | -m | -C | -S | -r | -k | -R | -p | -d | -z] [-Pprefix] [-Idir] [-o outfile] [infile]\n",
+               "       %s [-c | -h | -l | -m | -C | -S | -r | -k | -R | -p | -d | -z | -u] [-Pprefix] [-Idir] [-o outfile] [infile]\n",
                cmdname);
        f_print(stderr, "       %s [-s udp|tcp]* [-o outfile] [infile]\n",
                cmdname);
@@ -470,6 +471,8 @@ h_output(char *infile, char *define, int extend, char *outfile, int append)
     if (xflag) {
        f_print(fout, "#include \"rx/rx_globals.h\"\n");
     }
+    if (uflag)
+       f_print(fout, "#include <ubik.h>\n");
     f_print(fout, "#else       /* UKERNEL */\n");
     f_print(fout, "#include \"h/types.h\"\n");
     f_print(fout, "#ifndef     SOCK_DGRAM  /* XXXXX */\n");
@@ -521,6 +524,8 @@ h_output(char *infile, char *define, int extend, char *outfile, int append)
        f_print(fout, "#include <rx/rx_globals.h>\n");
     }
     f_print(fout, "#include <afs/rxgen_consts.h>\n");
+    if (uflag)
+       f_print(fout, "#include <ubik.h>\n");
     f_print(fout, "#endif      /* KERNEL */\n\n");
     f_print(fout, "#ifdef AFS_NT40_ENV\n");
     f_print(fout, "#ifndef AFS_RXGEN_EXPORT\n");
@@ -813,6 +818,7 @@ parseargs(int argc, char *argv[], struct commandline *cmd)
                case 'k':
                case 'p':
                case 'd':
+               case 'u':
                case 'x':
                case 'y':
                case 'z':
@@ -869,6 +875,7 @@ parseargs(int argc, char *argv[], struct commandline *cmd)
     cmd->Cflag = Cflag = flag['C'];
     cmd->Sflag = Sflag = flag['S'];
     cmd->rflag = flag['r'];
+    cmd->uflag = uflag = flag['u'];
     cmd->kflag = kflag = flag['k'];
     cmd->pflag = flag['p'];
     cmd->dflag = debug = flag['d'];
index 043f092..5319438 100644 (file)
@@ -134,6 +134,10 @@ static void cs_ProcMarshallInParams_setup(definition * defp, int split_flag);
 static void cs_ProcSendPacket_setup(definition * defp, int split_flag);
 static void cs_ProcUnmarshallOutParams_setup(definition * defp);
 static void cs_ProcTail_setup(definition * defp, int split_flag);
+static void ucs_ProcName_setup(definition * defp, char *procheader,
+                             int split_flag);
+static void ucs_ProcParams_setup(definition * defp, int split_flag);
+static void ucs_ProcTail_setup(definition * defp, int split_flag);
 static void ss_Proc_CodeGeneration(definition * defp);
 static void ss_ProcName_setup(definition * defp);
 static void ss_ProcParams_setup(definition * defp, int *somefrees);
@@ -1102,6 +1106,14 @@ cs_Proc_CodeGeneration(definition * defp, int split_flag, char *procheader)
        }
        cs_ProcTail_setup(defp, split_flag);
     }
+
+    if (!kflag && !split_flag && uflag) {
+       ucs_ProcName_setup(defp, "ubik_", split_flag);
+       if (!cflag) {
+           ucs_ProcParams_setup(defp, split_flag);
+           ucs_ProcTail_setup(defp, split_flag);
+       }
+    }
 }
 
 
@@ -1730,6 +1742,201 @@ ss_ProcTail_setup(definition * defp, int somefrees)
 }
 
 
+static void
+ucs_ProcName_setup(definition * defp, char *procheader, int split_flag)
+{
+    proc1_list *plist;
+
+    if (!cflag) {
+      f_print(fout, "int %s%s%s%s(aclient, aflags", procheader, prefix,
+             PackagePrefix[PackageIndex], defp->pc.proc_name);
+    }
+    if ((strlen(procheader) + strlen(prefix) +
+        strlen(PackagePrefix[PackageIndex]) + strlen(defp->pc.proc_name)) >=
+       MAX_FUNCTION_NAME_LEN) {
+       error("function name is too long, increase MAX_FUNCTION_NAME_LEN");
+    }
+    if (!cflag) {
+       for (plist = defp->pc.plists; plist; plist = plist->next) {
+           if (plist->component_kind == DEF_PARAM) {
+               plist->pl.param_flag &= ~PROCESSED_PARAM;
+               f_print(fout, ", %s", plist->pl.param_name);
+           }
+       }
+       f_print(fout, ")\n");
+    }
+}
+
+
+static void
+ucs_ProcParams_setup(definition * defp, int split_flag)
+{
+    proc1_list *plist, *plist1;
+
+    f_print(fout, "\tregister struct ubik_client *aclient;\n\tafs_int32 aflags;\n");
+    for (plist = defp->pc.plists; plist; plist = plist->next) {
+       if (plist->component_kind == DEF_PARAM
+           && !(plist->pl.param_flag & PROCESSED_PARAM)) {
+           if (plist->pl.param_flag & OUT_STRING) {
+               f_print(fout, "\t%s *%s", plist->pl.param_type,
+                       plist->pl.param_name);
+           } else {
+               f_print(fout, "\t%s %s", plist->pl.param_type,
+                       plist->pl.param_name);
+           }
+           plist->pl.param_flag |= PROCESSED_PARAM;
+           for (plist1 = defp->pc.plists; plist1; plist1 = plist1->next) {
+               if ((plist1->component_kind == DEF_PARAM)
+                   && streq(plist->pl.param_type, plist1->pl.param_type)
+                   && !(plist1->pl.param_flag & PROCESSED_PARAM)) {
+                   char *star = "";
+                   char *pntr = strchr(plist1->pl.param_type, '*');
+                   if (pntr)
+                       star = "*";
+                   if (plist1->pl.param_flag & OUT_STRING) {
+                       f_print(fout, ", *%s%s", star, plist1->pl.param_name);
+                   } else {
+                       f_print(fout, ", %s%s", star, plist1->pl.param_name);
+                   }
+                   plist1->pl.param_flag |= PROCESSED_PARAM;
+               }
+           }
+           f_print(fout, ";\n");
+       }
+    }
+}
+
+static void
+ucs_ProcTail_setup(definition * defp, int split_flag)
+{
+    proc1_list *plist;
+
+    f_print(fout, "{\tafs_int32 rcode, code, newHost, thisHost, i, _ucount;\n");
+    f_print(fout, "\tint chaseCount, pass, needsync, inlist, j;\n");
+    f_print(fout, "\tstruct rx_connection *tc;\n");
+    f_print(fout, "\tstruct rx_peer *rxp;\n");
+    f_print(fout, "\tshort origLevel;\n\n");
+    f_print(fout, "\tif (!aclient)\n");
+    f_print(fout, "\t\treturn UNOENT;\n");
+    f_print(fout, "\tLOCK_UBIK_CLIENT(aclient);\n\n");
+    f_print(fout, "\t restart:\n");
+    f_print(fout, "\torigLevel = aclient->initializationState;\n");
+    f_print(fout, "\trcode = UNOSERVERS;\n");
+    f_print(fout, "\tchaseCount = inlist = needsync = 0;\n\n");
+#if 0 /* We should do some sort of caching algorithm for this, but I need to think about it - shadow 26 jun 06 */
+    f_print(fout, "\tLOCK_UCLNT_CACHE;\n");
+    f_print(fout, "\tfor (j = 0; ((j < SYNCCOUNT) && calls_needsync[j]); j++) {\n");
+    f_print(fout, "\t\tif (calls_needsync[j] == (int *)%s%s%s) {\n", prefix, PackagePrefix[PackageIndex], defp->pc.proc_name);
+    f_print(fout, "\t\t\tinlist = needsync = 1;\n");
+    f_print(fout, "\t\t\tbreak;\n");
+    f_print(fout, "\t\t}\n");
+    f_print(fout, "\t}\n");
+    f_print(fout, "\tUNLOCK_UCLNT_CACHE;\n");
+#endif
+    f_print(fout, "\t/* \n\t* First  pass, we try all servers that are up.\n\t* Second pass, we try all servers.\n\t*/\n");
+    f_print(fout, "\tfor (pass = 0; pass < 2; pass++) {  /*p */\n");
+    f_print(fout, "\t\t/* For each entry in our servers list */\n");
+    f_print(fout, "\t\tfor (_ucount = 0;; _ucount++) {     /*s */\n\n");
+    f_print(fout, "\t\tif (needsync) {\n");
+    f_print(fout, "\t\t\t/* Need a sync site. Lets try to quickly find it */\n");
+    f_print(fout, "\t\t\tif (aclient->syncSite) {\n");
+    f_print(fout, "\t\t\t\tnewHost = aclient->syncSite;        /* already in network order */\n");
+    f_print(fout, "\t\t\t\taclient->syncSite = 0;      /* Will reset if it works */\n");
+    f_print(fout, "\t\t\t} else if (aclient->conns[3]) {\n");
+    f_print(fout, "\t\t\t\t/* If there are fewer than four db servers in a cell,\n");
+    f_print(fout, "\t\t\t\t* there's no point in making the GetSyncSite call.\n");
+    f_print(fout, "\t\t\t\t* At best, it's a wash. At worst, it results in more\n");
+    f_print(fout, "\t\t\t\t* RPCs than you would otherwise make.\n");
+    f_print(fout, "\t\t\t\t*/\n");
+    f_print(fout, "\t\t\t\ttc = aclient->conns[_ucount];\n");
+    f_print(fout, "\t\t\t\tif (tc && rx_ConnError(tc)) {\n");
+    f_print(fout, "\t\t\t\t\taclient->conns[_ucount] = tc = ubik_RefreshConn(tc);\n");
+    f_print(fout, "\t\t\t\t}\n");
+    f_print(fout, "\t\t\t\tif (!tc)\n");
+    f_print(fout, "\t\t\t\t\tbreak;\n");
+    f_print(fout, "\t\t\t\tcode = VOTE_GetSyncSite(tc, &newHost);\n");
+    f_print(fout, "\t\t\t\tif (aclient->initializationState != origLevel)\n");
+    f_print(fout, "\t\t\t\t\tgoto restart;   /* somebody did a ubik_ClientInit */\n");
+    f_print(fout, "\t\t\t\tif (code)\n");
+    f_print(fout, "\t\t\t\t\tnewHost = 0;\n");
+    f_print(fout, "\t\t\t\tnewHost = htonl(newHost);   /* convert to network order */\n");
+    f_print(fout, "\t\t\t} else {\n");
+    f_print(fout, "\t\t\t\tnewHost = 0;\n");
+    f_print(fout, "\t\t\t}\n");
+    f_print(fout, "\t\t\tif (newHost) {\n");
+    f_print(fout, "\t\t\t\t/* position count at the appropriate slot in the client\n");
+    f_print(fout, "\t\t\t\t* structure and retry. If we can't find in slot, we'll\n");
+    f_print(fout, "\t\t\t\t* just continue through the whole list \n");
+    f_print(fout, "\t\t\t\t*/\n");
+    f_print(fout, "\t\t\t\tfor (i = 0; i < MAXSERVERS && aclient->conns[i]; i++) {\n");
+    f_print(fout, "\t\t\t\t\trxp = rx_PeerOf(aclient->conns[i]);\n");
+    f_print(fout, "\t\t\t\t\tthisHost = rx_HostOf(rxp);\n");
+    f_print(fout, "\t\t\t\t\tif (!thisHost)\n");
+    f_print(fout, "\t\t\t\t\t\tbreak;\n");
+    f_print(fout, "\t\t\t\t\tif (thisHost == newHost) {\n");
+    f_print(fout, "\t\t\t\t\t\tif (chaseCount++ > 2)\n");
+    f_print(fout, "\t\t\t\t\t\t\tbreak;  /* avoid loop asking */\n");
+    f_print(fout, "\t\t\t\t\t\t_ucount = i;  /* this index is the sync site */\n");
+    f_print(fout, "\t\t\t\t\t\tbreak;\n");
+    f_print(fout, "\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n");
+    f_print(fout, "\t\t/*needsync */\n");
+    f_print(fout, "\t\ttc = aclient->conns[_ucount];\n");
+    f_print(fout, "\t\tif (tc && rx_ConnError(tc)) {\n");
+    f_print(fout, "\t\t\taclient->conns[_ucount] = tc = ubik_RefreshConn(tc);\n");
+    f_print(fout, "\t\t}\n");
+    f_print(fout, "\t\tif (!tc)\n");
+    f_print(fout, "\t\t\tbreak;\n\n");
+    f_print(fout, "\t\tif ((pass == 0) && (aclient->states[_ucount] & CFLastFailed)) {\n");
+    f_print(fout, "\t\t\tcontinue;       /* this guy's down */\n");
+    f_print(fout, "\t\t}\n");
+    
+    f_print(fout, "\t\trcode = %s%s%s(tc\n", prefix, PackagePrefix[PackageIndex], defp->pc.proc_name);
+    for (plist = defp->pc.plists; plist; plist = plist->next) {
+       if (plist->component_kind == DEF_PARAM) {
+           plist->pl.param_flag &= ~PROCESSED_PARAM;
+           f_print(fout, ", %s", plist->pl.param_name);
+       }
+    }
+    f_print(fout, ");\n");
+    f_print(fout, "\t\tif (aclient->initializationState != origLevel) {\n");
+    f_print(fout, "\t\t\t/* somebody did a ubik_ClientInit */\n");
+    f_print(fout, "\t\t\tif (rcode)\n");
+    f_print(fout, "\t\t\t\tgoto restart;       /* call failed */\n");
+    f_print(fout, "\t\t\telse\n");
+    f_print(fout, "\t\t\t\tgoto done;  /* call suceeded */\n");
+    f_print(fout, "\t\t}\n");
+    f_print(fout, "\t\tif (rcode < 0) {    /* network errors */\n");
+    f_print(fout, "\t\t\taclient->states[_ucount] |= CFLastFailed; /* Mark server down */\n");
+    f_print(fout, "\t\t} else if (rcode == UNOTSYNC) {\n");
+    f_print(fout, "\t\t\tneedsync = 1;\n");
+    f_print(fout, "\t\t} else if (rcode != UNOQUORUM) {\n");
+    f_print(fout, "\t\t\t/* either misc ubik code, or misc appl code, or success. */\n");
+    f_print(fout, "\t\t\taclient->states[_ucount] &= ~CFLastFailed;        /* mark server up*/\n");
+    f_print(fout, "\t\t\tgoto done;      /* all done */\n");
+    f_print(fout, "\t\t}\n");
+    f_print(fout, "\t\t}                       /*s */\n");
+    f_print(fout, "\t}                           /*p */\n\n");
+    f_print(fout, "\tdone:\n");
+    f_print(fout, "\tif (needsync) {\n");
+    f_print(fout, "\t\tif (!inlist) {          /* Remember proc call that needs sync site */\n");
+#if 0 /* We should do some sort of caching algorithm for this, but I need to think about it - shadow 26 jun 06 */
+    f_print(fout, "\t\t\tLOCK_UCLNT_CACHE;\n");
+    f_print(fout, "\t\t\tcalls_needsync[synccount % SYNCCOUNT] = (int *)%s%s%s;\n", prefix, PackagePrefix[PackageIndex], defp->pc.proc_name);
+    f_print(fout, "\t\t\tsynccount++;\n");
+    f_print(fout, "\t\t\tUNLOCK_UCLNT_CACHE;\n");
+#endif
+    f_print(fout, "\t\t\tinlist = 1;\n");
+    f_print(fout, "\t\t}\n");
+    f_print(fout, "\t\tif (!rcode) {           /* Remember the sync site - cmd successful */\n");
+    f_print(fout, "\t\t\trxp = rx_PeerOf(aclient->conns[_ucount]);\n");
+    f_print(fout, "\t\t\taclient->syncSite = rx_HostOf(rxp);\n");
+    f_print(fout, "\t\t}\n");
+    f_print(fout, "\t}\n");
+    f_print(fout, "\tUNLOCK_UBIK_CLIENT(aclient);\n");
+    f_print(fout, "\treturn rcode;\n}\n\n");
+}
+
+
 static int
 opcode_holes_exist(void)
 {
index 6b091f6..86e4894 100644 (file)
@@ -56,7 +56,7 @@ extern char *prefix;
 extern int nincludes;
 extern char *OutFileFlag;
 extern char OutFile[];
-extern char Sflag, Cflag, hflag, cflag, kflag;
+extern char Sflag, Cflag, hflag, cflag, kflag, uflag;
 extern char zflag;
 extern char xflag;
 extern char yflag;
index a0eafc1..99a65ab 100644 (file)
@@ -360,6 +360,8 @@ extern afs_int32 ubik_CallIter(int (*aproc) (), struct ubik_client *aclient,
                               long p8, long p9, long p10, long p11, long p12,
                               long p13, long p14, long p15, long p16);
 
+extern struct rx_connection *ubik_RefreshConn(struct rx_connection *tc);
+
 /* ubik.c */
 extern int ubik_BeginTrans(register struct ubik_dbase *dbase,
                           afs_int32 transMode, struct ubik_trans **transPtr);
index 11a1eea..47e6584 100644 (file)
@@ -306,8 +306,8 @@ ubik_ClientDestroy(struct ubik_client * aclient)
  *     error.
  */
 
-static struct rx_connection *
-RefreshConn(struct rx_connection *tc)
+struct rx_connection *
+ubik_RefreshConn(struct rx_connection *tc)
 {
     afs_uint32 host;
     u_short port;
@@ -428,7 +428,7 @@ ubik_Call(aproc, aclient, aflags, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10,
                     */
                    tc = aclient->conns[count];
                    if (tc && rx_ConnError(tc)) {
-                       aclient->conns[count] = tc = RefreshConn(tc);
+                       aclient->conns[count] = tc = ubik_RefreshConn(tc);
                    }
                    if (!tc)
                        break;
@@ -463,7 +463,7 @@ ubik_Call(aproc, aclient, aflags, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10,
            /*needsync */
            tc = aclient->conns[count];
            if (tc && rx_ConnError(tc)) {
-               aclient->conns[count] = tc = RefreshConn(tc);
+               aclient->conns[count] = tc = ubik_RefreshConn(tc);
            }
            if (!tc)
                break;
@@ -537,7 +537,7 @@ try_GetSyncSite(register struct ubik_client *aclient, afs_int32 apos)
     /* get this conn */
     tc = aclient->conns[apos];
     if (tc && rx_ConnError(tc)) {
-       aclient->conns[apos] = (tc = RefreshConn(tc));
+       aclient->conns[apos] = (tc = ubik_RefreshConn(tc));
     }
     if (!tc) {
        return -1;
@@ -626,7 +626,7 @@ CallIter(aproc, aclient, aflags, apos, p1, p2, p3, p4, p5, p6, p7, p8, p9,
        }
 
        if (rx_ConnError(tc)) {
-           tc = RefreshConn(tc);
+           tc = ubik_RefreshConn(tc);
            aclient->conns[*apos] = tc;
        }
 
index bab0fe6..1ad24aa 100644 (file)
@@ -33,7 +33,7 @@ utils.o: utils.c update.h global.h
 client.o server.o: update.h global.h AFS_component_version_number.c
 
 update.cs.c: update.xg
-       ${RXGEN} -C -o $@ ${srcdir}/update.xg
+       ${RXGEN} -u -C -o $@ ${srcdir}/update.xg
 
 update.ss.c: update.xg
        ${RXGEN} -S -o $@ ${srcdir}/update.xg
@@ -42,7 +42,7 @@ update.xdr.c: update.xg
        ${RXGEN} -c -o $@ ${srcdir}/update.xg
 
 update.h: update.xg
-       ${RXGEN} -h -o $@ ${srcdir}/update.xg
+       ${RXGEN} -u -h -o $@ ${srcdir}/update.xg
 
 update.cs.c: update.h
 upcate.ss.c: update.h
index 3fd31df..cbe6d59 100644 (file)
@@ -1714,7 +1714,7 @@ defect #3069
        if (code == 0) {
            /* make the check.  Don't complain if there are problems with init */
            code =
-               ubik_Call(VL_GetEntryByNameO, uclient, 0, volName,
+               ubik_VL_GetEntryByNameO(uclient, 0, volName,
                          &vldbEntry);
            if (code == VL_NOENT) {
                fprintf(stderr,
index 947cdf3..43d9d39 100644 (file)
@@ -405,7 +405,7 @@ hpr_GetHostCPS(afs_int32 host, prlist *CPS)
     }
 
     over = 0;
-    code = ubik_Call(PR_GetHostCPS, uclient, 0, host, CPS, &over);
+    code = ubik_PR_GetHostCPS(uclient, 0, host, CPS, &over);
     if (code != PRSUCCESS)
         return code;
     if (over) {
@@ -437,7 +437,7 @@ hpr_NameToId(namelist *names, idlist *ids)
 
     for (i = 0; i < names->namelist_len; i++)
         stolower(names->namelist_val[i]);
-    code = ubik_Call(PR_NameToID, uclient, 0, names, ids);
+    code = ubik_PR_NameToID(uclient, 0, names, ids);
     return code;
 #else
     return pr_NameToId(names, ids);
@@ -457,7 +457,7 @@ hpr_IdToName(idlist *ids, namelist *names)
         assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0);
     }
 
-    code = ubik_Call(PR_IDToName, uclient, 0, ids, names);
+    code = ubik_PR_IDToName(uclient, 0, ids, names);
     return code;
 #else
     return pr_IdToName(ids, names);
@@ -479,7 +479,7 @@ hpr_GetCPS(afs_int32 id, prlist *CPS)
     }
 
     over = 0;
-    code = ubik_Call(PR_GetCPS, uclient, 0, id, CPS, &over);
+    code = ubik_PR_GetCPS(uclient, 0, id, CPS, &over);
     if (code != PRSUCCESS)
         return code;
     if (over) {
index f20e04d..948b5a5 100644 (file)
@@ -207,6 +207,10 @@ struct timeval tp;
 pthread_key_t viced_uclient_key;
 #endif
 
+#ifdef AFS_PTHREAD_ENV
+pthread_key_t viced_uclient_key;
+#endif
+
 /*
  * FileServer's name and IP address, both network byte order and
  * host byte order.
@@ -1763,7 +1767,7 @@ Do_VLRegisterRPC()
        FS_HostAddrs_HBO[i] = ntohl(FS_HostAddrs[i]);
     addrs.bulkaddrs_len = FS_HostAddr_cnt;
     addrs.bulkaddrs_val = (afs_uint32 *) FS_HostAddrs_HBO;
-    code = ubik_Call(VL_RegisterAddrs, cstruct, 0, &FS_HostUUID, 0, &addrs);
+    code = ubik_VL_RegisterAddrs(cstruct, 0, &FS_HostUUID, 0, &addrs);
     if (code) {
        if (code == VL_MULTIPADDR) {
            ViceLog(0,
index 45bd2ff..32a2ae2 100644 (file)
@@ -72,7 +72,7 @@ vldbint.cs.o: vldbint.cs.c vldbint.xdr.c
 vldbint.xdr.o: vldbint.xdr.c vldbint.h
 
 vldbint.cs.c: vldbint.xg
-       ${RXGEN} -x -C -o $@ ${srcdir}/vldbint.xg
+       ${RXGEN} -u -x -C -o $@ ${srcdir}/vldbint.xg
 
 vldbint.ss.c: vldbint.xg
        ${RXGEN} -x -S -o $@ ${srcdir}/vldbint.xg
@@ -81,7 +81,7 @@ vldbint.xdr.c: vldbint.xg
        ${RXGEN} -x -c -o $@ ${srcdir}/vldbint.xg
 
 vldbint.h: vldbint.xg
-       ${RXGEN} -x -h -o $@ ${srcdir}/vldbint.xg
+       ${RXGEN} -u -x -h -o $@ ${srcdir}/vldbint.xg
 
 vldbint.cs.c: vldbint.h
 vldbint.ss.c: vldbint.h
index cd78bba..6cec711 100644 (file)
@@ -120,10 +120,10 @@ VLDB_CreateEntry(entryp)
        code = nvlentry_to_ovlentry(entryp, &oentry);
        if (code)
            return code;
-       code = ubik_Call(VL_CreateEntry, cstruct, 0, &oentry);
+       code = ubik_VL_CreateEntry(cstruct, 0, &oentry);
        return code;
     }
-    code = ubik_Call(VL_CreateEntryN, cstruct, 0, entryp);
+    code = ubik_VL_CreateEntryN(cstruct, 0, entryp);
     if (!newvlserver) {
        if (code == RXGEN_OPCODE) {
            newvlserver = 1;    /* Doesn't support new interface */
@@ -145,12 +145,12 @@ VLDB_GetEntryByID(volid, voltype, entryp)
     if (newvlserver == 1) {
       tryold:
        code =
-           ubik_Call(VL_GetEntryByID, cstruct, 0, volid, voltype, &oentry);
+           ubik_VL_GetEntryByID(cstruct, 0, volid, voltype, &oentry);
        if (!code)
            ovlentry_to_nvlentry(&oentry, entryp);
        return code;
     }
-    code = ubik_Call(VL_GetEntryByIDN, cstruct, 0, volid, voltype, entryp);
+    code = ubik_VL_GetEntryByIDN(cstruct, 0, volid, voltype, entryp);
     if (!newvlserver) {
        if (code == RXGEN_OPCODE) {
            newvlserver = 1;    /* Doesn't support new interface */
@@ -171,12 +171,12 @@ VLDB_GetEntryByName(namep, entryp)
 
     if (newvlserver == 1) {
       tryold:
-       code = ubik_Call(VL_GetEntryByNameO, cstruct, 0, namep, &oentry);
+       code = ubik_VL_GetEntryByNameO(cstruct, 0, namep, &oentry);
        if (!code)
            ovlentry_to_nvlentry(&oentry, entryp);
        return code;
     }
-    code = ubik_Call(VL_GetEntryByNameN, cstruct, 0, namep, entryp);
+    code = ubik_VL_GetEntryByNameN(cstruct, 0, namep, entryp);
     if (!newvlserver) {
        if (code == RXGEN_OPCODE) {
            newvlserver = 1;    /* Doesn't support new interface */
@@ -201,12 +201,12 @@ VLDB_ReplaceEntry(volid, voltype, entryp, releasetype)
        if (code)
            return code;
        code =
-           ubik_Call(VL_ReplaceEntry, cstruct, 0, volid, voltype, &oentry,
+           ubik_VL_ReplaceEntry(cstruct, 0, volid, voltype, &oentry,
                      releasetype);
        return code;
     }
     code =
-       ubik_Call(VL_ReplaceEntryN, cstruct, 0, volid, voltype, entryp,
+       ubik_VL_ReplaceEntryN(cstruct, 0, volid, voltype, entryp,
                  releasetype);
     if (!newvlserver) {
        if (code == RXGEN_OPCODE) {
@@ -233,7 +233,7 @@ VLDB_ListAttributes(attrp, entriesp, blkentriesp)
       tryold:
        memset(&arrayEntries, 0, sizeof(arrayEntries)); /*initialize to hint the stub  to alloc space */
        code =
-           ubik_Call(VL_ListAttributes, cstruct, 0, attrp, entriesp,
+           ubik_VL_ListAttributes(cstruct, 0, attrp, entriesp,
                      &arrayEntries);
        if (!code) {
            blkentriesp->nbulkentries_val =
@@ -248,7 +248,7 @@ VLDB_ListAttributes(attrp, entriesp, blkentriesp)
        return code;
     }
     code =
-       ubik_Call(VL_ListAttributesN, cstruct, 0, attrp, entriesp,
+       ubik_VL_ListAttributesN(cstruct, 0, attrp, entriesp,
                  blkentriesp);
     if (!newvlserver) {
        if (code == RXGEN_OPCODE) {
@@ -273,7 +273,7 @@ VLDB_ListAttributesN2(attrp, name, thisindex, nentriesp, blkentriesp,
     afs_int32 code;
 
     code =
-       ubik_Call(VL_ListAttributesN2, cstruct, 0, attrp, (name ? name : ""),
+       ubik_VL_ListAttributesN2(cstruct, 0, attrp, (name ? name : ""),
                  thisindex, nentriesp, blkentriesp, nextindexp);
     return code;
 }
@@ -342,7 +342,7 @@ VLDB_IsSameAddrs(serv1, serv2, errorp)
     memset(&addrs, 0, sizeof(addrs));
     memset(&uuid, 0, sizeof(uuid));
     code =
-       ubik_Call(VL_GetAddrsU, cstruct, 0, &attrs, &uuid, &unique, &nentries,
+       ubik_VL_GetAddrsU(cstruct, 0, &attrs, &uuid, &unique, &nentries,
                  &addrs);
     if (vlserverv4 == -1) {
        if (code == RXGEN_OPCODE) {
@@ -377,35 +377,6 @@ VLDB_IsSameAddrs(serv1, serv2, errorp)
 }
 
 
-#ifdef notdef
-afs_int32
-subik_Call(aproc, aclient, aflags, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10,
-          p11, p12, p13, p14, p15, p16)
-     register struct ubik_client *aclient;
-     int (*aproc) ();
-     afs_int32 aflags;
-     afs_int32 p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14,
-        p15, p16;
-{
-    struct vldbentry vldbentry;
-    register int code, (*nproc) ();
-
-    if (newvlserver == 1) {
-    }
-    code =
-       ubik_Call(aproc, aclient, aflags, p1, p2, p3, p4, p5, p6, p7, p8, p9,
-                 p10, p11, p12, p13, p14, p15, p16);
-    if (!newvlserver) {
-       if (code == RXGEN_OPCODE) {
-           newvlserver = 1;    /* Doesn't support new interface */
-       } else if (!code) {
-           newvlserver = 2;
-       }
-    }
-}
-#endif /* notdef */
-
-
 /*
   Set encryption.  If 'cryptflag' is nonzero, encrpytion is turned on
   for authenticated connections; if zero, encryption is turned off.