summaryrefslogtreecommitdiff
path: root/lib/libc/rpc/rpc_prot.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/rpc/rpc_prot.c')
-rw-r--r--lib/libc/rpc/rpc_prot.c44
1 files changed, 25 insertions, 19 deletions
diff --git a/lib/libc/rpc/rpc_prot.c b/lib/libc/rpc/rpc_prot.c
index 7fbb36fd7557..8debaf14ad6d 100644
--- a/lib/libc/rpc/rpc_prot.c
+++ b/lib/libc/rpc/rpc_prot.c
@@ -5,23 +5,23 @@
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
- *
+ *
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
+ *
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
- *
+ *
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
- *
+ *
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
- *
+ *
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
@@ -30,7 +30,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)rpc_prot.c 1.36 87/08/11 Copyr 1984 Sun Micro";*/
/*static char *sccsid = "from: @(#)rpc_prot.c 2.3 88/08/07 4.0 RPCSRC";*/
-static char *rcsid = "$Id: rpc_prot.c,v 1.1 1993/10/27 05:40:50 paul Exp $";
+static char *rcsid = "$Id: rpc_prot.c,v 1.4 1996/12/30 15:00:53 peter Exp $";
#endif
/*
@@ -86,9 +86,9 @@ xdr_des_block(xdrs, blkp)
/*
* XDR the MSG_ACCEPTED part of a reply message union
*/
-bool_t
+bool_t
xdr_accepted_reply(xdrs, ar)
- register XDR *xdrs;
+ register XDR *xdrs;
register struct accepted_reply *ar;
{
@@ -103,9 +103,11 @@ xdr_accepted_reply(xdrs, ar)
return ((*(ar->ar_results.proc))(xdrs, ar->ar_results.where));
case PROG_MISMATCH:
- if (! xdr_u_long(xdrs, &(ar->ar_vers.low)))
+ if (! xdr_u_int32_t(xdrs, &(ar->ar_vers.low)))
return (FALSE);
- return (xdr_u_long(xdrs, &(ar->ar_vers.high)));
+ return (xdr_u_int32_t(xdrs, &(ar->ar_vers.high)));
+ default:
+ break;
}
return (TRUE); /* TRUE => open ended set of problems */
}
@@ -113,7 +115,7 @@ xdr_accepted_reply(xdrs, ar)
/*
* XDR the MSG_DENIED part of a reply message union
*/
-bool_t
+bool_t
xdr_rejected_reply(xdrs, rr)
register XDR *xdrs;
register struct rejected_reply *rr;
@@ -125,9 +127,9 @@ xdr_rejected_reply(xdrs, rr)
switch (rr->rj_stat) {
case RPC_MISMATCH:
- if (! xdr_u_long(xdrs, &(rr->rj_vers.low)))
+ if (! xdr_u_int32_t(xdrs, &(rr->rj_vers.low)))
return (FALSE);
- return (xdr_u_long(xdrs, &(rr->rj_vers.high)));
+ return (xdr_u_int32_t(xdrs, &(rr->rj_vers.high)));
case AUTH_ERROR:
return (xdr_enum(xdrs, (enum_t *)&(rr->rj_why)));
@@ -149,7 +151,7 @@ xdr_replymsg(xdrs, rmsg)
register struct rpc_msg *rmsg;
{
if (
- xdr_u_long(xdrs, &(rmsg->rm_xid)) &&
+ xdr_u_int32_t(xdrs, &(rmsg->rm_xid)) &&
xdr_enum(xdrs, (enum_t *)&(rmsg->rm_direction)) &&
(rmsg->rm_direction == REPLY) )
return (xdr_union(xdrs, (enum_t *)&(rmsg->rm_reply.rp_stat),
@@ -173,11 +175,11 @@ xdr_callhdr(xdrs, cmsg)
cmsg->rm_call.cb_rpcvers = RPC_MSG_VERSION;
if (
(xdrs->x_op == XDR_ENCODE) &&
- xdr_u_long(xdrs, &(cmsg->rm_xid)) &&
+ xdr_u_int32_t(xdrs, &(cmsg->rm_xid)) &&
xdr_enum(xdrs, (enum_t *)&(cmsg->rm_direction)) &&
- xdr_u_long(xdrs, &(cmsg->rm_call.cb_rpcvers)) &&
- xdr_u_long(xdrs, &(cmsg->rm_call.cb_prog)) )
- return (xdr_u_long(xdrs, &(cmsg->rm_call.cb_vers)));
+ xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_rpcvers)) &&
+ xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_prog)) )
+ return (xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_vers)));
return (FALSE);
}
@@ -221,7 +223,7 @@ accepted(acpt_stat, error)
error->re_lb.s2 = (long)acpt_stat;
}
-static void
+static void
rejected(rjct_stat, error)
register enum reject_stat rjct_stat;
register struct rpc_err *error;
@@ -236,6 +238,8 @@ rejected(rjct_stat, error)
case AUTH_ERROR:
error->re_status = RPC_AUTHERROR;
return;
+ default:
+ break;
}
/* something's wrong, but we don't know what ... */
error->re_status = RPC_FAILED;
@@ -287,5 +291,7 @@ _seterr_reply(msg, error)
error->re_vers.low = msg->acpted_rply.ar_vers.low;
error->re_vers.high = msg->acpted_rply.ar_vers.high;
break;
+ default:
+ break;
}
}