From c9b6181e20ca004607709fd70d33bea4aea892c9 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sun, 13 Nov 2005 12:27:04 +0000 Subject: [PATCH] Cleanup: - Add $DragonFly$. - Ansify function definitions. - Change pmap_set()'s 'port' parameter from int to u_short. - In function definitions, move the type on a line of its own. - Remove (void) casts for discarded return values. - Remove 'register' storage class specifiers. --- include/rpc/clnt.h | 6 +-- include/rpc/pmap_clnt.h | 4 +- lib/libc/rpc/auth_des.c | 51 +++++++++------------- lib/libc/rpc/auth_none.c | 20 ++++----- lib/libc/rpc/auth_time.c | 43 ++++++++---------- lib/libc/rpc/auth_unix.c | 45 +++++++------------ lib/libc/rpc/authdes_prot.c | 10 ++--- lib/libc/rpc/authunix_prot.c | 6 +-- lib/libc/rpc/bindresvport.c | 10 ++--- lib/libc/rpc/clnt_perror.c | 55 ++++++++++------------- lib/libc/rpc/clnt_raw.c | 33 +++++--------- lib/libc/rpc/clnt_simple.c | 13 +++--- lib/libc/rpc/clnt_tcp.c | 68 +++++++++-------------------- lib/libc/rpc/clnt_udp.c | 69 ++++++++++------------------- lib/libc/rpc/clnt_unix.c | 79 +++++++++++---------------------- lib/libc/rpc/crypt_client.c | 7 +-- lib/libc/rpc/des_crypt.c | 23 +++------- lib/libc/rpc/des_soft.c | 5 ++- lib/libc/rpc/get_myaddress.c | 7 ++- lib/libc/rpc/getpublickey.c | 17 +++----- lib/libc/rpc/getrpcent.c | 27 +++++------- lib/libc/rpc/getrpcport.c | 6 +-- lib/libc/rpc/key_call.c | 48 ++++++-------------- lib/libc/rpc/netname.c | 21 +++------ lib/libc/rpc/netnamer.c | 28 ++++-------- lib/libc/rpc/pmap_clnt.c | 16 +++---- lib/libc/rpc/pmap_getmaps.c | 7 ++- lib/libc/rpc/pmap_getport.c | 11 ++--- lib/libc/rpc/pmap_prot.c | 6 +-- lib/libc/rpc/pmap_prot2.c | 6 +-- lib/libc/rpc/pmap_rmt.c | 54 ++++++++++------------- lib/libc/rpc/rpc_callmsg.c | 6 +-- lib/libc/rpc/rpc_prot.c | 38 +++++----------- lib/libc/rpc/rpcdname.c | 8 ++-- lib/libc/rpc/rtime.c | 12 ++--- lib/libc/rpc/svc.c | 66 ++++++++-------------------- lib/libc/rpc/svc_auth.c | 14 ++---- lib/libc/rpc/svc_auth_des.c | 35 +++++---------- lib/libc/rpc/svc_auth_unix.c | 14 +++--- lib/libc/rpc/svc_raw.c | 28 ++++-------- lib/libc/rpc/svc_run.c | 4 +- lib/libc/rpc/svc_simple.c | 30 ++++++------- lib/libc/rpc/svc_tcp.c | 76 ++++++++++---------------------- lib/libc/rpc/svc_udp.c | 64 +++++++++------------------ lib/libc/rpc/svc_unix.c | 85 +++++++++++------------------------- 45 files changed, 439 insertions(+), 842 deletions(-) diff --git a/include/rpc/clnt.h b/include/rpc/clnt.h index fd2308b0b6..ce5a0d7391 100644 --- a/include/rpc/clnt.h +++ b/include/rpc/clnt.h @@ -29,7 +29,7 @@ * from: @(#)clnt.h 1.31 88/02/08 SMI * from: @(#)clnt.h 2.1 88/07/29 4.0 RPCSRC * $FreeBSD: src/include/rpc/clnt.h,v 1.11.2.1 2001/06/28 21:44:09 iedowse Exp $ - * $DragonFly: src/include/rpc/clnt.h,v 1.5 2004/11/16 18:55:04 liamfoy Exp $ + * $DragonFly: src/include/rpc/clnt.h,v 1.6 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -307,7 +307,7 @@ __END_DECLS * struct sockaddr_in *raddr; * u_long prog; * u_long version; - * register int *sockp; + * int *sockp; * u_int sendsz; * u_int recvsz; */ @@ -365,7 +365,7 @@ __END_DECLS * struct sockaddr_un *raddr; * u_long prog; * u_long version; - * register int *sockp; + * int *sockp; * u_int sendsz; * u_int recvsz; */ diff --git a/include/rpc/pmap_clnt.h b/include/rpc/pmap_clnt.h index e2bc488495..79fcd53323 100644 --- a/include/rpc/pmap_clnt.h +++ b/include/rpc/pmap_clnt.h @@ -29,7 +29,7 @@ * from: @(#)pmap_clnt.h 1.11 88/02/08 SMI * from: @(#)pmap_clnt.h 2.1 88/07/29 4.0 RPCSRC * $FreeBSD: src/include/rpc/pmap_clnt.h,v 1.11 1999/08/27 23:45:04 peter Exp $ - * $DragonFly: src/include/rpc/pmap_clnt.h,v 1.6 2004/02/26 13:58:26 joerg Exp $ + * $DragonFly: src/include/rpc/pmap_clnt.h,v 1.7 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -67,7 +67,7 @@ #include __BEGIN_DECLS -bool_t pmap_set(u_long, u_long, int, int); +bool_t pmap_set(u_long, u_long, int, u_short); bool_t pmap_unset(u_long, u_long); struct pmaplist *pmap_getmaps(struct sockaddr_in *); enum clnt_stat pmap_rmtcall(struct sockaddr_in *, u_long, u_long, u_long, diff --git a/lib/libc/rpc/auth_des.c b/lib/libc/rpc/auth_des.c index fe1be6474d..ba00abb8c9 100644 --- a/lib/libc/rpc/auth_des.c +++ b/lib/libc/rpc/auth_des.c @@ -28,7 +28,7 @@ * * @(#)auth_des.c 2.2 88/07/29 4.0 RPCSRC; from 1.9 88/02/08 SMI * $FreeBSD: src/lib/libc/rpc/auth_des.c,v 1.3 1999/08/28 00:00:32 peter Exp $ - * $DragonFly: src/lib/libc/rpc/auth_des.c,v 1.4 2004/10/25 19:38:01 drhodus Exp $ + * $DragonFly: src/lib/libc/rpc/auth_des.c,v 1.5 2005/11/13 12:27:04 swildner Exp $ */ /* * Copyright (c) 1988 by Sun Microsystems, Inc. @@ -113,11 +113,10 @@ struct ad_private { * Create the client des authentication object */ AUTH * -authdes_create(servername, window, syncaddr, ckey) - char *servername; /* network name of server */ - u_int window; /* time to live */ - struct sockaddr *syncaddr; /* optional addr of host to sync with */ - des_block *ckey; /* optional conversation key to use*/ +authdes_create(char *servername, /* network name of server */ + u_int window, /* time to live */ + struct sockaddr *syncaddr, /* optional addr of host to sync with */ + des_block *ckey) /* optional conversation key to use*/ { AUTH *auth; @@ -133,7 +132,7 @@ authdes_create(servername, window, syncaddr, ckey) */ auth = ALLOC(AUTH); ad = ALLOC(struct ad_private); - (void) getnetname(namebuf); + getnetname(namebuf); ad->ad_fullnamelen = RNDUP(strlen(namebuf)); ad->ad_fullname = (char *)mem_alloc(ad->ad_fullnamelen + 1); @@ -200,13 +199,12 @@ failed: * getpublickey() which in the nameserver context can cause a deadlock. */ AUTH * -authdes_pk_create(servername, pkey, window, timehost, ckey, srvr) - char *servername; /* network name of server */ - netobj *pkey; /* public key of server */ - u_int window; /* time to live */ - char *timehost; /* optional hostname to sync with */ - des_block *ckey; /* optional conversation key to use */ - nis_server *srvr; /* optional NIS+ server struct */ +authdes_pk_create(char *servername, /* network name of server */ + netobj *pkey, /* public key of server */ + u_int window, /* time to live */ + char *timehost, /* optional hostname to sync with */ + des_block *ckey, /* optional conversation key to use */ + nis_server *srvr) /* optional NIS+ server struct */ { AUTH *auth; struct ad_private *ad; @@ -312,8 +310,7 @@ failed: */ /*ARGSUSED*/ static void -authdes_nextverf(auth) - AUTH *auth; +authdes_nextverf(AUTH *auth) { /* what the heck am I supposed to do??? */ } @@ -324,9 +321,7 @@ authdes_nextverf(auth) * 2. Marshal */ static bool_t -authdes_marshal(auth, xdrs) - AUTH *auth; - XDR *xdrs; +authdes_marshal(AUTH *auth, XDR *xdrs) { struct ad_private *ad = AUTH_PRIVATE(auth); struct authdes_cred *cred = &ad->ad_cred; @@ -341,7 +336,7 @@ authdes_marshal(auth, xdrs) * Figure out the "time", accounting for any time difference * with the server if necessary. */ - (void) gettimeofday(&ad->ad_timestamp, (struct timezone *)NULL); + gettimeofday(&ad->ad_timestamp, (struct timezone *)NULL); ad->ad_timestamp.tv_sec += ad->ad_timediff.tv_sec; ad->ad_timestamp.tv_usec += ad->ad_timediff.tv_usec; if (ad->ad_timestamp.tv_usec >= MILLION) { @@ -415,9 +410,7 @@ authdes_marshal(auth, xdrs) * 3. Validate */ static bool_t -authdes_validate(auth, rverf) - AUTH *auth; - struct opaque_auth *rverf; +authdes_validate(AUTH *auth, struct opaque_auth *rverf) { struct ad_private *ad = AUTH_PRIVATE(auth); struct authdes_verf verf; @@ -471,8 +464,7 @@ authdes_validate(auth, rverf) * 4. Refresh */ static bool_t -authdes_refresh(auth) - AUTH *auth; +authdes_refresh(AUTH *auth) { struct ad_private *ad = AUTH_PRIVATE(auth); struct authdes_cred *cred = &ad->ad_cred; @@ -511,8 +503,7 @@ authdes_refresh(auth) * 5. Destroy */ static void -authdes_destroy(auth) - AUTH *auth; +authdes_destroy(AUTH *auth) { struct ad_private *ad = AUTH_PRIVATE(auth); @@ -529,9 +520,7 @@ authdes_destroy(auth) * adjust timep to reflect the delta between our clocks */ static bool_t -synchronize(syncaddr, timep) - struct sockaddr *syncaddr; - struct timeval *timep; +synchronize(struct sockaddr *syncaddr, struct timeval *timep) { struct timeval mytime; struct timeval timeout; @@ -541,7 +530,7 @@ synchronize(syncaddr, timep) if (rtime((struct sockaddr_in *)syncaddr, timep, NULL /*&timeout*/) < 0) { return (FALSE); } - (void) gettimeofday(&mytime, (struct timezone *)NULL); + gettimeofday(&mytime, (struct timezone *)NULL); timep->tv_sec -= mytime.tv_sec; if (mytime.tv_usec > timep->tv_usec) { timep->tv_sec -= 1; diff --git a/lib/libc/rpc/auth_none.c b/lib/libc/rpc/auth_none.c index 7fd8d0a487..db8930948f 100644 --- a/lib/libc/rpc/auth_none.c +++ b/lib/libc/rpc/auth_none.c @@ -29,7 +29,7 @@ * @(#)auth_none.c 1.19 87/08/11 Copyr 1984 Sun Micro * @(#)auth_none.c 2.1 88/07/29 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/auth_none.c,v 1.9 1999/08/28 00:00:32 peter Exp $ - * $DragonFly: src/lib/libc/rpc/auth_none.c,v 1.3 2004/10/25 19:38:01 drhodus Exp $ + * $DragonFly: src/lib/libc/rpc/auth_none.c,v 1.4 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -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; @@ -88,8 +88,8 @@ authnone_create() xdrs = &xdr_stream; xdrmem_create(xdrs, ap->marshalled_client, (u_int)MAX_MARSHEL_SIZE, XDR_ENCODE); - (void)xdr_opaque_auth(xdrs, &ap->no_client.ah_cred); - (void)xdr_opaque_auth(xdrs, &ap->no_client.ah_verf); + xdr_opaque_auth(xdrs, &ap->no_client.ah_cred); + xdr_opaque_auth(xdrs, &ap->no_client.ah_verf); ap->mcnt = XDR_GETPOS(xdrs); XDR_DESTROY(xdrs); } @@ -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; @@ -111,25 +109,25 @@ authnone_marshal(client, xdrs) } static void -authnone_verf() +authnone_verf(void) { } static bool_t -authnone_validate() +authnone_validate(void) { return (TRUE); } static bool_t -authnone_refresh() +authnone_refresh(void) { return (FALSE); } static void -authnone_destroy() +authnone_destroy(void) { } diff --git a/lib/libc/rpc/auth_time.c b/lib/libc/rpc/auth_time.c index 5f4a857b20..e7281ae2c9 100644 --- a/lib/libc/rpc/auth_time.c +++ b/lib/libc/rpc/auth_time.c @@ -30,7 +30,7 @@ * it from TI-RPC back to TD-RPC for use on FreeBSD. * * $FreeBSD: src/lib/libc/rpc/auth_time.c,v 1.4 2000/01/27 23:06:35 jasone Exp $ - * $DragonFly: src/lib/libc/rpc/auth_time.c,v 1.3 2005/01/31 22:29:38 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/auth_time.c,v 1.4 2005/11/13 12:27:04 swildner Exp $ */ #include "namespace.h" #include @@ -70,8 +70,7 @@ static int saw_alarm = 0; static void -alarm_hndler(s) - int s; +alarm_hndler(int s) { saw_alarm = 1; return; @@ -92,12 +91,8 @@ alarm_hndler(s) * Turn a 'universal address' into a struct sockaddr_in. * Bletch. */ -static int uaddr_to_sockaddr(uaddr, sin) -#ifdef foo - endpoint *endpt; -#endif - char *uaddr; - struct sockaddr_in *sin; +static int +uaddr_to_sockaddr(char *uaddr, struct sockaddr_in *sin) { unsigned char p_bytes[2]; int i; @@ -127,9 +122,7 @@ static int uaddr_to_sockaddr(uaddr, sin) * Free the strings that were strduped into the eps structure. */ static void -free_eps(eps, num) - endpoint eps[]; - int num; +free_eps(endpoint eps[], int num) { int i; @@ -153,12 +146,11 @@ free_eps(eps, num) * structure already populated. */ static nis_server * -get_server(sin, host, srv, eps, maxep) - struct sockaddr_in *sin; - char *host; /* name of the time host */ - nis_server *srv; /* nis_server struct to use. */ - endpoint eps[]; /* array of endpoints */ - int maxep; /* max array size */ +get_server(struct sockaddr_in *sin, + char *host, /* name of the time host */ + nis_server *srv, /* nis_server struct to use. */ + endpoint eps[], /* array of endpoints */ + int maxep) /* max array size */ { char hname[256]; int num_ep = 0, i; @@ -238,12 +230,11 @@ get_server(sin, host, srv, eps, maxep) * td = "server" - "client" */ int -__rpc_get_time_offset(td, srv, thost, uaddr, netid) - struct timeval *td; /* Time difference */ - nis_server *srv; /* NIS Server description */ - char *thost; /* if no server, this is the timehost */ - char **uaddr; /* known universal address */ - struct sockaddr_in *netid; /* known network identifier */ +__rpc_get_time_offset(struct timeval *td, /* Time difference */ + nis_server *srv, /* NIS Server description */ + char *thost, /* if no server, this is the timehost */ + char **uaddr, /* known universal address */ + struct sockaddr_in *netid)/* known network identifier */ { CLIENT *clnt; /* Client handle */ endpoint *ep, /* useful endpoints */ @@ -452,7 +443,7 @@ __rpc_get_time_offset(td, srv, thost, uaddr, netid) time_valid = 1; } save = errno; - (void)_close(s); + _close(s); errno = save; s = RPC_ANYSOCK; @@ -471,7 +462,7 @@ error: */ if (s != RPC_ANYSOCK) - (void)_close(s); + _close(s); if (clnt != NULL) clnt_destroy(clnt); diff --git a/lib/libc/rpc/auth_unix.c b/lib/libc/rpc/auth_unix.c index 6988c56ab9..c8345e2c6f 100644 --- a/lib/libc/rpc/auth_unix.c +++ b/lib/libc/rpc/auth_unix.c @@ -29,7 +29,7 @@ * @(#)auth_unix.c 1.19 87/08/11 Copyr 1984 Sun Micro * @(#)auth_unix.c 2.2 88/08/01 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/auth_unix.c,v 1.12 1999/12/29 05:04:16 peter Exp $ - * $DragonFly: src/lib/libc/rpc/auth_unix.c,v 1.3 2004/10/25 19:38:01 drhodus Exp $ + * $DragonFly: src/lib/libc/rpc/auth_unix.c,v 1.4 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -104,12 +104,7 @@ set_rpc_maxgrouplist(int num) * 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]; @@ -124,14 +119,14 @@ authunix_create(machname, uid, gid, len, aup_gids) auth = (AUTH *)mem_alloc(sizeof(*auth)); #ifndef _KERNEL if (auth == NULL) { - (void)fprintf(stderr, "authunix_create: out of memory\n"); + fprintf(stderr, "authunix_create: out of memory\n"); return (NULL); } #endif au = (struct audata *)mem_alloc(sizeof(*au)); #ifndef _KERNEL if (au == NULL) { - (void)fprintf(stderr, "authunix_create: out of memory\n"); + fprintf(stderr, "authunix_create: out of memory\n"); return (NULL); } #endif @@ -143,7 +138,7 @@ authunix_create(machname, uid, gid, len, aup_gids) /* * fill in param struct from the given params */ - (void)gettimeofday(&now, (struct timezone *)0); + gettimeofday(&now, (struct timezone *)0); aup.aup_time = now.tv_sec; aup.aup_machname = machname; aup.aup_uid = uid; @@ -169,7 +164,7 @@ authunix_create(machname, uid, gid, len, aup_gids) au->au_origcred.oa_base = mem_alloc((u_int) len); #else if ((au->au_origcred.oa_base = mem_alloc((u_int) len)) == NULL) { - (void)fprintf(stderr, "authunix_create: out of memory\n"); + fprintf(stderr, "authunix_create: out of memory\n"); return (NULL); } #endif @@ -188,7 +183,7 @@ authunix_create(machname, uid, gid, len, aup_gids) * syscalls. */ AUTH * -authunix_create_default() +authunix_create_default(void) { int len; char machname[MAX_MACHINE_NAME + 1]; @@ -217,16 +212,13 @@ authunix_create_default() */ 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); @@ -234,9 +226,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; @@ -254,7 +244,7 @@ authunix_validate(auth, verf) auth->ah_cred = au->au_shcred; } else { xdrs.x_op = XDR_FREE; - (void)xdr_opaque_auth(&xdrs, &au->au_shcred); + xdr_opaque_auth(&xdrs, &au->au_shcred); au->au_shcred.oa_base = NULL; auth->ah_cred = au->au_origcred; } @@ -264,8 +254,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,7 +278,7 @@ authunix_refresh(auth) goto done; /* update the time and serialize in place */ - (void)gettimeofday(&now, (struct timezone *)0); + gettimeofday(&now, (struct timezone *)0); aup.aup_time = now.tv_sec; xdrs.x_op = XDR_ENCODE; XDR_SETPOS(&xdrs, 0); @@ -301,14 +290,13 @@ authunix_refresh(auth) done: /* free the struct authunix_parms created by deserializing */ xdrs.x_op = XDR_FREE; - (void)xdr_authunix_parms(&xdrs, &aup); + xdr_authunix_parms(&xdrs, &aup); XDR_DESTROY(&xdrs); return (stat); } static void -authunix_destroy(auth) - AUTH *auth; +authunix_destroy(AUTH *auth) { struct audata *au = AUTH_PRIVATE(auth); @@ -330,8 +318,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/authdes_prot.c b/lib/libc/rpc/authdes_prot.c index e3de821385..8f324b991f 100644 --- a/lib/libc/rpc/authdes_prot.c +++ b/lib/libc/rpc/authdes_prot.c @@ -1,7 +1,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)authdes_prot.c 2.1 88/07/29 4.0 RPCSRC; from 1.6 88/02/08 SMI"; #endif -/* $DragonFly: src/lib/libc/rpc/authdes_prot.c,v 1.2 2004/10/25 19:38:01 drhodus Exp $ */ +/* $DragonFly: src/lib/libc/rpc/authdes_prot.c,v 1.3 2005/11/13 12:27:04 swildner Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -46,9 +46,7 @@ static char sccsid[] = "@(#)authdes_prot.c 2.1 88/07/29 4.0 RPCSRC; from 1.6 88 #define ATTEMPT(xdr_op) if (!(xdr_op)) return (FALSE) bool_t -xdr_authdes_cred(xdrs, cred) - XDR *xdrs; - struct authdes_cred *cred; +xdr_authdes_cred(XDR *xdrs, struct authdes_cred *cred) { /* * Unrolled xdr @@ -70,9 +68,7 @@ xdr_authdes_cred(xdrs, cred) bool_t -xdr_authdes_verf(xdrs, verf) - XDR *xdrs; - struct authdes_verf *verf; +xdr_authdes_verf(XDR *xdrs, struct authdes_verf *verf) { /* * Unrolled xdr diff --git a/lib/libc/rpc/authunix_prot.c b/lib/libc/rpc/authunix_prot.c index 303e6eeba0..de95e4df22 100644 --- a/lib/libc/rpc/authunix_prot.c +++ b/lib/libc/rpc/authunix_prot.c @@ -29,7 +29,7 @@ * @(#)authunix_prot.c 1.15 87/08/11 Copyr 1984 Sun Micro * @(#)authunix_prot.c 2.1 88/07/29 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/authunix_prot.c,v 1.6 1999/08/28 00:00:33 peter Exp $ - * $DragonFly: src/lib/libc/rpc/authunix_prot.c,v 1.3 2004/10/25 19:38:01 drhodus Exp $ + * $DragonFly: src/lib/libc/rpc/authunix_prot.c,v 1.4 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -49,9 +49,7 @@ * 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 3418c7e181..b83e283063 100644 --- a/lib/libc/rpc/bindresvport.c +++ b/lib/libc/rpc/bindresvport.c @@ -29,7 +29,7 @@ * @(#)bindresvport.c 1.8 88/02/08 SMI * @(#)bindresvport.c 2.2 88/07/29 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/bindresvport.c,v 1.12 2000/01/26 09:02:42 shin Exp $ - * $DragonFly: src/lib/libc/rpc/bindresvport.c,v 1.3 2005/01/31 22:29:38 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/bindresvport.c,v 1.4 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -51,9 +51,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); } @@ -62,9 +60,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_perror.c b/lib/libc/rpc/clnt_perror.c index 2d75e57299..91dddb73c2 100644 --- a/lib/libc/rpc/clnt_perror.c +++ b/lib/libc/rpc/clnt_perror.c @@ -29,7 +29,7 @@ * @(#)clnt_perror.c 1.15 87/10/07 Copyr 1984 Sun Micro * @(#)clnt_perror.c 2.1 88/07/29 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/clnt_perror.c,v 1.11.2.1 2000/08/23 00:02:04 jhb Exp $ - * $DragonFly: src/lib/libc/rpc/clnt_perror.c,v 1.4 2004/11/16 18:55:45 liamfoy Exp $ + * $DragonFly: src/lib/libc/rpc/clnt_perror.c,v 1.5 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -52,7 +52,7 @@ static char *auth_errmsg(); static char *buf; static char * -_buf() +_buf(void) { if (buf == 0) @@ -64,9 +64,7 @@ _buf() * Print reply error info */ char * -clnt_sperror(rpch, s) - CLIENT *rpch; - const char *s; +clnt_sperror(CLIENT *rpch, const char *s) { struct rpc_err e; char *err; @@ -77,7 +75,7 @@ clnt_sperror(rpch, s) return (0); CLNT_GETERR(rpch, &e); - (void) snprintf(str, CLNT_PERROR_BUFLEN, "%s: %s", s, clnt_sperrno(e.re_status)); + snprintf(str, CLNT_PERROR_BUFLEN, "%s: %s", s, clnt_sperrno(e.re_status)); str += strlen(str); switch (e.re_status) { @@ -98,37 +96,37 @@ clnt_sperror(rpch, s) case RPC_CANTSEND: case RPC_CANTRECV: - (void) snprintf(str, CLNT_PERROR_BUFLEN - (str - strstart), + snprintf(str, CLNT_PERROR_BUFLEN - (str - strstart), "; errno = %s\n", strerror(e.re_errno)); break; case RPC_VERSMISMATCH: - (void) sprintf(str, + sprintf(str, "; low version = %lu, high version = %lu\n", (u_long)e.re_vers.low, (u_long)e.re_vers.high); break; case RPC_AUTHERROR: err = auth_errmsg(e.re_why); - (void) sprintf(str,"; why = "); + sprintf(str,"; why = "); str += strlen(str); if (err != NULL) { - (void) sprintf(str, "%s\n",err); + sprintf(str, "%s\n",err); } else { - (void) sprintf(str, + sprintf(str, "(unknown authentication error - %d)\n", (int) e.re_why); } break; case RPC_PROGVERSMISMATCH: - (void) sprintf(str, + sprintf(str, "; low version = %lu, high version = %lu\n", (u_long)e.re_vers.low, (u_long)e.re_vers.high); break; default: /* unknown */ - (void) sprintf(str, + sprintf(str, "; s1 = %lu, s2 = %lu\n", (long)e.re_lb.s1, (long)e.re_lb.s2); break; @@ -141,11 +139,9 @@ clnt_sperror(rpch, s) } void -clnt_perror(rpch, s) - CLIENT *rpch; - const char *s; +clnt_perror(CLIENT *rpch, const char *s) { - (void) fprintf(stderr,"%s\n",clnt_sperror(rpch,s)); + fprintf(stderr,"%s\n",clnt_sperror(rpch,s)); } @@ -175,8 +171,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; @@ -187,16 +182,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)); + fprintf(stderr,"%s\n",clnt_sperrno(num)); } char * -clnt_spcreateerror(s) - const char *s; +clnt_spcreateerror(const char *s) { char *str = _buf(); @@ -204,18 +197,18 @@ clnt_spcreateerror(s) return(0); switch (rpc_createerr.cf_stat) { case RPC_PMAPFAILURE: - (void) snprintf(str, CLNT_PERROR_BUFLEN, "%s: %s - %s\n", s, + snprintf(str, CLNT_PERROR_BUFLEN, "%s: %s - %s\n", s, clnt_sperrno(rpc_createerr.cf_stat), clnt_sperrno(rpc_createerr.cf_error.re_status)); break; case RPC_SYSTEMERROR: - (void) snprintf(str, CLNT_PERROR_BUFLEN, "%s: %s - %s\n", s, + snprintf(str, CLNT_PERROR_BUFLEN, "%s: %s - %s\n", s, clnt_sperrno(rpc_createerr.cf_stat), strerror(rpc_createerr.cf_error.re_errno)); break; default: - (void) snprintf(str, CLNT_PERROR_BUFLEN, "%s: %s\n", s, + snprintf(str, CLNT_PERROR_BUFLEN, "%s: %s\n", s, clnt_sperrno(rpc_createerr.cf_stat)); break; } @@ -225,10 +218,9 @@ clnt_spcreateerror(s) } void -clnt_pcreateerror(s) - const char *s; +clnt_pcreateerror(const char *s) { - (void) fprintf(stderr,"%s\n",clnt_spcreateerror(s)); + fprintf(stderr,"%s\n",clnt_spcreateerror(s)); } static const char *const auth_errlist[] = { @@ -243,8 +235,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 61e4ed50e2..6d0a86e92c 100644 --- a/lib/libc/rpc/clnt_raw.c +++ b/lib/libc/rpc/clnt_raw.c @@ -29,7 +29,7 @@ * @(#)clnt_raw.c 1.22 87/08/11 Copyr 1984 Sun Micro * @(#)clnt_raw.c 2.2 88/08/01 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/clnt_raw.c,v 1.10 1999/08/28 00:00:36 peter Exp $ - * $DragonFly: src/lib/libc/rpc/clnt_raw.c,v 1.3 2004/10/25 19:38:01 drhodus Exp $ + * $DragonFly: src/lib/libc/rpc/clnt_raw.c,v 1.4 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -82,9 +82,7 @@ void svc_getreq(); * 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; @@ -125,14 +123,8 @@ clntraw_create(prog, vers) } 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 = &clp->xdr_stream; @@ -155,7 +147,7 @@ call_again: (! (*xargs)(xdrs, argsp))) { return (RPC_CANTENCODEARGS); } - (void)XDR_GETPOS(xdrs); /* called just to cause overhead */ + XDR_GETPOS(xdrs); /* called just to cause overhead */ /* * We have to call server input routine here because this is @@ -192,7 +184,7 @@ call_again: } if (msg.acpted_rply.ar_verf.oa_base != NULL) { xdrs->x_op = XDR_FREE; - (void)xdr_opaque_auth(xdrs, &(msg.acpted_rply.ar_verf)); + xdr_opaque_auth(xdrs, &(msg.acpted_rply.ar_verf)); } } @@ -200,16 +192,13 @@ call_again: } static void -clntraw_geterr() +clntraw_geterr(void) { } 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 = &clp->xdr_stream; @@ -225,17 +214,17 @@ clntraw_freeres(cl, xdr_res, res_ptr) } static void -clntraw_abort() +clntraw_abort(void) { } static bool_t -clntraw_control() +clntraw_control(void) { return (FALSE); } static void -clntraw_destroy() +clntraw_destroy(void) { } diff --git a/lib/libc/rpc/clnt_simple.c b/lib/libc/rpc/clnt_simple.c index 750add4707..31da1bb199 100644 --- a/lib/libc/rpc/clnt_simple.c +++ b/lib/libc/rpc/clnt_simple.c @@ -29,7 +29,7 @@ * @(#)clnt_simple.c 1.35 87/08/11 Copyr 1984 Sun Micro * @(#)clnt_simple.c 2.2 88/08/01 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/clnt_simple.c,v 1.12 2000/01/27 23:06:35 jasone Exp $ - * $DragonFly: src/lib/libc/rpc/clnt_simple.c,v 1.4 2005/01/31 22:29:38 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/clnt_simple.c,v 1.5 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -58,11 +58,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 *crp = callrpc_private; struct sockaddr_in server_addr; @@ -87,7 +84,7 @@ callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out) } else { crp->valid = 0; if (crp->socket != -1) - (void)_close(crp->socket); + _close(crp->socket); crp->socket = RPC_ANYSOCK; if (crp->client) { clnt_destroy(crp->client); @@ -108,7 +105,7 @@ callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out) crp->valid = 1; crp->oldprognum = prognum; crp->oldversnum = versnum; - (void) strcpy(crp->oldhost, host); + strcpy(crp->oldhost, host); } tottimeout.tv_sec = 25; tottimeout.tv_usec = 0; diff --git a/lib/libc/rpc/clnt_tcp.c b/lib/libc/rpc/clnt_tcp.c index 657bad3883..dc589c6d84 100644 --- a/lib/libc/rpc/clnt_tcp.c +++ b/lib/libc/rpc/clnt_tcp.c @@ -29,7 +29,7 @@ * @(#)clnt_tcp.c 1.37 87/10/05 Copyr 1984 Sun Micro * @(#)clnt_tcp.c 2.2 88/08/01 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/clnt_tcp.c,v 1.14 2000/01/27 23:06:36 jasone Exp $ - * $DragonFly: src/lib/libc/rpc/clnt_tcp.c,v 1.4 2005/01/31 22:29:38 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/clnt_tcp.c,v 1.5 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -111,13 +111,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; @@ -130,14 +125,14 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz) h = (CLIENT *)mem_alloc(sizeof(*h)); if (h == NULL) { - (void)fprintf(stderr, "clnttcp_create: out of memory\n"); + fprintf(stderr, "clnttcp_create: out of memory\n"); rpc_createerr.cf_stat = RPC_SYSTEMERROR; rpc_createerr.cf_error.re_errno = errno; goto fooy; } ct = (struct ct_data *)mem_alloc(sizeof(*ct)); if (ct == NULL) { - (void)fprintf(stderr, "clnttcp_create: out of memory\n"); + fprintf(stderr, "clnttcp_create: out of memory\n"); rpc_createerr.cf_stat = RPC_SYSTEMERROR; rpc_createerr.cf_error.re_errno = errno; goto fooy; @@ -161,14 +156,14 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz) */ if (*sockp < 0) { *sockp = _socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - (void)bindresvport(*sockp, (struct sockaddr_in *)0); + bindresvport(*sockp, (struct sockaddr_in *)0); if ((*sockp < 0) || (_connect(*sockp, (struct sockaddr *)raddr, sizeof(*raddr)) < 0)) { rpc_createerr.cf_stat = RPC_SYSTEMERROR; rpc_createerr.cf_error.re_errno = errno; if (*sockp != -1) - (void)_close(*sockp); + _close(*sockp); goto fooy; } ct->ct_closeit = TRUE; @@ -187,7 +182,7 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz) /* * Initialize call message */ - (void)gettimeofday(&now, (struct timezone *)0); + gettimeofday(&now, (struct timezone *)0); call_msg.rm_xid = (++disrupt) ^ getpid() ^ now.tv_sec ^ now.tv_usec; call_msg.rm_direction = CALL; call_msg.rm_call.cb_rpcvers = RPC_MSG_VERSION; @@ -201,7 +196,7 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz) XDR_ENCODE); if (! xdr_callhdr(&(ct->ct_xdrs), &call_msg)) { if (ct->ct_closeit) { - (void)_close(*sockp); + _close(*sockp); } goto fooy; } @@ -231,14 +226,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); @@ -266,7 +255,7 @@ call_again: (! (*xdr_args)(xdrs, args_ptr))) { if (ct->ct_error.re_status == RPC_SUCCESS) ct->ct_error.re_status = RPC_CANTENCODEARGS; - (void)xdrrec_endofrecord(xdrs, TRUE); + xdrrec_endofrecord(xdrs, TRUE); return (ct->ct_error.re_status); } if (! xdrrec_endofrecord(xdrs, shipnow)) @@ -316,7 +305,7 @@ call_again: /* free verifier ... */ if (reply_msg.acpted_rply.ar_verf.oa_base != NULL) { xdrs->x_op = XDR_FREE; - (void)xdr_opaque_auth(xdrs, &(reply_msg.acpted_rply.ar_verf)); + xdr_opaque_auth(xdrs, &(reply_msg.acpted_rply.ar_verf)); } } /* end successful completion */ else { @@ -328,9 +317,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; @@ -339,10 +326,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); @@ -352,16 +336,13 @@ clnttcp_freeres(cl, xdr_res, res_ptr) } static void -clnttcp_abort() +clnttcp_abort(void) { } static bool_t -clnttcp_control(cl, request, info) - CLIENT *cl; - int request; - char *info; +clnttcp_control(CLIENT *cl, int request, char *info) { struct ct_data *ct = (struct ct_data *)cl->cl_private; struct timeval *tv; @@ -468,14 +449,13 @@ 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; if (ct->ct_closeit) { - (void)_close(ct->ct_sock); + _close(ct->ct_sock); } XDR_DESTROY(&(ct->ct_xdrs)); mem_free((caddr_t)ct, sizeof(struct ct_data)); @@ -488,10 +468,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) { fd_set *fds, readfds; struct timeval start, after, duration, delta, tmp, tv; @@ -563,10 +540,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 f98fb12eab..3cec09633d 100644 --- a/lib/libc/rpc/clnt_udp.c +++ b/lib/libc/rpc/clnt_udp.c @@ -29,7 +29,7 @@ * @(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro * @(#)clnt_udp.c 2.2 88/08/01 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/clnt_udp.c,v 1.15.2.1 2001/06/28 21:44:24 iedowse Exp $ - * $DragonFly: src/lib/libc/rpc/clnt_udp.c,v 1.4 2005/01/31 22:29:38 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/clnt_udp.c,v 1.5 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -108,14 +108,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; @@ -128,7 +122,7 @@ clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz) cl = (CLIENT *)mem_alloc(sizeof(CLIENT)); if (cl == NULL) { - (void) fprintf(stderr, "clntudp_create: out of memory\n"); + fprintf(stderr, "clntudp_create: out of memory\n"); rpc_createerr.cf_stat = RPC_SYSTEMERROR; rpc_createerr.cf_error.re_errno = errno; goto fooy; @@ -137,14 +131,14 @@ clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz) recvsz = ((recvsz + 3) / 4) * 4; cu = (struct cu_data *)mem_alloc(sizeof(*cu) + sendsz + recvsz); if (cu == NULL) { - (void) fprintf(stderr, "clntudp_create: out of memory\n"); + fprintf(stderr, "clntudp_create: out of memory\n"); rpc_createerr.cf_stat = RPC_SYSTEMERROR; rpc_createerr.cf_error.re_errno = errno; goto fooy; } cu->cu_outbuf = &cu->cu_inbuf[recvsz]; - (void)gettimeofday(&now, (struct timezone *)0); + gettimeofday(&now, (struct timezone *)0); if (raddr->sin_port == 0) { u_short port; if ((port = @@ -185,9 +179,9 @@ clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz) goto fooy; } /* attempt to bind to priv port */ - (void)bindresvport(*sockp, (struct sockaddr_in *)0); + bindresvport(*sockp, (struct sockaddr_in *)0); /* the sockets rpc controls are non-blocking */ - (void)_ioctl(*sockp, FIONBIO, (char *) &dontblock); + _ioctl(*sockp, FIONBIO, (char *) &dontblock); cu->cu_closeit = TRUE; } else { cu->cu_closeit = FALSE; @@ -204,12 +198,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, @@ -217,14 +207,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; @@ -393,7 +382,7 @@ send_again: } if (reply_msg.acpted_rply.ar_verf.oa_base != NULL) { xdrs->x_op = XDR_FREE; - (void)xdr_opaque_auth(xdrs, + xdr_opaque_auth(xdrs, &(reply_msg.acpted_rply.ar_verf)); } } /* end successful completion */ @@ -428,9 +417,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; @@ -439,10 +426,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); @@ -452,17 +436,13 @@ clntudp_freeres(cl, xdr_res, res_ptr) } static void -clntudp_abort(/*h*/) - /*CLIENT *h;*/ +clntudp_abort(void) /* CLIENT *h */ { } static bool_t -clntudp_control(cl, request, info) - CLIENT *cl; - int request; - char *info; +clntudp_control(CLIENT *cl, int request, char *info) { struct cu_data *cu = (struct cu_data *)cl->cl_private; struct timeval *tv; @@ -580,13 +560,12 @@ clntudp_control(cl, request, info) } static void -clntudp_destroy(cl) - CLIENT *cl; +clntudp_destroy(CLIENT *cl) { struct cu_data *cu = (struct cu_data *)cl->cl_private; if (cu->cu_closeit) { - (void)_close(cu->cu_sock); + _close(cu->cu_sock); } XDR_DESTROY(&(cu->cu_outxdrs)); mem_free((caddr_t)cu, (sizeof(*cu) + cu->cu_sendsz + cu->cu_recvsz)); diff --git a/lib/libc/rpc/clnt_unix.c b/lib/libc/rpc/clnt_unix.c index 6bef9e9214..06c2890b55 100644 --- a/lib/libc/rpc/clnt_unix.c +++ b/lib/libc/rpc/clnt_unix.c @@ -29,7 +29,7 @@ * @(#)clnt_unix.c 1.37 87/10/05 Copyr 1984 Sun Micro * @(#)clnt_unix.c 2.2 88/08/01 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/clnt_unix.c,v 1.5 2000/01/27 23:06:37 jasone Exp $ - * $DragonFly: src/lib/libc/rpc/clnt_unix.c,v 1.4 2005/01/31 22:29:38 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/clnt_unix.c,v 1.5 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -113,13 +113,8 @@ struct ct_data { * something more useful. */ CLIENT * -clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz) - struct sockaddr_un *raddr; - u_long prog; - u_long vers; - int *sockp; - u_int sendsz; - u_int recvsz; +clntunix_create(struct sockaddr_un *raddr, u_long prog, u_long vers, int *sockp, + u_int sendsz, u_int recvsz) { CLIENT *h; struct ct_data *ct = NULL; @@ -133,14 +128,14 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz) h = (CLIENT *)mem_alloc(sizeof(*h)); if (h == NULL) { - (void)fprintf(stderr, "clntunix_create: out of memory\n"); + fprintf(stderr, "clntunix_create: out of memory\n"); rpc_createerr.cf_stat = RPC_SYSTEMERROR; rpc_createerr.cf_error.re_errno = errno; goto fooy; } ct = (struct ct_data *)mem_alloc(sizeof(*ct)); if (ct == NULL) { - (void)fprintf(stderr, "clntunix_create: out of memory\n"); + fprintf(stderr, "clntunix_create: out of memory\n"); rpc_createerr.cf_stat = RPC_SYSTEMERROR; rpc_createerr.cf_error.re_errno = errno; goto fooy; @@ -159,7 +154,7 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz) rpc_createerr.cf_stat = RPC_SYSTEMERROR; rpc_createerr.cf_error.re_errno = errno; if (*sockp != -1) - (void)_close(*sockp); + _close(*sockp); goto fooy; } ct->ct_closeit = TRUE; @@ -178,7 +173,7 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz) /* * Initialize call message */ - (void)gettimeofday(&now, (struct timezone *)0); + gettimeofday(&now, (struct timezone *)0); call_msg.rm_xid = (++disrupt) ^ getpid() ^ now.tv_sec ^ now.tv_usec; call_msg.rm_direction = CALL; call_msg.rm_call.cb_rpcvers = RPC_MSG_VERSION; @@ -192,7 +187,7 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz) XDR_ENCODE); if (! xdr_callhdr(&(ct->ct_xdrs), &call_msg)) { if (ct->ct_closeit) { - (void)_close(*sockp); + _close(*sockp); } goto fooy; } @@ -222,14 +217,9 @@ fooy: } static enum clnt_stat -clntunix_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; +clntunix_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); @@ -257,7 +247,7 @@ call_again: (! (*xdr_args)(xdrs, args_ptr))) { if (ct->ct_error.re_status == RPC_SUCCESS) ct->ct_error.re_status = RPC_CANTENCODEARGS; - (void)xdrrec_endofrecord(xdrs, TRUE); + xdrrec_endofrecord(xdrs, TRUE); return (ct->ct_error.re_status); } if (! xdrrec_endofrecord(xdrs, shipnow)) @@ -307,7 +297,7 @@ call_again: /* free verifier ... */ if (reply_msg.acpted_rply.ar_verf.oa_base != NULL) { xdrs->x_op = XDR_FREE; - (void)xdr_opaque_auth(xdrs, &(reply_msg.acpted_rply.ar_verf)); + xdr_opaque_auth(xdrs, &(reply_msg.acpted_rply.ar_verf)); } } /* end successful completion */ else { @@ -319,9 +309,7 @@ call_again: } static void -clntunix_geterr(h, errp) - CLIENT *h; - struct rpc_err *errp; +clntunix_geterr(CLIENT *h, struct rpc_err *errp) { struct ct_data *ct = (struct ct_data *) h->cl_private; @@ -330,10 +318,7 @@ clntunix_geterr(h, errp) } static bool_t -clntunix_freeres(cl, xdr_res, res_ptr) - CLIENT *cl; - xdrproc_t xdr_res; - caddr_t res_ptr; +clntunix_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); @@ -343,16 +328,13 @@ clntunix_freeres(cl, xdr_res, res_ptr) } static void -clntunix_abort() +clntunix_abort(void) { } static bool_t -clntunix_control(cl, request, info) - CLIENT *cl; - int request; - char *info; +clntunix_control(CLIENT *cl, int request, char *info) { struct ct_data *ct = (struct ct_data *)cl->cl_private; struct timeval *tv; @@ -459,14 +441,13 @@ clntunix_control(cl, request, info) static void -clntunix_destroy(h) - CLIENT *h; +clntunix_destroy(CLIENT *h) { struct ct_data *ct = (struct ct_data *) h->cl_private; if (ct->ct_closeit) { - (void)_close(ct->ct_sock); + _close(ct->ct_sock); } XDR_DESTROY(&(ct->ct_xdrs)); mem_free((caddr_t)ct, sizeof(struct ct_data)); @@ -485,10 +466,8 @@ struct cmessage { struct cmsgcred cmcred; }; -static int __msgread(sock, buf, cnt) - int sock; - void *buf; - size_t cnt; +static int +__msgread(int sock, void *buf, size_t cnt) { struct iovec iov[1]; struct msghdr msg; @@ -509,10 +488,8 @@ static int __msgread(sock, buf, cnt) return(_recvmsg(sock, &msg, 0)); } -static int __msgwrite(sock, buf, cnt) - int sock; - void *buf; - size_t cnt; +static int +__msgwrite(int sock, void *buf, size_t cnt) { struct iovec iov[1]; struct msghdr msg; @@ -543,10 +520,7 @@ static int __msgwrite(sock, buf, cnt) * around for the rpc level. */ static int -readunix(ct, buf, len) - struct ct_data *ct; - caddr_t buf; - int len; +readunix(struct ct_data *ct, caddr_t buf, int len) { fd_set *fds, readfds; struct timeval start, after, duration, delta, tmp, tv; @@ -618,10 +592,7 @@ readunix(ct, buf, len) } static int -writeunix(ct, buf, len) - struct ct_data *ct; - caddr_t buf; - int len; +writeunix(struct ct_data *ct, caddr_t buf, int len) { int i, cnt; diff --git a/lib/libc/rpc/crypt_client.c b/lib/libc/rpc/crypt_client.c index 046a22fb4b..11a5065f59 100644 --- a/lib/libc/rpc/crypt_client.c +++ b/lib/libc/rpc/crypt_client.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/rpc/crypt_client.c,v 1.4 1999/08/28 00:00:37 peter Exp $ - * $DragonFly: src/lib/libc/rpc/crypt_client.c,v 1.2 2003/06/17 04:26:44 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/crypt_client.c,v 1.3 2005/11/13 12:27:04 swildner Exp $ * * $FreeBSD: src/lib/libc/rpc/crypt_client.c,v 1.4 1999/08/28 00:00:37 peter Exp $ */ @@ -46,10 +46,7 @@ #endif int -_des_crypt_call(buf, len, dparms) - char *buf; - int len; - struct desparams *dparms; +_des_crypt_call(char *buf, int len, struct desparams *dparms) { CLIENT *clnt; desresp *result_1; diff --git a/lib/libc/rpc/des_crypt.c b/lib/libc/rpc/des_crypt.c index 92eac78c8f..a539712f5d 100644 --- a/lib/libc/rpc/des_crypt.c +++ b/lib/libc/rpc/des_crypt.c @@ -28,7 +28,7 @@ * * @(#)des_crypt.c 2.2 88/08/10 4.0 RPCSRC; from 1.13 88/02/08 SMI * $FreeBSD: src/lib/libc/rpc/des_crypt.c,v 1.3 1999/08/28 00:00:38 peter Exp $ - * $DragonFly: src/lib/libc/rpc/des_crypt.c,v 1.4 2004/10/25 19:38:01 drhodus Exp $ + * $DragonFly: src/lib/libc/rpc/des_crypt.c,v 1.5 2005/11/13 12:27:04 swildner Exp $ */ /* * des_crypt.c, DES encryption library routines @@ -69,12 +69,7 @@ extern _des_crypt_call ( char *, int, struct desparams * ); * CBC mode encryption */ int -cbc_crypt(key, buf, len, mode, ivec) - char *key; - char *buf; - unsigned len; - unsigned mode; - char *ivec; +cbc_crypt(char *key, char *buf, unsigned len, unsigned mode, char *ivec) { int err; struct desparams dp; @@ -96,11 +91,7 @@ cbc_crypt(key, buf, len, mode, ivec) * ECB mode encryption */ int -ecb_crypt(key, buf, len, mode) - char *key; - char *buf; - unsigned len; - unsigned mode; +ecb_crypt(char *key, char *buf, unsigned len, unsigned mode) { struct desparams dp; @@ -119,12 +110,8 @@ ecb_crypt(key, buf, len, mode) * Common code to cbc_crypt() & ecb_crypt() */ static int -common_crypt(key, buf, len, mode, desp) - char *key; - char *buf; - unsigned len; - unsigned mode; - struct desparams *desp; +common_crypt(char *key, char *buf, unsigned len, unsigned mode, + struct desparams *desp) { int desdev; diff --git a/lib/libc/rpc/des_soft.c b/lib/libc/rpc/des_soft.c index 01dd7f280b..c27d2d6eda 100644 --- a/lib/libc/rpc/des_soft.c +++ b/lib/libc/rpc/des_soft.c @@ -28,6 +28,8 @@ static char sccsid[] = "@(#)des_soft.c 2.2 88/08/10 4.0 RPCSRC; from 1.13 88/02/ * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 + * + * $DragonFly: src/lib/libc/rpc/des_soft.c,v 1.2 2005/11/13 12:27:04 swildner Exp $ */ /* * Table giving odd parity in the low bit for ASCII characters @@ -55,8 +57,7 @@ static char partab[128] = { * Add odd parity to low bit of 8 byte key */ void -des_setparity(p) - char *p; +des_setparity(char *p) { int i; diff --git a/lib/libc/rpc/get_myaddress.c b/lib/libc/rpc/get_myaddress.c index f4a6bb0271..8a6f856e7f 100644 --- a/lib/libc/rpc/get_myaddress.c +++ b/lib/libc/rpc/get_myaddress.c @@ -29,7 +29,7 @@ * @(#)get_myaddress.c 1.4 87/08/11 Copyr 1984 Sun Micro * @(#)get_myaddress.c 2.1 88/07/29 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/get_myaddress.c,v 1.18.2.1 2003/01/01 23:55:34 jdp Exp $ - * $DragonFly: src/lib/libc/rpc/get_myaddress.c,v 1.3 2005/01/31 22:29:38 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/get_myaddress.c,v 1.4 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -59,8 +59,7 @@ * interface only if there are no other possible interfaces. */ int -get_myaddress(addr) - struct sockaddr_in *addr; +get_myaddress(struct sockaddr_in *addr) { int s; char buf[BUFSIZ]; @@ -110,6 +109,6 @@ again: loopback = 1; goto again; } - (void)_close(s); + _close(s); return (gotit ? 0 : -1); } diff --git a/lib/libc/rpc/getpublickey.c b/lib/libc/rpc/getpublickey.c index 8bb8d8665a..0677a9e45d 100644 --- a/lib/libc/rpc/getpublickey.c +++ b/lib/libc/rpc/getpublickey.c @@ -28,7 +28,7 @@ * Mountain View, California 94043 * * $FreeBSD: src/lib/libc/rpc/getpublickey.c,v 1.2.6.1 2000/09/20 04:43:11 jkh Exp $ - * $DragonFly: src/lib/libc/rpc/getpublickey.c,v 1.2 2003/06/17 04:26:44 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/getpublickey.c,v 1.3 2005/11/13 12:27:04 swildner Exp $ * * @(#)publickey.c 1.10 91/03/11 Copyr 1986 Sun Micro */ @@ -61,9 +61,7 @@ int (*__getpublickey_LOCAL)() = 0; * Get somebody's public key */ int -__getpublickey_real(netname, publickey) - char *netname; - char *publickey; +__getpublickey_real(char *netname, char *publickey) { char lookup[3 * HEXKEYBYTES]; char *p; @@ -77,7 +75,7 @@ __getpublickey_real(netname, publickey) return (0); } *p = '\0'; - (void) strncpy(publickey, lookup, HEXKEYBYTES); + strncpy(publickey, lookup, HEXKEYBYTES); publickey[HEXKEYBYTES] = '\0'; return (1); } @@ -88,9 +86,7 @@ __getpublickey_real(netname, publickey) */ int -getpublicandprivatekey(key, ret) - char *key; - char *ret; +getpublicandprivatekey(char *key, char *ret) { char buf[1024]; /* big enough */ char *res; @@ -165,9 +161,8 @@ getpublicandprivatekey(key, ret) } } -int getpublickey(netname, publickey) - char *netname; - char *publickey; +int +getpublickey(char *netname, char *publickey) { if (__getpublickey_LOCAL != NULL) return(__getpublickey_LOCAL(netname, publickey)); diff --git a/lib/libc/rpc/getrpcent.c b/lib/libc/rpc/getrpcent.c index a8dbe0430b..c5c6eb49c4 100644 --- a/lib/libc/rpc/getrpcent.c +++ b/lib/libc/rpc/getrpcent.c @@ -29,7 +29,7 @@ * * @(#)getrpcent.c 1.14 91/03/11 Copyr 1984 Sun Micro * $FreeBSD: src/lib/libc/rpc/getrpcent.c,v 1.10 1999/08/28 00:00:39 peter Exp $ - * $DragonFly: src/lib/libc/rpc/getrpcent.c,v 1.3 2004/10/25 19:38:01 drhodus Exp $ + * $DragonFly: src/lib/libc/rpc/getrpcent.c,v 1.4 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -75,7 +75,7 @@ char *inet_ntoa(); static char RPCDB[] = "/etc/rpc"; static struct rpcdata * -_rpcdata() +_rpcdata(void) { struct rpcdata *d = rpcdata; @@ -87,8 +87,7 @@ _rpcdata() } struct rpcent * -getrpcbynumber(number) - int number; +getrpcbynumber(int number) { struct rpcdata *d = _rpcdata(); struct rpcent *p; @@ -117,7 +116,7 @@ getrpcbynumber(number) } d->current[d->currentlen] = '\0'; p = interpret(d->current, d->currentlen); - (void) free(d->current); + free(d->current); return p; } no_yp: @@ -132,8 +131,7 @@ no_yp: } struct rpcent * -getrpcbyname(name) - char *name; +getrpcbyname(char *name) { struct rpcent *rpc = NULL; char **rp; @@ -153,8 +151,7 @@ done: } void -setrpcent(f) - int f; +setrpcent(int f) { struct rpcdata *d = _rpcdata(); @@ -178,7 +175,7 @@ setrpcent(f) } void -endrpcent() +endrpcent(void) { struct rpcdata *d = _rpcdata(); @@ -201,7 +198,7 @@ endrpcent() } struct rpcent * -getrpcent() +getrpcent(void) { struct rpcdata *d = _rpcdata(); #ifdef YP @@ -238,7 +235,7 @@ getrpcent() } val[vallen] = '\0'; hp = interpret(val, vallen); - (void) free(val); + free(val); return hp; } no_yp: @@ -252,9 +249,7 @@ no_yp: } static struct rpcent * -interpret(val, len) - char *val; - int len; +interpret(char *val, int len) { struct rpcdata *d = _rpcdata(); char *p; @@ -262,7 +257,7 @@ interpret(val, len) if (d == 0) return (0); - (void) strncpy(d->line, val, BUFSIZ); + strncpy(d->line, val, BUFSIZ); d->line[BUFSIZ] = '\0'; p = d->line; p[len] = '\n'; diff --git a/lib/libc/rpc/getrpcport.c b/lib/libc/rpc/getrpcport.c index 5cf4866eb1..377faadce9 100644 --- a/lib/libc/rpc/getrpcport.c +++ b/lib/libc/rpc/getrpcport.c @@ -29,7 +29,7 @@ * @(#)getrpcport.c 1.3 87/08/11 SMI * @(#)getrpcport.c 2.1 88/07/29 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/getrpcport.c,v 1.10 1999/08/28 00:00:40 peter Exp $ - * $DragonFly: src/lib/libc/rpc/getrpcport.c,v 1.2 2003/06/17 04:26:45 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/getrpcport.c,v 1.3 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -44,9 +44,7 @@ #include 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/key_call.c b/lib/libc/rpc/key_call.c index 49b36dfb64..9409561bbb 100644 --- a/lib/libc/rpc/key_call.c +++ b/lib/libc/rpc/key_call.c @@ -30,7 +30,7 @@ * Copyright (c) 1986-1991 by Sun Microsystems Inc. * * $FreeBSD: src/lib/libc/rpc/key_call.c,v 1.3 2000/01/27 23:06:39 jasone Exp $ - * $DragonFly: src/lib/libc/rpc/key_call.c,v 1.5 2005/01/31 22:29:38 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/key_call.c,v 1.6 2005/11/13 12:27:04 swildner Exp $ */ #ident "@(#)key_call.c 1.25 94/04/24 SMI" @@ -66,7 +66,7 @@ #define KEY_NRETRY 12 /* number of retries */ #ifdef DEBUG -#define debug(msg) (void) fprintf(stderr, "%s\n", msg); +#define debug(msg) fprintf(stderr, "%s\n", msg); #else #define debug(msg) #endif /* DEBUG */ @@ -87,8 +87,7 @@ des_block *(*__key_gendes_LOCAL)() = 0; static int key_call ( u_long, xdrproc_t, char *, xdrproc_t, char * ); int -key_setsecret(secretkey) - const char *secretkey; +key_setsecret(const char *secretkey) { keystatus status; @@ -129,10 +128,7 @@ key_secretkey_is_set(void) } int -key_encryptsession_pk(remotename, remotekey, deskey) - char *remotename; - netobj *remotekey; - des_block *deskey; +key_encryptsession_pk(char *remotename, netobj *remotekey, des_block *deskey) { cryptkeyarg2 arg; cryptkeyres res; @@ -153,10 +149,7 @@ key_encryptsession_pk(remotename, remotekey, deskey) } int -key_decryptsession_pk(remotename, remotekey, deskey) - char *remotename; - netobj *remotekey; - des_block *deskey; +key_decryptsession_pk(char *remotename, netobj *remotekey, des_block *deskey) { cryptkeyarg2 arg; cryptkeyres res; @@ -177,9 +170,7 @@ key_decryptsession_pk(remotename, remotekey, deskey) } int -key_encryptsession(remotename, deskey) - const char *remotename; - des_block *deskey; +key_encryptsession(const char *remotename, des_block *deskey) { cryptkeyarg arg; cryptkeyres res; @@ -199,9 +190,7 @@ key_encryptsession(remotename, deskey) } int -key_decryptsession(remotename, deskey) - const char *remotename; - des_block *deskey; +key_decryptsession(const char *remotename, des_block *deskey) { cryptkeyarg arg; cryptkeyres res; @@ -221,8 +210,7 @@ key_decryptsession(remotename, deskey) } int -key_gendes(key) - des_block *key; +key_gendes(des_block *key) { if (!key_call((u_long)KEY_GEN, xdr_void, (char *)NULL, xdr_des_block, (char *)key)) { @@ -232,8 +220,7 @@ key_gendes(key) } int -key_setnet(arg) -struct netstarg *arg; +key_setnet(struct netstarg *arg) { keystatus status; @@ -252,9 +239,7 @@ struct netstarg *arg; int -key_get_conv(pkey, deskey) - char *pkey; - des_block *deskey; +key_get_conv(char *pkey, des_block *deskey) { cryptkeyres res; @@ -295,8 +280,7 @@ key_call_destroy(void *vp) * Keep the handle cached. This call may be made quite often. */ static CLIENT * -getkeyserv_handle(vers) -int vers; +getkeyserv_handle(int vers) { struct key_call_private *kcp = key_call_private_main; struct timeval wait_time; @@ -369,7 +353,7 @@ int vers; wait_time.tv_sec = TOTAL_TIMEOUT/TOTAL_TRIES; wait_time.tv_usec = 0; - (void) clnt_control(kcp->client, CLSET_RETRY_TIMEOUT, + clnt_control(kcp->client, CLSET_RETRY_TIMEOUT, (char *)&wait_time); if (clnt_control(kcp->client, CLGET_FD, (char *)&fd)) _fcntl(fd, F_SETFD, 1); /* make it "close on exec" */ @@ -380,12 +364,8 @@ int vers; /* returns 0 on failure, 1 on success */ static int -key_call(proc, xdr_arg, arg, xdr_rslt, rslt) - u_long proc; - xdrproc_t xdr_arg; - char *arg; - xdrproc_t xdr_rslt; - char *rslt; +key_call(u_long proc, xdrproc_t xdr_arg, char *arg, xdrproc_t xdr_rslt, + char *rslt) { CLIENT *clnt; struct timeval wait_time; diff --git a/lib/libc/rpc/netname.c b/lib/libc/rpc/netname.c index 259b96ff63..456465288e 100644 --- a/lib/libc/rpc/netname.c +++ b/lib/libc/rpc/netname.c @@ -28,7 +28,7 @@ * Mountain View, California 94043 * * $FreeBSD: src/lib/libc/rpc/netname.c,v 1.2.6.1 2000/08/23 00:05:29 jhb Exp $ - * $DragonFly: src/lib/libc/rpc/netname.c,v 1.2 2003/06/17 04:26:45 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/netname.c,v 1.3 2005/11/13 12:27:04 swildner Exp $ * * @(#)netname.c 1.8 91/03/11 Copyr 1986 Sun Micro */ @@ -81,8 +81,7 @@ static char *OPSYS = "unix"; * Figure out my fully qualified network name */ int -getnetname(name) - char name[MAXNETNAMELEN+1]; +getnetname(char *name) { uid_t uid; @@ -99,10 +98,7 @@ getnetname(name) * Convert unix cred to network-name */ int -user2netname(netname, uid, domain) - char netname[MAXNETNAMELEN + 1]; - uid_t uid; - char *domain; +user2netname(char *netname, uid_t uid, char *domain) { char *dfltdom; @@ -115,7 +111,7 @@ user2netname(netname, uid, domain) if (strlen(domain) + 1 + INT_STRLEN_MAXIMUM(u_long) + 1 + strlen(OPSYS) > MAXNETNAMELEN) { return (0); } - (void) sprintf(netname, "%s.%ld@%s", OPSYS, (u_long)uid, domain); + sprintf(netname, "%s.%ld@%s", OPSYS, (u_long)uid, domain); return (1); } @@ -124,10 +120,7 @@ user2netname(netname, uid, domain) * Convert host to network-name */ int -host2netname(netname, host, domain) - char netname[MAXNETNAMELEN + 1]; - char *host; - char *domain; +host2netname(char *netname, char *host, char *domain) { char *dfltdom; char hostname[MAXHOSTNAMELEN+1]; @@ -139,12 +132,12 @@ host2netname(netname, host, domain) domain = dfltdom; } if (host == NULL) { - (void) gethostname(hostname, sizeof(hostname)); + gethostname(hostname, sizeof(hostname)); host = hostname; } if (strlen(domain) + 1 + strlen(host) + 1 + strlen(OPSYS) > MAXNETNAMELEN) { return (0); } - (void) sprintf(netname, "%s.%s@%s", OPSYS, host, domain); + sprintf(netname, "%s.%s@%s", OPSYS, host, domain); return (1); } diff --git a/lib/libc/rpc/netnamer.c b/lib/libc/rpc/netnamer.c index e5b6a0f13b..4396918480 100644 --- a/lib/libc/rpc/netnamer.c +++ b/lib/libc/rpc/netnamer.c @@ -28,7 +28,7 @@ * Mountain View, California 94043 * * $FreeBSD: src/lib/libc/rpc/netnamer.c,v 1.3.6.1 2000/09/20 04:43:11 jkh Exp $ - * $DragonFly: src/lib/libc/rpc/netnamer.c,v 1.4 2004/10/25 19:38:01 drhodus Exp $ + * $DragonFly: src/lib/libc/rpc/netnamer.c,v 1.5 2005/11/13 12:27:04 swildner Exp $ * * @(#)netnamer.c 1.13 91/03/11 Copyr 1986 Sun Micro */ @@ -68,12 +68,8 @@ static int _getgroups ( char *, gid_t * ); * Convert network-name into unix credential */ int -netname2user(netname, uidp, gidp, gidlenp, gidlist) - char netname[MAXNETNAMELEN + 1]; - uid_t *uidp; - gid_t *gidp; - int *gidlenp; - gid_t *gidlist; +netname2user(char *netname, uid_t *uidp, gid_t *gidp, int *gidlenp, + gid_t *gidlist) { char *p; int gidlen; @@ -121,7 +117,7 @@ netname2user(netname, uidp, gidp, gidlenp, gidlist) vallen = val2 - val1; if (vallen > (1024 - 1)) vallen = 1024 - 1; - (void) strncpy(val, val1, 1024); + strncpy(val, val1, 1024); val[vallen] = 0; err = _rpc_get_default_domain(&domain); /* change to rpc */ @@ -150,9 +146,7 @@ netname2user(netname, uidp, gidp, gidlenp, gidlist) */ static int -_getgroups(uname, groups) - char *uname; - gid_t groups[NGROUPS]; +_getgroups(char *uname, gid_t *groups) { gid_t ngroups = 0; struct group *grp; @@ -191,10 +185,7 @@ toomany: * Convert network-name to hostname */ int -netname2host(netname, hostname, hostlen) - char netname[MAXNETNAMELEN + 1]; - char *hostname; - int hostlen; +netname2host(char *netname, char *hostname, int hostlen) { int err; char valbuf[1024]; @@ -206,7 +197,7 @@ netname2host(netname, hostname, hostlen) if (getnetid(netname, valbuf)) { val = valbuf; if ((*val == '0') && (val[1] == ':')) { - (void) strncpy(hostname, val + 2, hostlen); + strncpy(hostname, val + 2, hostlen); return (1); } } @@ -222,7 +213,7 @@ netname2host(netname, hostname, hostlen) vallen = val2 - val; if (vallen > (hostlen - 1)) vallen = hostlen - 1; - (void) strncpy(hostname, val, vallen); + strncpy(hostname, val, vallen); hostname[vallen] = 0; err = _rpc_get_default_domain(&domain); /* change to rpc */ @@ -240,8 +231,7 @@ netname2host(netname, hostname, hostlen) * network information service. */ int -getnetid(key, ret) - char *key, *ret; +getnetid(char *key, char *ret) { char buf[1024]; /* big enough */ char *res; diff --git a/lib/libc/rpc/pmap_clnt.c b/lib/libc/rpc/pmap_clnt.c index fad87fa926..dacaebb413 100644 --- a/lib/libc/rpc/pmap_clnt.c +++ b/lib/libc/rpc/pmap_clnt.c @@ -29,7 +29,7 @@ * @(#)pmap_clnt.c 1.37 87/08/11 Copyr 1984 Sun Micro * @(#)pmap_clnt.c 2.2 88/08/01 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/pmap_clnt.c,v 1.11 2000/01/27 23:06:39 jasone Exp $ - * $DragonFly: src/lib/libc/rpc/pmap_clnt.c,v 1.4 2005/01/31 22:29:38 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/pmap_clnt.c,v 1.5 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -63,11 +63,7 @@ void clnt_perror(); * Calls the pmap service remotely to do the mapping. */ bool_t -pmap_set(program, version, protocol, port) - u_long program; - u_long version; - int protocol; - u_short port; +pmap_set(u_long program, u_long version, int protocol, u_short port) { struct sockaddr_in myaddress; int socket = -1; @@ -103,7 +99,7 @@ pmap_set(program, version, protocol, port) } CLNT_DESTROY(client); if (socket != -1) - (void)_close(socket); + _close(socket); return (rslt); } @@ -112,9 +108,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 socket = -1; @@ -145,6 +139,6 @@ pmap_unset(program, version) tottimeout); CLNT_DESTROY(client); if (socket != -1) - (void)_close(socket); + _close(socket); return (rslt); } diff --git a/lib/libc/rpc/pmap_getmaps.c b/lib/libc/rpc/pmap_getmaps.c index 183e4f778c..f618a31836 100644 --- a/lib/libc/rpc/pmap_getmaps.c +++ b/lib/libc/rpc/pmap_getmaps.c @@ -29,7 +29,7 @@ * @(#)pmap_getmaps.c 1.10 87/08/11 Copyr 1984 Sun Micro * @(#)pmap_getmaps.c 2.2 88/08/01 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/pmap_getmaps.c,v 1.11 2000/01/27 23:06:39 jasone Exp $ - * $DragonFly: src/lib/libc/rpc/pmap_getmaps.c,v 1.4 2005/01/31 22:29:38 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/pmap_getmaps.c,v 1.5 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -61,8 +61,7 @@ * 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 = (struct pmaplist *)NULL; int socket = -1; @@ -82,7 +81,7 @@ pmap_getmaps(address) CLNT_DESTROY(client); } if (socket != -1) - (void)_close(socket); + _close(socket); address->sin_port = 0; return (head); } diff --git a/lib/libc/rpc/pmap_getport.c b/lib/libc/rpc/pmap_getport.c index 2cbbb4b0f6..71346db902 100644 --- a/lib/libc/rpc/pmap_getport.c +++ b/lib/libc/rpc/pmap_getport.c @@ -29,7 +29,7 @@ * @(#)pmap_getport.c 1.9 87/08/11 Copyr 1984 Sun Micro * @(#)pmap_getport.c 2.2 88/08/01 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/pmap_getport.c,v 1.10 2000/01/27 23:06:40 jasone Exp $ - * $DragonFly: src/lib/libc/rpc/pmap_getport.c,v 1.5 2005/01/31 22:29:38 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/pmap_getport.c,v 1.6 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -69,11 +69,8 @@ pmap_getport_timeout(struct timeval *otv, struct timeval *ntv) * 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 socket = -1; @@ -98,7 +95,7 @@ pmap_getport(address, program, version, protocol) CLNT_DESTROY(client); } if (socket != -1) - (void)_close(socket); + _close(socket); address->sin_port = 0; return (port); } diff --git a/lib/libc/rpc/pmap_prot.c b/lib/libc/rpc/pmap_prot.c index a677fcbcd2..0ab4da6189 100644 --- a/lib/libc/rpc/pmap_prot.c +++ b/lib/libc/rpc/pmap_prot.c @@ -29,7 +29,7 @@ * @(#)pmap_prot.c 1.17 87/08/11 Copyr 1984 Sun Micro * @(#)pmap_prot.c 2.1 88/07/29 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/pmap_prot.c,v 1.6 1999/08/28 00:00:42 peter Exp $ - * $DragonFly: src/lib/libc/rpc/pmap_prot.c,v 1.2 2003/06/17 04:26:45 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/pmap_prot.c,v 1.3 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -45,9 +45,7 @@ bool_t -xdr_pmap(xdrs, regs) - XDR *xdrs; - struct pmap *regs; +xdr_pmap(XDR *xdrs, struct pmap *regs) { if (xdr_u_long(xdrs, ®s->pm_prog) && diff --git a/lib/libc/rpc/pmap_prot2.c b/lib/libc/rpc/pmap_prot2.c index ad4ec31908..a7df93b104 100644 --- a/lib/libc/rpc/pmap_prot2.c +++ b/lib/libc/rpc/pmap_prot2.c @@ -29,7 +29,7 @@ * @(#)pmap_prot2.c 1.3 87/08/11 Copyr 1984 Sun Micro * @(#)pmap_prot2.c 2.1 88/07/29 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/pmap_prot2.c,v 1.7 1999/08/28 00:00:42 peter Exp $ - * $DragonFly: src/lib/libc/rpc/pmap_prot2.c,v 1.3 2004/10/25 19:38:02 drhodus Exp $ + * $DragonFly: src/lib/libc/rpc/pmap_prot2.c,v 1.4 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -83,9 +83,7 @@ * 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 2ab850aedf..e8ae0b2b08 100644 --- a/lib/libc/rpc/pmap_rmt.c +++ b/lib/libc/rpc/pmap_rmt.c @@ -29,7 +29,7 @@ * @(#)pmap_rmt.c 1.21 87/08/27 Copyr 1984 Sun Micro * @(#)pmap_rmt.c 2.2 88/08/01 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/pmap_rmt.c,v 1.16.2.1 2002/06/30 23:34:58 iedowse Exp $ - * $DragonFly: src/lib/libc/rpc/pmap_rmt.c,v 1.4 2005/01/31 22:29:38 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/pmap_rmt.c,v 1.5 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -68,13 +68,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 socket = -1; CLIENT *client; @@ -100,7 +96,7 @@ pmap_rmtcall(addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout, port_pt stat = RPC_FAILED; } if (socket != -1) - (void)_close(socket); + _close(socket); addr->sin_port = 0; return (stat); } @@ -111,9 +107,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; @@ -142,9 +136,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; @@ -165,10 +157,9 @@ xdr_rmtcallres(xdrs, crp) */ static int -getbroadcastnets(addrs, sock, buf) - struct in_addr *addrs; - int sock; /* any valid socket will do */ - char *buf; /* why allocxate more when we can use existing... */ +getbroadcastnets(struct in_addr *addrs, + int sock, /* any valid socket will do */ + char *buf) /* why allocxate more when we can use existing... */ { struct ifconf ifc; struct ifreq ifreq, *ifr; @@ -227,15 +218,14 @@ getbroadcastnets(addrs, sock, buf) 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(); @@ -296,7 +286,7 @@ clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) baddr.sin_family = AF_INET; baddr.sin_port = htons(PMAPPORT); baddr.sin_addr.s_addr = htonl(INADDR_ANY); - (void)gettimeofday(&t, (struct timezone *)0); + gettimeofday(&t, (struct timezone *)0); msg.rm_xid = xid = (++disrupt) ^ getpid() ^ t.tv_sec ^ t.tv_usec; t.tv_usec = 0; msg.rm_direction = CALL; @@ -400,8 +390,8 @@ clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) } xdrs->x_op = XDR_FREE; msg.acpted_rply.ar_results.proc = xdr_void; - (void)xdr_replymsg(xdrs, &msg); - (void)(*xresults)(xdrs, resultsp); + xdr_replymsg(xdrs, &msg); + (*xresults)(xdrs, resultsp); xdr_destroy(xdrs); if (done) { stat = RPC_SUCCESS; @@ -414,7 +404,7 @@ done_broad: if (fds != &readfds) free(fds); if (sock >= 0) - (void)_close(sock); + _close(sock); AUTH_DESTROY(unix_auth); return (stat); } diff --git a/lib/libc/rpc/rpc_callmsg.c b/lib/libc/rpc/rpc_callmsg.c index 23658cdfcd..969e3b57e0 100644 --- a/lib/libc/rpc/rpc_callmsg.c +++ b/lib/libc/rpc/rpc_callmsg.c @@ -29,7 +29,7 @@ * @(#)rpc_callmsg.c 1.4 87/08/11 Copyr 1984 Sun Micro * @(#)rpc_callmsg.c 2.1 88/07/29 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/rpc_callmsg.c,v 1.9 1999/08/28 00:00:45 peter Exp $ - * $DragonFly: src/lib/libc/rpc/rpc_callmsg.c,v 1.3 2004/10/25 19:38:02 drhodus Exp $ + * $DragonFly: src/lib/libc/rpc/rpc_callmsg.c,v 1.4 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -48,9 +48,7 @@ * 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_prot.c b/lib/libc/rpc/rpc_prot.c index c47b5c60f0..c09ee58280 100644 --- a/lib/libc/rpc/rpc_prot.c +++ b/lib/libc/rpc/rpc_prot.c @@ -29,7 +29,7 @@ * @(#)rpc_prot.c 1.36 87/08/11 Copyr 1984 Sun Micro * @(#)rpc_prot.c 2.3 88/08/07 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/rpc_prot.c,v 1.8 1999/08/28 00:00:46 peter Exp $ - * $DragonFly: src/lib/libc/rpc/rpc_prot.c,v 1.3 2004/10/25 19:38:02 drhodus Exp $ + * $DragonFly: src/lib/libc/rpc/rpc_prot.c,v 1.4 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -58,9 +58,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))) @@ -73,9 +71,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))); } @@ -86,9 +82,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 */ @@ -115,9 +109,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 */ @@ -145,9 +137,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)) && @@ -165,9 +155,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; @@ -185,9 +173,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) { @@ -223,9 +209,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) { @@ -250,9 +234,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/rpcdname.c b/lib/libc/rpc/rpcdname.c index 87535b7169..8d21ef56e4 100644 --- a/lib/libc/rpc/rpcdname.c +++ b/lib/libc/rpc/rpcdname.c @@ -28,6 +28,7 @@ * Mountain View, California 94043 * * @(#)rpcdname.c 1.7 91/03/11 Copyr 1989 Sun Micro + * $DragonFly: src/lib/libc/rpc/rpcdname.c,v 1.3 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -42,7 +43,7 @@ static char *default_domain = 0; static char * -get_default_domain() +get_default_domain(void) { char temp[256]; @@ -54,7 +55,7 @@ get_default_domain() default_domain = (char *)malloc((strlen(temp)+(unsigned)1)); if (default_domain == 0) return (0); - (void) strcpy(default_domain, temp); + strcpy(default_domain, temp); return (default_domain); } return (0); @@ -67,8 +68,7 @@ get_default_domain() * get rejected elsewhere in the NIS client package. */ int -_rpc_get_default_domain(domain) - char **domain; +_rpc_get_default_domain(char **domain) { if ((*domain = get_default_domain()) != 0) return (0); diff --git a/lib/libc/rpc/rtime.c b/lib/libc/rpc/rtime.c index 831888b895..d2bbe944f9 100644 --- a/lib/libc/rpc/rtime.c +++ b/lib/libc/rpc/rtime.c @@ -28,7 +28,7 @@ * * @(#)rtime.c 2.2 88/08/10 4.0 RPCSRC; from 1.8 88/02/08 SMI * $FreeBSD: src/lib/libc/rpc/rtime.c,v 1.5 2000/01/27 23:06:41 jasone Exp $ - * $DragonFly: src/lib/libc/rpc/rtime.c,v 1.4 2005/01/31 22:29:38 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/rtime.c,v 1.5 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -66,10 +66,7 @@ extern int _rpc_dtablesize ( void ); static void do_close ( int ); int -rtime(addrp, timep, timeout) - struct sockaddr_in *addrp; - struct timeval *timep; - struct timeval *timeout; +rtime(struct sockaddr_in *addrp, struct timeval *timep, struct timeval *timeout) { int s; fd_set readfds; @@ -147,12 +144,11 @@ rtime(addrp, timep, timeout) } static void -do_close(s) - int s; +do_close(int s) { int save; save = errno; - (void)_close(s); + _close(s); errno = save; } diff --git a/lib/libc/rpc/svc.c b/lib/libc/rpc/svc.c index e99110f027..d3fa95fe35 100644 --- a/lib/libc/rpc/svc.c +++ b/lib/libc/rpc/svc.c @@ -29,7 +29,7 @@ * @(#)svc.c 1.44 88/02/08 Copyr 1984 Sun Micro * @(#)svc.c 2.4 88/08/11 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/svc.c,v 1.14.2.1 2001/03/05 10:50:36 obrien Exp $ - * $DragonFly: src/lib/libc/rpc/svc.c,v 1.3 2004/10/25 19:38:02 drhodus Exp $ + * $DragonFly: src/lib/libc/rpc/svc.c,v 1.4 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -79,8 +79,7 @@ fd_set *__svc_fdset = NULL; * Activate a transport handle. */ void -xprt_register(xprt) - SVCXPRT *xprt; +xprt_register(SVCXPRT *xprt) { int sock = xprt->xp_sock; @@ -126,8 +125,7 @@ xprt_register(xprt) * De-activate a transport handle. */ void -xprt_unregister(xprt) - SVCXPRT *xprt; +xprt_unregister(SVCXPRT *xprt) { int sock = xprt->xp_sock; @@ -157,12 +155,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; @@ -193,9 +187,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; @@ -210,7 +202,7 @@ svc_unregister(prog, vers) s->sc_next = NULL_SVC; mem_free((char *) s, (u_int) sizeof(struct svc_callout)); /* now unregister the information with the local binder service */ - (void)pmap_unset(prog, vers); + pmap_unset(prog, vers); } /* @@ -218,10 +210,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; @@ -242,10 +231,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; @@ -262,8 +248,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; @@ -278,8 +263,7 @@ svcerr_noproc(xprt) * Can't decode args error reply */ void -svcerr_decode(xprt) - SVCXPRT *xprt; +svcerr_decode(SVCXPRT *xprt) { struct rpc_msg rply; @@ -294,8 +278,7 @@ svcerr_decode(xprt) * Some system error */ void -svcerr_systemerr(xprt) - SVCXPRT *xprt; +svcerr_systemerr(SVCXPRT *xprt) { struct rpc_msg rply; @@ -310,9 +293,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; @@ -327,8 +308,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); @@ -338,8 +318,7 @@ svcerr_weakauth(xprt) * Program unavailable error reply */ void -svcerr_noprog(xprt) - SVCXPRT *xprt; +svcerr_noprog(SVCXPRT *xprt) { struct rpc_msg rply; @@ -354,10 +333,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; @@ -389,8 +365,7 @@ svcerr_progvers(xprt, low_vers, high_vers) */ void -svc_getreq(rdfds) - int rdfds; +svc_getreq(int rdfds) { fd_set readfds; @@ -400,16 +375,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) { 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 10f717f520..d3bea32e77 100644 --- a/lib/libc/rpc/svc_auth.c +++ b/lib/libc/rpc/svc_auth.c @@ -28,7 +28,7 @@ * * @(#)svc_auth.c 1.26 89/02/07 Copyr 1984 Sun Micro * $FreeBSD: src/lib/libc/rpc/svc_auth.c,v 1.7 1999/12/29 05:04:16 peter Exp $ - * $DragonFly: src/lib/libc/rpc/svc_auth.c,v 1.3 2004/10/25 19:38:02 drhodus Exp $ + * $DragonFly: src/lib/libc/rpc/svc_auth.c,v 1.4 2005/11/13 12:27:04 swildner Exp $ */ /* * Copyright (c) 1986-1991 by Sun Microsystems Inc. @@ -103,9 +103,7 @@ static struct authsvc *Auths = NULL; * 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; struct authsvc *asp; @@ -150,9 +148,7 @@ _authenticate(rqst, msg) /*ARGSUSED*/ enum auth_stat -_svcauth_null(rqst, msg) - struct svc_req *rqst; - struct rpc_msg *msg; +_svcauth_null(struct svc_req *rqst, struct rpc_msg *msg) { return (AUTH_OK); } @@ -172,9 +168,7 @@ _svcauth_null(rqst, msg) */ int -svc_auth_reg(cred_flavor, handler) - int cred_flavor; - enum auth_stat (*handler)(); +svc_auth_reg(int cred_flavor, enum auth_stat (*handler)()) { struct authsvc *asp; diff --git a/lib/libc/rpc/svc_auth_des.c b/lib/libc/rpc/svc_auth_des.c index b1d699fe57..67f7401103 100644 --- a/lib/libc/rpc/svc_auth_des.c +++ b/lib/libc/rpc/svc_auth_des.c @@ -4,7 +4,7 @@ * * @(#)svcauth_des.c 2.3 89/07/11 4.0 RPCSRC; from 1.15 88/02/08 SMI * $FreeBSD: src/lib/libc/rpc/svc_auth_des.c,v 1.3 1999/08/28 00:00:48 peter Exp $ - * $DragonFly: src/lib/libc/rpc/svc_auth_des.c,v 1.5 2005/01/31 22:29:38 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/svc_auth_des.c,v 1.6 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -86,7 +86,7 @@ static short *authdes_lru/* [AUTHDES_CACHESZ] */; static void cache_init(); /* initialize the cache */ static short cache_spot(); /* find an entry in the cache */ -static void cache_ref(/*short sid*/); /* note that sid was ref'd */ +static void cache_ref(short sid); /* note that sid was ref'd */ static void invalidate(); /* invalidate entry in cache */ @@ -103,9 +103,7 @@ static struct { * Service side authenticator for AUTH_DES */ enum auth_stat -_svcauth_des(rqst, msg) - struct svc_req *rqst; - struct rpc_msg *msg; +_svcauth_des(struct svc_req *rqst, struct rpc_msg *msg) { long *ixdr; @@ -264,7 +262,7 @@ _svcauth_des(rqst, msg) debug("timestamp before last seen"); return (AUTH_REJECTEDVERF); /* replay */ } - (void) gettimeofday(¤t, (struct timezone *)NULL); + gettimeofday(¤t, (struct timezone *)NULL); current.tv_sec -= window; /* allow for expiration */ if (!BEFORE(¤t, ×tamp)) { debug("timestamp expired"); @@ -325,7 +323,7 @@ _svcauth_des(rqst, msg) entry->rname = (char *)mem_alloc((u_int)strlen(cred->adc_fullname.name) + 1); if (entry->rname != NULL) { - (void) strcpy(entry->rname, cred->adc_fullname.name); + strcpy(entry->rname, cred->adc_fullname.name); } else { debug("out of memory"); } @@ -349,7 +347,7 @@ _svcauth_des(rqst, msg) * Initialize the cache */ static void -cache_init() +cache_init(void) { int i; @@ -372,7 +370,7 @@ cache_init() * Find the lru victim */ static short -cache_victim() +cache_victim(void) { return (authdes_lru[AUTHDES_CACHESZ-1]); } @@ -381,8 +379,7 @@ cache_victim() * Note that sid was referenced */ static void -cache_ref(sid) - short sid; +cache_ref(short sid) { int i; short curr; @@ -404,10 +401,7 @@ cache_ref(sid) * return the spot in the cache. */ static short -cache_spot(key, name, timestamp) - des_block *key; - char *name; - struct timeval *timestamp; +cache_spot(des_block *key, char *name, struct timeval *timestamp) { struct cache_entry *cp; int i; @@ -456,12 +450,8 @@ struct bsdcred { * the credential. */ int -authdes_getucred(adc, uid, gid, grouplen, groups) - struct authdes_cred *adc; - uid_t *uid; - gid_t *gid; - int *grouplen; - gid_t *groups; +authdes_getucred(struct authdes_cred *adc, uid_t *uid, gid_t *gid, + int *grouplen, gid_t *groups) { unsigned sid; int i; @@ -520,8 +510,7 @@ authdes_getucred(adc, uid, gid, grouplen, groups) } static void -invalidate(cred) - char *cred; +invalidate(char *cred) { if (cred == NULL) { return; diff --git a/lib/libc/rpc/svc_auth_unix.c b/lib/libc/rpc/svc_auth_unix.c index 227beb0607..3a799c7813 100644 --- a/lib/libc/rpc/svc_auth_unix.c +++ b/lib/libc/rpc/svc_auth_unix.c @@ -29,7 +29,7 @@ * @(#)svc_auth_unix.c 1.28 88/02/08 Copyr 1984 Sun Micro * @(#)svc_auth_unix.c 2.3 88/08/01 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/svc_auth_unix.c,v 1.8 1999/08/28 00:00:49 peter Exp $ - * $DragonFly: src/lib/libc/rpc/svc_auth_unix.c,v 1.3 2004/10/25 19:38:02 drhodus Exp $ + * $DragonFly: src/lib/libc/rpc/svc_auth_unix.c,v 1.4 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -51,9 +51,7 @@ * 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; @@ -102,14 +100,14 @@ _svcauth_unix(rqst, msg) * timestamp, hostname len (0), uid, gid, and gids len (0). */ if ((5 + gid_len) * BYTES_PER_XDR_UNIT + str_len > auth_len) { - (void) printf("bad auth_len gid %d str %d auth %d\n", + printf("bad auth_len gid %d str %d auth %d\n", gid_len, str_len, auth_len); stat = AUTH_BADCRED; goto done; } } else if (! xdr_authunix_parms(&xdrs, aup)) { xdrs.x_op = XDR_FREE; - (void)xdr_authunix_parms(&xdrs, aup); + xdr_authunix_parms(&xdrs, aup); stat = AUTH_BADCRED; goto done; } @@ -139,9 +137,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 7b57f98dbd..c6e02cab69 100644 --- a/lib/libc/rpc/svc_raw.c +++ b/lib/libc/rpc/svc_raw.c @@ -29,7 +29,7 @@ * @(#)svc_raw.c 1.15 87/08/11 Copyr 1984 Sun Micro * @(#)svc_raw.c 2.1 88/07/29 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/svc_raw.c,v 1.7 1999/08/28 00:00:49 peter Exp $ - * $DragonFly: src/lib/libc/rpc/svc_raw.c,v 1.3 2004/10/25 19:38:02 drhodus Exp $ + * $DragonFly: src/lib/libc/rpc/svc_raw.c,v 1.4 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -71,7 +71,7 @@ static struct xp_ops server_ops = { }; SVCXPRT * -svcraw_create() +svcraw_create(void) { struct svcraw_private *srp = svcraw_private; @@ -89,16 +89,14 @@ svcraw_create() } static enum xprt_stat -svcraw_stat() +svcraw_stat(void) { return (XPRT_IDLE); } 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; @@ -114,9 +112,7 @@ svcraw_recv(xprt, msg) } 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; @@ -128,15 +124,12 @@ svcraw_reply(xprt, msg) XDR_SETPOS(xdrs, 0); if (! xdr_replymsg(xdrs, msg)) return (FALSE); - (void)XDR_GETPOS(xdrs); /* called just for overhead */ + XDR_GETPOS(xdrs); /* called just for overhead */ return (TRUE); } 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; @@ -146,10 +139,7 @@ svcraw_getargs(xprt, xdr_args, args_ptr) } 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; @@ -162,6 +152,6 @@ svcraw_freeargs(xprt, xdr_args, args_ptr) } static void -svcraw_destroy() +svcraw_destroy(void) { } diff --git a/lib/libc/rpc/svc_run.c b/lib/libc/rpc/svc_run.c index ce46973655..a4babe9107 100644 --- a/lib/libc/rpc/svc_run.c +++ b/lib/libc/rpc/svc_run.c @@ -29,7 +29,7 @@ * @(#)svc_run.c 1.1 87/10/13 Copyr 1984 Sun Micro * @(#)svc_run.c 2.1 88/07/29 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/svc_run.c,v 1.10 1999/08/28 00:00:49 peter Exp $ - * $DragonFly: src/lib/libc/rpc/svc_run.c,v 1.3 2005/01/31 22:29:38 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/svc_run.c,v 1.4 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -51,7 +51,7 @@ extern int __svc_fdsetsize; extern fd_set *__svc_fdset; void -svc_run() +svc_run(void) { fd_set *fds; diff --git a/lib/libc/rpc/svc_simple.c b/lib/libc/rpc/svc_simple.c index 1219b6df3e..d35de7dbfa 100644 --- a/lib/libc/rpc/svc_simple.c +++ b/lib/libc/rpc/svc_simple.c @@ -29,7 +29,7 @@ * @(#)svc_simple.c 1.18 87/08/11 Copyr 1984 Sun Micro * @(#)svc_simple.c 2.2 88/08/01 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/svc_simple.c,v 1.9 1999/08/28 00:00:50 peter Exp $ - * $DragonFly: src/lib/libc/rpc/svc_simple.c,v 1.2 2003/06/17 04:26:45 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/svc_simple.c,v 1.3 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -59,34 +59,32 @@ 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) { - (void) fprintf(stderr, + fprintf(stderr, "can't reassign procedure number %ld\n", NULLPROC); return (-1); } if (transp == 0) { transp = svcudp_create(RPC_ANYSOCK); if (transp == NULL) { - (void) fprintf(stderr, "couldn't create an rpc server\n"); + fprintf(stderr, "couldn't create an rpc server\n"); return (-1); } } - (void) pmap_unset((u_long)prognum, (u_long)versnum); + pmap_unset((u_long)prognum, (u_long)versnum); if (!svc_register(transp, (u_long)prognum, (u_long)versnum, universal, IPPROTO_UDP)) { - (void) fprintf(stderr, "couldn't register prog %d vers %d\n", + fprintf(stderr, "couldn't register prog %d vers %d\n", prognum, versnum); return (-1); } pl = (struct proglst *)malloc(sizeof(struct proglst)); if (pl == NULL) { - (void) fprintf(stderr, "registerrpc: out of memory\n"); + fprintf(stderr, "registerrpc: out of memory\n"); return (-1); } pl->p_progname = progname; @@ -100,9 +98,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; @@ -114,7 +110,7 @@ universal(rqstp, transp) */ if (rqstp->rq_proc == NULLPROC) { if (svc_sendreply(transp, xdr_void, NULL) == FALSE) { - (void) fprintf(stderr, "xxx\n"); + fprintf(stderr, "xxx\n"); exit(1); } return; @@ -134,16 +130,16 @@ universal(rqstp, transp) /* there was an error */ return; if (!svc_sendreply(transp, pl->p_outproc, outdata)) { - (void) fprintf(stderr, + fprintf(stderr, "trouble replying to prog %d\n", pl->p_prognum); exit(1); } /* free the decoded arguments */ - (void)svc_freeargs(transp, pl->p_inproc, xdrbuf); + svc_freeargs(transp, pl->p_inproc, xdrbuf); return; } - (void) fprintf(stderr, "never registered prog %d\n", prog); + fprintf(stderr, "never registered prog %d\n", prog); exit(1); } diff --git a/lib/libc/rpc/svc_tcp.c b/lib/libc/rpc/svc_tcp.c index 9688521409..00ef1d50e3 100644 --- a/lib/libc/rpc/svc_tcp.c +++ b/lib/libc/rpc/svc_tcp.c @@ -29,7 +29,7 @@ * @(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro * @(#)svc_tcp.c 2.2 88/08/01 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/svc_tcp.c,v 1.18.2.3 2001/09/05 22:29:23 dec Exp $ - * $DragonFly: src/lib/libc/rpc/svc_tcp.c,v 1.4 2005/01/31 22:29:38 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/svc_tcp.c,v 1.5 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -123,10 +123,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; @@ -146,7 +143,7 @@ svctcp_create(sock, sendsize, recvsize) if (_ioctl(sock, FIONBIO, &on) < 0) { perror("svc_tcp.c - cannot turn on non-blocking mode"); if (madesock) - (void)_close(sock); + _close(sock); return ((SVCXPRT *)NULL); } memset(&addr, 0, sizeof (addr)); @@ -154,25 +151,25 @@ svctcp_create(sock, sendsize, recvsize) addr.sin_family = AF_INET; if (bindresvport(sock, &addr)) { addr.sin_port = 0; - (void)_bind(sock, (struct sockaddr *)&addr, len); + _bind(sock, (struct sockaddr *)&addr, len); } if ((_getsockname(sock, (struct sockaddr *)&addr, &len) != 0) || (_listen(sock, 2) != 0)) { perror("svctcp_.c - cannot getsockname or listen"); if (madesock) - (void)_close(sock); + _close(sock); return ((SVCXPRT *)NULL); } r = (struct tcp_rendezvous *)mem_alloc(sizeof(*r)); if (r == NULL) { - (void) fprintf(stderr, "svctcp_create: out of memory\n"); + fprintf(stderr, "svctcp_create: out of memory\n"); return (NULL); } r->sendsize = sendsize; r->recvsize = recvsize; xprt = (SVCXPRT *)mem_alloc(sizeof(SVCXPRT)); if (xprt == NULL) { - (void) fprintf(stderr, "svctcp_create: out of memory\n"); + fprintf(stderr, "svctcp_create: out of memory\n"); return (NULL); } xprt->xp_p2 = NULL; @@ -190,32 +187,26 @@ 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; xprt = (SVCXPRT *)mem_alloc(sizeof(SVCXPRT)); if (xprt == (SVCXPRT *)NULL) { - (void) fprintf(stderr, "svc_tcp: makefd_xprt: out of memory\n"); + fprintf(stderr, "svc_tcp: makefd_xprt: out of memory\n"); goto done; } cd = (struct tcp_conn *)mem_alloc(sizeof(struct tcp_conn)); if (cd == (struct tcp_conn *)NULL) { - (void) fprintf(stderr, "svc_tcp: makefd_xprt: out of memory\n"); + fprintf(stderr, "svc_tcp: makefd_xprt: out of memory\n"); mem_free((char *) xprt, sizeof(SVCXPRT)); xprt = (SVCXPRT *)NULL; goto done; @@ -236,8 +227,7 @@ makefd_xprt(fd, sendsize, recvsize) } static bool_t -rendezvous_request(xprt) - SVCXPRT *xprt; +rendezvous_request(SVCXPRT *xprt) { int sock; struct tcp_rendezvous *r; @@ -279,20 +269,19 @@ rendezvous_request(xprt) } static enum xprt_stat -rendezvous_stat() +rendezvous_stat(void) { return (XPRT_IDLE); } static void -svctcp_destroy(xprt) - SVCXPRT *xprt; +svctcp_destroy(SVCXPRT *xprt) { struct tcp_conn *cd = (struct tcp_conn *)xprt->xp_p1; xprt_unregister(xprt); - (void)_close(xprt->xp_sock); + _close(xprt->xp_sock); if (xprt->xp_port != 0) { /* a rendezvouser socket */ xprt->xp_port = 0; @@ -323,10 +312,7 @@ static struct timeval wait_per_try = { 35, 0 }; * to handle new requests if any are detected. */ 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; struct timeval start, delta, tv; @@ -395,10 +381,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; @@ -413,8 +396,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); @@ -427,16 +409,14 @@ 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); XDR *xdrs = &(cd->xdrs); xdrs->x_op = XDR_DECODE; - (void)xdrrec_skiprecord(xdrs); + xdrrec_skiprecord(xdrs); if (xdr_callmsg(xdrs, msg)) { cd->x_id = msg->rm_xid; return (TRUE); @@ -446,20 +426,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); @@ -469,9 +443,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); @@ -481,6 +453,6 @@ svctcp_reply(xprt, msg) xdrs->x_op = XDR_ENCODE; msg->rm_xid = cd->x_id; stat = xdr_replymsg(xdrs, msg); - (void)xdrrec_endofrecord(xdrs, TRUE); + xdrrec_endofrecord(xdrs, TRUE); return (stat); } diff --git a/lib/libc/rpc/svc_udp.c b/lib/libc/rpc/svc_udp.c index 81a7a2004b..e9461122f6 100644 --- a/lib/libc/rpc/svc_udp.c +++ b/lib/libc/rpc/svc_udp.c @@ -29,7 +29,7 @@ * @(#)svc_udp.c 1.24 87/08/11 Copyr 1984 Sun Micro * @(#)svc_udp.c 2.2 88/07/29 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/svc_udp.c,v 1.13 2000/01/27 23:06:41 jasone Exp $ - * $DragonFly: src/lib/libc/rpc/svc_udp.c,v 1.5 2005/01/31 22:29:38 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/svc_udp.c,v 1.6 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -97,9 +97,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; @@ -119,27 +117,27 @@ svcudp_bufcreate(sock, sendsz, recvsz) addr.sin_family = AF_INET; if (bindresvport(sock, &addr)) { addr.sin_port = 0; - (void)_bind(sock, (struct sockaddr *)&addr, len); + _bind(sock, (struct sockaddr *)&addr, len); } if (_getsockname(sock, (struct sockaddr *)&addr, &len) != 0) { perror("svcudp_create - cannot getsockname"); if (madesock) - (void)_close(sock); + _close(sock); return ((SVCXPRT *)NULL); } xprt = (SVCXPRT *)mem_alloc(sizeof(SVCXPRT)); if (xprt == NULL) { - (void)fprintf(stderr, "svcudp_create: out of memory\n"); + fprintf(stderr, "svcudp_create: out of memory\n"); return (NULL); } su = (struct svcudp_data *)mem_alloc(sizeof(*su)); if (su == NULL) { - (void)fprintf(stderr, "svcudp_create: out of memory\n"); + fprintf(stderr, "svcudp_create: out of memory\n"); return (NULL); } su->su_iosz = ((MAX(sendsz, recvsz) + 3) / 4) * 4; if ((rpc_buffer(xprt) = mem_alloc(su->su_iosz)) == NULL) { - (void)fprintf(stderr, "svcudp_create: out of memory\n"); + fprintf(stderr, "svcudp_create: out of memory\n"); return (NULL); } xdrmem_create( @@ -155,25 +153,21 @@ svcudp_bufcreate(sock, sendsz, recvsz) } SVCXPRT * -svcudp_create(sock) - int sock; +svcudp_create(int sock) { return(svcudp_bufcreate(sock, UDPMSGSIZE, UDPMSGSIZE)); } 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); @@ -196,7 +190,7 @@ svcudp_recv(xprt, msg) su->su_xid = msg->rm_xid; if (su->su_cache != NULL) { if (cache_get(xprt, msg, &reply, &replylen)) { - (void) _sendto(xprt->xp_sock, reply, (int) replylen, 0, + _sendto(xprt->xp_sock, reply, (int) replylen, 0, (struct sockaddr *) &xprt->xp_raddr, xprt->xp_addrlen); return (TRUE); } @@ -205,9 +199,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); @@ -232,20 +224,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); @@ -254,13 +240,12 @@ 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); xprt_unregister(xprt); - (void)_close(xprt->xp_sock); + _close(xprt->xp_sock); XDR_DESTROY(&(su->su_xdrs)); mem_free(rpc_buffer(xprt), su->su_iosz); mem_free((caddr_t)su, sizeof(struct svcudp_data)); @@ -279,7 +264,7 @@ svcudp_destroy(xprt) #define SPARSENESS 4 /* 75% sparse */ #define CACHE_PERROR(msg) \ - (void) fprintf(stderr,"%s\n", msg) + fprintf(stderr,"%s\n", msg) #define ALLOC(type, size) \ (type *) mem_alloc((unsigned) (sizeof(type) * (size))) @@ -339,9 +324,8 @@ struct udp_cache { * Enable use of the cache. * Note: there is no disable. */ -int svcudp_enablecache(transp, size) - SVCXPRT *transp; - u_long size; +int +svcudp_enablecache(SVCXPRT *transp, u_long size) { struct svcudp_data *su = su_data(transp); struct udp_cache *uc; @@ -378,9 +362,7 @@ int 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; @@ -443,11 +425,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/svc_unix.c b/lib/libc/rpc/svc_unix.c index 13acbc9983..a48ec399d6 100644 --- a/lib/libc/rpc/svc_unix.c +++ b/lib/libc/rpc/svc_unix.c @@ -29,7 +29,7 @@ * @(#)svc_unix.c 1.21 87/08/11 Copyr 1984 Sun Micro * @(#)svc_unix.c 2.2 88/08/01 4.0 RPCSRC * $FreeBSD: src/lib/libc/rpc/svc_unix.c,v 1.7.2.2 2001/09/05 22:29:23 dec Exp $ - * $DragonFly: src/lib/libc/rpc/svc_unix.c,v 1.4 2005/01/31 22:29:38 dillon Exp $ + * $DragonFly: src/lib/libc/rpc/svc_unix.c,v 1.5 2005/11/13 12:27:04 swildner Exp $ */ /* @@ -111,10 +111,8 @@ struct cmessage { static struct cmessage cm; -static int __msgread(sock, buf, cnt) - int sock; - void *buf; - size_t cnt; +static int +__msgread(int sock, void *buf, size_t cnt) { struct iovec iov[1]; struct msghdr msg; @@ -134,10 +132,8 @@ static int __msgread(sock, buf, cnt) return(_recvmsg(sock, &msg, 0)); } -static int __msgwrite(sock, buf, cnt) - int sock; - void *buf; - size_t cnt; +static int +__msgwrite(int sock, void *buf, size_t cnt) { struct iovec iov[1]; struct msghdr msg; @@ -182,11 +178,7 @@ static int __msgwrite(sock, buf, cnt) * 0 => use the system default. */ SVCXPRT * -svcunix_create(sock, sendsize, recvsize, path) - int sock; - u_int sendsize; - u_int recvsize; - char *path; +svcunix_create(int sock, u_int sendsize, u_int recvsize, char *path) { bool_t madesock = FALSE; SVCXPRT *xprt; @@ -214,19 +206,19 @@ svcunix_create(sock, sendsize, recvsize, path) (_listen(sock, 2) != 0)) { perror("svc_unix.c - cannot getsockname or listen"); if (madesock) - (void)_close(sock); + _close(sock); return ((SVCXPRT *)NULL); } r = (struct unix_rendezvous *)mem_alloc(sizeof(*r)); if (r == NULL) { - (void) fprintf(stderr, "svcunix_create: out of memory\n"); + fprintf(stderr, "svcunix_create: out of memory\n"); return (NULL); } r->sendsize = sendsize; r->recvsize = recvsize; xprt = (SVCXPRT *)mem_alloc(sizeof(SVCXPRT)); if (xprt == NULL) { - (void) fprintf(stderr, "svcunix_create: out of memory\n"); + fprintf(stderr, "svcunix_create: out of memory\n"); return (NULL); } xprt->xp_p2 = NULL; @@ -244,32 +236,26 @@ svcunix_create(sock, sendsize, recvsize, path) * descriptor as its first input. */ SVCXPRT * -svcunixfd_create(fd, sendsize, recvsize) - int fd; - u_int sendsize; - u_int recvsize; +svcunixfd_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 unix_conn *cd; xprt = (SVCXPRT *)mem_alloc(sizeof(SVCXPRT)); if (xprt == (SVCXPRT *)NULL) { - (void) fprintf(stderr, "svc_unix: makefd_xprt: out of memory\n"); + fprintf(stderr, "svc_unix: makefd_xprt: out of memory\n"); goto done; } cd = (struct unix_conn *)mem_alloc(sizeof(struct unix_conn)); if (cd == (struct unix_conn *)NULL) { - (void) fprintf(stderr, "svc_unix: makefd_xprt: out of memory\n"); + fprintf(stderr, "svc_unix: makefd_xprt: out of memory\n"); mem_free((char *) xprt, sizeof(SVCXPRT)); xprt = (SVCXPRT *)NULL; goto done; @@ -290,8 +276,7 @@ makefd_xprt(fd, sendsize, recvsize) } static bool_t -rendezvous_request(xprt) - SVCXPRT *xprt; +rendezvous_request(SVCXPRT *xprt) { int sock; struct unix_rendezvous *r; @@ -321,20 +306,19 @@ rendezvous_request(xprt) } static enum xprt_stat -rendezvous_stat() +rendezvous_stat(void) { return (XPRT_IDLE); } static void -svcunix_destroy(xprt) - SVCXPRT *xprt; +svcunix_destroy(SVCXPRT *xprt) { struct unix_conn *cd = (struct unix_conn *)xprt->xp_p1; xprt_unregister(xprt); - (void)_close(xprt->xp_sock); + _close(xprt->xp_sock); if (xprt->xp_port != 0) { /* a rendezvouser socket */ xprt->xp_port = 0; @@ -365,10 +349,7 @@ static struct timeval wait_per_try = { 35, 0 }; * to handle new requests if any are detected. */ static int -readunix(xprt, buf, len) - SVCXPRT *xprt; - caddr_t buf; - int len; +readunix(SVCXPRT *xprt, caddr_t buf, int len) { int sock = xprt->xp_sock; struct timeval start, delta, tv; @@ -437,10 +418,7 @@ fatal_err: * Any error is fatal and the connection is closed. */ static int -writeunix(xprt, buf, len) - SVCXPRT *xprt; - caddr_t buf; - int len; +writeunix(SVCXPRT *xprt, caddr_t buf, int len) { int i, cnt; @@ -455,8 +433,7 @@ writeunix(xprt, buf, len) } static enum xprt_stat -svcunix_stat(xprt) - SVCXPRT *xprt; +svcunix_stat(SVCXPRT *xprt) { struct unix_conn *cd = (struct unix_conn *)(xprt->xp_p1); @@ -469,16 +446,14 @@ svcunix_stat(xprt) } static bool_t -svcunix_recv(xprt, msg) - SVCXPRT *xprt; - struct rpc_msg *msg; +svcunix_recv(SVCXPRT *xprt, struct rpc_msg *msg) { struct unix_conn *cd = (struct unix_conn *)(xprt->xp_p1); XDR *xdrs = &(cd->xdrs); xdrs->x_op = XDR_DECODE; - (void)xdrrec_skiprecord(xdrs); + xdrrec_skiprecord(xdrs); if (xdr_callmsg(xdrs, msg)) { cd->x_id = msg->rm_xid; /* set up verifiers */ @@ -492,20 +467,14 @@ svcunix_recv(xprt, msg) } static bool_t -svcunix_getargs(xprt, xdr_args, args_ptr) - SVCXPRT *xprt; - xdrproc_t xdr_args; - caddr_t args_ptr; +svcunix_getargs(SVCXPRT *xprt, xdrproc_t xdr_args, caddr_t args_ptr) { return ((*xdr_args)(&(((struct unix_conn *)(xprt->xp_p1))->xdrs), args_ptr)); } static bool_t -svcunix_freeargs(xprt, xdr_args, args_ptr) - SVCXPRT *xprt; - xdrproc_t xdr_args; - caddr_t args_ptr; +svcunix_freeargs(SVCXPRT *xprt, xdrproc_t xdr_args, caddr_t args_ptr) { XDR *xdrs = &(((struct unix_conn *)(xprt->xp_p1))->xdrs); @@ -515,9 +484,7 @@ svcunix_freeargs(xprt, xdr_args, args_ptr) } static bool_t -svcunix_reply(xprt, msg) - SVCXPRT *xprt; - struct rpc_msg *msg; +svcunix_reply(SVCXPRT *xprt, struct rpc_msg *msg) { struct unix_conn *cd = (struct unix_conn *)(xprt->xp_p1); @@ -527,6 +494,6 @@ svcunix_reply(xprt, msg) xdrs->x_op = XDR_ENCODE; msg->rm_xid = cd->x_id; stat = xdr_replymsg(xdrs, msg); - (void)xdrrec_endofrecord(xdrs, TRUE); + xdrrec_endofrecord(xdrs, TRUE); return (stat); } -- 2.41.0