*/
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 */
/* 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);
/* 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);
/* 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);
afs_int32 code = 0;
code =
- ubik_Call(VL_GetEntryByID, uclient, 0, volID, volType, vldbEntryPtr);
+ ubik_VL_GetEntryByID(uclient, 0, volID, volType, vldbEntryPtr);
return (code);
}
${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
${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
/* 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,
}
/* 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);
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");
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} \
* 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".
*/
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 */
$(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
${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
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
${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
/* 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")) {
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,
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,
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
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) {
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")) {
}
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) {
}
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) {
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")) {
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")) {
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));
}
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));
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) {
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));
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));
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)
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")) {
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")) {
/* 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;
}
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);
/* 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;
}
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);
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;
}
}
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;
}
}
return code;
if (id == ANONYMOUSID)
return PRNOENT;
- code = ubik_Call(PR_Delete, pruclient, 0, id);
+ code = ubik_PR_Delete(pruclient, 0, id);
return code;
}
{
register afs_int32 code;
- code = ubik_Call(PR_Delete, pruclient, 0, id);
+ code = ubik_PR_Delete(pruclient, 0, id);
return code;
}
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)
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)
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;
}
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);
{
register afs_int32 code;
- code = ubik_Call(PR_IDToName, pruclient, 0, ids, names);
+ code = ubik_PR_IDToName(pruclient, 0, ids, names);
return code;
}
*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);
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) {
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) {
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) {
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) {
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) {
{
register afs_int32 code;
- code = ubik_Call(PR_ListEntry, pruclient, 0, id, aentry);
+ code = ubik_PR_ListEntry(pruclient, 0, id, aentry);
return code;
}
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;
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. */
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. */
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;
}
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);
{
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;
}
{
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;
}
{
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;
}
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;
}
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;
}
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");
}
psproc1(defp, 0, "int", "", 0xFFFFFFFF);
}
+ if (uflag && !kflag)
+ psproc1(defp, 2, "int", "ubik_", 0xFFFFFFFF);
+
if (*ServerPrefix)
psproc1(defp, 1, "afs_int32", ServerPrefix, 0xFFFFFFFF);
}
int dflag;
int xflag;
int yflag;
+ int uflag;
char *infile;
char *outfile;
};
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 */
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);
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");
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");
case 'k':
case 'p':
case 'd':
+ case 'u':
case 'x':
case 'y':
case 'z':
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'];
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);
}
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);
+ }
+ }
}
}
+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)
{
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;
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);
* 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;
*/
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;
/*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;
/* 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;
}
if (rx_ConnError(tc)) {
- tc = RefreshConn(tc);
+ tc = ubik_RefreshConn(tc);
aclient->conns[*apos] = tc;
}
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
${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
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,
}
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) {
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);
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);
}
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) {
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.
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,
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
${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
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 */
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 */
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 */
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) {
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 =
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) {
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;
}
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) {
}
-#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.