summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--benchmarks/nettest/DESCR7
-rw-r--r--benchmarks/nettest/Makefile21
-rw-r--r--benchmarks/nettest/PLIST4
-rw-r--r--benchmarks/nettest/distinfo8
-rw-r--r--benchmarks/nettest/patches/patch-aa30
-rw-r--r--benchmarks/nettest/patches/patch-ab61
-rw-r--r--benchmarks/nettest/patches/patch-ac65
-rw-r--r--benchmarks/nettest/patches/patch-ad57
8 files changed, 253 insertions, 0 deletions
diff --git a/benchmarks/nettest/DESCR b/benchmarks/nettest/DESCR
new file mode 100644
index 00000000000..2d2c85bfc90
--- /dev/null
+++ b/benchmarks/nettest/DESCR
@@ -0,0 +1,7 @@
+The nettest and nettestd commands perform client and server
+performance tests for various types of interprocess communication.
+These tests time the data throughput of pipes and UNIX domain, TCP,
+and UDP socket connections.
+
+The nettest command performs the client side of the test; the
+nettestd command performs the server side of the test.
diff --git a/benchmarks/nettest/Makefile b/benchmarks/nettest/Makefile
new file mode 100644
index 00000000000..df22100ff18
--- /dev/null
+++ b/benchmarks/nettest/Makefile
@@ -0,0 +1,21 @@
+# $NetBSD: Makefile,v 1.1.1.1 2003/04/11 17:07:23 cjep Exp $
+
+DISTNAME= nettest.92.11.09
+PKGNAME= nettest-92.11.09
+CATEGORIES= benchmarks net
+MASTER_SITES= ftp://ftp.cray.com/src/nettest/
+EXTRACT_SUFX= .tar.Z
+
+MAINTAINER= ginsbach@cray.com
+COMMENT= Performs client and server functions for timing data throughput
+
+.include "../../mk/bsd.prefs.mk"
+
+WRKSRC= ${WRKDIR}
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/nettest ${PREFIX}/bin/nettest
+ ${INSTALL_PROGRAM} ${WRKSRC}/nettestd ${PREFIX}/bin/nettestd
+ ${INSTALL_MAN} ${WRKSRC}/nettest.8 ${PREFIX}/man/man8/nettest.8
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/benchmarks/nettest/PLIST b/benchmarks/nettest/PLIST
new file mode 100644
index 00000000000..7a75ff270f6
--- /dev/null
+++ b/benchmarks/nettest/PLIST
@@ -0,0 +1,4 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2003/04/11 17:07:23 cjep Exp $
+bin/nettest
+bin/nettestd
+man/man8/nettest.8
diff --git a/benchmarks/nettest/distinfo b/benchmarks/nettest/distinfo
new file mode 100644
index 00000000000..dd14f9498fd
--- /dev/null
+++ b/benchmarks/nettest/distinfo
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.1.1.1 2003/04/11 17:07:23 cjep Exp $
+
+SHA1 (nettest.92.11.09.tar.Z) = 745408751115784f8f5dc63b16428eb1404d6c5e
+Size (nettest.92.11.09.tar.Z) = 35068 bytes
+SHA1 (patch-aa) = 78534b43a22bd22937e8dc8d0b16bf524e9d4188
+SHA1 (patch-ab) = e96227451fce253cd77491cfa2214fa49651af15
+SHA1 (patch-ac) = 5c47103210c06d2bf6fa2c749d554a7426b06535
+SHA1 (patch-ad) = e598ff0b66c5c7daf4692e5680bbacc66aaeb466
diff --git a/benchmarks/nettest/patches/patch-aa b/benchmarks/nettest/patches/patch-aa
new file mode 100644
index 00000000000..c5fc0d174de
--- /dev/null
+++ b/benchmarks/nettest/patches/patch-aa
@@ -0,0 +1,30 @@
+$NetBSD: patch-aa,v 1.1.1.1 2003/04/11 17:07:23 cjep Exp $
+
+--- Makefile.orig 1992-11-05 22:03:14.000000000 +0000
++++ Makefile
+@@ -3,10 +3,8 @@ MAKE=make
+ FILES=README Makefile nettest.h nettest.c nettestd.c nettest.8
+
+ all:
+- @if [ -f /bin/hostname -o -f /usr/bin/hostname ]; then \
+- $(MAKE) `hostname`; \
+- elif [ -f /bin/uname ]; then \
+- $(MAKE) `uname -n`; \
++ @if [ -f /bin/uname -o -f /usr/bin/uname ]; then \
++ $(MAKE) `uname -s`; \
+ else \
+ echo You must specify what machine you are on,;\
+ echo e.g. \"make sun\", \"make cray2\", \"make pyramid\", \"make xmp\";\
+@@ -33,6 +31,12 @@ unicos60 unicos61:
+ DEFINES="-DWAIT3CODE -DNO_ISO" \
+ LIBS="" OPT="-O"
+
++NetBSD:
++ $(MAKE) objs \
++ INCLUDE="" \
++ DEFINES="-DWAIT3CODE -DBSD44 -DNAMEDPIPES -DNO_ISO -DNONVOID_SETPGRP" \
++ OPT="-O" LIBS="-lcompat"
++
+ 4.4alpha:
+ $(MAKE) objs \
+ INCLUDE="" \
diff --git a/benchmarks/nettest/patches/patch-ab b/benchmarks/nettest/patches/patch-ab
new file mode 100644
index 00000000000..3a1682057f3
--- /dev/null
+++ b/benchmarks/nettest/patches/patch-ab
@@ -0,0 +1,61 @@
+$NetBSD: patch-ab,v 1.1.1.1 2003/04/11 17:07:23 cjep Exp $
+
+--- nettest.8.orig 1992-11-09 18:36:26.000000000 +0000
++++ nettest.8
+@@ -39,7 +39,7 @@
+ .QE
+ .SH SYNOPSIS
+ .QS
+-\*C/etc/nettest\fR
++\*Cnettest\fR
+ \%[\*C-c\fR]
+ \%[\*C-C\fR]
+ \%[\*C-d\fR]
+@@ -55,7 +55,7 @@
+ \%[\*C-w\fR]
+ \%[\fIhost\fR\ [\fIcount\fR\ [\fIsize\fR\ [\fIport\fR]]]]
+ .br
+-\*C/etc/nettest\fR
++\*Cnettest\fR
+ \%[\*C-c\fR]
+ \%[\*C-C\fR]
+ \%[\*C-d\fR]
+@@ -67,7 +67,7 @@
+ \%[\*C-w\fR]
+ \%[\fIcount\fR\ [\fIsize\fR\ [\fIfilename\fR]]]
+ .br
+-\*C/etc/nettest\fR
++\*Cnettest\fR
+ \%[\*C-c\fR]
+ \%[\*C-C\fR]
+ \%[\*C-d\fR]
+@@ -77,24 +77,24 @@
+ \%\*C-p\ file\fR\ \fIwritefile\ readfile\fR
+ \%[\fIcount\fR\ [\fIsize\fR]]
+ .br
+-\*C/etc/nettest\fR
++\*Cnettest\fR
+ \%\*C-V\fR
+ .sp
+-\*C/etc/nettestd\fR
++\*Cnettestd\fR
+ \%[\*C-d\fR]
+ \%[\*C-p\ tcp\fR|\*Cudp\fR|\*Ciso\fR]
+ \%[\fIport\fR]
+ .br
+-\*C/etc/nettestd\fR
++\*Cnettestd\fR
+ \%[\*C-d\fR]
+ \%\*C-p\ unix\fR|\*Cunixd\fR|\*Cpipe\fR
+ \%[\fIfilename\fR]
+ .br
+-\*C/etc/nettestd\fR
++\*Cnettestd\fR
+ \%[\*C-d\fR]
+ \%\*C-p\ file\fR\ \fIreadfile\ writefile\fR
+ .br
+-\*C/etc/nettestd\fR
++\*Cnettestd\fR
+ \%\*C-V\fR
+ .QE
+ .SH DESCRIPTION
diff --git a/benchmarks/nettest/patches/patch-ac b/benchmarks/nettest/patches/patch-ac
new file mode 100644
index 00000000000..5472285ee22
--- /dev/null
+++ b/benchmarks/nettest/patches/patch-ac
@@ -0,0 +1,65 @@
+$NetBSD: patch-ac,v 1.1.1.1 2003/04/11 17:07:23 cjep Exp $
+
+--- nettest.c.orig 1992-11-05 21:52:58.000000000 +0000
++++ nettest.c
+@@ -92,7 +92,11 @@ int kbufsize = 0;
+ int nodelay = 0;
+ int mesghdr = 0;
+
++#ifdef BSD44
++clock_t times();
++#else
+ long times();
++#endif
+ #if !defined(CRAY) && !defined(SYSV)
+ #define GETTIMES(a, b) ftime(&a); times(&b);
+ #define TIMETYPE struct timeb
+@@ -126,7 +130,8 @@ struct sockaddr_iso to_s = {sizeof(to_s)
+
+ void do_children(), do_stream(), usage(), do_dgram(), prtimes();
+
+-int read(), recv();
++int read();
++ssize_t recv();
+
+ int (*rfunc)() = read;
+
+@@ -550,7 +555,11 @@ main(argc, argv)
+ shutdown(s, 2);
+ exit(0);
+ }
++#ifdef BSD44
++ if (connect(s, (struct sockaddr *)&name, namesize) < 0) {
++#else
+ if (connect(s, (char *)&name, namesize) < 0) {
++#endif
+ perror("connect");
+ exit(1);
+ }
+@@ -1160,8 +1169,8 @@ do_dgram(s)
+ *data = 0;
+ for (i = 0; i < nchunks; i++) {
+ ret = mesghdr ? sendmsg(s, &outmsg, 0)
+- : sendto(s, data, chunksize, 0, (caddr_t)&name,
+- namesize);
++ : sendto(s, data, chunksize, 0,
++ (struct sockaddr *)&name, namesize);
+
+ if (ret < 0) {
+ perror(mesghdr ? "sendmsg" : "sendto");
+@@ -1397,12 +1406,13 @@ parsetos(name, proto)
+ register char *c;
+ int tos;
+
++#undef IP_TOS
+ #ifdef IP_TOS
+ struct tosent *tosp;
+
+- tosp = gettosbyname(name, proto);
++ tosp = (struct tosent *)gettosbyname(name, proto);
+ if (tosp) {
+- tos = tosp->t_tos;
++ tos = (int)tosp->t_tos;
+ } else {
+ #endif
+ for (c = name; *c; c++) {
diff --git a/benchmarks/nettest/patches/patch-ad b/benchmarks/nettest/patches/patch-ad
new file mode 100644
index 00000000000..4cf4ef65208
--- /dev/null
+++ b/benchmarks/nettest/patches/patch-ad
@@ -0,0 +1,57 @@
+$NetBSD: patch-ad,v 1.1.1.1 2003/04/11 17:07:23 cjep Exp $
+
+--- nettestd.c.orig 1992-11-05 21:52:58.000000000 +0000
++++ nettestd.c
+@@ -107,7 +107,8 @@ union {
+ } name;
+ int namesize;
+
+-int read(), recv();
++int read();
++ssize_t recv();
+ int (*rfunc)() = read;
+
+ main(argc, argv)
+@@ -271,7 +272,11 @@ char **argv;
+ # endif
+ #endif
+ if (daemon) {
++#ifdef NONVOID_SETPGRP
++ if (setpgrp(0, getpid()) < 0)
++#else
+ if (setpgrp() < 0)
++#endif
+ perror("setpgrp");
+ if ((c = open(_PATH_TTY, O_RDWR)) >= 0) {
+ (void)ioctl(c, TIOCNOTTY, (char *)0);
+@@ -416,7 +421,7 @@ char **argv;
+ )
+ error("setsockopt (IP_OPTIONS)");
+ #endif
+- if (bind(s, (char *)&name, namesize) < 0) {
++ if (bind(s, (struct sockaddr *)&name, namesize) < 0) {
+ error("bind");
+ exit(1);
+ }
+@@ -447,10 +452,10 @@ register int s;
+ #endif
+ listen(s, 5);
+
+- signal(SIGCHLD, dochild);
++ signal(SIGCHLD, (void *)dochild);
+ for (;;) {
+ namesize = sizeof(name);
+- s2 = accept(s, (char *)&name, &namesize);
++ s2 = accept(s, (struct sockaddr *)&name, &namesize);
+ if (s2 < 0) {
+ extern int errno;
+ if (errno == EINTR)
+@@ -723,7 +728,7 @@ int s;
+ #endif
+ {
+ namesize = sizeof(name.d_inet);
+- t = recvfrom(s, data, MAXSIZE, 0, (char *)&name.d_inet,
++ t = recvfrom(s, data, MAXSIZE, 0, (struct sockaddr *)&name.d_inet,
+ &namesize);
+ }
+ if (t < 0) {