summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2005-04-01 07:44:05 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2005-04-01 07:44:05 +0000
commit46dd7fa28774a43ed962f12dff50a2f623bdfc62 (patch)
treeb9aef01653cce18509f9ef07acab774e1b5b77eb /lib
parent1f49fb4097cac5eea507a78749b49b3783984392 (diff)
ansify. ok deraadt@ jaredy@
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/rpc/auth_none.c8
-rw-r--r--lib/libc/rpc/auth_unix.c33
-rw-r--r--lib/libc/rpc/authunix_prot.c6
-rw-r--r--lib/libc/rpc/bindresvport.c10
-rw-r--r--lib/libc/rpc/clnt_generic.c8
-rw-r--r--lib/libc/rpc/clnt_perror.c27
-rw-r--r--lib/libc/rpc/clnt_raw.c23
-rw-r--r--lib/libc/rpc/clnt_simple.c9
-rw-r--r--lib/libc/rpc/clnt_tcp.c57
-rw-r--r--lib/libc/rpc/clnt_udp.c49
-rw-r--r--lib/libc/rpc/get_myaddress.c5
-rw-r--r--lib/libc/rpc/getrpcent.c25
-rw-r--r--lib/libc/rpc/getrpcport.c6
-rw-r--r--lib/libc/rpc/pmap_clnt.c13
-rw-r--r--lib/libc/rpc/pmap_getmaps.c5
-rw-r--r--lib/libc/rpc/pmap_getport.c9
-rw-r--r--lib/libc/rpc/pmap_prot.c6
-rw-r--r--lib/libc/rpc/pmap_prot2.c6
-rw-r--r--lib/libc/rpc/pmap_rmt.c42
-rw-r--r--lib/libc/rpc/rpc.34
-rw-r--r--lib/libc/rpc/rpc_callmsg.c6
-rw-r--r--lib/libc/rpc/rpc_dtablesize.c4
-rw-r--r--lib/libc/rpc/rpc_prot.c38
-rw-r--r--lib/libc/rpc/svc.c74
-rw-r--r--lib/libc/rpc/svc_auth.c17
-rw-r--r--lib/libc/rpc/svc_auth_unix.c10
-rw-r--r--lib/libc/rpc/svc_raw.c42
-rw-r--r--lib/libc/rpc/svc_run.c4
-rw-r--r--lib/libc/rpc/svc_simple.c14
-rw-r--r--lib/libc/rpc/svc_tcp.c91
-rw-r--r--lib/libc/rpc/svc_udp.c50
-rw-r--r--lib/libc/rpc/xdr.c99
-rw-r--r--lib/libc/rpc/xdr_array.c23
-rw-r--r--lib/libc/rpc/xdr_float.c10
-rw-r--r--lib/libc/rpc/xdr_mem.c49
-rw-r--r--lib/libc/rpc/xdr_rec.c80
-rw-r--r--lib/libc/rpc/xdr_reference.c17
-rw-r--r--lib/libc/rpc/xdr_stdio.c39
38 files changed, 326 insertions, 692 deletions
diff --git a/lib/libc/rpc/auth_none.c b/lib/libc/rpc/auth_none.c
index b7b4f75b163..4d7520ea9e5 100644
--- a/lib/libc/rpc/auth_none.c
+++ b/lib/libc/rpc/auth_none.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: auth_none.c,v 1.7 2001/09/15 13:51:00 deraadt Exp $";
+static char *rcsid = "$OpenBSD: auth_none.c,v 1.8 2005/04/01 07:44:03 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -70,7 +70,7 @@ static struct authnone_private {
} *authnone_private;
AUTH *
-authnone_create()
+authnone_create(void)
{
struct authnone_private *ap = authnone_private;
XDR xdr_stream;
@@ -98,9 +98,7 @@ authnone_create()
/*ARGSUSED*/
static bool_t
-authnone_marshal(client, xdrs)
- AUTH *client;
- XDR *xdrs;
+authnone_marshal(AUTH *client, XDR *xdrs)
{
struct authnone_private *ap = authnone_private;
diff --git a/lib/libc/rpc/auth_unix.c b/lib/libc/rpc/auth_unix.c
index 7f2c4d0abfa..22bb22d19de 100644
--- a/lib/libc/rpc/auth_unix.c
+++ b/lib/libc/rpc/auth_unix.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: auth_unix.c,v 1.17 2005/01/08 19:17:39 krw Exp $";
+static char *rcsid = "$OpenBSD: auth_unix.c,v 1.18 2005/04/01 07:44:03 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -83,7 +83,7 @@ struct audata {
};
#define AUTH_PRIVATE(auth) ((struct audata *)auth->ah_private)
-static void marshal_new_auth();
+static void marshal_new_auth(AUTH *auth);
/*
@@ -91,12 +91,7 @@ static void marshal_new_auth();
* Returns an auth handle with the given stuff in it.
*/
AUTH *
-authunix_create(machname, uid, gid, len, aup_gids)
- char *machname;
- int uid;
- int gid;
- int len;
- int *aup_gids;
+authunix_create(char *machname, int uid, int gid, int len, int *aup_gids)
{
struct authunix_parms aup;
char mymem[MAX_AUTH_BYTES];
@@ -173,7 +168,7 @@ authunix_create(machname, uid, gid, len, aup_gids)
* syscalls.
*/
AUTH *
-authunix_create_default()
+authunix_create_default(void)
{
int len, i;
char machname[MAX_MACHINE_NAME + 1];
@@ -199,16 +194,13 @@ authunix_create_default()
*/
/* ARGSUSED */
static void
-authunix_nextverf(auth)
- AUTH *auth;
+authunix_nextverf(AUTH *auth)
{
/* no action necessary */
}
static bool_t
-authunix_marshal(auth, xdrs)
- AUTH *auth;
- XDR *xdrs;
+authunix_marshal(AUTH *auth, XDR *xdrs)
{
struct audata *au = AUTH_PRIVATE(auth);
@@ -216,9 +208,7 @@ authunix_marshal(auth, xdrs)
}
static bool_t
-authunix_validate(auth, verf)
- AUTH *auth;
- struct opaque_auth *verf;
+authunix_validate(AUTH *auth, struct opaque_auth *verf)
{
struct audata *au;
XDR xdrs;
@@ -246,8 +236,7 @@ authunix_validate(auth, verf)
}
static bool_t
-authunix_refresh(auth)
- AUTH *auth;
+authunix_refresh(AUTH *auth)
{
struct audata *au = AUTH_PRIVATE(auth);
struct authunix_parms aup;
@@ -289,8 +278,7 @@ done:
}
static void
-authunix_destroy(auth)
- AUTH *auth;
+authunix_destroy(AUTH *auth)
{
struct audata *au = AUTH_PRIVATE(auth);
@@ -312,8 +300,7 @@ authunix_destroy(auth)
* sets private data, au_marshed and au_mpos
*/
static void
-marshal_new_auth(auth)
- AUTH *auth;
+marshal_new_auth(AUTH *auth)
{
XDR xdr_stream;
XDR *xdrs = &xdr_stream;
diff --git a/lib/libc/rpc/authunix_prot.c b/lib/libc/rpc/authunix_prot.c
index 5b7755ec1b1..6a43f127c07 100644
--- a/lib/libc/rpc/authunix_prot.c
+++ b/lib/libc/rpc/authunix_prot.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: authunix_prot.c,v 1.4 2001/09/15 13:51:00 deraadt Exp $";
+static char *rcsid = "$OpenBSD: authunix_prot.c,v 1.5 2005/04/01 07:44:03 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -48,9 +48,7 @@ static char *rcsid = "$OpenBSD: authunix_prot.c,v 1.4 2001/09/15 13:51:00 deraad
* XDR for unix authentication parameters.
*/
bool_t
-xdr_authunix_parms(xdrs, p)
- XDR *xdrs;
- struct authunix_parms *p;
+xdr_authunix_parms(XDR *xdrs, struct authunix_parms *p)
{
if (xdr_u_long(xdrs, &(p->aup_time))
diff --git a/lib/libc/rpc/bindresvport.c b/lib/libc/rpc/bindresvport.c
index f17152272bb..2defe41f1d7 100644
--- a/lib/libc/rpc/bindresvport.c
+++ b/lib/libc/rpc/bindresvport.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bindresvport.c,v 1.15 2003/05/20 22:42:35 deraadt Exp $ */
+/* $OpenBSD: bindresvport.c,v 1.16 2005/04/01 07:44:03 otto Exp $ */
/*
* Copyright 1996, Jason Downs. All rights reserved.
@@ -35,9 +35,7 @@
* Bind a socket to a privileged IP port
*/
int
-bindresvport(sd, sin)
- int sd;
- struct sockaddr_in *sin;
+bindresvport(int sd, struct sockaddr_in *sin)
{
return bindresvport_sa(sd, (struct sockaddr *)sin);
}
@@ -46,9 +44,7 @@ bindresvport(sd, sin)
* Bind a socket to a privileged port for whatever protocol.
*/
int
-bindresvport_sa(sd, sa)
- int sd;
- struct sockaddr *sa;
+bindresvport_sa(int sd, struct sockaddr *sa)
{
int old, error, af;
struct sockaddr_storage myaddr;
diff --git a/lib/libc/rpc/clnt_generic.c b/lib/libc/rpc/clnt_generic.c
index 149f58c8e06..266861e1d99 100644
--- a/lib/libc/rpc/clnt_generic.c
+++ b/lib/libc/rpc/clnt_generic.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: clnt_generic.c,v 1.3 1996/08/19 08:31:25 tholo Exp $";
+static char *rcsid = "$OpenBSD: clnt_generic.c,v 1.4 2005/04/01 07:44:03 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -46,11 +46,7 @@ static char *rcsid = "$OpenBSD: clnt_generic.c,v 1.3 1996/08/19 08:31:25 tholo E
* change using the rpc equivalent of ioctl()'s.
*/
CLIENT *
-clnt_create(hostname, prog, vers, proto)
- char *hostname;
- u_long prog;
- u_long vers;
- char *proto;
+clnt_create(char *hostname, u_long prog, u_long vers, char *proto)
{
struct hostent *h;
struct protoent *p;
diff --git a/lib/libc/rpc/clnt_perror.c b/lib/libc/rpc/clnt_perror.c
index 16bde81825b..984ccc7b7f6 100644
--- a/lib/libc/rpc/clnt_perror.c
+++ b/lib/libc/rpc/clnt_perror.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: clnt_perror.c,v 1.15 2002/09/10 05:39:07 deraadt Exp $";
+static char *rcsid = "$OpenBSD: clnt_perror.c,v 1.16 2005/04/01 07:44:03 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -51,7 +51,7 @@ static char *auth_errmsg(enum auth_stat stat);
static char *buf;
static char *
-_buf()
+_buf(void)
{
if (buf == NULL)
@@ -63,9 +63,7 @@ _buf()
* Print reply error info
*/
char *
-clnt_sperror(rpch, s)
- CLIENT *rpch;
- char *s;
+clnt_sperror(CLIENT *rpch, char *s)
{
char *err, *str = _buf(), *strstart;
struct rpc_err e;
@@ -148,9 +146,7 @@ truncated:
}
void
-clnt_perror(rpch, s)
- CLIENT *rpch;
- char *s;
+clnt_perror(CLIENT *rpch, char *s)
{
(void) fprintf(stderr, "%s", clnt_sperror(rpch, s));
}
@@ -181,8 +177,7 @@ static const char *const rpc_errlist[] = {
* This interface for use by clntrpc
*/
char *
-clnt_sperrno(stat)
- enum clnt_stat stat;
+clnt_sperrno(enum clnt_stat stat)
{
unsigned int errnum = stat;
@@ -193,16 +188,14 @@ clnt_sperrno(stat)
}
void
-clnt_perrno(num)
- enum clnt_stat num;
+clnt_perrno(enum clnt_stat num)
{
(void) fprintf(stderr, "%s\n", clnt_sperrno(num));
}
char *
-clnt_spcreateerror(s)
- char *s;
+clnt_spcreateerror(char *s)
{
char *str = _buf();
@@ -233,8 +226,7 @@ clnt_spcreateerror(s)
}
void
-clnt_pcreateerror(s)
- char *s;
+clnt_pcreateerror(char *s)
{
(void) fprintf(stderr, "%s", clnt_spcreateerror(s));
}
@@ -251,8 +243,7 @@ static const char *const auth_errlist[] = {
};
static char *
-auth_errmsg(stat)
- enum auth_stat stat;
+auth_errmsg(enum auth_stat stat)
{
unsigned int errnum = stat;
diff --git a/lib/libc/rpc/clnt_raw.c b/lib/libc/rpc/clnt_raw.c
index 9c6caffed0d..424bd87081c 100644
--- a/lib/libc/rpc/clnt_raw.c
+++ b/lib/libc/rpc/clnt_raw.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: clnt_raw.c,v 1.11 2004/12/16 20:45:07 krw Exp $";
+static char *rcsid = "$OpenBSD: clnt_raw.c,v 1.12 2005/04/01 07:44:03 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -76,15 +76,13 @@ static struct clnt_ops client_ops = {
clntraw_control
};
-void svc_getreq();
+void svc_getreq(int rdfds);
/*
* Create a client handle for memory based rpc.
*/
CLIENT *
-clntraw_create(prog, vers)
- u_long prog;
- u_long vers;
+clntraw_create(u_long prog, u_long vers)
{
struct clntraw_private *clp = clntraw_private;
struct rpc_msg call_msg;
@@ -128,14 +126,8 @@ clntraw_create(prog, vers)
/* ARGSUSED */
static enum clnt_stat
-clntraw_call(h, proc, xargs, argsp, xresults, resultsp, timeout)
- CLIENT *h;
- u_long proc;
- xdrproc_t xargs;
- caddr_t argsp;
- xdrproc_t xresults;
- caddr_t resultsp;
- struct timeval timeout;
+clntraw_call(CLIENT *h, u_long proc, xdrproc_t xargs, caddr_t argsp,
+ xdrproc_t xresults, caddr_t resultsp, struct timeval timeout)
{
struct clntraw_private *clp = clntraw_private;
XDR *xdrs;
@@ -216,10 +208,7 @@ clntraw_geterr(CLIENT *clnt, struct rpc_err *err)
/* ARGSUSED */
static bool_t
-clntraw_freeres(cl, xdr_res, res_ptr)
- CLIENT *cl;
- xdrproc_t xdr_res;
- caddr_t res_ptr;
+clntraw_freeres(CLIENT *cl, xdrproc_t xdr_res, caddr_t res_ptr)
{
struct clntraw_private *clp = clntraw_private;
XDR *xdrs;
diff --git a/lib/libc/rpc/clnt_simple.c b/lib/libc/rpc/clnt_simple.c
index 06ee3c430cc..e6bb932306f 100644
--- a/lib/libc/rpc/clnt_simple.c
+++ b/lib/libc/rpc/clnt_simple.c
@@ -29,7 +29,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: clnt_simple.c,v 1.10 2001/06/27 00:58:56 lebel Exp $";
+static char *rcsid = "$OpenBSD: clnt_simple.c,v 1.11 2005/04/01 07:44:03 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -55,11 +55,8 @@ static struct callrpc_private {
} *callrpc_private;
int
-callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out)
- char *host;
- int prognum, versnum, procnum;
- xdrproc_t inproc, outproc;
- char *in, *out;
+callrpc(char *host, int prognum, int versnum, int procnum, xdrproc_t inproc,
+ char *in, xdrproc_t outproc, char *out)
{
struct callrpc_private *save_callrpc_private = callrpc_private;
struct callrpc_private *crp = callrpc_private;
diff --git a/lib/libc/rpc/clnt_tcp.c b/lib/libc/rpc/clnt_tcp.c
index a2b95644a2f..a5cb329eef4 100644
--- a/lib/libc/rpc/clnt_tcp.c
+++ b/lib/libc/rpc/clnt_tcp.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: clnt_tcp.c,v 1.20 2005/01/08 19:17:39 krw Exp $";
+static char *rcsid = "$OpenBSD: clnt_tcp.c,v 1.21 2005/04/01 07:44:03 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -62,9 +62,6 @@ static char *rcsid = "$OpenBSD: clnt_tcp.c,v 1.20 2005/01/08 19:17:39 krw Exp $"
#define MCALL_MSG_SIZE 24
-static int readtcp();
-static int writetcp();
-
static enum clnt_stat clnttcp_call(CLIENT *, u_long, xdrproc_t, caddr_t,
xdrproc_t, caddr_t, struct timeval);
static void clnttcp_abort(CLIENT *);
@@ -94,6 +91,9 @@ struct ct_data {
XDR ct_xdrs;
};
+static int readtcp(struct ct_data *, caddr_t, int);
+static int writetcp(struct ct_data *, caddr_t, int);
+
/*
* Create a client handle for a tcp/ip connection.
* If *sockp<0, *sockp is set to a newly created TCP socket and it is
@@ -109,13 +109,8 @@ struct ct_data {
* something more useful.
*/
CLIENT *
-clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
- struct sockaddr_in *raddr;
- u_long prog;
- u_long vers;
- int *sockp;
- u_int sendsz;
- u_int recvsz;
+clnttcp_create(struct sockaddr_in *raddr, u_long prog, u_long vers, int *sockp,
+ u_int sendsz, u_int recvsz)
{
CLIENT *h;
struct ct_data *ct = NULL;
@@ -207,7 +202,8 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
* and authnone for authentication.
*/
xdrrec_create(&(ct->ct_xdrs), sendsz, recvsz,
- (caddr_t)ct, readtcp, writetcp);
+ (caddr_t)ct, (int(*)(caddr_t, caddr_t, int))readtcp,
+ (int(*)(caddr_t, caddr_t, int))writetcp);
h->cl_ops = &tcp_ops;
h->cl_private = (caddr_t) ct;
h->cl_auth = authnone_create();
@@ -225,14 +221,8 @@ fooy:
}
static enum clnt_stat
-clnttcp_call(h, proc, xdr_args, args_ptr, xdr_results, results_ptr, timeout)
- CLIENT *h;
- u_long proc;
- xdrproc_t xdr_args;
- caddr_t args_ptr;
- xdrproc_t xdr_results;
- caddr_t results_ptr;
- struct timeval timeout;
+clnttcp_call(CLIENT *h, u_long proc, xdrproc_t xdr_args, caddr_t args_ptr,
+ xdrproc_t xdr_results, caddr_t results_ptr, struct timeval timeout)
{
struct ct_data *ct = (struct ct_data *) h->cl_private;
XDR *xdrs = &(ct->ct_xdrs);
@@ -322,9 +312,7 @@ call_again:
}
static void
-clnttcp_geterr(h, errp)
- CLIENT *h;
- struct rpc_err *errp;
+clnttcp_geterr(CLIENT *h, struct rpc_err *errp)
{
struct ct_data *ct =
(struct ct_data *) h->cl_private;
@@ -333,10 +321,7 @@ clnttcp_geterr(h, errp)
}
static bool_t
-clnttcp_freeres(cl, xdr_res, res_ptr)
- CLIENT *cl;
- xdrproc_t xdr_res;
- caddr_t res_ptr;
+clnttcp_freeres(CLIENT *cl, xdrproc_t xdr_res, caddr_t res_ptr)
{
struct ct_data *ct = (struct ct_data *)cl->cl_private;
XDR *xdrs = &(ct->ct_xdrs);
@@ -351,10 +336,7 @@ clnttcp_abort(CLIENT *clnt)
}
static bool_t
-clnttcp_control(cl, request, info)
- CLIENT *cl;
- u_int request;
- void *info;
+clnttcp_control(CLIENT *cl, u_int request, void *info)
{
struct ct_data *ct = (struct ct_data *)cl->cl_private;
@@ -377,8 +359,7 @@ clnttcp_control(cl, request, info)
static void
-clnttcp_destroy(h)
- CLIENT *h;
+clnttcp_destroy(CLIENT *h)
{
struct ct_data *ct =
(struct ct_data *) h->cl_private;
@@ -397,10 +378,7 @@ clnttcp_destroy(h)
* around for the rpc level.
*/
static int
-readtcp(ct, buf, len)
- struct ct_data *ct;
- caddr_t buf;
- int len;
+readtcp(struct ct_data *ct, caddr_t buf, int len)
{
struct pollfd pfd[1];
struct timeval start, after, duration, tmp;
@@ -462,10 +440,7 @@ readtcp(ct, buf, len)
}
static int
-writetcp(ct, buf, len)
- struct ct_data *ct;
- caddr_t buf;
- int len;
+writetcp(struct ct_data *ct, caddr_t buf, int len)
{
int i, cnt;
diff --git a/lib/libc/rpc/clnt_udp.c b/lib/libc/rpc/clnt_udp.c
index 53ceb86ff12..f1d4814a2cc 100644
--- a/lib/libc/rpc/clnt_udp.c
+++ b/lib/libc/rpc/clnt_udp.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: clnt_udp.c,v 1.21 2005/01/08 19:17:39 krw Exp $";
+static char *rcsid = "$OpenBSD: clnt_udp.c,v 1.22 2005/04/01 07:44:03 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -104,14 +104,8 @@ struct cu_data {
* sent and received.
*/
CLIENT *
-clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz)
- struct sockaddr_in *raddr;
- u_long program;
- u_long version;
- struct timeval wait;
- int *sockp;
- u_int sendsz;
- u_int recvsz;
+clntudp_bufcreate(struct sockaddr_in *raddr, u_long program, u_long version,
+ struct timeval wait, int *sockp, u_int sendsz, u_int recvsz)
{
CLIENT *cl;
struct cu_data *cu = NULL;
@@ -194,12 +188,8 @@ fooy:
}
CLIENT *
-clntudp_create(raddr, program, version, wait, sockp)
- struct sockaddr_in *raddr;
- u_long program;
- u_long version;
- struct timeval wait;
- int *sockp;
+clntudp_create(struct sockaddr_in *raddr, u_long program, u_long version,
+ struct timeval wait, int *sockp)
{
return(clntudp_bufcreate(raddr, program, version, wait, sockp,
@@ -207,14 +197,13 @@ clntudp_create(raddr, program, version, wait, sockp)
}
static enum clnt_stat
-clntudp_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout)
- CLIENT *cl; /* client handle */
- u_long proc; /* procedure number */
- xdrproc_t xargs; /* xdr routine for args */
- caddr_t argsp; /* pointer to args */
- xdrproc_t xresults; /* xdr routine for results */
- caddr_t resultsp; /* pointer to results */
- struct timeval utimeout; /* seconds to wait before giving up */
+clntudp_call(CLIENT *cl, /* client handle */
+ u_long proc, /* procedure number */
+ xdrproc_t xargs, /* xdr routine for args */
+ caddr_t argsp, /* pointer to args */
+ xdrproc_t xresults, /* xdr routine for results */
+ caddr_t resultsp, /* pointer to results */
+ struct timeval utimeout) /* seconds to wait before giving up */
{
struct cu_data *cu = (struct cu_data *)cl->cl_private;
XDR *xdrs;
@@ -380,9 +369,7 @@ send_again:
}
static void
-clntudp_geterr(cl, errp)
- CLIENT *cl;
- struct rpc_err *errp;
+clntudp_geterr(CLIENT *cl, struct rpc_err *errp)
{
struct cu_data *cu = (struct cu_data *)cl->cl_private;
@@ -391,10 +378,7 @@ clntudp_geterr(cl, errp)
static bool_t
-clntudp_freeres(cl, xdr_res, res_ptr)
- CLIENT *cl;
- xdrproc_t xdr_res;
- caddr_t res_ptr;
+clntudp_freeres(CLIENT *cl, xdrproc_t xdr_res, caddr_t res_ptr)
{
struct cu_data *cu = (struct cu_data *)cl->cl_private;
XDR *xdrs = &(cu->cu_outxdrs);
@@ -409,10 +393,7 @@ clntudp_abort(CLIENT *clnt)
}
static bool_t
-clntudp_control(cl, request, info)
- CLIENT *cl;
- u_int request;
- void *info;
+clntudp_control(CLIENT *cl, u_int request, void *info)
{
struct cu_data *cu = (struct cu_data *)cl->cl_private;
diff --git a/lib/libc/rpc/get_myaddress.c b/lib/libc/rpc/get_myaddress.c
index 0555425ec5e..bc0d7b66f86 100644
--- a/lib/libc/rpc/get_myaddress.c
+++ b/lib/libc/rpc/get_myaddress.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: get_myaddress.c,v 1.10 2000/02/25 05:06:27 itojun Exp $";
+static char *rcsid = "$OpenBSD: get_myaddress.c,v 1.11 2005/04/01 07:44:03 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -56,8 +56,7 @@ static char *rcsid = "$OpenBSD: get_myaddress.c,v 1.10 2000/02/25 05:06:27 itoju
* interface only if there are no other possible interfaces.
*/
int
-get_myaddress(addr)
- struct sockaddr_in *addr;
+get_myaddress(struct sockaddr_in *addr)
{
struct ifaddrs *ifap, *ifa;
int loopback = 0, gotit = 0;
diff --git a/lib/libc/rpc/getrpcent.c b/lib/libc/rpc/getrpcent.c
index b241f8b9e61..cfae27e3fda 100644
--- a/lib/libc/rpc/getrpcent.c
+++ b/lib/libc/rpc/getrpcent.c
@@ -29,7 +29,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: getrpcent.c,v 1.11 2001/09/15 13:51:00 deraadt Exp $";
+static char *rcsid = "$OpenBSD: getrpcent.c,v 1.12 2005/04/01 07:44:03 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -54,14 +54,12 @@ struct rpcdata {
char line[BUFSIZ+1];
} *rpcdata;
-static struct rpcent *interpret();
-struct hostent *gethostent();
-char *inet_ntoa();
+static struct rpcent *interpret(char *val, int len);
static char RPCDB[] = "/etc/rpc";
static struct rpcdata *
-_rpcdata()
+_rpcdata(void)
{
struct rpcdata *d = rpcdata;
@@ -73,8 +71,7 @@ _rpcdata()
}
struct rpcent *
-getrpcbynumber(number)
- int number;
+getrpcbynumber(int number)
{
struct rpcdata *d = _rpcdata();
struct rpcent *p;
@@ -91,8 +88,7 @@ getrpcbynumber(number)
}
struct rpcent *
-getrpcbyname(name)
- char *name;
+getrpcbyname(char *name)
{
struct rpcent *rpc;
char **rp;
@@ -112,8 +108,7 @@ done:
}
void
-setrpcent(f)
- int f;
+setrpcent(int f)
{
struct rpcdata *d = _rpcdata();
@@ -127,7 +122,7 @@ setrpcent(f)
}
void
-endrpcent()
+endrpcent(void)
{
struct rpcdata *d = _rpcdata();
@@ -140,7 +135,7 @@ endrpcent()
}
struct rpcent *
-getrpcent()
+getrpcent(void)
{
struct rpcdata *d = _rpcdata();
@@ -155,9 +150,7 @@ getrpcent()
}
static struct rpcent *
-interpret(val, len)
- char *val;
- int len;
+interpret(char *val, int len)
{
struct rpcdata *d = _rpcdata();
char *p;
diff --git a/lib/libc/rpc/getrpcport.c b/lib/libc/rpc/getrpcport.c
index 703fa084ceb..5b96a1d36c3 100644
--- a/lib/libc/rpc/getrpcport.c
+++ b/lib/libc/rpc/getrpcport.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: getrpcport.c,v 1.5 1996/09/30 21:12:59 deraadt Exp $";
+static char *rcsid = "$OpenBSD: getrpcport.c,v 1.6 2005/04/01 07:44:03 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -43,9 +43,7 @@ static char *rcsid = "$OpenBSD: getrpcport.c,v 1.5 1996/09/30 21:12:59 deraadt E
#include <sys/socket.h>
int
-getrpcport(host, prognum, versnum, proto)
- char *host;
- int prognum, versnum, proto;
+getrpcport(char *host, int prognum, int versnum, int proto)
{
struct sockaddr_in addr;
struct hostent *hp;
diff --git a/lib/libc/rpc/pmap_clnt.c b/lib/libc/rpc/pmap_clnt.c
index 281728e236e..e099345a991 100644
--- a/lib/libc/rpc/pmap_clnt.c
+++ b/lib/libc/rpc/pmap_clnt.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: pmap_clnt.c,v 1.13 2005/01/08 19:17:39 krw Exp $";
+static char *rcsid = "$OpenBSD: pmap_clnt.c,v 1.14 2005/04/01 07:44:03 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -52,17 +52,14 @@ static struct timeval tottimeout = { 60, 0 };
* Calls the pmap service remotely to do the mapping.
*/
bool_t
-pmap_set(program, version, protocol, port)
- u_long program;
- u_long version;
- u_int protocol;
- u_short port;
+pmap_set(u_long program, u_long version, u_int protocol, int iport)
{
struct sockaddr_in myaddress;
int sock = -1;
CLIENT *client;
struct pmap parms;
bool_t rslt;
+ u_short port = iport;
if (get_myaddress(&myaddress) != 0)
return (FALSE);
@@ -94,9 +91,7 @@ pmap_set(program, version, protocol, port)
* Calls the pmap service remotely to do the un-mapping.
*/
bool_t
-pmap_unset(program, version)
- u_long program;
- u_long version;
+pmap_unset(u_long program, u_long version)
{
struct sockaddr_in myaddress;
int sock = -1;
diff --git a/lib/libc/rpc/pmap_getmaps.c b/lib/libc/rpc/pmap_getmaps.c
index 77918130e28..07d3a208819 100644
--- a/lib/libc/rpc/pmap_getmaps.c
+++ b/lib/libc/rpc/pmap_getmaps.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: pmap_getmaps.c,v 1.8 2005/01/08 19:17:39 krw Exp $";
+static char *rcsid = "$OpenBSD: pmap_getmaps.c,v 1.9 2005/04/01 07:44:03 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -57,8 +57,7 @@ static char *rcsid = "$OpenBSD: pmap_getmaps.c,v 1.8 2005/01/08 19:17:39 krw Exp
* Calls the pmap service remotely to do get the maps.
*/
struct pmaplist *
-pmap_getmaps(address)
- struct sockaddr_in *address;
+pmap_getmaps(struct sockaddr_in *address)
{
struct pmaplist *head = NULL;
int sock = -1;
diff --git a/lib/libc/rpc/pmap_getport.c b/lib/libc/rpc/pmap_getport.c
index be841822fd9..7fc558082f7 100644
--- a/lib/libc/rpc/pmap_getport.c
+++ b/lib/libc/rpc/pmap_getport.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: pmap_getport.c,v 1.8 2005/01/08 19:17:39 krw Exp $";
+static char *rcsid = "$OpenBSD: pmap_getport.c,v 1.9 2005/04/01 07:44:03 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -54,11 +54,8 @@ static struct timeval tottimeout = { 60, 0 };
* Returns 0 if no map exists.
*/
u_short
-pmap_getport(address, program, version, protocol)
- struct sockaddr_in *address;
- u_long program;
- u_long version;
- u_int protocol;
+pmap_getport(struct sockaddr_in *address, u_long program, u_long version,
+ u_int protocol)
{
u_short port = 0;
int sock = -1;
diff --git a/lib/libc/rpc/pmap_prot.c b/lib/libc/rpc/pmap_prot.c
index 17d9be0ee8b..549a7d3048d 100644
--- a/lib/libc/rpc/pmap_prot.c
+++ b/lib/libc/rpc/pmap_prot.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: pmap_prot.c,v 1.4 2002/02/13 22:36:52 deraadt Exp $";
+static char *rcsid = "$OpenBSD: pmap_prot.c,v 1.5 2005/04/01 07:44:03 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -44,9 +44,7 @@ static char *rcsid = "$OpenBSD: pmap_prot.c,v 1.4 2002/02/13 22:36:52 deraadt Ex
bool_t
-xdr_pmap(xdrs, regs)
- XDR *xdrs;
- struct pmap *regs;
+xdr_pmap(XDR *xdrs, struct pmap *regs)
{
if (xdr_u_long(xdrs, &regs->pm_prog) &&
diff --git a/lib/libc/rpc/pmap_prot2.c b/lib/libc/rpc/pmap_prot2.c
index 507ad9b0916..dd6a2aa6059 100644
--- a/lib/libc/rpc/pmap_prot2.c
+++ b/lib/libc/rpc/pmap_prot2.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: pmap_prot2.c,v 1.4 2001/09/15 13:51:01 deraadt Exp $";
+static char *rcsid = "$OpenBSD: pmap_prot2.c,v 1.5 2005/04/01 07:44:03 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -82,9 +82,7 @@ static char *rcsid = "$OpenBSD: pmap_prot2.c,v 1.4 2001/09/15 13:51:01 deraadt E
* this sounds like a job for xdr_reference!
*/
bool_t
-xdr_pmaplist(xdrs, rp)
- XDR *xdrs;
- struct pmaplist **rp;
+xdr_pmaplist(XDR *xdrs, struct pmaplist **rp)
{
/*
* more_elements is pre-computed in case the direction is
diff --git a/lib/libc/rpc/pmap_rmt.c b/lib/libc/rpc/pmap_rmt.c
index 7aaec648e4f..08409bb7e5c 100644
--- a/lib/libc/rpc/pmap_rmt.c
+++ b/lib/libc/rpc/pmap_rmt.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: pmap_rmt.c,v 1.23 2005/01/08 19:17:39 krw Exp $";
+static char *rcsid = "$OpenBSD: pmap_rmt.c,v 1.24 2005/04/01 07:44:04 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -66,13 +66,9 @@ static struct timeval timeout = { 3, 0 };
* programs to do a lookup and call in one step.
*/
enum clnt_stat
-pmap_rmtcall(addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout, port_ptr)
- struct sockaddr_in *addr;
- u_long prog, vers, proc;
- xdrproc_t xdrargs, xdrres;
- caddr_t argsp, resp;
- struct timeval tout;
- u_long *port_ptr;
+pmap_rmtcall(struct sockaddr_in *addr, u_long prog, u_long vers, u_long proc,
+ xdrproc_t xdrargs, caddr_t argsp, xdrproc_t xdrres, caddr_t resp,
+ struct timeval tout, u_long *port_ptr)
{
int sock = -1;
CLIENT *client;
@@ -109,9 +105,7 @@ pmap_rmtcall(addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout, port_pt
* written for XDR_ENCODE direction only
*/
bool_t
-xdr_rmtcall_args(xdrs, cap)
- XDR *xdrs;
- struct rmtcallargs *cap;
+xdr_rmtcall_args(XDR *xdrs, struct rmtcallargs *cap)
{
u_int lenposition, argposition, position;
@@ -140,9 +134,7 @@ xdr_rmtcall_args(xdrs, cap)
* written for XDR_DECODE direction only
*/
bool_t
-xdr_rmtcallres(xdrs, crp)
- XDR *xdrs;
- struct rmtcallres *crp;
+xdr_rmtcallres(XDR *xdrs, struct rmtcallres *crp)
{
caddr_t port_ptr;
@@ -163,9 +155,8 @@ xdr_rmtcallres(xdrs, crp)
*/
static int
-newgetbroadcastnets(addrsp, sock)
- struct in_addr **addrsp;
- int sock; /* any valid socket will do */
+newgetbroadcastnets(struct in_addr **addrsp,
+ int sock) /* any valid socket will do */
{
struct ifaddrs *ifap, *ifa;
struct sockaddr_in *sin;
@@ -212,15 +203,14 @@ newgetbroadcastnets(addrsp, sock)
typedef bool_t (*resultproc_t)();
enum clnt_stat
-clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
- u_long prog; /* program number */
- u_long vers; /* version number */
- u_long proc; /* procedure number */
- xdrproc_t xargs; /* xdr routine for args */
- caddr_t argsp; /* pointer to args */
- xdrproc_t xresults; /* xdr routine for results */
- caddr_t resultsp; /* pointer to results */
- resultproc_t eachresult; /* call with each result obtained */
+clnt_broadcast(u_long prog, /* program number */
+ u_long vers, /* version number */
+ u_long proc, /* procedure number */
+ xdrproc_t xargs, /* xdr routine for args */
+ caddr_t argsp, /* pointer to args */
+ xdrproc_t xresults, /* xdr routine for results */
+ caddr_t resultsp, /* pointer to results */
+ resultproc_t eachresult) /* call with each result obtained */
{
enum clnt_stat stat;
AUTH *unix_auth = authunix_create_default();
diff --git a/lib/libc/rpc/rpc.3 b/lib/libc/rpc/rpc.3
index f7a28cbc035..eab8c90f8de 100644
--- a/lib/libc/rpc/rpc.3
+++ b/lib/libc/rpc/rpc.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: rpc.3,v 1.35 2004/04/28 06:28:23 jmc Exp $
+.\" $OpenBSD: rpc.3,v 1.36 2005/04/01 07:44:04 otto Exp $
.\"
.\" Copyright (c) 1998 Theo de Raadt
.\" All rights reserved.
@@ -193,7 +193,7 @@
.Ft "enum clnt_stat"
.Fn pmap_rmtcall "struct sockaddr_in *" "u_long prog, vers, proc" "xdrproc_t inp" "char *in" "xdrproc_t outp" "char *out" "struct timeval tv" "u_long *portp"
.Ft int
-.Fn pmap_set "u_long prognum" "u_long versnum" "u_int protocol" "u_short port"
+.Fn pmap_set "u_long prognum" "u_long versnum" "u_int protocol" "int port"
.Ft int
.Fn pmap_unset "u_long prognum" "u_long versnum"
.Ft int
diff --git a/lib/libc/rpc/rpc_callmsg.c b/lib/libc/rpc/rpc_callmsg.c
index fe2e17cb8dc..1f8b1bf7111 100644
--- a/lib/libc/rpc/rpc_callmsg.c
+++ b/lib/libc/rpc/rpc_callmsg.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: rpc_callmsg.c,v 1.7 2001/09/15 13:51:01 deraadt Exp $";
+static char *rcsid = "$OpenBSD: rpc_callmsg.c,v 1.8 2005/04/01 07:44:04 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -48,9 +48,7 @@ static char *rcsid = "$OpenBSD: rpc_callmsg.c,v 1.7 2001/09/15 13:51:01 deraadt
* XDR a call message
*/
bool_t
-xdr_callmsg(xdrs, cmsg)
- XDR *xdrs;
- struct rpc_msg *cmsg;
+xdr_callmsg(XDR *xdrs, struct rpc_msg *cmsg)
{
int32_t *buf;
struct opaque_auth *oa;
diff --git a/lib/libc/rpc/rpc_dtablesize.c b/lib/libc/rpc/rpc_dtablesize.c
index 070801b2440..d86661f1e4e 100644
--- a/lib/libc/rpc/rpc_dtablesize.c
+++ b/lib/libc/rpc/rpc_dtablesize.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: rpc_dtablesize.c,v 1.5 1997/09/22 05:11:09 millert Exp $";
+static char *rcsid = "$OpenBSD: rpc_dtablesize.c,v 1.6 2005/04/01 07:44:04 otto Exp $";
#endif /* LIBC_SCCS and not lint */
#include <unistd.h>
@@ -39,7 +39,7 @@ static char *rcsid = "$OpenBSD: rpc_dtablesize.c,v 1.5 1997/09/22 05:11:09 mille
* expensive system call every time.
*/
int
-_rpc_dtablesize()
+_rpc_dtablesize(void)
{
static int size;
diff --git a/lib/libc/rpc/rpc_prot.c b/lib/libc/rpc/rpc_prot.c
index a53bd254c4c..ffc17d1e402 100644
--- a/lib/libc/rpc/rpc_prot.c
+++ b/lib/libc/rpc/rpc_prot.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: rpc_prot.c,v 1.8 2005/01/08 19:17:39 krw Exp $";
+static char *rcsid = "$OpenBSD: rpc_prot.c,v 1.9 2005/04/01 07:44:04 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -57,9 +57,7 @@ struct opaque_auth _null_auth;
* (see auth.h)
*/
bool_t
-xdr_opaque_auth(xdrs, ap)
- XDR *xdrs;
- struct opaque_auth *ap;
+xdr_opaque_auth(XDR *xdrs, struct opaque_auth *ap)
{
if (xdr_enum(xdrs, &(ap->oa_flavor)))
@@ -72,9 +70,7 @@ xdr_opaque_auth(xdrs, ap)
* XDR a DES block
*/
bool_t
-xdr_des_block(xdrs, blkp)
- XDR *xdrs;
- des_block *blkp;
+xdr_des_block(XDR *xdrs, des_block *blkp)
{
return (xdr_opaque(xdrs, (caddr_t)blkp, sizeof(des_block)));
}
@@ -85,9 +81,7 @@ xdr_des_block(xdrs, blkp)
* XDR the MSG_ACCEPTED part of a reply message union
*/
bool_t
-xdr_accepted_reply(xdrs, ar)
- XDR *xdrs;
- struct accepted_reply *ar;
+xdr_accepted_reply(XDR *xdrs, struct accepted_reply *ar)
{
/* personalized union, rather than calling xdr_union */
@@ -112,9 +106,7 @@ xdr_accepted_reply(xdrs, ar)
* XDR the MSG_DENIED part of a reply message union
*/
bool_t
-xdr_rejected_reply(xdrs, rr)
- XDR *xdrs;
- struct rejected_reply *rr;
+xdr_rejected_reply(XDR *xdrs, struct rejected_reply *rr)
{
/* personalized union, rather than calling xdr_union */
@@ -141,9 +133,7 @@ static struct xdr_discrim reply_dscrm[3] = {
* XDR a reply message
*/
bool_t
-xdr_replymsg(xdrs, rmsg)
- XDR *xdrs;
- struct rpc_msg *rmsg;
+xdr_replymsg(XDR *xdrs, struct rpc_msg *rmsg)
{
if (xdr_u_int32_t(xdrs, &(rmsg->rm_xid)) &&
xdr_enum(xdrs, (enum_t *)&(rmsg->rm_direction)) &&
@@ -160,9 +150,7 @@ xdr_replymsg(xdrs, rmsg)
* The rm_xid is not really static, but the user can easily munge on the fly.
*/
bool_t
-xdr_callhdr(xdrs, cmsg)
- XDR *xdrs;
- struct rpc_msg *cmsg;
+xdr_callhdr(XDR *xdrs, struct rpc_msg *cmsg)
{
cmsg->rm_direction = CALL;
@@ -179,9 +167,7 @@ xdr_callhdr(xdrs, cmsg)
/* ************************** Client utility routine ************* */
static void
-accepted(acpt_stat, error)
- enum accept_stat acpt_stat;
- struct rpc_err *error;
+accepted(enum accept_stat acpt_stat, struct rpc_err *error)
{
switch (acpt_stat) {
@@ -217,9 +203,7 @@ accepted(acpt_stat, error)
}
static void
-rejected(rjct_stat, error)
- enum reject_stat rjct_stat;
- struct rpc_err *error;
+rejected(enum reject_stat rjct_stat, struct rpc_err *error)
{
switch (rjct_stat) {
@@ -242,9 +226,7 @@ rejected(rjct_stat, error)
* given a reply message, fills in the error
*/
void
-_seterr_reply(msg, error)
- struct rpc_msg *msg;
- struct rpc_err *error;
+_seterr_reply(struct rpc_msg *msg, struct rpc_err *error)
{
/* optimized for normal, SUCCESSful case */
diff --git a/lib/libc/rpc/svc.c b/lib/libc/rpc/svc.c
index fc8ded6a7f4..c47ed46d7c2 100644
--- a/lib/libc/rpc/svc.c
+++ b/lib/libc/rpc/svc.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: svc.c,v 1.18 2005/02/17 02:37:21 jolan Exp $";
+static char *rcsid = "$OpenBSD: svc.c,v 1.19 2005/04/01 07:44:04 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -85,8 +85,7 @@ static int svc_max_free; /* number of used slots in free list */
* Activate a transport handle.
*/
void
-xprt_register(xprt)
- SVCXPRT *xprt;
+xprt_register(SVCXPRT *xprt)
{
/* ignore failure conditions */
(void) __xprt_register(xprt);
@@ -96,8 +95,7 @@ xprt_register(xprt)
* Activate a transport handle.
*/
int
-__xprt_register(xprt)
- SVCXPRT *xprt;
+__xprt_register(SVCXPRT *xprt)
{
int sock = xprt->xp_sock;
@@ -274,8 +272,7 @@ svc_fd_remove(int sock)
* De-activate a transport handle.
*/
void
-xprt_unregister(xprt)
- SVCXPRT *xprt;
+xprt_unregister(SVCXPRT *xprt)
{
int sock = xprt->xp_sock;
@@ -294,12 +291,8 @@ xprt_unregister(xprt)
* program number comes in.
*/
bool_t
-svc_register(xprt, prog, vers, dispatch, protocol)
- SVCXPRT *xprt;
- u_long prog;
- u_long vers;
- void (*dispatch)();
- int protocol;
+svc_register(SVCXPRT *xprt, u_long prog, u_long vers, void (*dispatch)(),
+ int protocol)
{
struct svc_callout *prev;
struct svc_callout *s;
@@ -330,9 +323,7 @@ pmap_it:
* Remove a service program from the callout list.
*/
void
-svc_unregister(prog, vers)
- u_long prog;
- u_long vers;
+svc_unregister(u_long prog, u_long vers)
{
struct svc_callout *prev;
struct svc_callout *s;
@@ -355,10 +346,7 @@ svc_unregister(prog, vers)
* struct.
*/
static struct svc_callout *
-svc_find(prog, vers, prev)
- u_long prog;
- u_long vers;
- struct svc_callout **prev;
+svc_find(u_long prog, u_long vers, struct svc_callout **prev)
{
struct svc_callout *s, *p;
@@ -379,10 +367,7 @@ done:
* Send a reply to an rpc request
*/
bool_t
-svc_sendreply(xprt, xdr_results, xdr_location)
- SVCXPRT *xprt;
- xdrproc_t xdr_results;
- caddr_t xdr_location;
+svc_sendreply(SVCXPRT *xprt, xdrproc_t xdr_results, caddr_t xdr_location)
{
struct rpc_msg rply;
@@ -399,8 +384,7 @@ svc_sendreply(xprt, xdr_results, xdr_location)
* No procedure error reply
*/
void
-svcerr_noproc(xprt)
- SVCXPRT *xprt;
+svcerr_noproc(SVCXPRT *xprt)
{
struct rpc_msg rply;
@@ -415,8 +399,7 @@ svcerr_noproc(xprt)
* Can't decode args error reply
*/
void
-svcerr_decode(xprt)
- SVCXPRT *xprt;
+svcerr_decode(SVCXPRT *xprt)
{
struct rpc_msg rply;
@@ -431,8 +414,7 @@ svcerr_decode(xprt)
* Some system error
*/
void
-svcerr_systemerr(xprt)
- SVCXPRT *xprt;
+svcerr_systemerr(SVCXPRT *xprt)
{
struct rpc_msg rply;
@@ -447,9 +429,7 @@ svcerr_systemerr(xprt)
* Authentication error reply
*/
void
-svcerr_auth(xprt, why)
- SVCXPRT *xprt;
- enum auth_stat why;
+svcerr_auth(SVCXPRT *xprt, enum auth_stat why)
{
struct rpc_msg rply;
@@ -464,8 +444,7 @@ svcerr_auth(xprt, why)
* Auth too weak error reply
*/
void
-svcerr_weakauth(xprt)
- SVCXPRT *xprt;
+svcerr_weakauth(SVCXPRT *xprt)
{
svcerr_auth(xprt, AUTH_TOOWEAK);
@@ -475,8 +454,7 @@ svcerr_weakauth(xprt)
* Program unavailable error reply
*/
void
-svcerr_noprog(xprt)
- SVCXPRT *xprt;
+svcerr_noprog(SVCXPRT *xprt)
{
struct rpc_msg rply;
@@ -491,10 +469,7 @@ svcerr_noprog(xprt)
* Program version mismatch error reply
*/
void
-svcerr_progvers(xprt, low_vers, high_vers)
- SVCXPRT *xprt;
- u_long low_vers;
- u_long high_vers;
+svcerr_progvers(SVCXPRT *xprt, u_long low_vers, u_long high_vers)
{
struct rpc_msg rply;
@@ -526,8 +501,7 @@ svcerr_progvers(xprt, low_vers, high_vers)
*/
void
-svc_getreq(rdfds)
- int rdfds;
+svc_getreq(int rdfds)
{
int bit;
@@ -536,16 +510,13 @@ svc_getreq(rdfds)
}
void
-svc_getreqset(readfds)
- fd_set *readfds;
+svc_getreqset(fd_set *readfds)
{
svc_getreqset2(readfds, FD_SETSIZE);
}
void
-svc_getreqset2(readfds, width)
- fd_set *readfds;
- int width;
+svc_getreqset2(fd_set *readfds, int width)
{
fd_mask mask, *maskp;
int bit, sock;
@@ -559,9 +530,7 @@ svc_getreqset2(readfds, width)
}
void
-svc_getreq_poll(pfd, nready)
- struct pollfd *pfd;
- const int nready;
+svc_getreq_poll(struct pollfd *pfd, const int nready)
{
int i, n;
@@ -577,8 +546,7 @@ svc_getreq_poll(pfd, nready)
}
void
-svc_getreq_common(fd)
- int fd;
+svc_getreq_common(int fd)
{
enum xprt_stat stat;
struct rpc_msg msg;
diff --git a/lib/libc/rpc/svc_auth.c b/lib/libc/rpc/svc_auth.c
index 1e96ccbfb56..67d59a16ed0 100644
--- a/lib/libc/rpc/svc_auth.c
+++ b/lib/libc/rpc/svc_auth.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: svc_auth.c,v 1.5 2001/09/15 13:51:01 deraadt Exp $";
+static char *rcsid = "$OpenBSD: svc_auth.c,v 1.6 2005/04/01 07:44:04 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -55,9 +55,12 @@ static char *rcsid = "$OpenBSD: svc_auth.c,v 1.5 2001/09/15 13:51:01 deraadt Exp
*
*/
-enum auth_stat _svcauth_null(); /* no authentication */
-enum auth_stat _svcauth_unix(); /* unix style (uid, gids) */
-enum auth_stat _svcauth_short(); /* short hand unix style */
+/* no authentication */
+enum auth_stat _svcauth_null(void);
+/* unix style (uid, gids) */
+enum auth_stat _svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg);
+/* short hand unix style */
+enum auth_stat _svcauth_short(struct svc_req *rqst, struct rpc_msg *msg);
static struct {
enum auth_stat (*authenticator)();
@@ -88,9 +91,7 @@ static struct {
* invalid.
*/
enum auth_stat
-_authenticate(rqst, msg)
- struct svc_req *rqst;
- struct rpc_msg *msg;
+_authenticate(struct svc_req *rqst, struct rpc_msg *msg)
{
int cred_flavor;
@@ -106,7 +107,7 @@ _authenticate(rqst, msg)
}
enum auth_stat
-_svcauth_null(/*rqst, msg*/)
+_svcauth_null(void)
/*struct svc_req *rqst;
struct rpc_msg *msg;*/
{
diff --git a/lib/libc/rpc/svc_auth_unix.c b/lib/libc/rpc/svc_auth_unix.c
index bf3f98c765b..50b84ef68fb 100644
--- a/lib/libc/rpc/svc_auth_unix.c
+++ b/lib/libc/rpc/svc_auth_unix.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: svc_auth_unix.c,v 1.7 2001/09/15 13:51:01 deraadt Exp $";
+static char *rcsid = "$OpenBSD: svc_auth_unix.c,v 1.8 2005/04/01 07:44:04 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -50,9 +50,7 @@ static char *rcsid = "$OpenBSD: svc_auth_unix.c,v 1.7 2001/09/15 13:51:01 deraad
* Unix longhand authenticator
*/
enum auth_stat
-_svcauth_unix(rqst, msg)
- struct svc_req *rqst;
- struct rpc_msg *msg;
+_svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg)
{
enum auth_stat stat;
XDR xdrs;
@@ -127,9 +125,7 @@ done:
*/
/*ARGSUSED*/
enum auth_stat
-_svcauth_short(rqst, msg)
- struct svc_req *rqst;
- struct rpc_msg *msg;
+_svcauth_short(struct svc_req *rqst, struct rpc_msg *msg)
{
return (AUTH_REJECTEDCRED);
}
diff --git a/lib/libc/rpc/svc_raw.c b/lib/libc/rpc/svc_raw.c
index 71d5a2010d6..1d31212c597 100644
--- a/lib/libc/rpc/svc_raw.c
+++ b/lib/libc/rpc/svc_raw.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: svc_raw.c,v 1.6 2001/09/15 13:51:01 deraadt Exp $";
+static char *rcsid = "$OpenBSD: svc_raw.c,v 1.7 2005/04/01 07:44:04 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -54,12 +54,14 @@ static struct svcraw_private {
char verf_body[MAX_AUTH_BYTES];
} *svcraw_private;
-static bool_t svcraw_recv();
-static enum xprt_stat svcraw_stat();
-static bool_t svcraw_getargs();
-static bool_t svcraw_reply();
-static bool_t svcraw_freeargs();
-static void svcraw_destroy();
+static bool_t svcraw_recv(SVCXPRT *xprt, struct rpc_msg *msg);
+static enum xprt_stat svcraw_stat(SVCXPRT *xprt);
+static bool_t svcraw_getargs(SVCXPRT *xprt, xdrproc_t xdr_args,
+ caddr_t args_ptr);
+static bool_t svcraw_reply(SVCXPRT *xprt, struct rpc_msg *msg);
+static bool_t svcraw_freeargs(SVCXPRT *xprt, xdrproc_t xdr_args,
+ caddr_t args_ptr);
+static void svcraw_destroy(SVCXPRT *xprt);
static struct xp_ops server_ops = {
svcraw_recv,
@@ -71,7 +73,7 @@ static struct xp_ops server_ops = {
};
SVCXPRT *
-svcraw_create()
+svcraw_create(void)
{
struct svcraw_private *srp = svcraw_private;
@@ -88,8 +90,9 @@ svcraw_create()
return (&srp->server);
}
+/* ARGSUSED */
static enum xprt_stat
-svcraw_stat()
+svcraw_stat(SVCXPRT *xprt)
{
return (XPRT_IDLE);
@@ -97,9 +100,7 @@ svcraw_stat()
/* ARGSUSED */
static bool_t
-svcraw_recv(xprt, msg)
- SVCXPRT *xprt;
- struct rpc_msg *msg;
+svcraw_recv(SVCXPRT *xprt, struct rpc_msg *msg)
{
struct svcraw_private *srp = svcraw_private;
XDR *xdrs;
@@ -116,9 +117,7 @@ svcraw_recv(xprt, msg)
/* ARGSUSED */
static bool_t
-svcraw_reply(xprt, msg)
- SVCXPRT *xprt;
- struct rpc_msg *msg;
+svcraw_reply(SVCXPRT *xprt, struct rpc_msg *msg)
{
struct svcraw_private *srp = svcraw_private;
XDR *xdrs;
@@ -136,10 +135,7 @@ svcraw_reply(xprt, msg)
/* ARGSUSED */
static bool_t
-svcraw_getargs(xprt, xdr_args, args_ptr)
- SVCXPRT *xprt;
- xdrproc_t xdr_args;
- caddr_t args_ptr;
+svcraw_getargs(SVCXPRT *xprt, xdrproc_t xdr_args, caddr_t args_ptr)
{
struct svcraw_private *srp = svcraw_private;
@@ -150,10 +146,7 @@ svcraw_getargs(xprt, xdr_args, args_ptr)
/* ARGSUSED */
static bool_t
-svcraw_freeargs(xprt, xdr_args, args_ptr)
- SVCXPRT *xprt;
- xdrproc_t xdr_args;
- caddr_t args_ptr;
+svcraw_freeargs(SVCXPRT *xprt, xdrproc_t xdr_args, caddr_t args_ptr)
{
struct svcraw_private *srp = svcraw_private;
XDR *xdrs;
@@ -165,7 +158,8 @@ svcraw_freeargs(xprt, xdr_args, args_ptr)
return ((*xdr_args)(xdrs, args_ptr));
}
+/* ARGSUSED */
static void
-svcraw_destroy()
+svcraw_destroy(SVCXPRT *xprt)
{
}
diff --git a/lib/libc/rpc/svc_run.c b/lib/libc/rpc/svc_run.c
index bbe8374d7c5..9cdbc1f4f1d 100644
--- a/lib/libc/rpc/svc_run.c
+++ b/lib/libc/rpc/svc_run.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: svc_run.c,v 1.14 2003/12/31 03:27:23 millert Exp $";
+static char *rcsid = "$OpenBSD: svc_run.c,v 1.15 2005/04/01 07:44:04 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -43,7 +43,7 @@ static char *rcsid = "$OpenBSD: svc_run.c,v 1.14 2003/12/31 03:27:23 millert Exp
#include <string.h>
void
-svc_run()
+svc_run(void)
{
struct pollfd *pfd = NULL;
int nready, saved_max_pollfd = 0;
diff --git a/lib/libc/rpc/svc_simple.c b/lib/libc/rpc/svc_simple.c
index 6414eb50d50..be5e3883c3d 100644
--- a/lib/libc/rpc/svc_simple.c
+++ b/lib/libc/rpc/svc_simple.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: svc_simple.c,v 1.7 2001/03/03 06:50:28 deraadt Exp $";
+static char *rcsid = "$OpenBSD: svc_simple.c,v 1.8 2005/04/01 07:44:04 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -53,15 +53,13 @@ static struct proglst {
xdrproc_t p_inproc, p_outproc;
struct proglst *p_nxt;
} *proglst;
-static void universal();
+static void universal(struct svc_req *rqstp, SVCXPRT *transp);
static SVCXPRT *transp;
struct proglst *pl;
int
-registerrpc(prognum, versnum, procnum, progname, inproc, outproc)
- int prognum, versnum, procnum;
- char *(*progname)();
- xdrproc_t inproc, outproc;
+registerrpc(int prognum, int versnum, int procnum, char *(*progname)(),
+ xdrproc_t inproc, xdrproc_t outproc)
{
if (procnum == NULLPROC) {
@@ -99,9 +97,7 @@ registerrpc(prognum, versnum, procnum, progname, inproc, outproc)
}
static void
-universal(rqstp, transp)
- struct svc_req *rqstp;
- SVCXPRT *transp;
+universal(struct svc_req *rqstp, SVCXPRT *transp)
{
int prog, proc;
char *outdata;
diff --git a/lib/libc/rpc/svc_tcp.c b/lib/libc/rpc/svc_tcp.c
index 22df9815e87..24b90ba79ab 100644
--- a/lib/libc/rpc/svc_tcp.c
+++ b/lib/libc/rpc/svc_tcp.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: svc_tcp.c,v 1.24 2005/01/08 19:17:39 krw Exp $";
+static char *rcsid = "$OpenBSD: svc_tcp.c,v 1.25 2005/04/01 07:44:04 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -57,12 +57,14 @@ static char *rcsid = "$OpenBSD: svc_tcp.c,v 1.24 2005/01/08 19:17:39 krw Exp $";
/*
* Ops vector for TCP/IP based rpc service handle
*/
-static bool_t svctcp_recv();
-static enum xprt_stat svctcp_stat();
-static bool_t svctcp_getargs();
-static bool_t svctcp_reply();
-static bool_t svctcp_freeargs();
-static void svctcp_destroy();
+static bool_t svctcp_recv(SVCXPRT *xprt, struct rpc_msg *msg);
+static enum xprt_stat svctcp_stat(SVCXPRT *xprt);
+static bool_t svctcp_getargs(SVCXPRT *xprt, xdrproc_t xdr_args,
+ caddr_t args_ptr);
+static bool_t svctcp_reply(SVCXPRT *xprt, struct rpc_msg *msg);
+static bool_t svctcp_freeargs(SVCXPRT *xprt, xdrproc_t xdr_args,
+ caddr_t args_ptr);
+static void svctcp_destroy(SVCXPRT *xprt);
static struct xp_ops svctcp_op = {
svctcp_recv,
@@ -76,20 +78,22 @@ static struct xp_ops svctcp_op = {
/*
* Ops vector for TCP/IP rendezvous handler
*/
-static bool_t rendezvous_request();
-static enum xprt_stat rendezvous_stat();
+static bool_t rendezvous_request(SVCXPRT *xprt, struct rpc_msg *);
+static enum xprt_stat rendezvous_stat(SVCXPRT *xprt);
static struct xp_ops svctcp_rendezvous_op = {
rendezvous_request,
rendezvous_stat,
- (bool_t (*)())abort, /* XXX abort illegal in library */
- (bool_t (*)())abort, /* XXX abort illegal in library */
- (bool_t (*)())abort, /* XXX abort illegal in library */
+ /* XXX abort illegal in library */
+ (bool_t (*)(struct __rpc_svcxprt *, xdrproc_t, caddr_t))abort,
+ (bool_t (*)(struct __rpc_svcxprt *, struct rpc_msg *))abort,
+ (bool_t (*)(struct __rpc_svcxprt *, xdrproc_t, caddr_t))abort,
svctcp_destroy
};
-static int readtcp(), writetcp();
-static SVCXPRT *makefd_xprt();
+static int readtcp(SVCXPRT *xprt, caddr_t buf, int len),
+ writetcp(SVCXPRT *xprt, caddr_t buf, int len);
+static SVCXPRT *makefd_xprt(int fd, u_int sendsize, u_int recvsize);
struct tcp_rendezvous { /* kept in xprt->xp_p1 */
u_int sendsize;
@@ -124,10 +128,7 @@ struct tcp_conn { /* kept in xprt->xp_p1 */
* 0 => use the system default.
*/
SVCXPRT *
-svctcp_create(sock, sendsize, recvsize)
- int sock;
- u_int sendsize;
- u_int recvsize;
+svctcp_create(int sock, u_int sendsize, u_int recvsize)
{
bool_t madesock = FALSE;
SVCXPRT *xprt;
@@ -194,20 +195,14 @@ svctcp_create(sock, sendsize, recvsize)
* descriptor as its first input.
*/
SVCXPRT *
-svcfd_create(fd, sendsize, recvsize)
- int fd;
- u_int sendsize;
- u_int recvsize;
+svcfd_create(int fd, u_int sendsize, u_int recvsize)
{
return (makefd_xprt(fd, sendsize, recvsize));
}
static SVCXPRT *
-makefd_xprt(fd, sendsize, recvsize)
- int fd;
- u_int sendsize;
- u_int recvsize;
+makefd_xprt(int fd, u_int sendsize, u_int recvsize)
{
SVCXPRT *xprt;
struct tcp_conn *cd;
@@ -226,7 +221,8 @@ makefd_xprt(fd, sendsize, recvsize)
}
cd->strm_stat = XPRT_IDLE;
xdrrec_create(&(cd->xdrs), sendsize, recvsize,
- (caddr_t)xprt, readtcp, writetcp);
+ (caddr_t)xprt, (int(*)(caddr_t, caddr_t, int))readtcp,
+ (int(*)(caddr_t, caddr_t, int))writetcp);
xprt->xp_p2 = NULL;
xprt->xp_p1 = (caddr_t)cd;
xprt->xp_verf.oa_base = cd->verf_body;
@@ -243,9 +239,9 @@ makefd_xprt(fd, sendsize, recvsize)
return (xprt);
}
+/* ARGSUSED */
static bool_t
-rendezvous_request(xprt)
- SVCXPRT *xprt;
+rendezvous_request(SVCXPRT *xprt, struct rpc_msg *ignored)
{
int sock;
struct tcp_rendezvous *r;
@@ -303,16 +299,16 @@ rendezvous_request(xprt)
return (FALSE); /* there is never an rpc msg to be processed */
}
+/* ARGSUSED */
static enum xprt_stat
-rendezvous_stat()
+rendezvous_stat(SVCXPRT *xprt)
{
return (XPRT_IDLE);
}
static void
-svctcp_destroy(xprt)
- SVCXPRT *xprt;
+svctcp_destroy(SVCXPRT *xprt)
{
struct tcp_conn *cd = (struct tcp_conn *)xprt->xp_p1;
@@ -343,10 +339,7 @@ static struct timeval wait_per_try = { 35, 0 };
* (And a read of zero bytes is a half closed stream => error.)
*/
static int
-readtcp(xprt, buf, len)
- SVCXPRT *xprt;
- caddr_t buf;
- int len;
+readtcp(SVCXPRT *xprt, caddr_t buf, int len)
{
int sock = xprt->xp_sock;
int delta, nready;
@@ -414,10 +407,7 @@ fatal_err:
* Any error is fatal and the connection is closed.
*/
static int
-writetcp(xprt, buf, len)
- SVCXPRT *xprt;
- caddr_t buf;
- int len;
+writetcp(SVCXPRT *xprt, caddr_t buf, int len)
{
int i, cnt;
@@ -432,8 +422,7 @@ writetcp(xprt, buf, len)
}
static enum xprt_stat
-svctcp_stat(xprt)
- SVCXPRT *xprt;
+svctcp_stat(SVCXPRT *xprt)
{
struct tcp_conn *cd =
(struct tcp_conn *)(xprt->xp_p1);
@@ -446,9 +435,7 @@ svctcp_stat(xprt)
}
static bool_t
-svctcp_recv(xprt, msg)
- SVCXPRT *xprt;
- struct rpc_msg *msg;
+svctcp_recv(SVCXPRT *xprt, struct rpc_msg *msg)
{
struct tcp_conn *cd =
(struct tcp_conn *)(xprt->xp_p1);
@@ -465,20 +452,14 @@ svctcp_recv(xprt, msg)
}
static bool_t
-svctcp_getargs(xprt, xdr_args, args_ptr)
- SVCXPRT *xprt;
- xdrproc_t xdr_args;
- caddr_t args_ptr;
+svctcp_getargs(SVCXPRT *xprt, xdrproc_t xdr_args, caddr_t args_ptr)
{
return ((*xdr_args)(&(((struct tcp_conn *)(xprt->xp_p1))->xdrs), args_ptr));
}
static bool_t
-svctcp_freeargs(xprt, xdr_args, args_ptr)
- SVCXPRT *xprt;
- xdrproc_t xdr_args;
- caddr_t args_ptr;
+svctcp_freeargs(SVCXPRT *xprt, xdrproc_t xdr_args, caddr_t args_ptr)
{
XDR *xdrs =
&(((struct tcp_conn *)(xprt->xp_p1))->xdrs);
@@ -488,9 +469,7 @@ svctcp_freeargs(xprt, xdr_args, args_ptr)
}
static bool_t
-svctcp_reply(xprt, msg)
- SVCXPRT *xprt;
- struct rpc_msg *msg;
+svctcp_reply(SVCXPRT *xprt, struct rpc_msg *msg)
{
struct tcp_conn *cd =
(struct tcp_conn *)(xprt->xp_p1);
diff --git a/lib/libc/rpc/svc_udp.c b/lib/libc/rpc/svc_udp.c
index fc1b94bd03f..1b592c36429 100644
--- a/lib/libc/rpc/svc_udp.c
+++ b/lib/libc/rpc/svc_udp.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: svc_udp.c,v 1.14 2005/01/08 19:17:39 krw Exp $";
+static char *rcsid = "$OpenBSD: svc_udp.c,v 1.15 2005/04/01 07:44:04 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -58,7 +58,8 @@ static bool_t svcudp_reply(SVCXPRT *, struct rpc_msg *);
static bool_t svcudp_freeargs(SVCXPRT *, xdrproc_t, caddr_t);
static void svcudp_destroy(SVCXPRT *);
static void cache_set(SVCXPRT *, u_long);
-static int cache_get(SVCXPRT *, struct rpc_msg *, char **, u_long *);
+static int cache_get(SVCXPRT *, struct rpc_msg *, char **,
+ u_long *);
static struct xp_ops svcudp_op = {
svcudp_recv,
@@ -95,9 +96,7 @@ struct svcudp_data {
* The routines returns NULL if a problem occurred.
*/
SVCXPRT *
-svcudp_bufcreate(sock, sendsz, recvsz)
- int sock;
- u_int sendsz, recvsz;
+svcudp_bufcreate(int sock, u_int sendsz, u_int recvsz)
{
bool_t madesock = FALSE;
SVCXPRT *xprt;
@@ -169,8 +168,7 @@ svcudp_bufcreate(sock, sendsz, recvsz)
}
SVCXPRT *
-svcudp_create(sock)
- int sock;
+svcudp_create(int sock)
{
return(svcudp_bufcreate(sock, UDPMSGSIZE, UDPMSGSIZE));
@@ -178,17 +176,14 @@ svcudp_create(sock)
/* ARGSUSED */
static enum xprt_stat
-svcudp_stat(xprt)
- SVCXPRT *xprt;
+svcudp_stat(SVCXPRT *xprt)
{
return (XPRT_IDLE);
}
static bool_t
-svcudp_recv(xprt, msg)
- SVCXPRT *xprt;
- struct rpc_msg *msg;
+svcudp_recv(SVCXPRT *xprt, struct rpc_msg *msg)
{
struct svcudp_data *su = su_data(xprt);
XDR *xdrs = &(su->su_xdrs);
@@ -221,9 +216,7 @@ svcudp_recv(xprt, msg)
}
static bool_t
-svcudp_reply(xprt, msg)
- SVCXPRT *xprt;
- struct rpc_msg *msg;
+svcudp_reply(SVCXPRT *xprt, struct rpc_msg *msg)
{
struct svcudp_data *su = su_data(xprt);
XDR *xdrs = &(su->su_xdrs);
@@ -248,20 +241,14 @@ svcudp_reply(xprt, msg)
}
static bool_t
-svcudp_getargs(xprt, xdr_args, args_ptr)
- SVCXPRT *xprt;
- xdrproc_t xdr_args;
- caddr_t args_ptr;
+svcudp_getargs(SVCXPRT *xprt, xdrproc_t xdr_args, caddr_t args_ptr)
{
return ((*xdr_args)(&(su_data(xprt)->su_xdrs), args_ptr));
}
static bool_t
-svcudp_freeargs(xprt, xdr_args, args_ptr)
- SVCXPRT *xprt;
- xdrproc_t xdr_args;
- caddr_t args_ptr;
+svcudp_freeargs(SVCXPRT *xprt, xdrproc_t xdr_args, caddr_t args_ptr)
{
XDR *xdrs = &(su_data(xprt)->su_xdrs);
@@ -270,8 +257,7 @@ svcudp_freeargs(xprt, xdr_args, args_ptr)
}
static void
-svcudp_destroy(xprt)
- SVCXPRT *xprt;
+svcudp_destroy(SVCXPRT *xprt)
{
struct svcudp_data *su = su_data(xprt);
@@ -353,9 +339,7 @@ struct udp_cache {
* Note: there is no disable.
*/
int
-svcudp_enablecache(transp, size)
- SVCXPRT *transp;
- u_long size;
+svcudp_enablecache(SVCXPRT *transp, u_long size)
{
struct svcudp_data *su = su_data(transp);
struct udp_cache *uc;
@@ -395,9 +379,7 @@ svcudp_enablecache(transp, size)
* Set an entry in the cache
*/
static void
-cache_set(xprt, replylen)
- SVCXPRT *xprt;
- u_long replylen;
+cache_set(SVCXPRT *xprt, u_long replylen)
{
cache_ptr victim;
cache_ptr *vicp;
@@ -461,11 +443,7 @@ cache_set(xprt, replylen)
* return 1 if found, 0 if not found
*/
static int
-cache_get(xprt, msg, replyp, replylenp)
- SVCXPRT *xprt;
- struct rpc_msg *msg;
- char **replyp;
- u_long *replylenp;
+cache_get(SVCXPRT *xprt, struct rpc_msg *msg, char **replyp, u_long *replylenp)
{
u_int loc;
cache_ptr ent;
diff --git a/lib/libc/rpc/xdr.c b/lib/libc/rpc/xdr.c
index 071bff4313a..1f5aa627bb2 100644
--- a/lib/libc/rpc/xdr.c
+++ b/lib/libc/rpc/xdr.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: xdr.c,v 1.7 2005/01/08 19:17:39 krw Exp $";
+static char *rcsid = "$OpenBSD: xdr.c,v 1.8 2005/04/01 07:44:04 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -65,9 +65,7 @@ static char xdr_zero[BYTES_PER_XDR_UNIT] = { 0, 0, 0, 0 };
* Not a filter, but a convenient utility nonetheless
*/
void
-xdr_free(proc, objp)
- xdrproc_t proc;
- char *objp;
+xdr_free(xdrproc_t proc, char *objp)
{
XDR x;
@@ -79,7 +77,7 @@ xdr_free(proc, objp)
* XDR nothing
*/
bool_t
-xdr_void(/* xdrs, addr */)
+xdr_void(void)
/* XDR *xdrs; */
/* caddr_t addr; */
{
@@ -92,9 +90,7 @@ xdr_void(/* xdrs, addr */)
* XDR integers
*/
bool_t
-xdr_int(xdrs, ip)
- XDR *xdrs;
- int *ip;
+xdr_int(XDR *xdrs, int *ip)
{
long l;
@@ -121,9 +117,7 @@ xdr_int(xdrs, ip)
* XDR unsigned integers
*/
bool_t
-xdr_u_int(xdrs, up)
- XDR *xdrs;
- u_int *up;
+xdr_u_int(XDR *xdrs, u_int *up)
{
u_long l;
@@ -152,9 +146,7 @@ xdr_u_int(xdrs, up)
* same as xdr_u_long - open coded to save a proc call!
*/
bool_t
-xdr_long(xdrs, lp)
- XDR *xdrs;
- long *lp;
+xdr_long(XDR *xdrs, long int *lp)
{
switch (xdrs->x_op) {
case XDR_ENCODE:
@@ -173,9 +165,7 @@ xdr_long(xdrs, lp)
* same as xdr_long - open coded to save a proc call!
*/
bool_t
-xdr_u_long(xdrs, ulp)
- XDR *xdrs;
- u_long *ulp;
+xdr_u_long(XDR *xdrs, u_long *ulp)
{
switch (xdrs->x_op) {
case XDR_ENCODE:
@@ -194,9 +184,7 @@ xdr_u_long(xdrs, ulp)
* same as xdr_u_int32_t - open coded to save a proc call!
*/
bool_t
-xdr_int32_t(xdrs, int32_p)
- XDR *xdrs;
- int32_t *int32_p;
+xdr_int32_t(XDR *xdrs, int32_t *int32_p)
{
long l;
@@ -224,9 +212,7 @@ xdr_int32_t(xdrs, int32_p)
* same as xdr_int32_t - open coded to save a proc call!
*/
bool_t
-xdr_u_int32_t(xdrs, u_int32_p)
- XDR *xdrs;
- u_int32_t *u_int32_p;
+xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
{
u_long l;
@@ -254,9 +240,7 @@ xdr_u_int32_t(xdrs, u_int32_p)
* XDR short integers
*/
bool_t
-xdr_short(xdrs, sp)
- XDR *xdrs;
- short *sp;
+xdr_short(XDR *xdrs, short int *sp)
{
long l;
@@ -283,9 +267,7 @@ xdr_short(xdrs, sp)
* XDR unsigned short integers
*/
bool_t
-xdr_u_short(xdrs, usp)
- XDR *xdrs;
- u_short *usp;
+xdr_u_short(XDR *xdrs, u_short *usp)
{
u_long l;
@@ -313,9 +295,7 @@ xdr_u_short(xdrs, usp)
* XDR 16-bit integers
*/
bool_t
-xdr_int16_t(xdrs, int16_p)
- XDR *xdrs;
- int16_t *int16_p;
+xdr_int16_t(XDR *xdrs, int16_t *int16_p)
{
long l;
@@ -342,9 +322,7 @@ xdr_int16_t(xdrs, int16_p)
* XDR unsigned 16-bit integers
*/
bool_t
-xdr_u_int16_t(xdrs, u_int16_p)
- XDR *xdrs;
- u_int16_t *u_int16_p;
+xdr_u_int16_t(XDR *xdrs, u_int16_t *u_int16_p)
{
u_long l;
@@ -372,9 +350,7 @@ xdr_u_int16_t(xdrs, u_int16_p)
* XDR a char
*/
bool_t
-xdr_char(xdrs, cp)
- XDR *xdrs;
- char *cp;
+xdr_char(XDR *xdrs, char *cp)
{
int i;
@@ -390,9 +366,7 @@ xdr_char(xdrs, cp)
* XDR an unsigned char
*/
bool_t
-xdr_u_char(xdrs, cp)
- XDR *xdrs;
- u_char *cp;
+xdr_u_char(XDR *xdrs, u_char *cp)
{
u_int u;
@@ -408,9 +382,7 @@ xdr_u_char(xdrs, cp)
* XDR booleans
*/
bool_t
-xdr_bool(xdrs, bp)
- XDR *xdrs;
- bool_t *bp;
+xdr_bool(XDR *xdrs, int32_t *bp)
{
long lb;
@@ -437,9 +409,7 @@ xdr_bool(xdrs, bp)
* XDR enumerations
*/
bool_t
-xdr_enum(xdrs, ep)
- XDR *xdrs;
- enum_t *ep;
+xdr_enum(XDR *xdrs, int32_t *ep)
{
#ifndef lint
enum sizecheck { SIZEVAL }; /* used to find the size of an enum */
@@ -469,10 +439,7 @@ xdr_enum(xdrs, ep)
* cp points to the opaque object and cnt gives the byte length.
*/
bool_t
-xdr_opaque(xdrs, cp, cnt)
- XDR *xdrs;
- caddr_t cp;
- u_int cnt;
+xdr_opaque(XDR *xdrs, caddr_t cp, u_int cnt)
{
u_int rndup;
static int crud[BYTES_PER_XDR_UNIT];
@@ -521,11 +488,7 @@ xdr_opaque(xdrs, cp, cnt)
* If *cpp is NULL maxsize bytes are allocated
*/
bool_t
-xdr_bytes(xdrs, cpp, sizep, maxsize)
- XDR *xdrs;
- char **cpp;
- u_int *sizep;
- u_int maxsize;
+xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
{
char *sp = *cpp; /* sp is the actual string pointer */
u_int nodesize;
@@ -576,9 +539,7 @@ xdr_bytes(xdrs, cpp, sizep, maxsize)
* Implemented here due to commonality of the object.
*/
bool_t
-xdr_netobj(xdrs, np)
- XDR *xdrs;
- struct netobj *np;
+xdr_netobj(XDR *xdrs, struct netobj *np)
{
return (xdr_bytes(xdrs, &np->n_bytes, &np->n_len, MAX_NETOBJ_SZ));
@@ -596,12 +557,11 @@ xdr_netobj(xdrs, np)
* If there is no specific or default routine an error is returned.
*/
bool_t
-xdr_union(xdrs, dscmp, unp, choices, dfault)
- XDR *xdrs;
- enum_t *dscmp; /* enum to decide which arm to work on */
- char *unp; /* the union itself */
- struct xdr_discrim *choices; /* [value, xdr proc] for each arm */
- xdrproc_t dfault; /* default xdr routine */
+xdr_union(XDR *xdrs,
+ int32_t *dscmp, /* enum to decide which arm to work on */
+ char *unp, /* the union itself */
+ struct xdr_discrim *choices, /* [value, xdr proc] for each arm */
+ xdrproc_t dfault) /* default xdr routine */
{
enum_t dscm;
@@ -645,10 +605,7 @@ xdr_union(xdrs, dscmp, unp, choices, dfault)
* of the string as specified by a protocol.
*/
bool_t
-xdr_string(xdrs, cpp, maxsize)
- XDR *xdrs;
- char **cpp;
- u_int maxsize;
+xdr_string(XDR *xdrs, char **cpp, u_int maxsize)
{
char *sp = *cpp; /* sp is the actual string pointer */
u_int size;
@@ -709,9 +666,7 @@ xdr_string(xdrs, cpp, maxsize)
* routines like clnt_call
*/
bool_t
-xdr_wrapstring(xdrs, cpp)
- XDR *xdrs;
- char **cpp;
+xdr_wrapstring(XDR *xdrs, char **cpp)
{
return xdr_string(xdrs, cpp, LASTUNSIGNED);
}
diff --git a/lib/libc/rpc/xdr_array.c b/lib/libc/rpc/xdr_array.c
index 8e29dde9dc8..ea8dd45e41a 100644
--- a/lib/libc/rpc/xdr_array.c
+++ b/lib/libc/rpc/xdr_array.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: xdr_array.c,v 1.6 2002/08/01 01:05:24 deraadt Exp $";
+static char *rcsid = "$OpenBSD: xdr_array.c,v 1.7 2005/04/01 07:44:04 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -57,13 +57,12 @@ static char *rcsid = "$OpenBSD: xdr_array.c,v 1.6 2002/08/01 01:05:24 deraadt Ex
* xdr procedure to call to handle each element of the array.
*/
bool_t
-xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc)
- XDR *xdrs;
- caddr_t *addrp; /* array pointer */
- u_int *sizep; /* number of elements */
- u_int maxsize; /* max numberof elements */
- u_int elsize; /* size in bytes of each element */
- xdrproc_t elproc; /* xdr routine to handle each element */
+xdr_array(XDR *xdrs,
+ caddr_t *addrp, /* array pointer */
+ u_int *sizep, /* number of elements */
+ u_int maxsize, /* max numberof elements */
+ u_int elsize, /* size in bytes of each element */
+ xdrproc_t elproc) /* xdr routine to handle each element */
{
caddr_t target = *addrp;
u_int nodesize, c, i;
@@ -130,12 +129,8 @@ xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc)
* > xdr_elem: routine to XDR each element
*/
bool_t
-xdr_vector(xdrs, basep, nelem, elemsize, xdr_elem)
- XDR *xdrs;
- char *basep;
- u_int nelem;
- u_int elemsize;
- xdrproc_t xdr_elem;
+xdr_vector(XDR *xdrs, char *basep, u_int nelem, u_int elemsize,
+ xdrproc_t xdr_elem)
{
char *elptr;
u_int i;
diff --git a/lib/libc/rpc/xdr_float.c b/lib/libc/rpc/xdr_float.c
index 93759d8f8c7..f89143d2db1 100644
--- a/lib/libc/rpc/xdr_float.c
+++ b/lib/libc/rpc/xdr_float.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: xdr_float.c,v 1.12 2004/02/01 07:11:24 drahn Exp $";
+static char *rcsid = "$OpenBSD: xdr_float.c,v 1.13 2005/04/01 07:44:04 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -92,9 +92,7 @@ static struct sgl_limits {
#endif /* __vax__ */
bool_t
-xdr_float(xdrs, fp)
- XDR *xdrs;
- float *fp;
+xdr_float(XDR *xdrs, float *fp)
{
#ifdef IEEEFP
bool_t rv;
@@ -199,9 +197,7 @@ static struct dbl_limits {
bool_t
-xdr_double(xdrs, dp)
- XDR *xdrs;
- double *dp;
+xdr_double(XDR *xdrs, double *dp)
{
#ifdef IEEEFP
int32_t *i32p;
diff --git a/lib/libc/rpc/xdr_mem.c b/lib/libc/rpc/xdr_mem.c
index 5581b735f56..9772fa33157 100644
--- a/lib/libc/rpc/xdr_mem.c
+++ b/lib/libc/rpc/xdr_mem.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: xdr_mem.c,v 1.10 2004/09/14 22:20:01 deraadt Exp $";
+static char *rcsid = "$OpenBSD: xdr_mem.c,v 1.11 2005/04/01 07:44:04 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -87,11 +87,7 @@ static struct xdr_ops xdrmem_ops_unaligned = {
* memory buffer.
*/
void
-xdrmem_create(xdrs, addr, size, op)
- XDR *xdrs;
- caddr_t addr;
- u_int size;
- enum xdr_op op;
+xdrmem_create(XDR *xdrs, caddr_t addr, u_int size, enum xdr_op op)
{
xdrs->x_op = op;
@@ -107,9 +103,7 @@ xdrmem_destroy(XDR *xdrs)
}
static bool_t
-xdrmem_getlong_aligned(xdrs, lp)
- XDR *xdrs;
- long *lp;
+xdrmem_getlong_aligned(XDR *xdrs, long int *lp)
{
if (xdrs->x_handy < sizeof(int32_t))
@@ -121,9 +115,7 @@ xdrmem_getlong_aligned(xdrs, lp)
}
static bool_t
-xdrmem_putlong_aligned(xdrs, lp)
- XDR *xdrs;
- long *lp;
+xdrmem_putlong_aligned(XDR *xdrs, long int *lp)
{
if (xdrs->x_handy < sizeof(int32_t))
@@ -135,9 +127,7 @@ xdrmem_putlong_aligned(xdrs, lp)
}
static bool_t
-xdrmem_getlong_unaligned(xdrs, lp)
- XDR *xdrs;
- long *lp;
+xdrmem_getlong_unaligned(XDR *xdrs, long int *lp)
{
int32_t l;
@@ -151,9 +141,7 @@ xdrmem_getlong_unaligned(xdrs, lp)
}
static bool_t
-xdrmem_putlong_unaligned(xdrs, lp)
- XDR *xdrs;
- long *lp;
+xdrmem_putlong_unaligned(XDR *xdrs, long int *lp)
{
int32_t l;
@@ -167,10 +155,7 @@ xdrmem_putlong_unaligned(xdrs, lp)
}
static bool_t
-xdrmem_getbytes(xdrs, addr, len)
- XDR *xdrs;
- caddr_t addr;
- u_int len;
+xdrmem_getbytes(XDR *xdrs, caddr_t addr, u_int len)
{
if (xdrs->x_handy < len)
@@ -182,10 +167,7 @@ xdrmem_getbytes(xdrs, addr, len)
}
static bool_t
-xdrmem_putbytes(xdrs, addr, len)
- XDR *xdrs;
- caddr_t addr;
- u_int len;
+xdrmem_putbytes(XDR *xdrs, caddr_t addr, u_int len)
{
if (xdrs->x_handy < len)
@@ -197,8 +179,7 @@ xdrmem_putbytes(xdrs, addr, len)
}
static u_int
-xdrmem_getpos(xdrs)
- XDR *xdrs;
+xdrmem_getpos(XDR *xdrs)
{
/* XXX w/64-bit pointers, u_int not enough! */
@@ -206,9 +187,7 @@ xdrmem_getpos(xdrs)
}
static bool_t
-xdrmem_setpos(xdrs, pos)
- XDR *xdrs;
- u_int pos;
+xdrmem_setpos(XDR *xdrs, u_int pos)
{
caddr_t newaddr = xdrs->x_base + pos;
caddr_t lastaddr = xdrs->x_private + xdrs->x_handy;
@@ -221,9 +200,7 @@ xdrmem_setpos(xdrs, pos)
}
static int32_t *
-xdrmem_inline_aligned(xdrs, len)
- XDR *xdrs;
- u_int len;
+xdrmem_inline_aligned(XDR *xdrs, u_int len)
{
int32_t *buf = 0;
@@ -237,9 +214,7 @@ xdrmem_inline_aligned(xdrs, len)
/* ARGSUSED */
static int32_t *
-xdrmem_inline_unaligned(xdrs, len)
- XDR *xdrs;
- u_int len;
+xdrmem_inline_unaligned(XDR *xdrs, u_int len)
{
return (0);
diff --git a/lib/libc/rpc/xdr_rec.c b/lib/libc/rpc/xdr_rec.c
index 347cc5c7100..15a502e880f 100644
--- a/lib/libc/rpc/xdr_rec.c
+++ b/lib/libc/rpc/xdr_rec.c
@@ -27,7 +27,7 @@
* Mountain View, California 94043
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: xdr_rec.c,v 1.9 2002/02/16 21:27:24 millert Exp $";
+static char *rcsid = "$OpenBSD: xdr_rec.c,v 1.10 2005/04/01 07:44:04 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -63,6 +63,8 @@ static bool_t xdrrec_setpos(XDR *, u_int);
static int32_t *xdrrec_inline(XDR *, u_int);
static void xdrrec_destroy(XDR *);
+struct ct_data;
+
static struct xdr_ops xdrrec_ops = {
xdrrec_getlong,
xdrrec_putlong,
@@ -132,13 +134,11 @@ static bool_t skip_input_bytes(RECSTREAM *, long);
* calls expect that they take an opaque handle rather than an fd.
*/
void
-xdrrec_create(xdrs, sendsize, recvsize, tcp_handle, readit, writeit)
- XDR *xdrs;
- u_int sendsize;
- u_int recvsize;
- caddr_t tcp_handle;
- int (*readit)(); /* like read, but pass it a tcp_handle, not sock */
- int (*writeit)(); /* like write, but pass it a tcp_handle, not sock */
+xdrrec_create(XDR *xdrs, u_int sendsize, u_int recvsize, caddr_t tcp_handle,
+ int (*readit)(caddr_t, caddr_t, int), /* like read, but pass it a
+ tcp_handle, not sock */
+ int (*writeit)(caddr_t, caddr_t, int)) /* like write, but pass it a
+ tcp_handle, not sock */
{
RECSTREAM *rstrm =
(RECSTREAM *)mem_alloc(sizeof(RECSTREAM));
@@ -193,9 +193,7 @@ xdrrec_create(xdrs, sendsize, recvsize, tcp_handle, readit, writeit)
*/
static bool_t
-xdrrec_getlong(xdrs, lp)
- XDR *xdrs;
- long *lp;
+xdrrec_getlong(XDR *xdrs, long int *lp)
{
RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
int32_t *buflp = (int32_t *)(rstrm->in_finger);
@@ -217,9 +215,7 @@ xdrrec_getlong(xdrs, lp)
}
static bool_t
-xdrrec_putlong(xdrs, lp)
- XDR *xdrs;
- long *lp;
+xdrrec_putlong(XDR *xdrs, long int *lp)
{
RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
int32_t *dest_lp = ((int32_t *)(rstrm->out_finger));
@@ -241,10 +237,7 @@ xdrrec_putlong(xdrs, lp)
}
static bool_t /* must manage buffers, fragments, and records */
-xdrrec_getbytes(xdrs, addr, len)
- XDR *xdrs;
- caddr_t addr;
- u_int len;
+xdrrec_getbytes(XDR *xdrs, caddr_t addr, u_int len)
{
RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
int current;
@@ -269,10 +262,7 @@ xdrrec_getbytes(xdrs, addr, len)
}
static bool_t
-xdrrec_putbytes(xdrs, addr, len)
- XDR *xdrs;
- caddr_t addr;
- u_int len;
+xdrrec_putbytes(XDR *xdrs, caddr_t addr, u_int len)
{
RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
long current;
@@ -295,8 +285,7 @@ xdrrec_putbytes(xdrs, addr, len)
}
static u_int
-xdrrec_getpos(xdrs)
- XDR *xdrs;
+xdrrec_getpos(XDR *xdrs)
{
RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;
long pos;
@@ -321,9 +310,7 @@ xdrrec_getpos(xdrs)
}
static bool_t
-xdrrec_setpos(xdrs, pos)
- XDR *xdrs;
- u_int pos;
+xdrrec_setpos(XDR *xdrs, u_int pos)
{
RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;
u_int currpos = xdrrec_getpos(xdrs);
@@ -357,9 +344,7 @@ xdrrec_setpos(xdrs, pos)
}
static int32_t *
-xdrrec_inline(xdrs, len)
- XDR *xdrs;
- u_int len;
+xdrrec_inline(XDR *xdrs, u_int len)
{
RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;
int32_t *buf = NULL;
@@ -386,8 +371,7 @@ xdrrec_inline(xdrs, len)
}
static void
-xdrrec_destroy(xdrs)
- XDR *xdrs;
+xdrrec_destroy(XDR *xdrs)
{
RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;
@@ -406,8 +390,7 @@ xdrrec_destroy(xdrs)
* this procedure to guarantee proper record alignment.
*/
bool_t
-xdrrec_skiprecord(xdrs)
- XDR *xdrs;
+xdrrec_skiprecord(XDR *xdrs)
{
RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
@@ -428,8 +411,7 @@ xdrrec_skiprecord(xdrs)
* after consuming the rest of the current record.
*/
bool_t
-xdrrec_eof(xdrs)
- XDR *xdrs;
+xdrrec_eof(XDR *xdrs)
{
RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
@@ -452,9 +434,7 @@ xdrrec_eof(xdrs)
* pipelined procedure calls.) TRUE => immmediate flush to tcp connection.
*/
bool_t
-xdrrec_endofrecord(xdrs, sendnow)
- XDR *xdrs;
- bool_t sendnow;
+xdrrec_endofrecord(XDR *xdrs, int32_t sendnow)
{
RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
u_long len; /* fragment length */
@@ -478,9 +458,7 @@ xdrrec_endofrecord(xdrs, sendnow)
* Internal useful routines
*/
static bool_t
-flush_out(rstrm, eor)
- RECSTREAM *rstrm;
- bool_t eor;
+flush_out(RECSTREAM *rstrm, int32_t eor)
{
u_long eormask = (eor == TRUE) ? LAST_FRAG : 0;
u_int32_t len = (u_long)(rstrm->out_finger) -
@@ -497,8 +475,7 @@ flush_out(rstrm, eor)
}
static bool_t /* knows nothing about records! Only about input buffers */
-fill_input_buf(rstrm)
- RECSTREAM *rstrm;
+fill_input_buf(RECSTREAM *rstrm)
{
caddr_t where;
u_long i;
@@ -517,10 +494,7 @@ fill_input_buf(rstrm)
}
static bool_t /* knows nothing about records! Only about input buffers */
-get_input_bytes(rstrm, addr, len)
- RECSTREAM *rstrm;
- caddr_t addr;
- int len;
+get_input_bytes(RECSTREAM *rstrm, caddr_t addr, int len)
{
long current;
@@ -541,8 +515,7 @@ get_input_bytes(rstrm, addr, len)
}
static bool_t /* next four bytes of the input stream are treated as a header */
-set_input_fragment(rstrm)
- RECSTREAM *rstrm;
+set_input_fragment(RECSTREAM *rstrm)
{
u_int32_t header;
@@ -557,9 +530,7 @@ set_input_fragment(rstrm)
}
static bool_t /* consumes input bytes; knows nothing about records! */
-skip_input_bytes(rstrm, cnt)
- RECSTREAM *rstrm;
- long cnt;
+skip_input_bytes(RECSTREAM *rstrm, long int cnt)
{
long current;
@@ -578,8 +549,7 @@ skip_input_bytes(rstrm, cnt)
}
static u_int
-fix_buf_size(s)
- u_int s;
+fix_buf_size(u_int s)
{
if (s < 100)
diff --git a/lib/libc/rpc/xdr_reference.c b/lib/libc/rpc/xdr_reference.c
index 0cc8df8030f..e2c046824a9 100644
--- a/lib/libc/rpc/xdr_reference.c
+++ b/lib/libc/rpc/xdr_reference.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: xdr_reference.c,v 1.4 2001/09/15 13:51:01 deraadt Exp $";
+static char *rcsid = "$OpenBSD: xdr_reference.c,v 1.5 2005/04/01 07:44:04 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -56,11 +56,10 @@ static char *rcsid = "$OpenBSD: xdr_reference.c,v 1.4 2001/09/15 13:51:01 deraad
* proc is the routine to handle the referenced structure.
*/
bool_t
-xdr_reference(xdrs, pp, size, proc)
- XDR *xdrs;
- caddr_t *pp; /* the pointer to work on */
- u_int size; /* size of the object pointed to */
- xdrproc_t proc; /* xdr routine to handle the object */
+xdr_reference(XDR *xdrs,
+ caddr_t *pp, /* the pointer to work on */
+ u_int size, /* size of the object pointed to */
+ xdrproc_t proc) /* xdr routine to handle the object */
{
caddr_t loc = *pp;
bool_t stat;
@@ -111,11 +110,7 @@ xdr_reference(xdrs, pp, size, proc)
*
*/
bool_t
-xdr_pointer(xdrs,objpp,obj_size,xdr_obj)
- XDR *xdrs;
- char **objpp;
- u_int obj_size;
- xdrproc_t xdr_obj;
+xdr_pointer(XDR *xdrs, char **objpp, u_int obj_size, xdrproc_t xdr_obj)
{
bool_t more_data;
diff --git a/lib/libc/rpc/xdr_stdio.c b/lib/libc/rpc/xdr_stdio.c
index 799695f1066..0fd044fbbd0 100644
--- a/lib/libc/rpc/xdr_stdio.c
+++ b/lib/libc/rpc/xdr_stdio.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: xdr_stdio.c,v 1.6 2001/09/17 18:34:51 jason Exp $";
+static char *rcsid = "$OpenBSD: xdr_stdio.c,v 1.7 2005/04/01 07:44:04 otto Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -74,10 +74,7 @@ static struct xdr_ops xdrstdio_ops = {
* Operation flag is set to op.
*/
void
-xdrstdio_create(xdrs, file, op)
- XDR *xdrs;
- FILE *file;
- enum xdr_op op;
+xdrstdio_create(XDR *xdrs, FILE *file, enum xdr_op op)
{
xdrs->x_op = op;
@@ -92,17 +89,14 @@ xdrstdio_create(xdrs, file, op)
* Cleans up the xdr stream handle xdrs previously set up by xdrstdio_create.
*/
static void
-xdrstdio_destroy(xdrs)
- XDR *xdrs;
+xdrstdio_destroy(XDR *xdrs)
{
(void)fflush((FILE *)xdrs->x_private);
/* xx should we close the file ?? */
}
static bool_t
-xdrstdio_getlong(xdrs, lp)
- XDR *xdrs;
- long *lp;
+xdrstdio_getlong(XDR *xdrs, long int *lp)
{
if (fread((caddr_t)lp, sizeof(int32_t), 1,
@@ -113,9 +107,7 @@ xdrstdio_getlong(xdrs, lp)
}
static bool_t
-xdrstdio_putlong(xdrs, lp)
- XDR *xdrs;
- long *lp;
+xdrstdio_putlong(XDR *xdrs, long int *lp)
{
long mycopy = (long)htonl((u_int32_t)*lp);
@@ -126,10 +118,7 @@ xdrstdio_putlong(xdrs, lp)
}
static bool_t
-xdrstdio_getbytes(xdrs, addr, len)
- XDR *xdrs;
- caddr_t addr;
- u_int len;
+xdrstdio_getbytes(XDR *xdrs, caddr_t addr, u_int len)
{
if ((len != 0) && (fread(addr, (int)len, 1, (FILE *)xdrs->x_private) != 1))
@@ -138,10 +127,7 @@ xdrstdio_getbytes(xdrs, addr, len)
}
static bool_t
-xdrstdio_putbytes(xdrs, addr, len)
- XDR *xdrs;
- caddr_t addr;
- u_int len;
+xdrstdio_putbytes(XDR *xdrs, caddr_t addr, u_int len)
{
if ((len != 0) && (fwrite(addr, (int)len, 1, (FILE *)xdrs->x_private) != 1))
@@ -150,17 +136,14 @@ xdrstdio_putbytes(xdrs, addr, len)
}
static u_int
-xdrstdio_getpos(xdrs)
- XDR *xdrs;
+xdrstdio_getpos(XDR *xdrs)
{
return ((u_int) ftell((FILE *)xdrs->x_private));
}
static bool_t
-xdrstdio_setpos(xdrs, pos)
- XDR *xdrs;
- u_int pos;
+xdrstdio_setpos(XDR *xdrs, u_int pos)
{
return ((fseek((FILE *)xdrs->x_private, (long)pos, 0) < 0) ?
@@ -169,9 +152,7 @@ xdrstdio_setpos(xdrs, pos)
/* ARGSUSED */
static int32_t *
-xdrstdio_inline(xdrs, len)
- XDR *xdrs;
- u_int len;
+xdrstdio_inline(XDR *xdrs, u_int len)
{
/*