summaryrefslogtreecommitdiffstats
path: root/lib/libc/rpc
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-12-30 14:55:38 +0000
committerpeter <peter@FreeBSD.org>1996-12-30 14:55:38 +0000
commit7960357196a6123552f99b144475c17b9791df32 (patch)
tree38b0664d9e797b723f4afb25eef8546058e0c737 /lib/libc/rpc
parent9f036a4d01cb1d8904bd1fbbc7242bc3f3846259 (diff)
downloadFreeBSD-src-7960357196a6123552f99b144475c17b9791df32.zip
FreeBSD-src-7960357196a6123552f99b144475c17b9791df32.tar.gz
- 64 bit type safe on-the-wire protocol
- use standard functions - prototype now in include file Obtained from: a diff of FreeBSD vs. OpenBSD/NetBSD rpc code.
Diffstat (limited to 'lib/libc/rpc')
-rw-r--r--lib/libc/rpc/rpc_callmsg.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/lib/libc/rpc/rpc_callmsg.c b/lib/libc/rpc/rpc_callmsg.c
index 23ca32e..14f50b9 100644
--- a/lib/libc/rpc/rpc_callmsg.c
+++ b/lib/libc/rpc/rpc_callmsg.c
@@ -30,7 +30,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)rpc_callmsg.c 1.4 87/08/11 Copyr 1984 Sun Micro";*/
/*static char *sccsid = "from: @(#)rpc_callmsg.c 2.1 88/07/29 4.0 RPCSRC";*/
-static char *rcsid = "$Id: rpc_callmsg.c,v 1.3 1995/10/22 14:51:33 phk Exp $";
+static char *rcsid = "$Id: rpc_callmsg.c,v 1.4 1996/06/08 22:54:55 jraynard Exp $";
#endif
/*
@@ -45,8 +45,6 @@ static char *rcsid = "$Id: rpc_callmsg.c,v 1.3 1995/10/22 14:51:33 phk Exp $";
#include <string.h>
#include <rpc/rpc.h>
-bool_t xdr_opaque_auth(XDR *xdrs, struct opaque_auth *ap);
-
/*
* XDR a call message
*/
@@ -55,7 +53,7 @@ xdr_callmsg(xdrs, cmsg)
register XDR *xdrs;
register struct rpc_msg *cmsg;
{
- register long *buf;
+ register int32_t *buf;
register struct opaque_auth *oa;
if (xdrs->x_op == XDR_ENCODE) {
@@ -86,16 +84,16 @@ xdr_callmsg(xdrs, cmsg)
IXDR_PUT_ENUM(buf, oa->oa_flavor);
IXDR_PUT_LONG(buf, oa->oa_length);
if (oa->oa_length) {
- bcopy(oa->oa_base, (caddr_t)buf, oa->oa_length);
- buf += RNDUP(oa->oa_length) / sizeof (long);
+ memcpy((caddr_t)buf, oa->oa_base, oa->oa_length);
+ buf += RNDUP(oa->oa_length) / sizeof (int32_t);
}
oa = &cmsg->rm_call.cb_verf;
IXDR_PUT_ENUM(buf, oa->oa_flavor);
IXDR_PUT_LONG(buf, oa->oa_length);
if (oa->oa_length) {
- bcopy(oa->oa_base, (caddr_t)buf, oa->oa_length);
+ memcpy((caddr_t)buf, oa->oa_base, oa->oa_length);
/* no real need....
- buf += RNDUP(oa->oa_length) / sizeof (long);
+ buf += RNDUP(oa->oa_length) / sizeof (int32_t);
*/
}
return (TRUE);
@@ -134,11 +132,11 @@ xdr_callmsg(xdrs, cmsg)
return (FALSE);
}
} else {
- bcopy((caddr_t)buf, oa->oa_base,
+ memcpy(oa->oa_base, (caddr_t)buf,
oa->oa_length);
/* no real need....
buf += RNDUP(oa->oa_length) /
- sizeof (long);
+ sizeof (int32_t);
*/
}
}
@@ -168,11 +166,11 @@ xdr_callmsg(xdrs, cmsg)
return (FALSE);
}
} else {
- bcopy((caddr_t)buf, oa->oa_base,
+ memcpy(oa->oa_base, (caddr_t)buf,
oa->oa_length);
/* no real need...
buf += RNDUP(oa->oa_length) /
- sizeof (long);
+ sizeof (int32_t);
*/
}
}
@@ -180,14 +178,14 @@ xdr_callmsg(xdrs, cmsg)
}
}
if (
- xdr_u_long(xdrs, &(cmsg->rm_xid)) &&
+ xdr_u_int32_t(xdrs, &(cmsg->rm_xid)) &&
xdr_enum(xdrs, (enum_t *)&(cmsg->rm_direction)) &&
(cmsg->rm_direction == CALL) &&
- xdr_u_long(xdrs, &(cmsg->rm_call.cb_rpcvers)) &&
+ xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_rpcvers)) &&
(cmsg->rm_call.cb_rpcvers == RPC_MSG_VERSION) &&
- xdr_u_long(xdrs, &(cmsg->rm_call.cb_prog)) &&
- xdr_u_long(xdrs, &(cmsg->rm_call.cb_vers)) &&
- xdr_u_long(xdrs, &(cmsg->rm_call.cb_proc)) &&
+ xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_prog)) &&
+ xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_vers)) &&
+ xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_proc)) &&
xdr_opaque_auth(xdrs, &(cmsg->rm_call.cb_cred)) )
return (xdr_opaque_auth(xdrs, &(cmsg->rm_call.cb_verf)));
return (FALSE);
OpenPOWER on IntegriCloud