From: Tom Yu Date: Fri, 17 Sep 2004 21:52:12 +0000 (+0000) Subject: * libgssrpc.exports: Don't export internals X-Git-Tag: krb5-1.4-beta1~73 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bd166d32666c29e0fe8769528e40ac2c675b7757;p=krb5.git * libgssrpc.exports: Don't export internals * svc.c (svc_getreqset): * svc_tcp.c (readtcp): Don't intersperse preprocessor conditionals with braces. * auth_gssapi.c, auth_gssapi_misc.c, auth_none.c: * auth_unix.c, authunix_prot.c, bindresvport.c: * clnt_generic.c, clnt_perror.c, clnt_raw.c * clnt_simple.c, clnt_tcp.c, clnt_udp.c, get_myaddress.c: * getrpcent.c, getrpcport.c, pmap_clnt.c: * pmap_getmaps.c, pmap_getport.c, pmap_prot.c, pmap_prot2.c: * pmap_rmt.c, rpc_callmsg.c, rpc_prot.c: * svc.c, svc_auth.c, svc_auth_gss.c: * svc_auth_gssapi.c, svc_auth_unix.c, svc_raw.c: * svc_run.c, svc_simple.c, svc_tcp.c: * svc_udp.c, xdr.c, xdr_alloc.c, xdr_array.c: * xdr_float.c, xdr_mem.c, xdr_rec.c, xdr_reference.c: * xdr_stdio.c: Protoize, to avoid potential problems when fixed-width types are not ints on some platforms. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16768 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/rpc/ChangeLog b/src/lib/rpc/ChangeLog index 2df8c5830..b2ddbe971 100644 --- a/src/lib/rpc/ChangeLog +++ b/src/lib/rpc/ChangeLog @@ -1,3 +1,26 @@ +2004-09-17 Tom Yu + + * libgssrpc.exports: Don't export internals. + + * svc.c (svc_getreqset): + * svc_tcp.c (readtcp): Don't intersperse preprocessor + conditionals with braces. + + * auth_gssapi.c, auth_gssapi_misc.c, auth_none.c: + * auth_unix.c, authunix_prot.c, bindresvport.c: + * clnt_generic.c, clnt_perror.c, clnt_raw.c + * clnt_simple.c, clnt_tcp.c, clnt_udp.c, get_myaddress.c: + * getrpcent.c, getrpcport.c, pmap_clnt.c: + * pmap_getmaps.c, pmap_getport.c, pmap_prot.c, pmap_prot2.c: + * pmap_rmt.c, rpc_callmsg.c, rpc_prot.c: + * svc.c, svc_auth.c, svc_auth_gss.c: + * svc_auth_gssapi.c, svc_auth_unix.c, svc_raw.c: + * svc_run.c, svc_simple.c, svc_tcp.c: + * svc_udp.c, xdr.c, xdr_alloc.c, xdr_array.c: + * xdr_float.c, xdr_mem.c, xdr_rec.c, xdr_reference.c: + * xdr_stdio.c: Protoize, to avoid potential problems when + fixed-width types are not ints on some platforms. + 2004-08-26 Tom Yu * configure.in: Look for uint32_t, not int32_t, since some BSD-ish diff --git a/src/lib/rpc/auth_gssapi.c b/src/lib/rpc/auth_gssapi.c index d38097ba4..3d6e6fe63 100644 --- a/src/lib/rpc/auth_gssapi.c +++ b/src/lib/rpc/auth_gssapi.c @@ -77,9 +77,7 @@ struct auth_gssapi_data { * * Effects: See design document, section XXX. */ -AUTH *auth_gssapi_create_default(clnt, service_name) - CLIENT *clnt; - char *service_name; +AUTH *auth_gssapi_create_default(CLIENT *clnt, char *service_name) { AUTH *auth; OM_uint32 gssstat, minor_stat; @@ -123,26 +121,18 @@ AUTH *auth_gssapi_create_default(clnt, service_name) * * Effects: See design document, section XXX. */ -AUTH *auth_gssapi_create(clnt, gssstat, minor_stat, - claimant_cred_handle, - target_name, - mech_type, - req_flags, - time_req, - actual_mech_type, - ret_flags, - time_rec) - CLIENT *clnt; - OM_uint32 *gssstat; - OM_uint32 *minor_stat; - gss_cred_id_t claimant_cred_handle; - gss_name_t target_name; - gss_OID mech_type; - OM_uint32 req_flags; - OM_uint32 time_req; - gss_OID *actual_mech_type; - OM_uint32 *ret_flags; - OM_uint32 *time_rec; +AUTH *auth_gssapi_create( + CLIENT *clnt, + OM_uint32 *gssstat, + OM_uint32 *minor_stat, + gss_cred_id_t claimant_cred_handle, + gss_name_t target_name, + gss_OID mech_type, + OM_uint32 req_flags, + OM_uint32 time_req, + gss_OID *actual_mech_type, + OM_uint32 *ret_flags, + OM_uint32 *time_rec) { AUTH *auth, *save_auth; struct auth_gssapi_data *pdata; @@ -489,10 +479,10 @@ cleanup: * * Modifies: auth */ -static bool_t marshall_new_creds(auth, auth_msg, client_handle) - AUTH *auth; - bool_t auth_msg; - gss_buffer_t client_handle; +static bool_t marshall_new_creds( + AUTH *auth, + bool_t auth_msg, + gss_buffer_t client_handle) { auth_gssapi_creds creds; XDR xdrs; @@ -539,8 +529,7 @@ static bool_t marshall_new_creds(auth, auth_msg, client_handle) * * Effects: None. Never called. */ -static void auth_gssapi_nextverf(auth) - AUTH *auth; +static void auth_gssapi_nextverf(AUTH *auth) { } @@ -567,9 +556,9 @@ static void auth_gssapi_nextverf(auth) * If this took all the header fields as arguments, it could sign * them. */ -static bool_t auth_gssapi_marshall(auth, xdrs) - AUTH *auth; - XDR *xdrs; +static bool_t auth_gssapi_marshall( + AUTH *auth, + XDR *xdrs) { OM_uint32 minor_stat; gss_buffer_desc out_buf; @@ -618,9 +607,9 @@ static bool_t auth_gssapi_marshall(auth, xdrs) * * Effects: See design document, section XXX. */ -static bool_t auth_gssapi_validate(auth, verf) - AUTH *auth; - struct opaque_auth *verf; +static bool_t auth_gssapi_validate( + AUTH *auth, + struct opaque_auth *verf) { gss_buffer_desc in_buf; uint32_t seq_num; @@ -675,9 +664,9 @@ static bool_t auth_gssapi_validate(auth, verf) * resyncrhonize by incrementing the client's sequence number and * returning TRUE. If any other error arrives, it returns FALSE. */ -static bool_t auth_gssapi_refresh(auth, msg) - AUTH *auth; - struct rpc_msg *msg; +static bool_t auth_gssapi_refresh( + AUTH *auth, + struct rpc_msg *msg) { if (msg->rm_reply.rp_rjct.rj_stat == AUTH_ERROR && msg->rm_reply.rp_rjct.rj_why == AUTH_REJECTEDVERF) { @@ -701,8 +690,7 @@ static bool_t auth_gssapi_refresh(auth, msg) * context. Since the client doesn't really care whether the server * gets this message, no failures are reported. */ -static void auth_gssapi_destroy(auth) - AUTH *auth; +static void auth_gssapi_destroy(AUTH *auth) { struct timeval timeout; OM_uint32 gssstat, minor_stat; @@ -769,11 +757,11 @@ skip_call: * * Effects: See design doc, section XXX. */ -static bool_t auth_gssapi_wrap(auth, out_xdrs, xdr_func, xdr_ptr) - AUTH *auth; - XDR *out_xdrs; - bool_t (*xdr_func)(); - caddr_t xdr_ptr; +static bool_t auth_gssapi_wrap( + AUTH *auth, + XDR *out_xdrs, + bool_t (*xdr_func)(), + caddr_t xdr_ptr) { OM_uint32 gssstat, minor_stat; @@ -800,11 +788,11 @@ static bool_t auth_gssapi_wrap(auth, out_xdrs, xdr_func, xdr_ptr) * * Effects: See design doc, section XXX. */ -static bool_t auth_gssapi_unwrap(auth, in_xdrs, xdr_func, xdr_ptr) - AUTH *auth; - XDR *in_xdrs; - bool_t (*xdr_func)(); - caddr_t xdr_ptr; +static bool_t auth_gssapi_unwrap( + AUTH *auth, + XDR *in_xdrs, + bool_t (*xdr_func)(), + caddr_t xdr_ptr) { OM_uint32 gssstat, minor_stat; diff --git a/src/lib/rpc/auth_gssapi_misc.c b/src/lib/rpc/auth_gssapi_misc.c index 8c417aaa6..3e878206b 100644 --- a/src/lib/rpc/auth_gssapi_misc.c +++ b/src/lib/rpc/auth_gssapi_misc.c @@ -28,9 +28,9 @@ int misc_debug_gssapi = DEBUG_GSSAPI; static void auth_gssapi_display_status_1 (char *, OM_uint32, int, int); -bool_t xdr_gss_buf(xdrs, buf) - XDR *xdrs; - gss_buffer_t buf; +bool_t xdr_gss_buf( + XDR *xdrs, + gss_buffer_t buf) { /* * On decode, xdr_bytes will only allocate buf->value if the @@ -49,9 +49,9 @@ bool_t xdr_gss_buf(xdrs, buf) return result; } -bool_t xdr_authgssapi_creds(xdrs, creds) - XDR *xdrs; - auth_gssapi_creds *creds; +bool_t xdr_authgssapi_creds( + XDR *xdrs, + auth_gssapi_creds *creds) { if (! xdr_u_int32(xdrs, &creds->version) || ! xdr_bool(xdrs, &creds->auth_msg) || @@ -60,9 +60,9 @@ bool_t xdr_authgssapi_creds(xdrs, creds) return TRUE; } -bool_t xdr_authgssapi_init_arg(xdrs, init_arg) - XDR *xdrs; - auth_gssapi_init_arg *init_arg; +bool_t xdr_authgssapi_init_arg( + XDR *xdrs, + auth_gssapi_init_arg *init_arg) { if (! xdr_u_int32(xdrs, &init_arg->version) || ! xdr_gss_buf(xdrs, &init_arg->token)) @@ -70,9 +70,9 @@ bool_t xdr_authgssapi_init_arg(xdrs, init_arg) return TRUE; } -bool_t xdr_authgssapi_init_res(xdrs, init_res) - XDR *xdrs; - auth_gssapi_init_res *init_res; +bool_t xdr_authgssapi_init_res( + XDR *xdrs, + auth_gssapi_init_res *init_res) { if (! xdr_u_int32(xdrs, &init_res->version) || ! xdr_gss_buf(xdrs, &init_res->client_handle) || @@ -84,10 +84,10 @@ bool_t xdr_authgssapi_init_res(xdrs, init_res) return TRUE; } -bool_t auth_gssapi_seal_seq(context, seq_num, out_buf) - gss_ctx_id_t context; - uint32_t seq_num; - gss_buffer_t out_buf; +bool_t auth_gssapi_seal_seq( + gss_ctx_id_t context, + uint32_t seq_num, + gss_buffer_t out_buf) { gss_buffer_desc in_buf; OM_uint32 gssstat, minor_stat; @@ -108,10 +108,10 @@ bool_t auth_gssapi_seal_seq(context, seq_num, out_buf) return TRUE; } -bool_t auth_gssapi_unseal_seq(context, in_buf, seq_num) - gss_ctx_id_t context; - gss_buffer_t in_buf; - uint32_t *seq_num; +bool_t auth_gssapi_unseal_seq( + gss_ctx_id_t context, + gss_buffer_t in_buf, + uint32_t *seq_num) { gss_buffer_desc out_buf; OM_uint32 gssstat, minor_stat; @@ -138,20 +138,20 @@ bool_t auth_gssapi_unseal_seq(context, in_buf, seq_num) return TRUE; } -void auth_gssapi_display_status(msg, major, minor) - char *msg; - OM_uint32 major; - OM_uint32 minor; +void auth_gssapi_display_status( + char *msg, + OM_uint32 major, + OM_uint32 minor) { auth_gssapi_display_status_1(msg, major, GSS_C_GSS_CODE, 0); auth_gssapi_display_status_1(msg, minor, GSS_C_MECH_CODE, 0); } -static void auth_gssapi_display_status_1(m, code, type, rec) - char *m; - OM_uint32 code; - int type; - int rec; +static void auth_gssapi_display_status_1( + char *m, + OM_uint32 code, + int type, + int rec) { OM_uint32 gssstat, minor_stat; gss_buffer_desc msg; @@ -185,14 +185,14 @@ static void auth_gssapi_display_status_1(m, code, type, rec) } } -bool_t auth_gssapi_wrap_data(major, minor, context, seq_num, out_xdrs, - xdr_func, xdr_ptr) - OM_uint32 *major, *minor; - gss_ctx_id_t context; - uint32_t seq_num; - XDR *out_xdrs; - bool_t (*xdr_func)(); - caddr_t xdr_ptr; +bool_t auth_gssapi_wrap_data( + OM_uint32 *major, + OM_uint32 *minor, + gss_ctx_id_t context, + uint32_t seq_num, + XDR *out_xdrs, + bool_t (*xdr_func)(), + caddr_t xdr_ptr) { gss_buffer_desc in_buf, out_buf; XDR temp_xdrs; @@ -252,14 +252,14 @@ bool_t auth_gssapi_wrap_data(major, minor, context, seq_num, out_xdrs, return TRUE; } -bool_t auth_gssapi_unwrap_data(major, minor, context, seq_num, - in_xdrs, xdr_func, xdr_ptr) - OM_uint32 *major, *minor; - gss_ctx_id_t context; - uint32_t seq_num; - XDR *in_xdrs; - bool_t (*xdr_func)(); - caddr_t xdr_ptr; +bool_t auth_gssapi_unwrap_data( + OM_uint32 *major, + OM_uint32 *minor, + gss_ctx_id_t context, + uint32_t seq_num, + XDR *in_xdrs, + bool_t (*xdr_func)(), + caddr_t xdr_ptr) { gss_buffer_desc in_buf, out_buf; XDR temp_xdrs; diff --git a/src/lib/rpc/auth_none.c b/src/lib/rpc/auth_none.c index 0cc6d890e..f4869aa6a 100644 --- a/src/lib/rpc/auth_none.c +++ b/src/lib/rpc/auth_none.c @@ -72,7 +72,7 @@ static struct authnone_private { } *authnone_private; AUTH * -authnone_create() +authnone_create(void) { register struct authnone_private *ap = authnone_private; XDR xdr_stream; @@ -100,9 +100,7 @@ authnone_create() /*ARGSUSED*/ static bool_t -authnone_marshal(client, xdrs) - AUTH *client; - XDR *xdrs; +authnone_marshal(AUTH *client, XDR *xdrs) { register struct authnone_private *ap = authnone_private; @@ -114,16 +112,13 @@ authnone_marshal(client, xdrs) /*ARGSUSED*/ static void -authnone_verf(auth) - AUTH *auth; +authnone_verf(AUTH *auth) { } /*ARGSUSED*/ static bool_t -authnone_validate(auth, verf) - AUTH *auth; - struct opaque_auth *verf; +authnone_validate(AUTH *auth, struct opaque_auth *verf) { return (TRUE); @@ -131,9 +126,7 @@ authnone_validate(auth, verf) /*ARGSUSED*/ static bool_t -authnone_refresh(auth, msg) - AUTH *auth; - struct rpc_msg *msg; +authnone_refresh(AUTH *auth, struct rpc_msg *msg) { return (FALSE); @@ -141,8 +134,7 @@ authnone_refresh(auth, msg) /*ARGSUSED*/ static void -authnone_destroy(auth) - AUTH *auth; +authnone_destroy(AUTH *auth) { } diff --git a/src/lib/rpc/auth_unix.c b/src/lib/rpc/auth_unix.c index 12d4f5e63..4af3bc4c7 100644 --- a/src/lib/rpc/auth_unix.c +++ b/src/lib/rpc/auth_unix.c @@ -96,12 +96,12 @@ static void marshal_new_auth(AUTH *); * Returns an auth handle with the given stuff in it. */ AUTH * -authunix_create(machname, uid, gid, len, aup_gids) - char *machname; - int uid; - int gid; - register int len; - int *aup_gids; +authunix_create( + char *machname, + int uid, + int gid, + register int len, + int *aup_gids) { struct authunix_parms aup; char mymem[MAX_AUTH_BYTES]; @@ -174,7 +174,7 @@ authunix_create(machname, uid, gid, len, aup_gids) * syscalls. */ AUTH * -authunix_create_default() +authunix_create_default(void) { register int len; char machname[MAX_MACHINE_NAME + 1]; @@ -201,16 +201,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) { register struct audata *au = AUTH_PRIVATE(auth); @@ -218,9 +215,7 @@ authunix_marshal(auth, xdrs) } static bool_t -authunix_validate(auth, verf) - register AUTH *auth; - struct opaque_auth *verf; +authunix_validate(register AUTH *auth, struct opaque_auth *verf) { register struct audata *au; XDR xdrs; @@ -248,9 +243,7 @@ authunix_validate(auth, verf) } static bool_t -authunix_refresh(auth, msg) - register AUTH *auth; - struct rpc_msg *msg; +authunix_refresh(register AUTH *auth, struct rpc_msg *msg) { register struct audata *au = AUTH_PRIVATE(auth); struct authunix_parms aup; @@ -292,8 +285,7 @@ done: } static void -authunix_destroy(auth) - register AUTH *auth; +authunix_destroy(register AUTH *auth) { register struct audata *au = AUTH_PRIVATE(auth); @@ -315,8 +307,7 @@ authunix_destroy(auth) * sets private data, au_marshed and au_mpos */ static void -marshal_new_auth(auth) - register AUTH *auth; +marshal_new_auth(register AUTH *auth) { XDR xdr_stream; register XDR *xdrs = &xdr_stream; diff --git a/src/lib/rpc/authunix_prot.c b/src/lib/rpc/authunix_prot.c index e7f863dd3..7eb47a4b4 100644 --- a/src/lib/rpc/authunix_prot.c +++ b/src/lib/rpc/authunix_prot.c @@ -48,9 +48,7 @@ static char sccsid[] = "@(#)authunix_prot.c 1.15 87/08/11 Copyr 1984 Sun Micro"; * XDR for unix authentication parameters. */ bool_t -xdr_authunix_parms(xdrs, p) - register XDR *xdrs; - register struct authunix_parms *p; +xdr_authunix_parms(register XDR *xdrs, register struct authunix_parms *p) { if (xdr_u_int32(xdrs, &(p->aup_time)) diff --git a/src/lib/rpc/bindresvport.c b/src/lib/rpc/bindresvport.c index da1f357bc..d1ec65452 100644 --- a/src/lib/rpc/bindresvport.c +++ b/src/lib/rpc/bindresvport.c @@ -47,9 +47,7 @@ static char sccsid[] = "@(#)bindresvport.c 2.2 88/07/29 4.0 RPCSRC 1.8 88/02/08 * Bind a socket to a privileged IP port */ int -bindresvport(sd, sockin) - int sd; - struct sockaddr_in *sockin; +bindresvport(int sd, struct sockaddr_in *sockin) { int res; static short port; diff --git a/src/lib/rpc/clnt_generic.c b/src/lib/rpc/clnt_generic.c index d960c69dc..8c5fe3cbb 100644 --- a/src/lib/rpc/clnt_generic.c +++ b/src/lib/rpc/clnt_generic.c @@ -45,11 +45,11 @@ static char sccsid[] = "@(#)clnt_generic.c 1.4 87/08/11 (C) 1987 SMI"; * change using the rpc equivalent of ioctl()'s. */ CLIENT * -clnt_create(hostname, prog, vers, proto) - char *hostname; - rpcprog_t prog; - rpcvers_t vers; - char *proto; +clnt_create( + char *hostname, + rpcprog_t prog, + rpcvers_t vers, + char *proto) { struct hostent *h; struct protoent *p; diff --git a/src/lib/rpc/clnt_perror.c b/src/lib/rpc/clnt_perror.c index 3fa788ffa..4f159c3b0 100644 --- a/src/lib/rpc/clnt_perror.c +++ b/src/lib/rpc/clnt_perror.c @@ -60,7 +60,7 @@ static char *auth_errmsg(enum auth_stat); static char *buf; static char * -get_buf() +get_buf(void) { if (buf == NULL) buf = (char *)malloc(BUFSIZ); @@ -71,9 +71,7 @@ get_buf() * Print reply error info */ char * -clnt_sperror(rpch, s) - CLIENT *rpch; - char *s; +clnt_sperror(CLIENT *rpch, char *s) { struct rpc_err e; void clnt_perrno(); @@ -174,9 +172,7 @@ clnt_sperror(rpch, s) } void -clnt_perror(rpch, s) - CLIENT *rpch; - char *s; +clnt_perror(CLIENT *rpch, char *s) { (void) fprintf(stderr,"%s",clnt_sperror(rpch,s)); } @@ -231,8 +227,7 @@ static struct rpc_errtab rpc_errlist[] = { * This interface for use by clntrpc */ char * -clnt_sperrno(stat) - enum clnt_stat stat; +clnt_sperrno(enum clnt_stat stat) { int i; @@ -245,16 +240,14 @@ clnt_sperrno(stat) } void -clnt_perrno(num) - enum clnt_stat num; +clnt_perrno(enum clnt_stat num) { (void) fprintf(stderr,"%s",clnt_sperrno(num)); } char * -clnt_spcreateerror(s) - char *s; +clnt_spcreateerror(char *s) { char *str = get_buf(); @@ -307,8 +300,7 @@ clnt_spcreateerror(s) } void -clnt_pcreateerror(s) - char *s; +clnt_pcreateerror(char *s) { (void) fprintf(stderr,"%s",clnt_spcreateerror(s)); } @@ -338,8 +330,7 @@ static struct auth_errtab auth_errlist[] = { }; static char * -auth_errmsg(stat) - enum auth_stat stat; +auth_errmsg(enum auth_stat stat) { int i; diff --git a/src/lib/rpc/clnt_raw.c b/src/lib/rpc/clnt_raw.c index 5e02d891b..06b078e99 100644 --- a/src/lib/rpc/clnt_raw.c +++ b/src/lib/rpc/clnt_raw.c @@ -84,9 +84,9 @@ void svc_getreq(); * Create a client handle for memory based rpc. */ CLIENT * -clntraw_create(prog, vers) - rpcprog_t prog; - rpcvers_t vers; +clntraw_create( + rpcprog_t prog, + rpcvers_t vers) { register struct clntraw_private *clp = clntraw_private; struct rpc_msg call_msg; @@ -127,14 +127,14 @@ clntraw_create(prog, vers) } static enum clnt_stat -clntraw_call(h, proc, xargs, argsp, xresults, resultsp, timeout) - CLIENT *h; - rpcproc_t proc; - xdrproc_t xargs; - void * argsp; - xdrproc_t xresults; - void * resultsp; - struct timeval timeout; +clntraw_call( + CLIENT *h, + rpcproc_t proc, + xdrproc_t xargs, + void * argsp, + xdrproc_t xresults, + void * resultsp, + struct timeval timeout) { register struct clntraw_private *clp = clntraw_private; register XDR *xdrs = &clp->xdr_stream; @@ -219,18 +219,18 @@ call_again: /*ARGSUSED*/ static void -clntraw_geterr(cl, err) - CLIENT *cl; - struct rpc_err *err; +clntraw_geterr( + CLIENT *cl, + struct rpc_err *err) { } static bool_t -clntraw_freeres(cl, xdr_res, res_ptr) - CLIENT *cl; - xdrproc_t xdr_res; - void *res_ptr; +clntraw_freeres( + CLIENT *cl, + xdrproc_t xdr_res, + void *res_ptr) { register struct clntraw_private *clp = clntraw_private; register XDR *xdrs = &clp->xdr_stream; @@ -247,24 +247,22 @@ clntraw_freeres(cl, xdr_res, res_ptr) /*ARGSUSED*/ static void -clntraw_abort(cl) - CLIENT *cl; +clntraw_abort(CLIENT *cl) { } /*ARGSUSED*/ static bool_t -clntraw_control(cl, request, info) - CLIENT *cl; - int request; - void *info; +clntraw_control( + CLIENT *cl, + int request, + void *info) { return (FALSE); } /*ARGSUSED*/ static void -clntraw_destroy(cl) - CLIENT *cl; +clntraw_destroy(CLIENT *cl) { } diff --git a/src/lib/rpc/clnt_simple.c b/src/lib/rpc/clnt_simple.c index bb8454634..ebb2fee7d 100644 --- a/src/lib/rpc/clnt_simple.c +++ b/src/lib/rpc/clnt_simple.c @@ -54,13 +54,15 @@ static struct callrpc_private { } *callrpc_private; int -callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out) - char *host; - xdrproc_t inproc, outproc; - rpcprog_t prognum; - rpcvers_t versnum; - rpcproc_t procnum; - char *in, *out; +callrpc( + char *host, + rpcprog_t prognum, + rpcvers_t versnum, + rpcproc_t procnum, + xdrproc_t inproc, + char *in, + xdrproc_t outproc, + char *out) { register struct callrpc_private *crp = callrpc_private; struct sockaddr_in server_addr; diff --git a/src/lib/rpc/clnt_tcp.c b/src/lib/rpc/clnt_tcp.c index fec7533e9..1f8de8276 100644 --- a/src/lib/rpc/clnt_tcp.c +++ b/src/lib/rpc/clnt_tcp.c @@ -114,13 +114,13 @@ static int writetcp(char *, caddr_t, int); * something more useful. */ CLIENT * -clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz) - struct sockaddr_in *raddr; - rpcprog_t prog; - rpcvers_t vers; - register int *sockp; - u_int sendsz; - u_int recvsz; +clnttcp_create( + struct sockaddr_in *raddr, + rpcprog_t prog, + rpcvers_t vers, + register int *sockp, + u_int sendsz, + u_int recvsz) { CLIENT *h; register struct ct_data *ct = 0; @@ -227,14 +227,14 @@ fooy: } static enum clnt_stat -clnttcp_call(h, proc, xdr_args, args_ptr, xdr_results, results_ptr, timeout) - register CLIENT *h; - rpcproc_t proc; - xdrproc_t xdr_args; - void * args_ptr; - xdrproc_t xdr_results; - void * results_ptr; - struct timeval timeout; +clnttcp_call( + register CLIENT *h, + rpcproc_t proc, + xdrproc_t xdr_args, + void * args_ptr, + xdrproc_t xdr_results, + void * results_ptr, + struct timeval timeout) { register struct ct_data *ct = (struct ct_data *) h->cl_private; register XDR *xdrs = &(ct->ct_xdrs); @@ -336,9 +336,9 @@ call_again: } static void -clnttcp_geterr(h, errp) - CLIENT *h; - struct rpc_err *errp; +clnttcp_geterr( + CLIENT *h, + struct rpc_err *errp) { register struct ct_data *ct = (struct ct_data *) h->cl_private; @@ -347,10 +347,10 @@ clnttcp_geterr(h, errp) } static bool_t -clnttcp_freeres(cl, xdr_res, res_ptr) - CLIENT *cl; - xdrproc_t xdr_res; - void * res_ptr; +clnttcp_freeres( + CLIENT *cl, + xdrproc_t xdr_res, + void * res_ptr) { register struct ct_data *ct = (struct ct_data *)cl->cl_private; register XDR *xdrs = &(ct->ct_xdrs); @@ -361,16 +361,15 @@ clnttcp_freeres(cl, xdr_res, res_ptr) /*ARGSUSED*/ static void -clnttcp_abort(cl) - CLIENT *cl; +clnttcp_abort(CLIENT *cl) { } static bool_t -clnttcp_control(cl, request, info) - CLIENT *cl; - int request; - void *info; +clnttcp_control( + CLIENT *cl, + int request, + void *info) { register struct ct_data *ct = (struct ct_data *)cl->cl_private; int len; @@ -400,8 +399,7 @@ clnttcp_control(cl, request, info) static void -clnttcp_destroy(h) - CLIENT *h; +clnttcp_destroy(CLIENT *h) { register struct ct_data *ct = (struct ct_data *) h->cl_private; @@ -420,10 +418,10 @@ clnttcp_destroy(h) * around for the rpc level. */ static int -readtcp(ctptr, buf, len) - char *ctptr; - caddr_t buf; - register int len; +readtcp( + char *ctptr, + caddr_t buf, + register int len) { register struct ct_data *ct = (struct ct_data *)(void *)ctptr; struct timeval tout; @@ -479,10 +477,10 @@ readtcp(ctptr, buf, len) } static int -writetcp(ctptr, buf, len) - char *ctptr; - caddr_t buf; - int len; +writetcp( + char *ctptr, + caddr_t buf, + int len) { struct ct_data *ct = (struct ct_data *)(void *)ctptr; register int i, cnt; diff --git a/src/lib/rpc/clnt_udp.c b/src/lib/rpc/clnt_udp.c index 33d3b0ec1..a8b59563f 100644 --- a/src/lib/rpc/clnt_udp.c +++ b/src/lib/rpc/clnt_udp.c @@ -110,14 +110,14 @@ struct cu_data { * sent and received. */ CLIENT * -clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz) - struct sockaddr_in *raddr; - rpcprog_t program; - rpcvers_t version; - struct timeval wait; - register int *sockp; - u_int sendsz; - u_int recvsz; +clntudp_bufcreate( + struct sockaddr_in *raddr, + rpcprog_t program, + rpcvers_t version, + struct timeval wait, + register int *sockp, + u_int sendsz, + u_int recvsz) { CLIENT *cl; register struct cu_data *cu = 0; @@ -206,12 +206,12 @@ fooy: } CLIENT * -clntudp_create(raddr, program, version, wait, sockp) - struct sockaddr_in *raddr; - rpcprog_t program; - rpcvers_t version; - struct timeval wait; - register int *sockp; +clntudp_create( + struct sockaddr_in *raddr, + rpcprog_t program, + rpcvers_t version, + struct timeval wait, + register int *sockp) { return(clntudp_bufcreate(raddr, program, version, wait, sockp, @@ -219,14 +219,16 @@ clntudp_create(raddr, program, version, wait, sockp) } static enum clnt_stat -clntudp_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout) - register CLIENT *cl; /* client handle */ - rpcproc_t proc; /* procedure number */ - xdrproc_t xargs; /* xdr routine for args */ - void * argsp; /* pointer to args */ - xdrproc_t xresults; /* xdr routine for results */ - void * resultsp; /* pointer to results */ - struct timeval utimeout; /* seconds to wait before giving up */ +clntudp_call( + register CLIENT *cl, /* client handle */ + rpcproc_t proc, /* procedure number */ + xdrproc_t xargs, /* xdr routine for args */ + void * argsp, /* pointer to args */ + xdrproc_t xresults, /* xdr routine for results */ + void * resultsp, /* pointer to results */ + struct timeval utimeout /* seconds to wait before + * giving up */ + ) { register struct cu_data *cu = (struct cu_data *)cl->cl_private; register XDR *xdrs; @@ -405,9 +407,9 @@ send_again: } static void -clntudp_geterr(cl, errp) - CLIENT *cl; - struct rpc_err *errp; +clntudp_geterr( + CLIENT *cl, + struct rpc_err *errp) { register struct cu_data *cu = (struct cu_data *)cl->cl_private; @@ -416,10 +418,10 @@ clntudp_geterr(cl, errp) static bool_t -clntudp_freeres(cl, xdr_res, res_ptr) - CLIENT *cl; - xdrproc_t xdr_res; - void *res_ptr; +clntudp_freeres( + CLIENT *cl, + xdrproc_t xdr_res, + void *res_ptr) { register struct cu_data *cu = (struct cu_data *)cl->cl_private; register XDR *xdrs = &(cu->cu_outxdrs); @@ -431,16 +433,15 @@ clntudp_freeres(cl, xdr_res, res_ptr) /*ARGSUSED*/ static void -clntudp_abort(h) - CLIENT *h; +clntudp_abort(CLIENT *h) { } static bool_t -clntudp_control(cl, request, info) - CLIENT *cl; - int request; - void *info; +clntudp_control( + CLIENT *cl, + int request, + void *info) { register struct cu_data *cu = (struct cu_data *)cl->cl_private; @@ -470,8 +471,7 @@ clntudp_control(cl, request, info) } static void -clntudp_destroy(cl) - CLIENT *cl; +clntudp_destroy(CLIENT *cl) { register struct cu_data *cu = (struct cu_data *)cl->cl_private; diff --git a/src/lib/rpc/get_myaddress.c b/src/lib/rpc/get_myaddress.c index 8c6aa12fd..871c8fcb1 100644 --- a/src/lib/rpc/get_myaddress.c +++ b/src/lib/rpc/get_myaddress.c @@ -50,8 +50,7 @@ static char sccsid[] = "@(#)get_myaddress.c 1.4 87/08/11 Copyr 1984 Sun Micro"; * don't use gethostbyname, which would invoke yellow pages */ int -get_myaddress(addr) - struct sockaddr_in *addr; +get_myaddress(struct sockaddr_in *addr) { memset((void *) addr, 0, sizeof(*addr)); addr->sin_family = AF_INET; @@ -79,8 +78,7 @@ get_myaddress(addr) /* * don't use gethostbyname, which would invoke yellow pages */ -get_myaddress(addr) - struct sockaddr_in *addr; +get_myaddress(struct sockaddr_in *addr) { int s; char buf[256 * sizeof (struct ifreq)]; diff --git a/src/lib/rpc/getrpcent.c b/src/lib/rpc/getrpcent.c index b1d380b2b..a91a7a5bb 100644 --- a/src/lib/rpc/getrpcent.c +++ b/src/lib/rpc/getrpcent.c @@ -69,7 +69,7 @@ char *inet_ntoa(); static char RPCDB[] = "/etc/rpc"; static struct rpcdata * -get_rpcdata() +get_rpcdata(void) { register struct rpcdata *d = rpcdata; @@ -81,8 +81,7 @@ get_rpcdata() } struct rpcent * -getrpcbynumber(number) - register int number; +getrpcbynumber(register int number) { register struct rpcdata *d = get_rpcdata(); register struct rpcent *p; @@ -102,8 +101,7 @@ getrpcbynumber(number) } struct rpcent * -getrpcbyname(name) - const char *name; +getrpcbyname(const char *name) { struct rpcent *rpc; char **rp; @@ -121,8 +119,7 @@ getrpcbyname(name) return (NULL); } -SETRPCENT_TYPE setrpcent(f) - int f; +SETRPCENT_TYPE setrpcent(int f) { register struct rpcdata *d = _rpcdata(); @@ -138,7 +135,7 @@ SETRPCENT_TYPE setrpcent(f) d->stayopen |= f; } -ENDRPCENT_TYPE endrpcent() +ENDRPCENT_TYPE endrpcent(void) { register struct rpcdata *d = _rpcdata(); @@ -155,7 +152,7 @@ ENDRPCENT_TYPE endrpcent() } struct rpcent * -getrpcent() +getrpcent(void) { struct rpcent *hp; int reason; @@ -173,8 +170,7 @@ getrpcent() } static struct rpcent * -interpret(val, len) -char *val; +interpret(char *val, int len) { register struct rpcdata *d = _rpcdata(); char *p; diff --git a/src/lib/rpc/getrpcport.c b/src/lib/rpc/getrpcport.c index 66bcb6f99..e40401726 100644 --- a/src/lib/rpc/getrpcport.c +++ b/src/lib/rpc/getrpcport.c @@ -43,11 +43,11 @@ static char sccsid[] = "@(#)getrpcport.c 1.3 87/08/11 SMI"; #include int -gssrpc_getrpcport(host, prognum, versnum, proto) - char *host; - rpcprog_t prognum; - rpcvers_t versnum; - rpcprot_t proto; +gssrpc_getrpcport( + char *host, + rpcprog_t prognum, + rpcvers_t versnum, + rpcprot_t proto) { struct sockaddr_in addr; struct hostent *hp; diff --git a/src/lib/rpc/libgssrpc.exports b/src/lib/rpc/libgssrpc.exports index de3280f2d..66f27a4ce 100644 --- a/src/lib/rpc/libgssrpc.exports +++ b/src/lib/rpc/libgssrpc.exports @@ -1,12 +1,3 @@ -gssrpc__authenticate -gssrpc__null_auth -gssrpc__rpc_dtablesize -gssrpc__seterr_reply -gssrpc__svcauth_gss -gssrpc__svcauth_gssapi -gssrpc__svcauth_none -gssrpc__svcauth_short -gssrpc__svcauth_unix gssrpc_auth_debug_gss gssrpc_auth_debug_gssapi gssrpc_auth_gssapi_create @@ -146,21 +137,3 @@ gssrpc_xdrrec_skiprecord gssrpc_xdrstdio_create gssrpc_xprt_register gssrpc_xprt_unregister -gssrpcint_DynAdd -gssrpcint_DynAppend -gssrpcint_DynArray -gssrpcint_DynCapacity -gssrpcint_DynCopy -gssrpcint_DynCreate -gssrpcint_DynDebug -gssrpcint_DynDelete -gssrpcint_DynDestroy -gssrpcint_DynGet -gssrpcint_DynInitzero -gssrpcint_DynInsert -gssrpcint_DynParanoid -gssrpcint_DynPut -gssrpcint_DynRealloc -gssrpcint_DynRelease -gssrpcint_DynResize -gssrpcint_DynSize diff --git a/src/lib/rpc/pmap_clnt.c b/src/lib/rpc/pmap_clnt.c index 39e8d90bd..7951d2ea0 100644 --- a/src/lib/rpc/pmap_clnt.c +++ b/src/lib/rpc/pmap_clnt.c @@ -53,11 +53,11 @@ void clnt_perror(); * Calls the pmap service remotely to do the mapping. */ bool_t -pmap_set(program, version, protocol, port) - rpcprog_t program; - rpcvers_t version; - rpcprot_t protocol; - u_int port; +pmap_set( + rpcprog_t program, + rpcvers_t version, + rpcprot_t protocol, + u_int port) { struct sockaddr_in myaddress; int socket = -1; @@ -89,9 +89,9 @@ pmap_set(program, version, protocol, port) * Calls the pmap service remotely to do the un-mapping. */ bool_t -pmap_unset(program, version) - rpcprog_t program; - rpcvers_t version; +pmap_unset( + rpcprog_t program, + rpcvers_t version) { struct sockaddr_in myaddress; int socket = -1; diff --git a/src/lib/rpc/pmap_getmaps.c b/src/lib/rpc/pmap_getmaps.c index a4e1f9ca0..36997c22a 100644 --- a/src/lib/rpc/pmap_getmaps.c +++ b/src/lib/rpc/pmap_getmaps.c @@ -62,8 +62,7 @@ static char sccsid[] = "@(#)pmap_getmaps.c 1.10 87/08/11 Copyr 1984 Sun Micro"; * 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 sock = -1; diff --git a/src/lib/rpc/pmap_getport.c b/src/lib/rpc/pmap_getport.c index 35be08774..998a08199 100644 --- a/src/lib/rpc/pmap_getport.c +++ b/src/lib/rpc/pmap_getport.c @@ -58,11 +58,11 @@ static struct timeval tottimeout = { 60, 0 }; * Returns 0 if no map exists. */ u_short -pmap_getport(address, program, version, protocol) - struct sockaddr_in *address; - rpcprog_t program; - rpcvers_t version; - rpcprot_t protocol; +pmap_getport( + struct sockaddr_in *address, + rpcprog_t program, + rpcvers_t version, + rpcprot_t protocol) { unsigned short port = 0; int sock = -1; diff --git a/src/lib/rpc/pmap_prot.c b/src/lib/rpc/pmap_prot.c index 0dc6a5c46..0f39f91a4 100644 --- a/src/lib/rpc/pmap_prot.c +++ b/src/lib/rpc/pmap_prot.c @@ -44,9 +44,7 @@ static char sccsid[] = "@(#)pmap_prot.c 1.17 87/08/11 Copyr 1984 Sun Micro"; bool_t -xdr_pmap(xdrs, regs) - XDR *xdrs; - struct pmap *regs; +xdr_pmap(XDR *xdrs, struct pmap *regs) { if (xdr_rpcprog(xdrs, ®s->pm_prog) && diff --git a/src/lib/rpc/pmap_prot2.c b/src/lib/rpc/pmap_prot2.c index 4743ede83..13dc1afb6 100644 --- a/src/lib/rpc/pmap_prot2.c +++ b/src/lib/rpc/pmap_prot2.c @@ -82,9 +82,7 @@ static char sccsid[] = "@(#)pmap_prot2.c 1.3 87/08/11 Copyr 1984 Sun Micro"; * this sounds like a job for xdr_reference! */ bool_t -xdr_pmaplist(xdrs, rp) - register XDR *xdrs; - register struct pmaplist **rp; +xdr_pmaplist(register XDR *xdrs, register struct pmaplist **rp) { /* * more_elements is pre-computed in case the direction is diff --git a/src/lib/rpc/pmap_rmt.c b/src/lib/rpc/pmap_rmt.c index a1c3b63b3..062a5e19f 100644 --- a/src/lib/rpc/pmap_rmt.c +++ b/src/lib/rpc/pmap_rmt.c @@ -71,15 +71,17 @@ 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; - rpcprog_t prog; - rpcvers_t vers; - rpcproc_t proc; - xdrproc_t xdrargs, xdrres; - caddr_t argsp, resp; - struct timeval tout; - rpcport_t *port_ptr; +pmap_rmtcall( + struct sockaddr_in *addr, + rpcprog_t prog, + rpcvers_t vers, + rpcproc_t proc, + xdrproc_t xdrargs, + caddr_t argsp, + xdrproc_t xdrres, + caddr_t resp, + struct timeval tout, + rpcport_t *port_ptr) { int sock = -1; register CLIENT *client; @@ -115,9 +117,9 @@ 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) - register XDR *xdrs; - register struct rmtcallargs *cap; +xdr_rmtcall_args( + register XDR *xdrs, + register struct rmtcallargs *cap) { u_int lenposition, argposition, position; @@ -146,9 +148,9 @@ xdr_rmtcall_args(xdrs, cap) * written for XDR_DECODE direction only */ bool_t -xdr_rmtcallres(xdrs, crp) - register XDR *xdrs; - register struct rmtcallres *crp; +xdr_rmtcallres( + register XDR *xdrs, + register struct rmtcallres *crp) { caddr_t port_ptr; @@ -171,10 +173,11 @@ xdr_rmtcallres(xdrs, crp) #define GIFCONF_BUFSIZE (256 * sizeof (struct ifconf)) 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; @@ -225,15 +228,16 @@ getbroadcastnets(addrs, sock, buf) } enum clnt_stat -clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) - rpcprog_t prog; /* program number */ - rpcvers_t vers; /* version number */ - rpcproc_t 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( + rpcprog_t prog, /* program number */ + rpcvers_t vers, /* version number */ + rpcproc_t proc, /* procedure number */ + xdrproc_t xargs, /* xdr routine for args */ + caddr_t argsp, /* pointer to args */ + xdrproc_t xresults, /* xdr routine for results */ + caddr_t resultsp, /* pointer to results */ + resultproc_t eachresult /* call with each result obtained */ + ) { enum clnt_stat stat; AUTH *unix_auth = authunix_create_default(); diff --git a/src/lib/rpc/rpc_callmsg.c b/src/lib/rpc/rpc_callmsg.c index 7765f1f22..2e4789abb 100644 --- a/src/lib/rpc/rpc_callmsg.c +++ b/src/lib/rpc/rpc_callmsg.c @@ -46,9 +46,7 @@ static char sccsid[] = "@(#)rpc_callmsg.c 1.4 87/08/11 Copyr 1984 Sun Micro"; * XDR a call message */ bool_t -xdr_callmsg(xdrs, cmsg) - register XDR *xdrs; - register struct rpc_msg *cmsg; +xdr_callmsg(register XDR *xdrs, register struct rpc_msg *cmsg) { register rpc_inline_t *buf; register struct opaque_auth *oa; diff --git a/src/lib/rpc/rpc_prot.c b/src/lib/rpc/rpc_prot.c index 4f282fb84..17e26b101 100644 --- a/src/lib/rpc/rpc_prot.c +++ b/src/lib/rpc/rpc_prot.c @@ -55,9 +55,7 @@ static char sccsid[] = "@(#)rpc_prot.c 1.36 87/08/11 Copyr 1984 Sun Micro"; * (see auth.h) */ bool_t -xdr_opaque_auth(xdrs, ap) - register XDR *xdrs; - register struct opaque_auth *ap; +xdr_opaque_auth(XDR *xdrs, struct opaque_auth *ap) { if (xdr_enum(xdrs, &(ap->oa_flavor))) @@ -70,9 +68,7 @@ xdr_opaque_auth(xdrs, ap) * XDR a DES block */ bool_t -xdr_des_block(xdrs, blkp) - register XDR *xdrs; - register des_block *blkp; +xdr_des_block(XDR *xdrs, des_block *blkp) { return (xdr_opaque(xdrs, (caddr_t)blkp, sizeof(des_block))); } @@ -83,9 +79,7 @@ xdr_des_block(xdrs, blkp) * XDR the MSG_ACCEPTED part of a reply message union */ bool_t -xdr_accepted_reply(xdrs, ar) - register XDR *xdrs; - register struct accepted_reply *ar; +xdr_accepted_reply(XDR *xdrs, struct accepted_reply *ar) { /* personalized union, rather than calling xdr_union */ @@ -116,9 +110,7 @@ xdr_accepted_reply(xdrs, ar) * XDR the MSG_DENIED part of a reply message union */ bool_t -xdr_rejected_reply(xdrs, rr) - register XDR *xdrs; - register struct rejected_reply *rr; +xdr_rejected_reply(XDR *xdrs, struct rejected_reply *rr) { /* personalized union, rather than calling xdr_union */ @@ -146,9 +138,7 @@ static struct xdr_discrim reply_dscrm[3] = { * XDR a reply message */ bool_t -xdr_replymsg(xdrs, rmsg) - register XDR *xdrs; - register struct rpc_msg *rmsg; +xdr_replymsg(XDR *xdrs, struct rpc_msg *rmsg) { if ( xdr_u_int32(xdrs, &(rmsg->rm_xid)) && @@ -166,9 +156,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) - register XDR *xdrs; - register struct rpc_msg *cmsg; +xdr_callhdr(XDR *xdrs, struct rpc_msg *cmsg) { cmsg->rm_direction = CALL; @@ -186,9 +174,7 @@ xdr_callhdr(xdrs, cmsg) /* ************************** Client utility routine ************* */ static void -accepted(acpt_stat, error) - register enum accept_stat acpt_stat; - register struct rpc_err *error; +accepted(enum accept_stat acpt_stat, struct rpc_err *error) { switch (acpt_stat) { @@ -224,9 +210,7 @@ accepted(acpt_stat, error) } static void -rejected(rjct_stat, error) - register enum reject_stat rjct_stat; - register struct rpc_err *error; +rejected(enum reject_stat rjct_stat, struct rpc_err *error) { switch (rjct_stat) { @@ -249,9 +233,7 @@ rejected(rjct_stat, error) * given a reply message, fills in the error */ void -gssrpc__seterr_reply(msg, error) - register struct rpc_msg *msg; - register struct rpc_err *error; +gssrpc__seterr_reply(struct rpc_msg *msg, struct rpc_err *error) { /* optimized for normal, SUCCESSful case */ diff --git a/src/lib/rpc/svc.c b/src/lib/rpc/svc.c index ac69df48f..523ef2f6d 100644 --- a/src/lib/rpc/svc.c +++ b/src/lib/rpc/svc.c @@ -83,8 +83,7 @@ static struct svc_callout *svc_find(rpcprog_t, rpcvers_t, * Activate a transport handle. */ void -xprt_register(xprt) - SVCXPRT *xprt; +xprt_register(SVCXPRT *xprt) { register int sock = xprt->xp_sock; @@ -117,8 +116,7 @@ xprt_register(xprt) * De-activate a transport handle. */ void -xprt_unregister(xprt) - SVCXPRT *xprt; +xprt_unregister(SVCXPRT *xprt) { register int sock = xprt->xp_sock; @@ -148,12 +146,12 @@ xprt_unregister(xprt) * program number comes in. */ bool_t -svc_register(xprt, prog, vers, dispatch, protocol) - SVCXPRT *xprt; - rpcprog_t prog; - rpcvers_t vers; - void (*dispatch)(); - int protocol; +svc_register( + SVCXPRT *xprt, + rpcprog_t prog, + rpcvers_t vers, + void (*dispatch)(), + int protocol) { struct svc_callout *prev; register struct svc_callout *s; @@ -184,9 +182,9 @@ pmap_it: * Remove a service program from the callout list. */ void -svc_unregister(prog, vers) - rpcprog_t prog; - rpcvers_t vers; +svc_unregister( + rpcprog_t prog, + rpcvers_t vers) { struct svc_callout *prev; register struct svc_callout *s; @@ -209,10 +207,10 @@ svc_unregister(prog, vers) * struct. */ static struct svc_callout * -svc_find(prog, vers, prev) - rpcprog_t prog; - rpcvers_t vers; - struct svc_callout **prev; +svc_find( + rpcprog_t prog, + rpcvers_t vers, + struct svc_callout **prev) { register struct svc_callout *s, *p; @@ -233,10 +231,10 @@ done: * Send a reply to an rpc request */ bool_t -svc_sendreply(xprt, xdr_results, xdr_location) - register SVCXPRT *xprt; - xdrproc_t xdr_results; - caddr_t xdr_location; +svc_sendreply( + register SVCXPRT *xprt, + xdrproc_t xdr_results, + caddr_t xdr_location) { struct rpc_msg rply; @@ -253,8 +251,7 @@ svc_sendreply(xprt, xdr_results, xdr_location) * No procedure error reply */ void -svcerr_noproc(xprt) - register SVCXPRT *xprt; +svcerr_noproc(register SVCXPRT *xprt) { struct rpc_msg rply; @@ -269,8 +266,7 @@ svcerr_noproc(xprt) * Can't decode args error reply */ void -svcerr_decode(xprt) - register SVCXPRT *xprt; +svcerr_decode(register SVCXPRT *xprt) { struct rpc_msg rply; @@ -285,8 +281,7 @@ svcerr_decode(xprt) * Some system error */ void -svcerr_systemerr(xprt) - register SVCXPRT *xprt; +svcerr_systemerr(register SVCXPRT *xprt) { struct rpc_msg rply; @@ -301,9 +296,9 @@ 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; @@ -318,8 +313,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); @@ -329,8 +323,7 @@ svcerr_weakauth(xprt) * Program unavailable error reply */ void -svcerr_noprog(xprt) - register SVCXPRT *xprt; +svcerr_noprog(register SVCXPRT *xprt) { struct rpc_msg rply; @@ -345,10 +338,10 @@ svcerr_noprog(xprt) * Program version mismatch error reply */ void -svcerr_progvers(xprt, low_vers, high_vers) - register SVCXPRT *xprt; - rpcvers_t low_vers; - rpcvers_t high_vers; +svcerr_progvers( + register SVCXPRT *xprt, + rpcvers_t low_vers, + rpcvers_t high_vers) { struct rpc_msg rply; @@ -380,8 +373,7 @@ svcerr_progvers(xprt, low_vers, high_vers) */ void -svc_getreq(rdfds) - int rdfds; +svc_getreq(int rdfds) { #ifdef FD_SETSIZE fd_set readfds; @@ -402,15 +394,17 @@ svc_getreq(rdfds) } void -svc_getreqset(readfds) +svc_getreqset( #ifdef FD_SETSIZE - fd_set *readfds; -{ + fd_set *readfds #else - int *readfds; -{ - int readfds_local = *readfds; + int *readfds #endif /* def FD_SETSIZE */ + ) +{ +#ifndef FD_SETSIZE + int readfds_local = *readfds; +#endif enum xprt_stat stat; struct rpc_msg msg; int prog_found; @@ -434,16 +428,19 @@ svc_getreqset(readfds) r.rq_clntcred = cookedcred; #ifdef FD_SETSIZE - for (sock = 0; sock <= max_xport; sock++) { - if (FD_ISSET(sock, readfds)) { - /* sock has input waiting */ - xprt = xports[sock]; +#define loopcond (sock <= max_xport) +#define loopincr (sock++) +#define sockready (FD_ISSET(sock, readfds)) #else - for (sock = 0; readfds_local != 0; sock++, readfds_local >>= 1) { - if ((readfds_local & 1) != 0) { +#define loopcond (readfds_local !=0) +#define loopincr (sock++, readfds_local >>= 1) +#define sockready ((readfds_local & 1) != 0) +#endif + + for (sock = 0; loopcond; loopincr) { + if (sockready) { /* sock has input waiting */ xprt = xports[sock]; -#endif /* def FD_SETSIZE */ /* now receive msgs from xprtprt (support batch calls) */ do { if (SVC_RECV(xprt, &msg)) { diff --git a/src/lib/rpc/svc_auth.c b/src/lib/rpc/svc_auth.c index 7630f416e..8732619cb 100644 --- a/src/lib/rpc/svc_auth.c +++ b/src/lib/rpc/svc_auth.c @@ -84,10 +84,10 @@ static int svcauthnum = sizeof(svcauthsw) / sizeof(struct svcauthsw_type); * rqst->rq_client_cred, the cooked credentials. */ enum auth_stat -gssrpc__authenticate(rqst, msg, no_dispatch) - register struct svc_req *rqst; - struct rpc_msg *msg; - bool_t *no_dispatch; +gssrpc__authenticate( + register struct svc_req *rqst, + struct rpc_msg *msg, + bool_t *no_dispatch) { register int cred_flavor, i; diff --git a/src/lib/rpc/svc_auth_gss.c b/src/lib/rpc/svc_auth_gss.c index 4479513cf..78da340cb 100644 --- a/src/lib/rpc/svc_auth_gss.c +++ b/src/lib/rpc/svc_auth_gss.c @@ -683,13 +683,12 @@ svcauth_gss_get_principal(SVCAUTH *auth) * * See functional specifications. */ -void svcauth_gss_set_log_badauth_func - (func, data) - auth_gssapi_log_badauth_func func; - caddr_t data; +void svcauth_gss_set_log_badauth_func( + auth_gssapi_log_badauth_func func, + caddr_t data) { - log_badauth = func; - log_badauth_data = data; + log_badauth = func; + log_badauth_data = data; } /* @@ -700,13 +699,12 @@ void svcauth_gss_set_log_badauth_func * * See functional specifications. */ -void svcauth_gss_set_log_badverf_func - (func, data) - auth_gssapi_log_badverf_func func; - caddr_t data; +void svcauth_gss_set_log_badverf_func( + auth_gssapi_log_badverf_func func, + caddr_t data) { - log_badverf = func; - log_badverf_data = data; + log_badverf = func; + log_badverf_data = data; } /* @@ -717,11 +715,10 @@ void svcauth_gss_set_log_badverf_func * * See functional specifications. */ -void svcauth_gss_set_log_miscerr_func - (func, data) - auth_gssapi_log_miscerr_func func; - caddr_t data; +void svcauth_gss_set_log_miscerr_func( + auth_gssapi_log_miscerr_func func, + caddr_t data) { - log_miscerr = func; - log_miscerr_data = data; + log_miscerr = func; + log_miscerr_data = data; } diff --git a/src/lib/rpc/svc_auth_gssapi.c b/src/lib/rpc/svc_auth_gssapi.c index f9bde1783..7ddefe5e8 100644 --- a/src/lib/rpc/svc_auth_gssapi.c +++ b/src/lib/rpc/svc_auth_gssapi.c @@ -119,10 +119,10 @@ typedef struct _client_list { static client_list *clients = NULL; -enum auth_stat gssrpc__svcauth_gssapi(rqst, msg, no_dispatch) - register struct svc_req *rqst; - register struct rpc_msg *msg; - bool_t *no_dispatch; +enum auth_stat gssrpc__svcauth_gssapi( + register struct svc_req *rqst, + register struct rpc_msg *msg, + bool_t *no_dispatch) { XDR xdrs; auth_gssapi_creds creds; @@ -623,7 +623,7 @@ error: return ret; } -static void cleanup() +static void cleanup(void) { client_list *c, *c2; @@ -654,7 +654,7 @@ static void cleanup() * b-tree. A new key that is unique in the current database is * chosen; this key should be used as the client's client_handle. */ -static svc_auth_gssapi_data *create_client() +static svc_auth_gssapi_data *create_client(void) { client_list *c; svc_auth_gssapi_data *client_data; @@ -720,9 +720,9 @@ static svc_auth_gssapi_data *create_client() * would break the rep invariant. Now the database is an unsorted * linked list, so it doesn't matter. */ -static void client_expire(client_data, exp) - svc_auth_gssapi_data *client_data; - uint32_t exp; +static void client_expire( + svc_auth_gssapi_data *client_data, + uint32_t exp) { client_data->expiration = exp; } @@ -743,8 +743,7 @@ static void client_expire(client_data, exp) * matches the contents of client_handle, or returns NULL if none was * found. */ -static svc_auth_gssapi_data *get_client(client_handle) - gss_buffer_t client_handle; +static svc_auth_gssapi_data *get_client(gss_buffer_t client_handle) { client_list *c; uint32_t handle; @@ -779,8 +778,7 @@ static svc_auth_gssapi_data *get_client(client_handle) * client_data's entry in the database is destroyed. client_data is * freed. */ -static void destroy_client(client_data) - svc_auth_gssapi_data *client_data; +static void destroy_client(svc_auth_gssapi_data *client_data) { OM_uint32 gssstat, minor_stat; gss_buffer_desc out_buf; @@ -842,8 +840,7 @@ done: #endif } -static void dump_db(msg) - char *msg; +static void dump_db(char *msg) { svc_auth_gssapi_data *client_data; client_list *c; @@ -861,7 +858,7 @@ static void dump_db(msg) L_PRINTF(3, ("\n")); } -static void clean_client() +static void clean_client(void) { svc_auth_gssapi_data *client_data; client_list *c; @@ -896,9 +893,9 @@ static void clean_client() * * See functional specifications. */ -bool_t svcauth_gssapi_set_names(names, num) - auth_gssapi_name *names; - int num; +bool_t svcauth_gssapi_set_names( + auth_gssapi_name *names, + int num) { OM_uint32 gssstat, minor_stat; gss_buffer_desc in_buf; @@ -964,7 +961,7 @@ fail: * svcauth_gssapi_set_names */ -void svcauth_gssapi_unset_names() +void svcauth_gssapi_unset_names(void) { int i; OM_uint32 minor_stat; @@ -997,10 +994,9 @@ void svcauth_gssapi_unset_names() * * See functional specifications. */ -void svcauth_gssapi_set_log_badauth_func - (func, data) - auth_gssapi_log_badauth_func func; - caddr_t data; +void svcauth_gssapi_set_log_badauth_func( + auth_gssapi_log_badauth_func func, + caddr_t data) { log_badauth = func; log_badauth_data = data; @@ -1014,10 +1010,9 @@ void svcauth_gssapi_set_log_badauth_func * * See functional specifications. */ -void svcauth_gssapi_set_log_badverf_func - (func, data) - auth_gssapi_log_badverf_func func; - caddr_t data; +void svcauth_gssapi_set_log_badverf_func( + auth_gssapi_log_badverf_func func, + caddr_t data) { log_badverf = func; log_badverf_data = data; @@ -1031,10 +1026,9 @@ void svcauth_gssapi_set_log_badverf_func * * See functional specifications. */ -void svcauth_gssapi_set_log_miscerr_func - (func, data) - auth_gssapi_log_miscerr_func func; - caddr_t data; +void svcauth_gssapi_set_log_miscerr_func( + auth_gssapi_log_miscerr_func func, + caddr_t data) { log_miscerr = func; log_miscerr_data = data; @@ -1044,11 +1038,11 @@ void svcauth_gssapi_set_log_miscerr_func * Encrypt the serialized arguments from xdr_func applied to xdr_ptr * and write the result to xdrs. */ -static bool_t svc_auth_gssapi_wrap(auth, out_xdrs, xdr_func, xdr_ptr) - SVCAUTH *auth; - XDR *out_xdrs; - bool_t (*xdr_func)(); - caddr_t xdr_ptr; +static bool_t svc_auth_gssapi_wrap( + SVCAUTH *auth, + XDR *out_xdrs, + bool_t (*xdr_func)(), + caddr_t xdr_ptr) { OM_uint32 gssstat, minor_stat; @@ -1067,11 +1061,11 @@ static bool_t svc_auth_gssapi_wrap(auth, out_xdrs, xdr_func, xdr_ptr) return TRUE; } -static bool_t svc_auth_gssapi_unwrap(auth, in_xdrs, xdr_func, xdr_ptr) - SVCAUTH *auth; - XDR *in_xdrs; - bool_t (*xdr_func)(); - caddr_t xdr_ptr; +static bool_t svc_auth_gssapi_unwrap( + SVCAUTH *auth, + XDR *in_xdrs, + bool_t (*xdr_func)(), + caddr_t xdr_ptr) { svc_auth_gssapi_data *client_data = SVCAUTH_PRIVATE(auth); OM_uint32 gssstat, minor_stat; @@ -1091,8 +1085,7 @@ static bool_t svc_auth_gssapi_unwrap(auth, in_xdrs, xdr_func, xdr_ptr) return TRUE; } -static bool_t svc_auth_gssapi_destroy(auth) - SVCAUTH *auth; +static bool_t svc_auth_gssapi_destroy(SVCAUTH *auth) { svc_auth_gssapi_data *client_data = SVCAUTH_PRIVATE(auth); diff --git a/src/lib/rpc/svc_auth_unix.c b/src/lib/rpc/svc_auth_unix.c index eb8182de0..480ee7a9e 100644 --- a/src/lib/rpc/svc_auth_unix.c +++ b/src/lib/rpc/svc_auth_unix.c @@ -50,10 +50,10 @@ static char sccsid[] = "@(#)svc_auth_unix.c 1.28 88/02/08 Copyr 1984 Sun Micro"; * Unix longhand authenticator */ enum auth_stat -gssrpc__svcauth_unix(rqst, msg, dispatch) - register struct svc_req *rqst; - register struct rpc_msg *msg; - bool_t *dispatch; +gssrpc__svcauth_unix( + register struct svc_req *rqst, + register struct rpc_msg *msg, + bool_t *dispatch) { register enum auth_stat stat; XDR xdrs; @@ -130,10 +130,10 @@ done: */ /*ARGSUSED*/ enum auth_stat -gssrpc__svcauth_short(rqst, msg, dispatch) - struct svc_req *rqst; - struct rpc_msg *msg; - bool_t *dispatch; +gssrpc__svcauth_short( + struct svc_req *rqst, + struct rpc_msg *msg, + bool_t *dispatch) { rqst->rq_xprt->xp_auth = &svc_auth_none; return (AUTH_REJECTEDCRED); diff --git a/src/lib/rpc/svc_raw.c b/src/lib/rpc/svc_raw.c index 00220e6eb..d2507ae8d 100644 --- a/src/lib/rpc/svc_raw.c +++ b/src/lib/rpc/svc_raw.c @@ -70,7 +70,7 @@ static struct xp_ops server_ops = { }; SVCXPRT * -svcraw_create() +svcraw_create(void) { register struct svcraw_private *srp = svcraw_private; @@ -88,17 +88,14 @@ svcraw_create() } static enum xprt_stat -svcraw_stat(xprt) - SVCXPRT *xprt; +svcraw_stat(SVCXPRT *xprt) { return (XPRT_IDLE); } static bool_t -svcraw_recv(xprt, msg) - SVCXPRT *xprt; - struct rpc_msg *msg; +svcraw_recv(SVCXPRT *xprt, struct rpc_msg *msg) { register struct svcraw_private *srp = svcraw_private; register XDR *xdrs; @@ -114,9 +111,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) { register struct svcraw_private *srp = svcraw_private; register XDR *xdrs; @@ -133,10 +128,7 @@ svcraw_reply(xprt, msg) } static bool_t -svcraw_getargs(xprt, xdr_args, args_ptr) - SVCXPRT *xprt; - xdrproc_t xdr_args; - void * args_ptr; +svcraw_getargs(SVCXPRT *xprt, xdrproc_t xdr_args, void *args_ptr) { register struct svcraw_private *srp = svcraw_private; @@ -150,10 +142,7 @@ svcraw_getargs(xprt, xdr_args, args_ptr) } static bool_t -svcraw_freeargs(xprt, xdr_args, args_ptr) - SVCXPRT *xprt; - xdrproc_t xdr_args; - void * args_ptr; +svcraw_freeargs(SVCXPRT *xprt, xdrproc_t xdr_args, void *args_ptr) { register struct svcraw_private *srp = svcraw_private; register XDR *xdrs; @@ -166,7 +155,6 @@ svcraw_freeargs(xprt, xdr_args, args_ptr) } static void -svcraw_destroy(xprt) - SVCXPRT *xprt; +svcraw_destroy(SVCXPRT *xprt) { } diff --git a/src/lib/rpc/svc_run.c b/src/lib/rpc/svc_run.c index ea6dfdd5d..f87a1e12f 100644 --- a/src/lib/rpc/svc_run.c +++ b/src/lib/rpc/svc_run.c @@ -40,7 +40,7 @@ static char sccsid[] = "@(#)svc_run.c 1.1 87/10/13 Copyr 1984 Sun Micro"; #include void -svc_run() +svc_run(void) { #ifdef FD_SETSIZE fd_set readfds; diff --git a/src/lib/rpc/svc_simple.c b/src/lib/rpc/svc_simple.c index 520fa6a1b..6ae85ce52 100644 --- a/src/lib/rpc/svc_simple.c +++ b/src/lib/rpc/svc_simple.c @@ -56,12 +56,13 @@ static void universal(struct svc_req *, SVCXPRT *); static SVCXPRT *transp; int -registerrpc(prognum, versnum, procnum, progname, inproc, outproc) - char *(*progname)(); - xdrproc_t inproc, outproc; - rpcprog_t prognum; - rpcvers_t versnum; - rpcproc_t procnum; +registerrpc( + rpcprog_t prognum, + rpcvers_t versnum, + rpcproc_t procnum, + char *(*progname)(), + xdrproc_t inproc, + xdrproc_t outproc) { struct proglst *pl; @@ -99,9 +100,9 @@ registerrpc(prognum, versnum, procnum, progname, inproc, outproc) } static void -universal(rqstp, s_transp) - struct svc_req *rqstp; - SVCXPRT *s_transp; +universal( + struct svc_req *rqstp, + SVCXPRT *s_transp) { int prog, proc; char *outdata; diff --git a/src/lib/rpc/svc_tcp.c b/src/lib/rpc/svc_tcp.c index 841bcc6be..95ab9febc 100644 --- a/src/lib/rpc/svc_tcp.c +++ b/src/lib/rpc/svc_tcp.c @@ -126,10 +126,10 @@ struct tcp_conn { /* kept in xprt->xp_p1 */ * 0 => use the system default. */ SVCXPRT * -svctcp_create(sock, sendsize, recvsize) - register int sock; - u_int sendsize; - u_int recvsize; +svctcp_create( + register int sock, + u_int sendsize, + u_int recvsize) { bool_t madesock = FALSE; register SVCXPRT *xprt; @@ -191,20 +191,20 @@ 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) { register SVCXPRT *xprt; register struct tcp_conn *cd; @@ -239,9 +239,9 @@ makefd_xprt(fd, sendsize, recvsize) } static bool_t -rendezvous_request(xprt, msg) - register SVCXPRT *xprt; - struct rpc_msg *msg; +rendezvous_request( + register SVCXPRT *xprt, + struct rpc_msg *msg) { int sock; struct tcp_rendezvous *r; @@ -272,16 +272,14 @@ rendezvous_request(xprt, msg) } static enum xprt_stat -rendezvous_stat(xprt) - register SVCXPRT *xprt; +rendezvous_stat(register SVCXPRT *xprt) { return (XPRT_IDLE); } static void -svctcp_destroy(xprt) - register SVCXPRT *xprt; +svctcp_destroy(register SVCXPRT *xprt) { register struct tcp_conn *cd = (struct tcp_conn *)xprt->xp_p1; @@ -314,10 +312,10 @@ static struct timeval wait_per_try = { 35, 0 }; * (And a read of zero bytes is a half closed stream => error.) */ static int -readtcp(xprtptr, buf, len) - char *xprtptr; - caddr_t buf; - register int len; +readtcp( + char *xprtptr, + caddr_t buf, + register int len) { register SVCXPRT *xprt = (SVCXPRT *)(void *)xprtptr; register int sock = xprt->xp_sock; @@ -332,6 +330,11 @@ readtcp(xprtptr, buf, len) register int mask = 1 << sock; int readfds; #endif /* def FD_SETSIZE */ +#ifdef FD_SETSIZE +#define loopcond (!FD_ISSET(sock, &readfds)) +#else +#define loopcond (readfds != mask) +#endif do { readfds = mask; tout = wait_per_try; @@ -342,11 +345,7 @@ readtcp(xprtptr, buf, len) } goto fatal_err; } -#ifdef FD_SETSIZE - } while (!FD_ISSET(sock, &readfds)); -#else - } while (readfds != mask); -#endif /* def FD_SETSIZE */ + } while (loopcond); if ((len = read(sock, buf, (size_t) len)) > 0) { return (len); } @@ -360,10 +359,10 @@ fatal_err: * Any error is fatal and the connection is closed. */ static int -writetcp(xprtptr, buf, len) - char *xprtptr; - caddr_t buf; - int len; +writetcp( + char *xprtptr, + caddr_t buf, + int len) { register SVCXPRT *xprt = (SVCXPRT *)(void *) xprtptr; register int i, cnt; @@ -379,8 +378,7 @@ writetcp(xprtptr, buf, len) } static enum xprt_stat -svctcp_stat(xprt) - SVCXPRT *xprt; +svctcp_stat(SVCXPRT *xprt) { register struct tcp_conn *cd = (struct tcp_conn *)(xprt->xp_p1); @@ -393,9 +391,9 @@ svctcp_stat(xprt) } static bool_t -svctcp_recv(xprt, msg) - SVCXPRT *xprt; - register struct rpc_msg *msg; +svctcp_recv( + SVCXPRT *xprt, + register struct rpc_msg *msg) { register struct tcp_conn *cd = (struct tcp_conn *)(xprt->xp_p1); @@ -411,10 +409,10 @@ svctcp_recv(xprt, msg) } static bool_t -svctcp_getargs(xprt, xdr_args, args_ptr) - SVCXPRT *xprt; - xdrproc_t xdr_args; - void *args_ptr; +svctcp_getargs( + SVCXPRT *xprt, + xdrproc_t xdr_args, + void *args_ptr) { if (! SVCAUTH_UNWRAP(xprt->xp_auth, &(((struct tcp_conn *)(xprt->xp_p1))->xdrs), @@ -426,10 +424,10 @@ svctcp_getargs(xprt, xdr_args, args_ptr) } static bool_t -svctcp_freeargs(xprt, xdr_args, args_ptr) - SVCXPRT *xprt; - xdrproc_t xdr_args; - void * args_ptr; +svctcp_freeargs( + SVCXPRT *xprt, + xdrproc_t xdr_args, + void * args_ptr) { register XDR *xdrs = &(((struct tcp_conn *)(xprt->xp_p1))->xdrs); @@ -438,69 +436,65 @@ svctcp_freeargs(xprt, xdr_args, args_ptr) return ((*xdr_args)(xdrs, args_ptr)); } -static bool_t svctcp_reply(xprt, msg) - SVCXPRT *xprt; - register struct rpc_msg *msg; +static bool_t svctcp_reply( + SVCXPRT *xprt, + register struct rpc_msg *msg) { - register struct tcp_conn *cd = - (struct tcp_conn *)(xprt->xp_p1); - register XDR *xdrs = &(cd->xdrs); - register bool_t stat; + register struct tcp_conn *cd = + (struct tcp_conn *)(xprt->xp_p1); + register XDR *xdrs = &(cd->xdrs); + register bool_t stat; - xdrproc_t xdr_results; - caddr_t xdr_location; - bool_t has_args; - - if (msg->rm_reply.rp_stat == MSG_ACCEPTED && - msg->rm_reply.rp_acpt.ar_stat == SUCCESS) { - has_args = TRUE; - xdr_results = msg->acpted_rply.ar_results.proc; - xdr_location = msg->acpted_rply.ar_results.where; + xdrproc_t xdr_results; + caddr_t xdr_location; + bool_t has_args; + + if (msg->rm_reply.rp_stat == MSG_ACCEPTED && + msg->rm_reply.rp_acpt.ar_stat == SUCCESS) { + has_args = TRUE; + xdr_results = msg->acpted_rply.ar_results.proc; + xdr_location = msg->acpted_rply.ar_results.where; - msg->acpted_rply.ar_results.proc = xdr_void; - msg->acpted_rply.ar_results.where = NULL; - } else - has_args = FALSE; + msg->acpted_rply.ar_results.proc = xdr_void; + msg->acpted_rply.ar_results.where = NULL; + } else + has_args = FALSE; - xdrs->x_op = XDR_ENCODE; - msg->rm_xid = cd->x_id; - stat = FALSE; - if (xdr_replymsg(xdrs, msg) && - (!has_args || - (SVCAUTH_WRAP(xprt->xp_auth, xdrs, xdr_results, xdr_location)))) { - stat = TRUE; - } - (void)xdrrec_endofrecord(xdrs, TRUE); - return (stat); + xdrs->x_op = XDR_ENCODE; + msg->rm_xid = cd->x_id; + stat = FALSE; + if (xdr_replymsg(xdrs, msg) && + (!has_args || + (SVCAUTH_WRAP(xprt->xp_auth, xdrs, xdr_results, xdr_location)))) { + stat = TRUE; + } + (void)xdrrec_endofrecord(xdrs, TRUE); + return (stat); } -static bool_t abortx() +static bool_t abortx(void) { - abort(); - return 1; + abort(); + return 1; } -static bool_t abortx_getargs(xprt, proc, info) - SVCXPRT *xprt; - xdrproc_t proc; - void *info; +static bool_t abortx_getargs( + SVCXPRT *xprt, + xdrproc_t proc, + void *info) { - return abortx(); + return abortx(); } - -static bool_t abortx_reply(xprt, msg) - SVCXPRT *xprt; - struct rpc_msg *msg; +static bool_t abortx_reply(SVCXPRT *xprt, struct rpc_msg *msg) { - return abortx(); + return abortx(); } -static bool_t abortx_freeargs(xprt, proc, info) - SVCXPRT *xprt; - xdrproc_t proc; - void * info; +static bool_t abortx_freeargs( + SVCXPRT *xprt, xdrproc_t proc, + void * info) { - return abortx(); + return abortx(); } diff --git a/src/lib/rpc/svc_udp.c b/src/lib/rpc/svc_udp.c index 46305001b..3cc3147cb 100644 --- a/src/lib/rpc/svc_udp.c +++ b/src/lib/rpc/svc_udp.c @@ -101,9 +101,10 @@ struct svcudp_data { * The routines returns NULL if a problem occurred. */ SVCXPRT * -svcudp_bufcreate(sock, sendsz, recvsz) - register int sock; - u_int sendsz, recvsz; +svcudp_bufcreate( + register int sock, + u_int sendsz, + u_int recvsz) { bool_t madesock = FALSE; register SVCXPRT *xprt; @@ -159,25 +160,23 @@ 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) - register SVCXPRT *xprt; - struct rpc_msg *msg; +svcudp_recv( + register SVCXPRT *xprt, + struct rpc_msg *msg) { struct msghdr dummy; struct iovec dummy_iov[1]; @@ -225,9 +224,9 @@ svcudp_recv(xprt, msg) return (TRUE); } -static bool_t svcudp_reply(xprt, msg) - register SVCXPRT *xprt; - struct rpc_msg *msg; +static bool_t svcudp_reply( + register SVCXPRT *xprt, + struct rpc_msg *msg) { register struct svcudp_data *su = su_data(xprt); register XDR *xdrs = &(su->su_xdrs); @@ -269,10 +268,10 @@ static bool_t svcudp_reply(xprt, msg) } static bool_t -svcudp_getargs(xprt, xdr_args, args_ptr) - SVCXPRT *xprt; - xdrproc_t xdr_args; - void * args_ptr; +svcudp_getargs( + SVCXPRT *xprt, + xdrproc_t xdr_args, + void * args_ptr) { if (! SVCAUTH_UNWRAP(xprt->xp_auth, &(su_data(xprt)->su_xdrs), xdr_args, args_ptr)) { @@ -283,10 +282,10 @@ svcudp_getargs(xprt, xdr_args, args_ptr) } static bool_t -svcudp_freeargs(xprt, xdr_args, args_ptr) - SVCXPRT *xprt; - xdrproc_t xdr_args; - void * args_ptr; +svcudp_freeargs( + SVCXPRT *xprt, + xdrproc_t xdr_args, + void * args_ptr) { register XDR *xdrs = &(su_data(xprt)->su_xdrs); @@ -295,8 +294,7 @@ svcudp_freeargs(xprt, xdr_args, args_ptr) } static void -svcudp_destroy(xprt) - register SVCXPRT *xprt; +svcudp_destroy(register SVCXPRT *xprt) { register struct svcudp_data *su = su_data(xprt); @@ -387,9 +385,9 @@ struct udp_cache { * Note: there is no disable. */ int -svcudp_enablecache(transp, size) - SVCXPRT *transp; - uint32_t size; +svcudp_enablecache( + SVCXPRT *transp, + uint32_t size) { struct svcudp_data *su = su_data(transp); struct udp_cache *uc; @@ -426,9 +424,9 @@ svcudp_enablecache(transp, size) * Set an entry in the cache */ static void -cache_set(xprt, replylen) - SVCXPRT *xprt; - uint32_t replylen; +cache_set( + SVCXPRT *xprt, + uint32_t replylen) { register cache_ptr victim; register cache_ptr *vicp; @@ -491,11 +489,11 @@ 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; - uint32_t *replylenp; +cache_get( + SVCXPRT *xprt, + struct rpc_msg *msg, + char **replyp, + uint32_t *replylenp) { u_int loc; register cache_ptr ent; diff --git a/src/lib/rpc/xdr.c b/src/lib/rpc/xdr.c index 264035c54..ec0d27717 100644 --- a/src/lib/rpc/xdr.c +++ b/src/lib/rpc/xdr.c @@ -64,9 +64,7 @@ static char xdr_zero[BYTES_PER_XDR_UNIT] = { 0, 0, 0, 0 }; * Not a filter, but a convenient utility nonetheless */ void -xdr_free(proc, objp) - xdrproc_t proc; - void *objp; +xdr_free(xdrproc_t proc, void *objp) { XDR x; @@ -78,9 +76,7 @@ xdr_free(proc, objp) * XDR nothing */ bool_t -xdr_void(xdrs, addr ) - XDR *xdrs; - void *addr; +xdr_void(XDR *xdrs, void *addr) { return (TRUE); @@ -90,9 +86,7 @@ xdr_void(xdrs, addr ) * XDR integers */ bool_t -xdr_int(xdrs, ip) - XDR *xdrs; - int *ip; +xdr_int(XDR *xdrs, int *ip) { long l; @@ -125,9 +119,7 @@ xdr_int(xdrs, ip) * XDR unsigned integers */ bool_t -xdr_u_int(xdrs, up) - XDR *xdrs; - u_int *up; +xdr_u_int(XDR *xdrs, u_int *up) { u_long l; @@ -161,9 +153,7 @@ xdr_u_int(xdrs, up) * XDR long integers */ bool_t -xdr_long(xdrs, lp) - register XDR *xdrs; - long *lp; +xdr_long(XDR *xdrs, long *lp) { switch (xdrs->x_op) { @@ -186,9 +176,7 @@ xdr_long(xdrs, lp) * XDR unsigned long integers */ bool_t -xdr_u_long(xdrs, ulp) - register XDR *xdrs; - u_long *ulp; +xdr_u_long(XDR *xdrs, u_long *ulp) { switch (xdrs->x_op) { @@ -211,9 +199,7 @@ xdr_u_long(xdrs, ulp) * XDR short integers */ bool_t -xdr_short(xdrs, sp) - register XDR *xdrs; - short *sp; +xdr_short(register XDR *xdrs, short *sp) { long l; @@ -243,9 +229,7 @@ xdr_short(xdrs, sp) * XDR unsigned short integers */ bool_t -xdr_u_short(xdrs, usp) - register XDR *xdrs; - u_short *usp; +xdr_u_short(register XDR *xdrs, u_short *usp) { u_long l; @@ -273,9 +257,7 @@ xdr_u_short(xdrs, usp) * XDR a char */ bool_t -xdr_char(xdrs, cp) - XDR *xdrs; - char *cp; +xdr_char(XDR *xdrs, char *cp) { int i; @@ -291,9 +273,7 @@ xdr_char(xdrs, cp) * XDR an unsigned char */ bool_t -xdr_u_char(xdrs, cp) - XDR *xdrs; - u_char *cp; +xdr_u_char(XDR *xdrs, u_char *cp) { u_int u; @@ -309,9 +289,7 @@ xdr_u_char(xdrs, cp) * XDR booleans */ bool_t -xdr_bool(xdrs, bp) - register XDR *xdrs; - bool_t *bp; +xdr_bool(register XDR *xdrs, bool_t *bp) { long lb; @@ -338,9 +316,7 @@ xdr_bool(xdrs, bp) * XDR enumerations */ bool_t -xdr_enum(xdrs, ep) - XDR *xdrs; - enum_t *ep; +xdr_enum(XDR *xdrs, enum_t *ep) { #ifndef lint enum sizecheck { SIZEVAL }; /* used to find the size of an enum */ @@ -369,10 +345,7 @@ xdr_enum(xdrs, ep) * cp points to the opaque object and cnt gives the byte length. */ bool_t -xdr_opaque(xdrs, cp, cnt) - register XDR *xdrs; - caddr_t cp; - register u_int cnt; +xdr_opaque(XDR *xdrs, caddr_t cp, u_int cnt) { register u_int rndup; static int crud[BYTES_PER_XDR_UNIT]; @@ -421,11 +394,11 @@ xdr_opaque(xdrs, cp, cnt) * If *cpp is NULL maxsize bytes are allocated */ bool_t -xdr_bytes(xdrs, cpp, sizep, maxsize) - register XDR *xdrs; - char **cpp; - register u_int *sizep; - u_int maxsize; +xdr_bytes( + XDR *xdrs, + char **cpp, + u_int *sizep, + u_int maxsize) { register char *sp = *cpp; /* sp is the actual string pointer */ register u_int nodesize; @@ -476,18 +449,14 @@ xdr_bytes(xdrs, cpp, sizep, maxsize) * Implemented here due to commonality of the object. */ bool_t -xdr_netobj(xdrs, np) - XDR *xdrs; - struct netobj *np; +xdr_netobj(XDR *xdrs, struct netobj *np) { return (xdr_bytes(xdrs, &np->n_bytes, &np->n_len, MAX_NETOBJ_SZ)); } bool_t -xdr_int32(xdrs, ip) - XDR *xdrs; - int32_t *ip; +xdr_int32(XDR *xdrs, int32_t *ip) { long l; @@ -511,9 +480,7 @@ xdr_int32(xdrs, ip) } bool_t -xdr_u_int32(xdrs, up) - XDR *xdrs; - uint32_t *up; +xdr_u_int32(XDR *xdrs, uint32_t *up) { u_long ul; @@ -548,12 +515,13 @@ xdr_u_int32(xdrs, up) * If there is no specific or default routine an error is returned. */ bool_t -xdr_union(xdrs, dscmp, unp, choices, dfault) - register XDR *xdrs; - enum_t *dscmp; /* enum to decide which arm to work on */ - char *unp; /* the union itself */ - struct xdr_discrim *choices; /* [value, xdr proc] for each arm */ - xdrproc_t dfault; /* default xdr routine */ +xdr_union( + XDR *xdrs, + enum_t *dscmp, /* enum to decide which arm to work on */ + char *unp, /* the union itself */ + struct xdr_discrim *choices, /* [value, xdr proc] for each arm */ + xdrproc_t dfault /* default xdr routine */ + ) { register enum_t dscm; @@ -597,10 +565,7 @@ xdr_union(xdrs, dscmp, unp, choices, dfault) * of the string as specified by a protocol. */ bool_t -xdr_string(xdrs, cpp, maxsize) - register XDR *xdrs; - char **cpp; - u_int maxsize; +xdr_string(XDR *xdrs, char **cpp, u_int maxsize) { register char *sp = *cpp; /* sp is the actual string pointer */ u_int size; @@ -663,9 +628,7 @@ xdr_string(xdrs, cpp, maxsize) * routines like clnt_call */ bool_t -xdr_wrapstring(xdrs, cpp) - XDR *xdrs; - char **cpp; +xdr_wrapstring(XDR *xdrs, char **cpp) { if (xdr_string(xdrs, cpp, LASTUNSIGNED)) { return (TRUE); diff --git a/src/lib/rpc/xdr_alloc.c b/src/lib/rpc/xdr_alloc.c index 4cd17056f..b0aa032c6 100644 --- a/src/lib/rpc/xdr_alloc.c +++ b/src/lib/rpc/xdr_alloc.c @@ -63,9 +63,7 @@ static struct xdr_ops xdralloc_ops = { * The procedure xdralloc_create initializes a stream descriptor for a * memory buffer. */ -void xdralloc_create(xdrs, op) - register XDR *xdrs; - enum xdr_op op; +void xdralloc_create(XDR *xdrs, enum xdr_op op) { xdrs->x_op = op; xdrs->x_ops = &xdralloc_ops; @@ -73,34 +71,31 @@ void xdralloc_create(xdrs, op) /* not allowed to fail */ } -caddr_t xdralloc_getdata(xdrs) - XDR *xdrs; +caddr_t xdralloc_getdata(XDR *xdrs) { return (caddr_t) DynGet((DynObject) xdrs->x_private, 0); } -void xdralloc_release(xdrs) - XDR *xdrs; +void xdralloc_release(XDR *xdrs) { DynRelease((DynObject) xdrs->x_private); } -static void xdralloc_destroy(xdrs) - XDR *xdrs; +static void xdralloc_destroy(XDR *xdrs) { DynDestroy((DynObject) xdrs->x_private); } -static bool_t xdralloc_notsup_getlong(xdrs, lp) - register XDR *xdrs; - long *lp; +static bool_t xdralloc_notsup_getlong( + register XDR *xdrs, + long *lp) { return FALSE; } -static bool_t xdralloc_putlong(xdrs, lp) - register XDR *xdrs; - long *lp; +static bool_t xdralloc_putlong( + register XDR *xdrs, + long *lp) { int l = htonl((uint32_t) *lp); /* XXX need bounds checking */ @@ -113,19 +108,19 @@ static bool_t xdralloc_putlong(xdrs, lp) } -static bool_t xdralloc_notsup_getbytes(xdrs, addr, len) - register XDR *xdrs; - caddr_t addr; - register unsigned int len; +static bool_t xdralloc_notsup_getbytes( + register XDR *xdrs, + caddr_t addr, + register unsigned int len) { return FALSE; } -static bool_t xdralloc_putbytes(xdrs, addr, len) - register XDR *xdrs; - caddr_t addr; - register unsigned int len; +static bool_t xdralloc_putbytes( + register XDR *xdrs, + caddr_t addr, + register unsigned int len) { if (DynInsert((DynObject) xdrs->x_private, DynSize((DynObject) xdrs->x_private), @@ -134,24 +129,23 @@ static bool_t xdralloc_putbytes(xdrs, addr, len) return TRUE; } -static unsigned int xdralloc_getpos(xdrs) - register XDR *xdrs; +static unsigned int xdralloc_getpos(XDR *xdrs) { return DynSize((DynObject) xdrs->x_private); } -static bool_t xdralloc_notsup_setpos(xdrs, lp) - register XDR *xdrs; - unsigned int lp; +static bool_t xdralloc_notsup_setpos( + register XDR *xdrs, + unsigned int lp) { return FALSE; } -static rpc_inline_t *xdralloc_inline(xdrs, len) - register XDR *xdrs; - int len; +static rpc_inline_t *xdralloc_inline( + register XDR *xdrs, + int len) { return (rpc_inline_t *) 0; } diff --git a/src/lib/rpc/xdr_array.c b/src/lib/rpc/xdr_array.c index 8ae0ec7ce..7d5745d4e 100644 --- a/src/lib/rpc/xdr_array.c +++ b/src/lib/rpc/xdr_array.c @@ -56,13 +56,14 @@ static char sccsid[] = "@(#)xdr_array.c 1.10 87/08/11 Copyr 1984 Sun Micro"; * xdr procedure to call to handle each element of the array. */ bool_t -xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc) - register XDR *xdrs; - caddr_t *addrp; /* array pointer */ - u_int *sizep; /* number of elements */ - u_int maxsize; /* max numberof elements */ - u_int elsize; /* size in bytes of each element */ - xdrproc_t elproc; /* xdr routine to handle each element */ +xdr_array( + register XDR *xdrs, + caddr_t *addrp, /* array pointer */ + u_int *sizep, /* number of elements */ + u_int maxsize, /* max numberof elements */ + u_int elsize, /* size in bytes of each element */ + xdrproc_t elproc /* xdr routine to handle each element */ + ) { register u_int i; register caddr_t target = *addrp; @@ -135,12 +136,12 @@ xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc) * > xdr_elem: routine to XDR each element */ bool_t -xdr_vector(xdrs, basep, nelem, elemsize, xdr_elem) - register XDR *xdrs; - register char *basep; - register u_int nelem; - register u_int elemsize; - register xdrproc_t xdr_elem; +xdr_vector( + register XDR *xdrs, + register char *basep, + register u_int nelem, + register u_int elemsize, + register xdrproc_t xdr_elem) { register u_int i; register char *elptr; diff --git a/src/lib/rpc/xdr_float.c b/src/lib/rpc/xdr_float.c index 6fd2b1756..3e4805d97 100644 --- a/src/lib/rpc/xdr_float.c +++ b/src/lib/rpc/xdr_float.c @@ -84,9 +84,7 @@ static struct sgl_limits { #endif /* vax */ bool_t -xdr_float(xdrs, fp) - register XDR *xdrs; - register float *fp; +xdr_float(XDR *xdrs, float *fp) { #if defined(vax) struct ieee_single is; @@ -196,9 +194,7 @@ static struct dbl_limits { bool_t -xdr_double(xdrs, dp) - register XDR *xdrs; - double *dp; +xdr_double(XDR *xdrs, double *dp) { register int32_t *lp; #if defined(vax) diff --git a/src/lib/rpc/xdr_mem.c b/src/lib/rpc/xdr_mem.c index 39be29642..6908aa8a3 100644 --- a/src/lib/rpc/xdr_mem.c +++ b/src/lib/rpc/xdr_mem.c @@ -75,11 +75,11 @@ static struct xdr_ops xdrmem_ops = { * memory buffer. */ void -xdrmem_create(xdrs, addr, size, op) - register XDR *xdrs; - caddr_t addr; - u_int size; - enum xdr_op op; +xdrmem_create( + XDR *xdrs, + caddr_t addr, + u_int size, + enum xdr_op op) { xdrs->x_op = op; @@ -89,15 +89,12 @@ xdrmem_create(xdrs, addr, size, op) } static void -xdrmem_destroy(xdrs) - XDR *xdrs; +xdrmem_destroy(XDR *xdrs) { } static bool_t -xdrmem_getlong(xdrs, lp) - register XDR *xdrs; - long *lp; +xdrmem_getlong(XDR *xdrs, long *lp) { if (xdrs->x_handy < BYTES_PER_XDR_UNIT) @@ -110,9 +107,7 @@ xdrmem_getlong(xdrs, lp) } static bool_t -xdrmem_putlong(xdrs, lp) - register XDR *xdrs; - long *lp; +xdrmem_putlong(XDR *xdrs, long *lp) { if (xdrs->x_handy < BYTES_PER_XDR_UNIT) @@ -125,10 +120,7 @@ xdrmem_putlong(xdrs, lp) } static bool_t -xdrmem_getbytes(xdrs, addr, len) - register XDR *xdrs; - caddr_t addr; - register u_int len; +xdrmem_getbytes(XDR *xdrs, caddr_t addr, u_int len) { if (xdrs->x_handy < len) @@ -141,10 +133,7 @@ xdrmem_getbytes(xdrs, addr, len) } static bool_t -xdrmem_putbytes(xdrs, addr, len) - register XDR *xdrs; - caddr_t addr; - register u_int len; +xdrmem_putbytes(XDR *xdrs, caddr_t addr, u_int len) { if (xdrs->x_handy < len) @@ -157,8 +146,7 @@ xdrmem_putbytes(xdrs, addr, len) } static u_int -xdrmem_getpos(xdrs) - register XDR *xdrs; +xdrmem_getpos(XDR *xdrs) { /* * 11/3/95 - JRG - Rather than recast everything for 64 bit, just convert @@ -168,9 +156,7 @@ xdrmem_getpos(xdrs) } static bool_t -xdrmem_setpos(xdrs, pos) - register XDR *xdrs; - u_int pos; +xdrmem_setpos(XDR *xdrs, u_int pos) { register caddr_t newaddr = xdrs->x_base + pos; register caddr_t lastaddr = (char *) xdrs->x_private + xdrs->x_handy; @@ -183,9 +169,7 @@ xdrmem_setpos(xdrs, pos) } static rpc_inline_t * -xdrmem_inline(xdrs, len) - register XDR *xdrs; - int len; +xdrmem_inline(XDR *xdrs, int len) { rpc_inline_t *buf = 0; diff --git a/src/lib/rpc/xdr_rec.c b/src/lib/rpc/xdr_rec.c index eefd9db1f..3e4299126 100644 --- a/src/lib/rpc/xdr_rec.c +++ b/src/lib/rpc/xdr_rec.c @@ -133,13 +133,14 @@ static bool_t skip_input_bytes(RECSTREAM *, int32_t); * calls expect that they take an opaque handle rather than an fd. */ void -xdrrec_create(xdrs, sendsize, recvsize, tcp_handle, readit, writeit) - register XDR *xdrs; - register u_int sendsize; - register u_int recvsize; - caddr_t tcp_handle; - int (*readit)(); /* like read, but pass it a tcp_handle, not sock */ - int (*writeit)(); /* like write, but pass it a tcp_handle, not sock */ +xdrrec_create( + XDR *xdrs, + u_int sendsize, + u_int recvsize, + caddr_t tcp_handle, + int (*readit)(), /* like read, but pass it a tcp_handle, not sock */ + int (*writeit)() /* like write, but pass it a tcp_handle, not sock */ + ) { register RECSTREAM *rstrm = (RECSTREAM *)mem_alloc(sizeof(RECSTREAM)); @@ -194,9 +195,7 @@ xdrrec_create(xdrs, sendsize, recvsize, tcp_handle, readit, writeit) */ static bool_t -xdrrec_getlong(xdrs, lp) - XDR *xdrs; - long *lp; +xdrrec_getlong(XDR *xdrs, long *lp) { register RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); register int32_t *buflp = (int32_t *)(void *)(rstrm->in_finger); @@ -219,9 +218,7 @@ xdrrec_getlong(xdrs, lp) } static bool_t -xdrrec_putlong(xdrs, lp) - XDR *xdrs; - long *lp; +xdrrec_putlong(XDR *xdrs, long *lp) { register RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); register int32_t *dest_lp = ((int32_t *)(void *)(rstrm->out_finger)); @@ -242,10 +239,7 @@ xdrrec_putlong(xdrs, lp) } static bool_t /* must manage buffers, fragments, and records */ -xdrrec_getbytes(xdrs, addr, len) - XDR *xdrs; - register caddr_t addr; - register u_int len; +xdrrec_getbytes(XDR *xdrs, caddr_t addr, u_int len) { register RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); register int current; @@ -270,10 +264,7 @@ xdrrec_getbytes(xdrs, addr, len) } static bool_t -xdrrec_putbytes(xdrs, addr, len) - XDR *xdrs; - register caddr_t addr; - register u_int len; +xdrrec_putbytes(XDR *xdrs, caddr_t addr, u_int len) { register RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); register size_t current; @@ -296,8 +287,7 @@ xdrrec_putbytes(xdrs, addr, len) } static u_int -xdrrec_getpos(xdrs) - register XDR *xdrs; +xdrrec_getpos(XDR *xdrs) { register RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; register int pos; @@ -322,9 +312,7 @@ xdrrec_getpos(xdrs) } static bool_t -xdrrec_setpos(xdrs, pos) - register XDR *xdrs; - u_int pos; +xdrrec_setpos(XDR *xdrs, u_int pos) { register RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; u_int currpos = xdrrec_getpos(xdrs); @@ -361,9 +349,7 @@ xdrrec_setpos(xdrs, pos) } static rpc_inline_t * -xdrrec_inline(xdrs, len) - register XDR *xdrs; - int len; +xdrrec_inline(XDR *xdrs, int len) { register RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; rpc_inline_t * buf = NULL; @@ -396,8 +382,7 @@ xdrrec_inline(xdrs, len) } static void -xdrrec_destroy(xdrs) - register XDR *xdrs; +xdrrec_destroy(XDR *xdrs) { register RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; @@ -416,8 +401,7 @@ xdrrec_destroy(xdrs) * this procedure to guarantee proper record alignment. */ bool_t -xdrrec_skiprecord(xdrs) - XDR *xdrs; +xdrrec_skiprecord(XDR *xdrs) { register RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); @@ -438,8 +422,7 @@ xdrrec_skiprecord(xdrs) * after consuming the rest of the current record. */ bool_t -xdrrec_eof(xdrs) - XDR *xdrs; +xdrrec_eof(XDR *xdrs) { register RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); @@ -462,9 +445,7 @@ xdrrec_eof(xdrs) * pipelined procedure calls.) TRUE => immmediate flush to tcp connection. */ bool_t -xdrrec_endofrecord(xdrs, sendnow) - XDR *xdrs; - bool_t sendnow; +xdrrec_endofrecord(XDR *xdrs, bool_t sendnow) { register RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); register uint32_t len; /* fragment length */ @@ -488,9 +469,7 @@ xdrrec_endofrecord(xdrs, sendnow) * Internal useful routines */ static bool_t -flush_out(rstrm, eor) - register RECSTREAM *rstrm; - bool_t eor; +flush_out(RECSTREAM *rstrm, bool_t eor) { register uint32_t eormask = (eor == TRUE) ? LAST_FRAG : 0; register uint32_t len = (u_long)(rstrm->out_finger) - @@ -507,8 +486,7 @@ flush_out(rstrm, eor) } static bool_t /* knows nothing about records! Only about input buffers */ -fill_input_buf(rstrm) - register RECSTREAM *rstrm; +fill_input_buf(RECSTREAM *rstrm) { register caddr_t where; u_int i; @@ -527,10 +505,7 @@ fill_input_buf(rstrm) } static bool_t /* knows nothing about records! Only about input buffers */ -get_input_bytes(rstrm, addr, len) - register RECSTREAM *rstrm; - register caddr_t addr; - register int len; +get_input_bytes(RECSTREAM *rstrm, caddr_t addr, int len) { register size_t current; @@ -566,9 +541,7 @@ set_input_fragment(rstrm) } static bool_t /* consumes input bytes; knows nothing about records! */ -skip_input_bytes(rstrm, cnt) - register RECSTREAM *rstrm; - int32_t cnt; +skip_input_bytes(RECSTREAM *rstrm, int32_t cnt) { register int current; @@ -588,8 +561,7 @@ skip_input_bytes(rstrm, cnt) } static u_int -fix_buf_size(s) - register u_int s; +fix_buf_size(u_int s) { if (s < 100) diff --git a/src/lib/rpc/xdr_reference.c b/src/lib/rpc/xdr_reference.c index f8d7b20ee..50a4fe4ae 100644 --- a/src/lib/rpc/xdr_reference.c +++ b/src/lib/rpc/xdr_reference.c @@ -57,11 +57,12 @@ static char sccsid[] = "@(#)xdr_reference.c 1.11 87/08/11 SMI"; * proc is the routine to handle the referenced structure. */ bool_t -xdr_reference(xdrs, pp, size, proc) - register XDR *xdrs; - caddr_t *pp; /* the pointer to work on */ - u_int size; /* size of the object pointed to */ - xdrproc_t proc; /* xdr routine to handle the object */ +xdr_reference( + XDR *xdrs, + caddr_t *pp, /* the pointer to work on */ + u_int size, /* size of the object pointed to */ + xdrproc_t proc /* xdr routine to handle the object */ + ) { register caddr_t loc = *pp; register bool_t stat; @@ -115,11 +116,11 @@ xdr_reference(xdrs, pp, size, proc) * */ bool_t -xdr_pointer(xdrs,objpp,obj_size,xdr_obj) - register XDR *xdrs; - char **objpp; - u_int obj_size; - xdrproc_t xdr_obj; +xdr_pointer( + XDR *xdrs, + char **objpp, + u_int obj_size, + xdrproc_t xdr_obj) { bool_t more_data; diff --git a/src/lib/rpc/xdr_stdio.c b/src/lib/rpc/xdr_stdio.c index d0657d5c7..471d9f2ee 100644 --- a/src/lib/rpc/xdr_stdio.c +++ b/src/lib/rpc/xdr_stdio.c @@ -74,10 +74,7 @@ static struct xdr_ops xdrstdio_ops = { * Operation flag is set to op. */ void -xdrstdio_create(xdrs, file, op) - register XDR *xdrs; - FILE *file; - enum xdr_op op; +xdrstdio_create(XDR *xdrs, FILE *file, enum xdr_op op) { xdrs->x_op = op; @@ -92,17 +89,14 @@ xdrstdio_create(xdrs, file, op) * Cleans up the xdr stream handle xdrs previously set up by xdrstdio_create. */ static void -xdrstdio_destroy(xdrs) - register XDR *xdrs; +xdrstdio_destroy(XDR *xdrs) { (void)fflush((FILE *)xdrs->x_private); /* xx should we close the file ?? */ } static bool_t -xdrstdio_getlong(xdrs, lp) - XDR *xdrs; - register long *lp; +xdrstdio_getlong(XDR *xdrs, long *lp) { uint32_t tmp; if (fread((caddr_t)&tmp, @@ -115,9 +109,7 @@ xdrstdio_getlong(xdrs, lp) } static bool_t -xdrstdio_putlong(xdrs, lp) - XDR *xdrs; - long *lp; +xdrstdio_putlong(XDR *xdrs, long *lp) { uint32_t mycopy = htonl((uint32_t)*lp); @@ -127,10 +119,7 @@ xdrstdio_putlong(xdrs, lp) } static bool_t -xdrstdio_getbytes(xdrs, addr, len) - XDR *xdrs; - caddr_t addr; - u_int len; +xdrstdio_getbytes(XDR *xdrs, caddr_t addr, u_int len) { if ((len != 0) && (fread(addr, (size_t)len, 1, @@ -140,10 +129,7 @@ xdrstdio_getbytes(xdrs, addr, len) } static bool_t -xdrstdio_putbytes(xdrs, addr, len) - XDR *xdrs; - caddr_t addr; - u_int len; +xdrstdio_putbytes(XDR *xdrs, caddr_t addr, u_int len) { if ((len != 0) && (fwrite(addr, (size_t)len, 1, @@ -153,17 +139,14 @@ xdrstdio_putbytes(xdrs, addr, len) } static u_int -xdrstdio_getpos(xdrs) - XDR *xdrs; +xdrstdio_getpos(XDR *xdrs) { return ((u_int) ftell((FILE *)xdrs->x_private)); } static bool_t -xdrstdio_setpos(xdrs, pos) - XDR *xdrs; - u_int pos; +xdrstdio_setpos(XDR *xdrs, u_int pos) { return ((fseek((FILE *)xdrs->x_private, (long)pos, 0) < 0) ? @@ -171,9 +154,7 @@ xdrstdio_setpos(xdrs, pos) } static rpc_inline_t * -xdrstdio_inline(xdrs, len) - XDR *xdrs; - int len; +xdrstdio_inline(XDR *xdrs, int len) { /*