OSDN Git Service

I've been working on fixing up the rpc crap. now it is only
authorEric Andersen <andersen@codepoet.org>
Mon, 15 Jan 2001 13:18:42 +0000 (13:18 -0000)
committerEric Andersen <andersen@codepoet.org>
Mon, 15 Jan 2001 13:18:42 +0000 (13:18 -0000)
_mostly_ broken, a big improvement.  Still doesn't compile...

libc/inet/rpc/auth_unix.c
libc/inet/rpc/bindresvport.c
libc/inet/rpc/clnt_generic.c
libc/inet/rpc/clnt_perror.c
libc/inet/rpc/clnt_simple.c
libc/inet/rpc/getrpcport.c
libc/inet/rpc/pmap_rmt.c

index dcd7df9..1f213bd 100644 (file)
@@ -92,12 +92,9 @@ static bool_t marshal_new_auth();
  * Create a unix style authenticator.
  * 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;
+AUTH *authunix_create __P ((char *machname, uid_t uid,
+                                  gid_t gid, int len,
+                                  gid_t *aup_gids))
 {
        struct authunix_parms aup;
        char mymem[MAX_AUTH_BYTES];
index 6a6f385..e08994d 100644 (file)
@@ -1,6 +1,3 @@
-static char sccsid[] =
-
-       "@(#)bindresvport.c     2.2 88/07/29 4.0 RPCSRC 1.8 88/02/08 SMI";
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  * unrestricted use provided that this legend is included on all tape
@@ -34,6 +31,8 @@ static char sccsid[] =
  * Copyright (c) 1987 by Sun Microsystems, Inc.
  */
 
+#include <unistd.h>
+#include <string.h>
 #include <sys/types.h>
 #include <sys/errno.h>
 #include <sys/socket.h>
@@ -42,7 +41,7 @@ static char sccsid[] =
 /*
  * Bind a socket to a privileged IP port
  */
-bindresvport(sd, sin)
+int bindresvport(sd, sin)
 int sd;
 struct sockaddr_in *sin;
 {
index ba53094..45199a4 100644 (file)
@@ -43,11 +43,8 @@ static char sccsid[] = "@(#)clnt_generic.c 1.4 87/08/11 (C) 1987 SMI";
  * returns client handle. Default options are set, which the user can 
  * change using the rpc equivalent of ioctl()'s.
  */
-CLIENT *clnt_create(hostname, prog, vers, proto)
-char *hostname;
-unsigned prog;
-unsigned vers;
-char *proto;
+CLIENT *clnt_create __P ((const char *hostname, const u_long prog,
+                                const u_long vers, const char *proto))
 {
        struct hostent *h;
        struct protoent *p;
@@ -94,7 +91,7 @@ char *proto;
                        return (NULL);
                }
                tv.tv_sec = 25;
-               clnt_control(client, CLSET_TIMEOUT, &tv);
+               clnt_control(client, CLSET_TIMEOUT, (char*)&tv);
                break;
        case IPPROTO_TCP:
                client = clnttcp_create(&sin, prog, vers, &sock, 0, 0);
@@ -103,7 +100,7 @@ char *proto;
                }
                tv.tv_sec = 25;
                tv.tv_usec = 0;
-               clnt_control(client, CLSET_TIMEOUT, &tv);
+               clnt_control(client, CLSET_TIMEOUT, (char*)&tv);
                break;
        default:
                rpc_createerr.cf_stat = RPC_SYSTEMERROR;
index 84d2658..4ede1a4 100644 (file)
@@ -45,11 +45,12 @@ static char sccsid[] =
 #include <rpc/auth.h>
 #include <rpc/clnt.h>
 
-extern char *sys_errlist[];
-static char *auth_errmsg();
+//extern char *sys_errlist[];
+//static char *auth_errmsg();
 
 extern char *strcpy();
 
+#if 0
 static char *buf;
 
 static char *_buf()
@@ -59,13 +60,12 @@ static char *_buf()
                buf = (char *) malloc(256);
        return (buf);
 }
+#endif 
 
 /*
  * Print reply error info
  */
-char *clnt_sperror(rpch, s)
-CLIENT *rpch;
-char *s;
+char *clnt_sperror __P ((CLIENT *rpch, const char *s))
 {
 #if 0
        struct rpc_err e;
@@ -143,11 +143,10 @@ char *s;
        (void) sprintf(str, "\n");
        return (strstart);
 #endif
+       return (0);
 }
 
-void clnt_perror(rpch, s)
-CLIENT *rpch;
-char *s;
+void clnt_perror __P ((CLIENT *rpch, const char *s))
 {
        (void) fprintf(stderr, "%s", clnt_sperror(rpch, s));
 }
@@ -224,8 +223,7 @@ enum clnt_stat num;
 }
 
 
-char *clnt_spcreateerror(s)
-char *s;
+char *clnt_spcreateerror __P ((__const char *s))
 {
 #if 0
        extern int sys_nerr;
@@ -256,10 +254,10 @@ char *s;
        (void) strcat(str, "\n");
        return (str);
 #endif
+       return(0);
 }
 
-void clnt_pcreateerror(s)
-char *s;
+extern void clnt_pcreateerror __P ((__const char *s))
 {
        (void) fprintf(stderr, "%s", clnt_spcreateerror(s));
 }
@@ -269,6 +267,7 @@ struct auth_errtab {
        char *message;
 };
 
+#if 0
 static struct auth_errtab auth_errlist[] = {
        {AUTH_OK,
         "Authentication OK"},
@@ -300,3 +299,4 @@ enum auth_stat stat;
        }
        return (NULL);
 }
+#endif 
index 77657ec..15bf3fe 100644 (file)
@@ -41,6 +41,7 @@ static char sccsid[] =
  */
 
 #include <stdio.h>
+#include <unistd.h>
 #include <rpc/rpc.h>
 #include <sys/socket.h>
 #include <netdb.h>
@@ -53,10 +54,10 @@ static struct callrpc_private {
        char *oldhost;
 } *callrpc_private;
 
-callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out)
-char *host;
-xdrproc_t inproc, outproc;
-char *in, *out;
+int callrpc (const char *host, const u_long prognum,
+                        const u_long versnum, const u_long procnum,
+                        const xdrproc_t inproc, const char *in,
+                        const xdrproc_t outproc, char *out)
 {
        register struct callrpc_private *crp = callrpc_private;
        struct sockaddr_in server_addr;
index af4f7da..0665fba 100644 (file)
@@ -40,8 +40,8 @@ static char sccsid[] = "@(#)getrpcport.c 1.3 87/08/11 SMI";
 #include <netdb.h>
 #include <sys/socket.h>
 
-getrpcport(host, prognum, versnum, proto)
-char *host;
+extern int getrpcport (const char * host, u_long prognum,
+                          u_long versnum, u_int proto)
 {
        struct sockaddr_in addr;
        struct hostent *hp;
index 1f2b47c..80e984b 100644 (file)
@@ -105,11 +105,12 @@ u_long *port_ptr;
  * XDR remote call arguments
  * written for XDR_ENCODE direction only
  */
-bool_t xdr_rmtcall_args(xdrs, cap)
+bool_t xdr_rmtcall_args(xdrs, args)
 register XDR *xdrs;
-register struct rmtcallargs *cap;
+void * arg2;
 {
        u_int lenposition, argposition, position;
+       register struct rmtcallargs *cap = arg2;
 
        if (xdr_u_long(xdrs, &(cap->prog)) &&
                xdr_u_long(xdrs, &(cap->vers)) && xdr_u_long(xdrs, &(cap->proc))) {