Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/fs/common Highly uncool to stash a partial copy of the...



details:   https://anonhg.NetBSD.org/src/rev/a307ef70dac8
branches:  trunk
changeset: 785241:a307ef70dac8
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Mar 05 19:58:33 2013 +0000

description:
Highly uncool to stash a partial copy of the ti-rpc code here.

diffstat:

 tests/fs/common/Makefile              |    15 +-
 tests/fs/common/nfsrpc/Makefile.inc   |    13 -
 tests/fs/common/nfsrpc/bindresvport.c |   163 ----
 tests/fs/common/nfsrpc/clnt_bcast.c   |   688 -----------------
 tests/fs/common/nfsrpc/clnt_dg.c      |   773 -------------------
 tests/fs/common/nfsrpc/clnt_generic.c |   375 ---------
 tests/fs/common/nfsrpc/clnt_vc.c      |   784 -------------------
 tests/fs/common/nfsrpc/namespace.h    |    91 --
 tests/fs/common/nfsrpc/reentrant.h    |   264 ------
 tests/fs/common/nfsrpc/rpc_generic.c  |   902 ----------------------
 tests/fs/common/nfsrpc/rpc_internal.h |    69 -
 tests/fs/common/nfsrpc/rpc_soc.c      |   449 -----------
 tests/fs/common/nfsrpc/rpcb_clnt.c    |  1300 ---------------------------------
 tests/fs/common/nfsrpc/svc.c          |   863 ---------------------
 tests/fs/common/nfsrpc/svc_dg.c       |   656 ----------------
 tests/fs/common/nfsrpc/svc_dg.h       |    49 -
 tests/fs/common/nfsrpc/svc_fdset.h    |     6 -
 tests/fs/common/nfsrpc/svc_generic.c  |   317 --------
 tests/fs/common/nfsrpc/svc_run.c      |   116 --
 tests/fs/common/nfsrpc/svc_vc.c       |   843 ---------------------
 20 files changed, 12 insertions(+), 8724 deletions(-)

diffs (truncated from 8826 to 300 lines):

diff -r e058de8a4190 -r a307ef70dac8 tests/fs/common/Makefile
--- a/tests/fs/common/Makefile  Tue Mar 05 19:55:22 2013 +0000
+++ b/tests/fs/common/Makefile  Tue Mar 05 19:58:33 2013 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.9 2012/08/31 14:46:54 pooka Exp $
+#      $NetBSD: Makefile,v 1.10 2013/03/05 19:58:33 christos Exp $
 #
 
 .include <bsd.own.mk>
@@ -15,8 +15,17 @@
 
 WARNS= 3
 
-.PATH: ${.CURDIR}/nfsrpc
-.include "nfsrpc/Makefile.inc"
+# NFSRPC libc rpc using rump syscalls
+SRCS+= bindresvport.c clnt_bcast.c clnt_dg.c clnt_generic.c clnt_vc.c \
+       rpc_generic.c rpc_soc.c rpcb_clnt.c \
+       svc.c svc_dg.c svc_fdset.c svc_generic.c svc_run.c svc_vc.c
+
+LIBC=${NETBSDSRCDIR}/lib/libc
+.PATH: ${NETBSDSRCDIR}/lib/libc/rpc
+CPPFLAGS+=     -DPORTMAP -D_REENTRANT -DRUMP_SYS_NETWORKING
+CPPFLAGS+=     -DDEBUG -DLIBWRAP -DRUMP_RPC
+CPPFLAGS+=     -I${LIBC}/include -I${LIBC}/rpc
+
 
 LIBISPRIVATE=  # yup
 
diff -r e058de8a4190 -r a307ef70dac8 tests/fs/common/nfsrpc/Makefile.inc
--- a/tests/fs/common/nfsrpc/Makefile.inc       Tue Mar 05 19:55:22 2013 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-#      $NetBSD: Makefile.inc,v 1.3 2011/06/29 02:36:13 mrg Exp $
-#
-
-# libc rpc using rump syscalls
-SRCS+= bindresvport.c clnt_bcast.c clnt_dg.c clnt_generic.c clnt_vc.c \
-       rpc_generic.c rpc_soc.c rpcb_clnt.c \
-       svc.c svc_dg.c svc_generic.c svc_run.c svc_vc.c
-
-CPPFLAGS+=     -DPORTMAP -D_REENTRANT -DRUMP_SYS_NETWORKING
-CPPFLAGS+=     -DDEBUG -DLIBWRAP
-
-# XXX
-CPPFLAGS.clnt_dg.c+=   -fno-strict-aliasing
diff -r e058de8a4190 -r a307ef70dac8 tests/fs/common/nfsrpc/bindresvport.c
--- a/tests/fs/common/nfsrpc/bindresvport.c     Tue Mar 05 19:55:22 2013 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,163 +0,0 @@
-/*     $NetBSD: bindresvport.c,v 1.1 2010/07/26 15:56:45 pooka Exp $   */
-
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part.  Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- * 
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- * 
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- * 
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- * 
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- * 
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California  94043
- */
-
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char *sccsid = "@(#)bindresvport.c 1.8 88/02/08 SMI";
-static char *sccsid = "@(#)bindresvport.c      2.2 88/07/29 4.0 RPCSRC";
-#else
-__RCSID("$NetBSD: bindresvport.c,v 1.1 2010/07/26 15:56:45 pooka Exp $");
-#endif
-#endif
-
-/*
- * Copyright (c) 1987 by Sun Microsystems, Inc.
- */
-
-#include "namespace.h"
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <rpc/rpc.h>
-
-#include <rump/rump.h>
-#include <rump/rump_syscalls.h>
-
-/*
- * Bind a socket to a privileged IP port
- */
-int
-bindresvport(sd, brsin)
-       int sd;
-       struct sockaddr_in *brsin;
-{
-       return bindresvport_sa(sd, (struct sockaddr *)(void *)brsin);
-}
-
-#include <stdio.h>
-/*
- * Bind a socket to a privileged IP port
- */
-int
-bindresvport_sa(sd, sa)
-       int sd;
-       struct sockaddr *sa;
-{
-       int error, old;
-       struct sockaddr_storage myaddr;
-       struct sockaddr_in *brsin;
-#ifdef INET6
-       struct sockaddr_in6 *brsin6;
-#endif
-       int proto, portrange, portlow;
-       u_int16_t *portp;
-       socklen_t salen;
-       int af;
-
-       if (sa == NULL) {
-               salen = sizeof(myaddr);
-               sa = (struct sockaddr *)(void *)&myaddr;
-
-               if (getsockname(sd, sa, &salen) == -1)
-                       return -1;      /* errno is correctly set */
-
-               af = sa->sa_family;
-               memset(sa, 0, salen);
-       } else
-               af = sa->sa_family;
-
-       switch (af) {
-       case AF_INET:
-               proto = IPPROTO_IP;
-               portrange = IP_PORTRANGE;
-               portlow = IP_PORTRANGE_LOW;
-               brsin = (struct sockaddr_in *)(void *)sa;
-               salen = sizeof(struct sockaddr_in);
-               portp = &brsin->sin_port;
-               break;
-#ifdef INET6
-       case AF_INET6:
-               proto = IPPROTO_IPV6;
-               portrange = IPV6_PORTRANGE;
-               portlow = IPV6_PORTRANGE_LOW;
-               brsin6 = (struct sockaddr_in6 *)(void *)sa;
-               salen = sizeof(struct sockaddr_in6);
-               portp = &brsin6->sin6_port;
-               break;
-#endif
-       default:
-               errno = EPFNOSUPPORT;
-               return (-1);
-       }
-       sa->sa_family = af;
-       sa->sa_len = salen;
-
-       if (*portp == 0) {
-               socklen_t oldlen = sizeof(old);
-
-               error = getsockopt(sd, proto, portrange, &old, &oldlen);
-               if (error < 0)
-                       return (error);
-               error = setsockopt(sd, proto, portrange, &portlow,
-                   sizeof(portlow));
-               if (error < 0)
-                       return (error);
-       }
-
-       error = bind(sd, sa, salen);
-
-       if (*portp == 0) {
-               int saved_errno = errno;
-
-               if (error < 0) {
-                       if (setsockopt(sd, proto, portrange, &old,
-                           sizeof(old)) < 0)
-                               errno = saved_errno;
-                       return (error);
-               }
-
-               if (sa != (struct sockaddr *)(void *)&myaddr) {
-                       /* What did the kernel assign? */
-                       if (getsockname(sd, sa, &salen) < 0)
-                               errno = saved_errno;
-                       return (error);
-               }
-       }
-       return (error);
-}
diff -r e058de8a4190 -r a307ef70dac8 tests/fs/common/nfsrpc/clnt_bcast.c
--- a/tests/fs/common/nfsrpc/clnt_bcast.c       Tue Mar 05 19:55:22 2013 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,688 +0,0 @@
-/*     $NetBSD: clnt_bcast.c,v 1.2 2010/09/23 09:38:14 he Exp $        */
-
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part.  Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- * 
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- * 
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- * 
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- * 
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- * 
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California  94043
- */
-/*
- * Copyright (c) 1986-1991 by Sun Microsystems Inc. 
- */
-
-/* #ident      "@(#)clnt_bcast.c       1.18    94/05/03 SMI" */
-
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)clnt_bcast.c 1.15 89/04/21 Copyr 1988 Sun Micro";
-#else
-__RCSID("$NetBSD: clnt_bcast.c,v 1.2 2010/09/23 09:38:14 he Exp $");
-#endif
-#endif
-
-/*
- * clnt_bcast.c
- * Client interface to broadcast service.
- *
- * Copyright (C) 1988, Sun Microsystems, Inc.
- *
- * The following is kludged-up support for simple rpc broadcasts.
- * Someday a large, complicated system will replace these routines.
- */
-
-#include "namespace.h"
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/queue.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <ifaddrs.h>
-#include <sys/poll.h>
-#include <rpc/rpc.h>
-#ifdef PORTMAP
-#include <rpc/pmap_prot.h>
-#include <rpc/pmap_clnt.h>
-#include <rpc/pmap_rmt.h>
-#endif
-#include <rpc/nettype.h>
-#include <arpa/inet.h>
-#ifdef RPC_DEBUG
-#include <stdio.h>
-#endif
-#include <assert.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <netdb.h>
-#include <err.h>
-#include <string.h>
-#include <stdio.h>
-



Home | Main Index | Thread Index | Old Index