From b84a15e5239bf0dc9639077c6da55228d58b7b62 Mon Sep 17 00:00:00 2001 From: arved Date: Sat, 2 Sep 2006 12:07:20 +0000 Subject: Update to 1.26 --- benchmarks/netio/Makefile | 19 +- benchmarks/netio/distinfo | 6 +- benchmarks/netio/files/patch-Makefile | 22 +- benchmarks/netio/files/patch-netio.c | 374 +++++++++++++++++++++------------- benchmarks/netio/pkg-descr | 3 + 5 files changed, 257 insertions(+), 167 deletions(-) (limited to 'benchmarks') diff --git a/benchmarks/netio/Makefile b/benchmarks/netio/Makefile index 313c1e0a1699..bb4def0b95ad 100644 --- a/benchmarks/netio/Makefile +++ b/benchmarks/netio/Makefile @@ -5,11 +5,11 @@ # $FreeBSD$ PORTNAME= netio -PORTVERSION= 1.14 -PORTREVISION= 1 +PORTVERSION= 1.26 CATEGORIES= benchmarks net ipv6 -MASTER_SITES= http://www.netfuse.de/techarea/netio/ -DISTNAME= netio114 +MASTER_SITES= ${MASTER_SITE_LOCAL} +MASTER_SITE_SUBDIR= arved +DISTNAME= netio126 MAINTAINER= arved@FreeBSD.org COMMENT= Network benchmark @@ -19,17 +19,18 @@ USE_ZIP= yes USE_GMAKE= yes PLIST_FILES= bin/netio +CFLAGS+= -DUNIX ${PTHREAD_CFLAGS} +MAKE_ENV+= OUT="-o" LIBS=${PTHREAD_LIBS} .if defined(WITH_IPV6) PLIST_FILES+= bin/netio6 .endif -post-patch: - ${REINPLACE_CMD} -e "s,-lsocket,," ${WRKSRC}/Makefile - do-build: - cd ${WRKSRC} && ${GMAKE} unix + cd ${WRKSRC}; \ + ${SETENV} ${MAKE_ENV} O=.o CFLAGS="${CFLAGS}" ${GMAKE} all .if defined(WITH_IPV6) - cd ${WRKSRC} && ${GMAKE} unix6 + cd ${WRKSRC}; \ + ${MAKE_ENV} O=.6o X=6 CFLAGS="${CFLAGS} -DUSE_IPV6" ${GMAKE} all .endif do-install: diff --git a/benchmarks/netio/distinfo b/benchmarks/netio/distinfo index 8d8a3d16e431..350cb76fd091 100644 --- a/benchmarks/netio/distinfo +++ b/benchmarks/netio/distinfo @@ -1,3 +1,3 @@ -MD5 (netio114.zip) = 7c41f385f1c216319bfaf93639cb4a20 -SHA256 (netio114.zip) = b7b140f5d8a8ff6e97a1f568b1580f851afb67c0b755da3ebd57b7eecc36081c -SIZE (netio114.zip) = 210744 +MD5 (netio126.zip) = e54ac24ceac94c5ea6dd143abf9752e3 +SHA256 (netio126.zip) = 86c0bdee3224477b43c0cb6161ce1a20b2a2b6d59ef37f67864227096d9e8d5c +SIZE (netio126.zip) = 140402 diff --git a/benchmarks/netio/files/patch-Makefile b/benchmarks/netio/files/patch-Makefile index 0527087fff19..364e94f9146c 100644 --- a/benchmarks/netio/files/patch-Makefile +++ b/benchmarks/netio/files/patch-Makefile @@ -1,22 +1,6 @@ ---- Makefile.orig Thu Apr 19 14:21:19 2001 -+++ Makefile Sat Dec 3 15:19:39 2005 -@@ -57,9 +57,15 @@ - unix: - $(MAKE) all CC="gcc" O=.o X= \ - CFLAGS="-DUNIX -O" LFLAGS="-s" LIBS="-lsocket" OUT=-o -+unix6: -+ $(MAKE) all CC="gcc" O=.6o X=6 \ -+ CFLAGS="-DUNIX -O -DUSE_IPV6" LFLAGS="-lsocket" LIBS="" OUT=-o - unix-debug: - $(MAKE) all CC="gcc -g" O=.o X= \ - CFLAGS="-DUNIX" LFLAGS="" LIBS="-lsocket" OUT=-o -+unix6-debug: -+ $(MAKE) all CC="gcc -g" O=.6o X=6 \ -+ CFLAGS="-DUNIX -DUSE_IPV6" LFLAGS="-lsocket" LIBS="" OUT=-o - watt32: - $(MAKE) all CC="gcc -g -O2" O=.o X=.exe OUT=-o \ - CFLAGS="-DWATT32 -I../../inc" LIBS="../../lib/libwatt.a" -@@ -73,7 +79,7 @@ +--- Makefile.orig Sat Sep 2 13:27:40 2006 ++++ Makefile Sat Sep 2 13:29:30 2006 +@@ -96,7 +96,7 @@ .SUFFIXES: .c $O .c$O: diff --git a/benchmarks/netio/files/patch-netio.c b/benchmarks/netio/files/patch-netio.c index 41cc0a95ec2f..121b1fedaa92 100644 --- a/benchmarks/netio/files/patch-netio.c +++ b/benchmarks/netio/files/patch-netio.c @@ -1,179 +1,281 @@ ---- netio.c.orig Thu Apr 19 14:21:02 2001 -+++ netio.c Sat Dec 3 16:14:21 2005 -@@ -477,14 +477,22 @@ - - /* TCP/IP code */ - --int nPort = 0x494F; /* "IO" */ -+int nPort = 0x494F; /* "IO" */ -+#ifdef USE_IPV6 -+struct in6_addr addr_server; +--- netio.c.orig Tue Aug 30 16:47:18 2005 ++++ netio.c Sat Sep 2 13:46:50 2006 +@@ -782,8 +782,13 @@ + const int sobufsize = 131072; + int nPort = DEFAULTPORT; + int nAuxPort = DEFAULTPORT + 1; ++#ifdef USE_IPV6 ++struct in6_addr addr_server; ++struct in6_addr addr_local; +#else struct in_addr addr_server; -+#endif + struct in_addr addr_local; ++#endif - void TcpIpServer(void *arg) - { + int udpsocket, udpd; + unsigned long nUDPCount; +@@ -794,7 +799,11 @@ char *cBuffer; -- int bQuit = 0; -- struct sockaddr_in sa_server, sa_client; -+ int bQuit = 0; + CONTROL ctl; + long long nData; +#ifdef USE_IPV6 -+ struct sockaddr_in6 sa_server, sa_client; -+#else -+ struct sockaddr_in sa_server, sa_client; ++ struct sockaddr_in6 sa_server, sa_client; ++#else + struct sockaddr_in sa_server, sa_client; +#endif - int server, client, length; + int server, client; + size_t length; struct timeval tv; - fd_set fds; -@@ -495,17 +503,27 @@ - perror("malloc()"); - return; +@@ -808,7 +817,11 @@ + return THREADRESULT; } -- -- if ((server = socket(PF_INET, SOCK_STREAM, 0)) < 0) -+ + +#ifdef USE_IPV6 -+ if ((server = socket(PF_INET6, SOCK_STREAM, 0)) < 0) -+#else -+ if ((server = socket(PF_INET, SOCK_STREAM, 0)) < 0) ++ if ((server = socket(PF_INET6, SOCK_STREAM, 0)) < 0) ++#else + if ((server = socket(PF_INET, SOCK_STREAM, 0)) < 0) +#endif { psock_errno("socket()"); free(cBuffer); +@@ -818,10 +831,15 @@ + setsockopt(server, SOL_SOCKET, SO_RCVBUF, (char *) &sobufsize, sizeof(sobufsize)); + setsockopt(server, SOL_SOCKET, SO_SNDBUF, (char *) &sobufsize, sizeof(sobufsize)); + ++#ifdef USE_IPV6 ++ sa_server.sin6_family = AF_INET6; ++ sa_server.sin6_port = htons(nPort); ++ sa_server.sin6_addr = addr_local; ++#else + sa_server.sin_family = AF_INET; + sa_server.sin_port = htons(nPort); + sa_server.sin_addr = addr_local; +- ++#endif + if (bind(server, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0) + { + psock_errno("bind()"); +@@ -958,7 +976,11 @@ + long nTime, nResult; + long long nData; + int i; ++#ifdef USE_IPV6 ++ struct sockaddr_in6 sa_server; ++#else + struct sockaddr_in sa_server; ++#endif + int server; + int rc; + int nByte; +@@ -969,7 +991,11 @@ return; } -- -- sa_server.sin_family = AF_INET; -+ + ++#ifdef USE_IPV6 ++ if ((server = socket(PF_INET6, SOCK_STREAM, 0)) < 0) ++#else + if ((server = socket(PF_INET, SOCK_STREAM, 0)) < 0) ++#endif + { + psock_errno("socket()"); + free(cBuffer); +@@ -979,9 +1005,16 @@ + setsockopt(server, SOL_SOCKET, SO_RCVBUF, (char *) &sobufsize, sizeof(sobufsize)); + setsockopt(server, SOL_SOCKET, SO_SNDBUF, (char *) &sobufsize, sizeof(sobufsize)); + +#ifdef USE_IPV6 -+ sa_server.sin6_family = AF_INET6; ++ sa_server.sin6_family = AF_INET6; + sa_server.sin6_port = htons(nPort); -+ sa_server.sin6_addr = in6addr_any; -+#else -+ sa_server.sin_family = AF_INET; ++ sa_server.sin6_addr = addr_server; ++ ++#else + sa_server.sin_family = AF_INET; sa_server.sin_port = htons(nPort); - sa_server.sin_addr.s_addr = INADDR_ANY; + sa_server.sin_addr = addr_server; +#endif - if (bind(server, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0) + if (connect(server, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0) { -@@ -524,8 +542,12 @@ +@@ -1121,7 +1154,11 @@ + THREAD UDP_Receiver(void *arg) + { + char *cBuffer; ++#ifdef USE_IPV6 ++ struct sockaddr_in6 sa_server, sa_client; ++#else + struct sockaddr_in sa_server, sa_client; ++#endif + int rc; + size_t nBytes; + +@@ -1131,7 +1168,11 @@ + return THREADRESULT; } - for (;;) -- { -+ { -+#ifdef USE_IPV6 -+ printf("TCP/IP server Listening (IPv6).\n"); -+#else - printf("TCP/IP server Listening.\n"); -+#endif - - FD_ZERO(&fds); - FD_SET(server, &fds); -@@ -575,8 +597,12 @@ - TIMER nTimer; - long nTime; - long nData; -- int i; -- struct sockaddr_in sa_server; -+#ifdef USE_IPV6 -+ struct sockaddr_in6 sa_client; -+#else -+ struct sockaddr_in sa_client; -+#endif -+ int i; ++#ifdef USE_IPV6 ++ if ((udpsocket = socket(PF_INET6, SOCK_DGRAM, 0)) < 0) ++#else + if ((udpsocket = socket(PF_INET, SOCK_DGRAM, 0)) < 0) ++#endif + { + psock_errno("socket(DGRAM)"); + free(cBuffer); +@@ -1141,9 +1182,15 @@ + setsockopt(udpsocket, SOL_SOCKET, SO_RCVBUF, (char *) &sobufsize, sizeof(sobufsize)); + setsockopt(udpsocket, SOL_SOCKET, SO_SNDBUF, (char *) &sobufsize, sizeof(sobufsize)); + ++#ifdef USE_IPV6 ++ sa_server.sin6_family = AF_INET6; ++ sa_server.sin6_port = htons(nAuxPort); ++ sa_server.sin6_addr = addr_local; ++#else + sa_server.sin_family = AF_INET; + sa_server.sin_port = htons(nAuxPort); + sa_server.sin_addr = addr_local; ++#endif + + if (bind(udpsocket, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0) + { +@@ -1181,7 +1228,11 @@ + char *cBuffer; + CONTROL ctl; + long long nData; ++#ifdef USE_IPV6 ++ struct sockaddr_in6 sa_server, sa_client; ++#else + struct sockaddr_in sa_server, sa_client; ++#endif + int server, client; + struct timeval tv; + fd_set fds; +@@ -1194,7 +1245,11 @@ + return THREADRESULT; + } + ++#ifdef USE_IPV6 ++ if ((server = socket(PF_INET6, SOCK_STREAM, 0)) < 0) ++#else + if ((server = socket(PF_INET, SOCK_STREAM, 0)) < 0) ++#endif + { + psock_errno("socket(STREAM)"); + free(cBuffer); +@@ -1204,9 +1259,15 @@ + setsockopt(server, SOL_SOCKET, SO_RCVBUF, (char *) &sobufsize, sizeof(sobufsize)); + setsockopt(server, SOL_SOCKET, SO_SNDBUF, (char *) &sobufsize, sizeof(sobufsize)); + ++#ifdef USE_IPV6 ++ sa_server.sin6_family = AF_INET6; ++ sa_server.sin6_port = htons(nAuxPort); ++ sa_server.sin6_addr = addr_local; ++#else + sa_server.sin_family = AF_INET; + sa_server.sin_port = htons(nAuxPort); + sa_server.sin_addr = addr_local; ++#endif + + if (bind(server, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0) + { +@@ -1252,7 +1313,11 @@ + printf("UDP connection established ... "); + fflush(stdout); + ++#ifdef USE_IPV6 ++ sa_client.sin6_port = htons(nAuxPort); ++#else + sa_client.sin_port = htons(nAuxPort); ++#endif + + for (;;) + { +@@ -1345,7 +1410,11 @@ + long nTime, nResult, nCount; + long long nData; + int i; ++#ifdef USE_IPV6 ++ struct sockaddr_in6 sa_server; ++#else + struct sockaddr_in sa_server; ++#endif int server; - int rc; + int rc, nByte; -@@ -585,19 +611,28 @@ - perror("malloc()"); +@@ -1355,7 +1424,11 @@ return; } -- -- sa_server.sin_family = AF_INET; -- sa_server.sin_port = htons(nPort); -- sa_server.sin_addr = addr_server; -- -+ -+#ifdef USE_IPV6 -+ sa_client.sin6_family = AF_INET6; -+ sa_client.sin6_port = htons(nPort); -+ sa_client.sin6_addr = addr_server; -+#else -+ sa_client.sin_family = AF_INET; -+ sa_client.sin_port = htons(nPort); -+ sa_client.sin_addr = addr_server; -+#endif -+ + +#ifdef USE_IPV6 + if ((server = socket(PF_INET6, SOCK_STREAM, 0)) < 0) -+#else ++#else if ((server = socket(PF_INET, SOCK_STREAM, 0)) < 0) -+#endif ++#endif { psock_errno("socket()"); free(cBuffer); - return; -- } -- -- if (connect(server, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0) -+ } -+ if (connect(server, (struct sockaddr *) &sa_client, sizeof(sa_client)) < 0) +@@ -1365,9 +1438,15 @@ + setsockopt(server, SOL_SOCKET, SO_RCVBUF, (char *) &sobufsize, sizeof(sobufsize)); + setsockopt(server, SOL_SOCKET, SO_SNDBUF, (char *) &sobufsize, sizeof(sobufsize)); + ++#ifdef USE_IPV6 ++ sa_server.sin6_family = AF_INET6; ++ sa_server.sin6_port = htons(nAuxPort); ++ sa_server.sin6_addr = addr_server; ++#else + sa_server.sin_family = AF_INET; + sa_server.sin_port = htons(nAuxPort); + sa_server.sin_addr = addr_server; ++#endif + + if (connect(server, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0) { - psock_errno("connect()"); - soclose(server); -@@ -664,13 +699,17 @@ - { - printf( - #ifndef USE_NETBIOS -+#ifdef USE_IPV6 -+ "\nUsage: netio6 [-s] [-p ] []\n" -+#else - "\nUsage: netio [-s] [-p ] []\n" -+#endif - "\n\t-s\t\trun server side of benchmark (otherwise run client)" - "\n\t-p \tuse this port instead of the default (%d)" - "\n\t\tif the client side of the benchmark is running," - "\n\t\t\ta server host name is required\n" --#else -- "\nUsage: netio [-s] [-t | -n] [-p ] [-a ] []\n" -+#else -+ "\nUsage: netio [-s] [-t | -n] [-p ] [-a ] []\n" - "\n\t-s\trun server side of benchmark (otherwise run client)" - "\n\t-t\tuse TCP/IP protocol for benchmark" - "\n\t-p \tuse this port for TCP/IP (default is %d)" -@@ -766,14 +805,28 @@ - if (optind == argc) - usage(); +@@ -1669,17 +1748,29 @@ + return psock_errno("sock_init()"), 1; -- if (isdigit(*argv[optind])) -- addr_server.s_addr = inet_addr(argv[optind]); -+ if (isdigit(*argv[optind]) -+#ifdef USE_IPV6 -+ || *argv[optind] == ':') -+ inet_pton(AF_INET6, argv[optind], &addr_server); -+#else -+ ) -+ addr_server.s_addr = inet_addr(argv[optind]); -+#endif + if (szLocal == 0) ++#ifdef USE_IPV6 ++ addr_local = in6addr_any; ++#else + addr_local.s_addr = INADDR_ANY; ++#endif + else + { + if (isdigit(*szLocal)) ++#ifdef USE_IPV6 ++ inet_pton(AF_INET6, szLocal, &addr_local); ++#else + addr_local.s_addr = inet_addr(szLocal); ++#endif else -- { -- if ((host = gethostbyname(argv[optind])) == NULL) -+ { -+#ifdef USE_IPV6 -+ if ((host = gethostbyname2(argv[optind], AF_INET6)) == NULL) -+#else -+ if ((host = gethostbyname(argv[optind])) == NULL) + { + if ((host = gethostbyname(szLocal)) == NULL) + return psock_errno("gethostbyname()"), 1; + ++#ifdef USE_IPV6 ++ addr_local = * (struct in6_addr *) (host->h_addr); ++#else + addr_local = * (struct in_addr *) (host->h_addr); +#endif + } + } + +@@ -1689,13 +1780,21 @@ + usage(); + + if (isdigit(*argv[optind])) ++#ifdef USE_IPV6 ++ inet_pton(AF_INET6, argv[optind], &addr_server); ++#else + addr_server.s_addr = inet_addr(argv[optind]); ++#endif + else + { + if ((host = gethostbyname(argv[optind])) == NULL) return psock_errno("gethostbyname()"), 1; -- addr_server = * (struct in_addr *) (host->h_addr); +#ifdef USE_IPV6 -+ addr_server = * (struct in6_addr *) (host->h_addr); -+#else -+ addr_server = * (struct in_addr *) (host->h_addr); ++ addr_server = * (struct in6_addr *) (host->h_addr); ++#else + addr_server = * (struct in_addr *) (host->h_addr); +#endif } } diff --git a/benchmarks/netio/pkg-descr b/benchmarks/netio/pkg-descr index 6b3e35172504..298285deaac4 100644 --- a/benchmarks/netio/pkg-descr +++ b/benchmarks/netio/pkg-descr @@ -6,3 +6,6 @@ packet sizes. One instance has to run on one machine as a server process, another instance is used on another machine to perform the benchmark. When executed without arguments, the program will explain its usage. + +Author: Kai Uwe Rommel +WWW: http://www.ars.de/ars/ars.nsf/docs/netio/ -- cgit