* svc_simple.c (universal): Change transp to s_transp to not
authorEzra Peisach <epeisach@mit.edu>
Fri, 22 Jun 2001 11:26:34 +0000 (11:26 +0000)
committerEzra Peisach <epeisach@mit.edu>
Fri, 22 Jun 2001 11:26:34 +0000 (11:26 +0000)
        shadow filewide static definition of name.
        Move file wide definition of "pl" into respective functions.

        * pmap_rmt.c: Change sin->sockin and socket->sock.

        * pmap_getmaps.c, pmap_getport.c: Change socket to sock to not
        shadow network function.

        * bindresvport.c, clnt_generic.c: Change sin to sockin to not
        shadow function declaration.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13486 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/rpc/ChangeLog
src/lib/rpc/bindresvport.c
src/lib/rpc/clnt_generic.c
src/lib/rpc/pmap_getmaps.c
src/lib/rpc/pmap_getport.c
src/lib/rpc/pmap_rmt.c
src/lib/rpc/svc_simple.c

index a6ce019e89fb36a7f9d7e3d20dca2b8cf03ccf7b..540a0ca10933f7683c16215e9e4b36c4badfc15c 100644 (file)
@@ -1,3 +1,17 @@
+2001-06-21  Ezra Peisach  <epeisach@mit.edu>
+
+       * svc_simple.c (universal): Change transp to s_transp to not
+       shadow filewide static definition of name.
+       Move file wide definition of "pl" into respective functions.
+
+       * pmap_rmt.c: Change sin->sockin and socket->sock.
+
+       * pmap_getmaps.c, pmap_getport.c: Change socket to sock to not
+       shadow network function.
+
+       * bindresvport.c, clnt_generic.c: Change sin to sockin to not
+       shadow function declaration.
+
 2001-06-19  Ezra Peisach  <epeisach@mit.edu>
 
        * pmap_prot2.c (xdr_pmaplist): Ensure variable set before use. 
index ca041dfc1c48cea6f9c0426dabc0459933d827ca..b23b8e6254355b4d10133997f46b1452bfb39a7b 100644 (file)
@@ -45,9 +45,9 @@ 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
-gssrpc_bindresvport(sd, sin)
+gssrpc_bindresvport(sd, sockin)
        int sd;
-       struct sockaddr_in *sin;
+       struct sockaddr_in *sockin;
 {
        int res;
        static short port;
@@ -59,11 +59,11 @@ gssrpc_bindresvport(sd, sin)
 #define ENDPORT (IPPORT_RESERVED - 1)
 #define NPORTS (ENDPORT - STARTPORT + 1)
 
-       if (sin == (struct sockaddr_in *)0) {
-               sin = &myaddr;
-               memset(sin, 0, sizeof (*sin));
-               sin->sin_family = AF_INET;
-       } else if (sin->sin_family != AF_INET) {
+       if (sockin == (struct sockaddr_in *)0) {
+               sockin = &myaddr;
+               memset(sockin, 0, sizeof (*sockin));
+               sockin->sin_family = AF_INET;
+       } else if (sockin->sin_family != AF_INET) {
                errno = EPFNOSUPPORT;
                return (-1);
        }
@@ -73,11 +73,11 @@ gssrpc_bindresvport(sd, sin)
        res = -1;
        errno = EADDRINUSE;
        for (i = 0; i < NPORTS && res < 0 && errno == EADDRINUSE; i++) {
-               sin->sin_port = htons(port++);
+               sockin->sin_port = htons(port++);
                if (port > ENDPORT) {
                        port = STARTPORT;
                }
-               res = bind(sd, (struct sockaddr *) sin,
+               res = bind(sd, (struct sockaddr *) sockin,
                           sizeof(struct sockaddr_in));
        }
        return (res);
index b0eed3d328f59e2c0daaf66e68fdc81b266f9c58..c7cc24e49d1748c8c1e3dee7069b994c6518bf69 100644 (file)
@@ -53,7 +53,7 @@ clnt_create(hostname, prog, vers, proto)
 {
        struct hostent *h;
        struct protoent *p;
-       struct sockaddr_in sin;
+       struct sockaddr_in sockin;
        int sock;
        struct timeval tv;
        CLIENT *client;
@@ -71,10 +71,10 @@ clnt_create(hostname, prog, vers, proto)
                rpc_createerr.cf_error.re_errno = EAFNOSUPPORT; 
                return (NULL);
        }
-       sin.sin_family = h->h_addrtype;
-       sin.sin_port = 0;
-       memset(sin.sin_zero, 0, sizeof(sin.sin_zero));
-       memmove((char*)&sin.sin_addr, h->h_addr, sizeof(sin.sin_addr));
+       sockin.sin_family = h->h_addrtype;
+       sockin.sin_port = 0;
+       memset(sockin.sin_zero, 0, sizeof(sockin.sin_zero));
+       memmove((char*)&sockin.sin_addr, h->h_addr, sizeof(sockin.sin_addr));
        p = getprotobyname(proto);
        if (p == NULL) {
                rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
@@ -86,7 +86,7 @@ clnt_create(hostname, prog, vers, proto)
        case IPPROTO_UDP:
                tv.tv_sec = 5;
                tv.tv_usec = 0;
-               client = clntudp_create(&sin, prog, vers, tv, &sock);
+               client = clntudp_create(&sockin, prog, vers, tv, &sock);
                if (client == NULL) {
                        return (NULL);
                }
@@ -94,7 +94,7 @@ clnt_create(hostname, prog, vers, proto)
                clnt_control(client, CLSET_TIMEOUT, &tv);
                break;
        case IPPROTO_TCP:
-               client = clnttcp_create(&sin, prog, vers, &sock, 0, 0);
+               client = clnttcp_create(&sockin, prog, vers, &sock, 0, 0);
                if (client == NULL) {
                        return (NULL);
                }
index 187749338c3de321962413de923a8acf71057b5c..7f90206176138cf903fd5ae815126a79179a6ebf 100644 (file)
@@ -67,7 +67,7 @@ pmap_getmaps(address)
         struct sockaddr_in *address;
 {
        struct pmaplist *head = (struct pmaplist *)NULL;
-       int socket = -1;
+       int sock = -1;
        struct timeval minutetimeout;
        register CLIENT *client;
 
@@ -75,7 +75,7 @@ pmap_getmaps(address)
        minutetimeout.tv_usec = 0;
        address->sin_port = htons(PMAPPORT);
        client = clnttcp_create(address, PMAPPROG,
-           PMAPVERS, &socket, 50, 500);
+           PMAPVERS, &sock, 50, 500);
        if (client != (CLIENT *)NULL) {
                if (CLNT_CALL(client, PMAPPROC_DUMP, xdr_void, NULL, xdr_pmaplist,
                    &head, minutetimeout) != RPC_SUCCESS) {
@@ -83,7 +83,7 @@ pmap_getmaps(address)
                }
                CLNT_DESTROY(client);
        }
-       (void)close(socket);
+       (void)close(sock);
        address->sin_port = 0;
        return (head);
 }
index 6fbd141042ba6c7ce2fb415739d531620b22eaf1..7712f1195f3f95d635bed266323cf70bb457cf6f 100644 (file)
@@ -65,13 +65,13 @@ pmap_getport(address, program, version, protocol)
        unsigned int protocol;
 {
        unsigned short port = 0;
-       int socket = -1;
+       int sock = -1;
        register CLIENT *client;
        struct pmap parms;
 
        address->sin_port = htons(PMAPPORT);
        client = clntudp_bufcreate(address, PMAPPROG,
-           PMAPVERS, timeout, &socket, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
+           PMAPVERS, timeout, &sock, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
        if (client != (CLIENT *)NULL) {
                parms.pm_prog = program;
                parms.pm_vers = version;
@@ -86,7 +86,7 @@ pmap_getport(address, program, version, protocol)
                }
                CLNT_DESTROY(client);
        }
-       (void)close(socket);
+       (void)close(sock);
        address->sin_port = 0;
        return (port);
 }
index faa1fc206e47ecaf09c0ad6a4d983ff14f899d33..401fd80b6ea68062d92679cc6e0d29300f77da44 100644 (file)
@@ -79,14 +79,14 @@ pmap_rmtcall(addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout, port_pt
        struct timeval tout;
        rpc_u_int32 *port_ptr;
 {
-       int socket = -1;
+       int sock = -1;
        register CLIENT *client;
        struct rmtcallargs a;
        struct rmtcallres r;
        enum clnt_stat stat;
 
        addr->sin_port = htons(PMAPPORT);
-       client = clntudp_create(addr, PMAPPROG, PMAPVERS, timeout, &socket);
+       client = clntudp_create(addr, PMAPPROG, PMAPVERS, timeout, &sock);
        if (client != (CLIENT *)NULL) {
                a.prog = prog;
                a.vers = vers;
@@ -102,7 +102,7 @@ pmap_rmtcall(addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout, port_pt
        } else {
                stat = RPC_FAILED;
        }
-       (void)close(socket);
+       (void)close(sock);
        addr->sin_port = 0;
        return (stat);
 }
@@ -176,7 +176,7 @@ getbroadcastnets(addrs, sock, buf)
 {
        struct ifconf ifc;
         struct ifreq ifreq, *ifr;
-       struct sockaddr_in *sin;
+       struct sockaddr_in *sockin;
         int n, i;
 
         ifc.ifc_len = GIFCONF_BUFSIZE;
@@ -196,16 +196,16 @@ getbroadcastnets(addrs, sock, buf)
                 if ((ifreq.ifr_flags & IFF_BROADCAST) &&
                    (ifreq.ifr_flags & IFF_UP) &&
                    ifr->ifr_addr.sa_family == AF_INET) {
-                       sin = (struct sockaddr_in *)&ifr->ifr_addr;
+                       sockin = (struct sockaddr_in *)&ifr->ifr_addr;
 #ifdef SIOCGIFBRDADDR   /* 4.3BSD */
                        if (ioctl(sock, SIOCGIFBRDADDR, (char *)&ifreq) < 0) {
                                addrs[i++].s_addr = INADDR_ANY;
 #if 0 /* this is uuuuugly */
                                addrs[i++] = inet_makeaddr(inet_netof
 #if defined(hpux) || (defined(sun) && defined(__svr4__)) || defined(linux) || (defined(__osf__) && defined(__alpha__))
-                                                          (sin->sin_addr),
+                                                          (sockin->sin_addr),
 #else /* hpux or solaris */
-                                                          (sin->sin_addr.s_addr),
+                                                          (sockin->sin_addr.s_addr),
 #endif                         
                                                           INADDR_ANY);
 #endif
@@ -215,7 +215,7 @@ getbroadcastnets(addrs, sock, buf)
                        }
 #else /* 4.2 BSD */
                        addrs[i++] = inet_makeaddr(inet_netof
-                         (sin->sin_addr.s_addr), INADDR_ANY);
+                         (sockin->sin_addr.s_addr), INADDR_ANY);
 #endif
                }
        }
index 9a58cf6269d3358e0e5aca31747d2f937bb0ef47..b4769d02b15fd0a3854bd38851d2da2e8a0e442d 100644 (file)
@@ -53,13 +53,13 @@ static struct proglst {
 } *proglst;
 static void universal();
 static SVCXPRT *transp;
-static struct proglst *pl;
 
 int
 gssrpc_registerrpc(prognum, versnum, procnum, progname, inproc, outproc)
        char *(*progname)();
        xdrproc_t inproc, outproc;
 {
+        struct proglst *pl;
        
        if (procnum == NULLPROC) {
                (void) fprintf(stderr,
@@ -96,9 +96,9 @@ gssrpc_registerrpc(prognum, versnum, procnum, progname, inproc, outproc)
 }
 
 static void
-universal(rqstp, transp)
+universal(rqstp, s_transp)
        struct svc_req *rqstp;
-       SVCXPRT *transp;
+       SVCXPRT *s_transp;
 {
        int prog, proc;
        char *outdata;
@@ -109,7 +109,7 @@ universal(rqstp, transp)
         * enforce "procnum 0 is echo" convention
         */
        if (rqstp->rq_proc == NULLPROC) {
-               if (svc_sendreply(transp, xdr_void, (char *)NULL) == FALSE) {
+               if (svc_sendreply(s_transp, xdr_void, (char *)NULL) == FALSE) {
                        (void) fprintf(stderr, "xxx\n");
                        exit(1);
                }
@@ -121,22 +121,22 @@ universal(rqstp, transp)
                if (pl->p_prognum == prog && pl->p_procnum == proc) {
                        /* decode arguments into a CLEAN buffer */
                        memset(xdrbuf, 0, sizeof(xdrbuf)); /* required ! */
-                       if (!svc_getargs(transp, pl->p_inproc, xdrbuf)) {
-                               svcerr_decode(transp);
+                       if (!svc_getargs(s_transp, pl->p_inproc, xdrbuf)) {
+                               svcerr_decode(s_transp);
                                return;
                        }
                        outdata = (*(pl->p_progname))(xdrbuf);
                        if (outdata == NULL && pl->p_outproc != xdr_void)
                                /* there was an error */
                                return;
-                       if (!svc_sendreply(transp, pl->p_outproc, outdata)) {
+                       if (!svc_sendreply(s_transp, pl->p_outproc, outdata)) {
                                (void) 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);
+                       (void)svc_freeargs(s_transp, pl->p_inproc, xdrbuf);
                        return;
                }
        (void) fprintf(stderr, "never registered prog %d\n", prog);